profile_form.html 3.83 KB
Newer Older
1 2
{% extends "dashboard/base.html" %}
{% load i18n %}
3
{% load crispy_forms_tags %}
4
{% load render_table from django_tables2 %}
5 6 7

{% block title-page %}{% trans "Profile" %}{% endblock %}

8 9 10 11 12 13
{% block content %}

<div class="row">
  <div class="col-md-12">
    <div class="panel panel-default">
      <div class="panel-heading">
14
        <a class="pull-right btn btn-default btn-xs"
15 16
          href="{% url "dashboard.views.profile" username=object.user.username %}">
          {% trans "Go to my profile" %}</a>
17
        <h3 class="no-margin"><i class="fa fa-desktop"></i> {% trans "My profile" %}</h3>
18 19
      </div>
      <div class="panel-body">
20
        <div class="row">
21
          <div class="col-md-4" style="margin-bottom: 50px;">
22 23 24 25
            <fieldset>
              <legend>{% trans "Password change" %}</legend>
              {% crispy forms.change_password %}
            </fieldset>
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
            <fieldset style="margin-top: 25px;">
              <legend>{% trans "Two-factor authentication" %}</legend>
              {% if profile.two_factor_secret %}
                {% blocktrans %}
                Two-factor authentication is currently enabled on your account. To disable it
                click the button
                {% endblocktrans %}
                <a href="{% url "dashboard.views.profile-disable-two-factor" %}" class="btn btn-warning btn-xs">
                  <i class="fa fa-unlock"></i>
                  {% trans "Disable" %}
                </a>
              {% else %}
                {% blocktrans %}
                Two-factor authentication is currently disabled on your account. To enable it
                click the button
                {% endblocktrans %}
                <a href="{% url "dashboard.views.profile-enable-two-factor" %}" class="btn btn-success btn-xs">
                  <i class="fa fa-lock"></i>
                  {% trans "Enable" %}
                </a>
              {% endif %}
            </fieldset>
48
          </div>
49
          <div class="col-md-4" style="margin-bottom: 50px;">
50
            <fieldset>
51
              <legend>{% trans "My preferences" %}</legend>
52 53 54
              {% crispy forms.change_language %}
            </fieldset>
          </div>
55 56 57 58
          <div class="col-md-4">
            <fieldset>
              <legend>{% trans "Current avatar" %}</legend>
              <p>
59
                <img id="dashboard-profile-avatar"
60 61 62 63 64 65 66 67 68
                 class="img-rounded" src="{{ object.get_avatar_url }}"/>
              </p>
              <p>
                <a href="{% url "dashboard.views.profile" username=profile.user.username %}">
                  {% trans "Go to my profile" %}
                </a>
              </p>
            </fieldset>
          </div>
69
        </div>
70 71 72 73 74
      </div>
    </div>
  </div>
</div>

75 76 77 78 79
<div class="row">
  <div class="col-md-12">
    <div class="panel panel-default">
      <div class="panel-heading">
        <a href="{% url "dashboard.views.userkey-create" %}" class="pull-right btn btn-success btn-xs" style="margin-right: 10px;">
80
          <i class="fa fa-plus"></i> {% trans "add SSH key" %}
81
        </a>
82
        <h3 class="no-margin"><i class="fa fa-key"></i> {% trans "SSH public keys" %}</h3>
83 84 85 86 87 88 89 90
      </div>
      <div class="panel-body">
        {% render_table userkey_table %}
      </div>
    </div>
  </div>
</div>

91 92 93 94
<div class="row">
  <div class="col-md-12">
    <div class="panel panel-default">
      <div class="panel-heading">
95
        <a href="{% url "dashboard.views.connect-command-create" %}"
96
          class="pull-right btn btn-success btn-xs" style="margin-right: 10px;">
97
          <i class="fa fa-plus"></i> {% trans "add command template" %}
98
        </a>
99
        <h3 class="no-margin"><i class="fa fa-code"></i> {% trans "Command templates" %}</h3>
100 101 102 103 104 105 106
      </div>
      <div class="panel-body">
        {% render_table connectcommand_table %}
      </div>
    </div>
  </div>
</div>
107
{% endblock %}