profile.html 3.62 KB
Newer Older
1 2
{% extends "dashboard/base.html" %}
{% load i18n %}
3
{% load crispy_forms_tags %}
4 5 6 7 8 9 10 11 12 13 14

{% block title-page %}{{ profile.username}} | {% trans "Profile" %}{% endblock %}

{% block content %}

<div class="row">
  <div class="col-md-12">
    <div class="panel panel-default">
      <div class="panel-heading">
        <a class="pull-right btn btn-default btn-xs" href="{% url "dashboard.index" %}">{% trans "Back" %}</a>
        <h3 class="no-margin">
15
          <i class="fa fa-user"></i>
16 17 18 19 20 21
          {% include "dashboard/_display-name.html" with user=profile show_org=True %}
        </h3>
      </div>
      <div class="panel-body">
        <div>
          <div class="" style="float: left">
22
            <img id="dashboard-profile-avatar" src="{{ avatar_url }}" class="img-rounded"/>
23 24
          </div>
          <div class="" style="padding-left: 215px;">
25
            <p>{% trans "Username" %}: {{ profile.username }}</p>
Kálmán Viktor committed
26
            <p>{% trans "Organization ID" %}: {{ profile.profile.org_id|default:"-" }}</p>
27 28
            <p>{% trans "First name" %}: {{ profile.first_name|default:"-" }}</p>
            <p>{% trans "Last name" %}: {{ profile.last_name|default:"-" }}</p>
29
            <p>
30
              {% if perm_email %}
31 32 33
                {% trans "Email address" %}: {{ profile.email }}
              {% endif %}
            </p>
34
            {% if request.user == profile %}
35
            <p>
36
              {% trans "Use email address as Gravatar profile image" %}:
37
              <input id="dashboard-profile-use-gravatar" data-user="{{ profile.username }}"
38
              {% if profile.profile.use_gravatar %}checked="checked"{% endif %}
39
              type="checkbox"/> <a href="https://gravatar.com">{% trans "What's Gravatar?" %}</a>
40
            </p>
41
            <a href="{% url "dashboard.views.profile-preferences" %}">{% trans "Change my preferences" %}</a>
42
            {% endif %}
43 44 45 46
          </div>
          <div class="clearfix"></div>
        </div>

47 48 49
        {% if perm_group_list %}
          <hr />
          <h4>
50
            <i class="fa fa-group"></i> {% trans "Groups" %}
51 52 53 54 55 56 57 58 59
          </h4>
          <ul class="dashboard-profile-group-list">
          {% for g in groups %}
            <li>{{ g.name }}</li>
            {% empty %}
            {% trans "This user is not in any group." %}
          {% endfor %}
          </ul>
        {% endif %}
60 61 62 63

        <hr />

        <h4>
64
          <i class="fa fa-desktop"></i>
65
          {% trans "Virtual machines owned by the user" %} ({{ instances_owned|length }})
66 67 68 69 70
        </h4>
        <ul class="dashboard-profile-vm-list">
        {% for i in instances_owned %}
          <li>
            <a href="{{ i.get_absolute_url }}">
71
              <i class="fa fa-li {{ i.get_status_icon }}"></i>
72 73 74 75 76 77 78 79 80 81 82 83 84
              {{ i }}
            </a>
          </li>
          {% empty %}
          <li>
            {% trans "This user have no virtual machines." %}
          </li>
        {% endfor %}
        </ul>

        <hr />

        <h4>
85
          <i class="fa fa-desktop"></i>
86
          {% trans "Virtual machines with access" %} ({{ instances_with_access|length }})
87 88 89 90 91
        </h4>
        <ul class="dashboard-profile-vm-list">
        {% for i in instances_with_access %}
          <li>
            <a href="{{ i.get_absolute_url }}">
92
              <i class="fa fa-li {{ i.get_status_icon }}"></i>
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
              {{ i }}
            </a>
          </li>
          {% empty %}
          <li>
            {% trans "This user have no access to any virtual machine." %}
          </li>
        {% endfor %}
        </ul>
      </div>
    </div>
  </div>
</div>

{% endblock %}
108 109 110 111

{% block extra_js %}
  <script src="{{ STATIC_URL }}dashboard/profile.js"></script>
{% endblock %}