profile.html 3.93 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

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

53 54 55
        {% if perm_group_list %}
          <hr />
          <h4>
56
            <i class="fa fa-group"></i> {% trans "Groups" %}
57 58 59 60 61 62 63 64 65
          </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 %}
66 67 68 69

        <hr />

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

        <hr />

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

{% endblock %}
114 115 116 117

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