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

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

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

        <hr />

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

        <hr />

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

{% endblock %}