user_update.html 5.17 KB
Newer Older
1
{% extends "base.html" %}
BERJON Matthieu's avatar
BERJON Matthieu committed
2
{% load static htmlattrs socialaccount %}
3 4 5

{% block title %}User settings{% endblock %}

BERJON Matthieu's avatar
BERJON Matthieu committed
6
{% block breadcrumb %}
7
<li class="breadcrumb-item active" aria-current="page">My profile</li>
BERJON Matthieu's avatar
BERJON Matthieu committed
8 9
{% endblock %}

10
{% block content %}
BERJON Matthieu's avatar
BERJON Matthieu committed
11 12
<div class="container">
  <div class="allgo-page">
13

BERJON Matthieu's avatar
BERJON Matthieu committed
14 15
    <div class="clearfix border-bottom pb-3 mb-3">
      <h5>Profile</h5>
BERJON Matthieu's avatar
BERJON Matthieu committed
16 17
        <form method="post">
          {% csrf_token %}
18 19 20 21 22 23 24 25 26 27

          <div class="form-row">
            <div class="form-group col-md-6">
              {{ form.first_name.label_tag }}
              {{ form.first_name | attr:"placeholder:First name" | add_class:"form-control" }}
            </div>
            <div class="form-group col-md-6">
              {{ form.last_name.label_tag }}
              {{ form.last_name | attr:"placeholder:Your last name" | add_class:"form-control" }}
            </div>
BERJON Matthieu's avatar
BERJON Matthieu committed
28
          </div>
29

BERJON Matthieu's avatar
BERJON Matthieu committed
30
          <button type="submit" class="btn btn-primary float-right">
31 32 33
            <i class="far fa-user"></i> Update profile
          </button>
        </form>
BERJON Matthieu's avatar
BERJON Matthieu committed
34
    </div>
35

36 37 38 39 40 41 42 43 44 45 46 47 48 49
    <div class="clearfix border-bottom pb-3 mb-3">
      <h5>E-mail</h5>
      <ul>
          {% for addr in user.email_addresses %}
          <li class="{% if addr.primary %}font-weight-bold{% endif %}">{{addr.email}}{% if addr.primary %}{% endif %} </li>
          {% endfor %}
      </ul>
      <div class="float-right">
        <a class="btn btn-primary" href="{% url 'account_email' %}" role="button">
          <i class="fas fa-envelope"></i> Manage addresses
        </a>
      </div>
    </div>

BERJON Matthieu's avatar
BERJON Matthieu committed
50 51 52
    <div class="clearfix border-bottom pb-3 mb-3">
      {% if user.has_usable_password %}
      <h5>Password</h5>
53

BERJON Matthieu's avatar
BERJON Matthieu committed
54 55 56 57 58 59 60 61 62 63
      <p>
      Follow the link to <a href="{% url 'main:user_password' %}" title="Change your password">change your password</a>.</p>
      {% else %}
      <h5>Social accounts</h5>

      <p>
      Follow the link to <a href="{% url 'socialaccount_connections' %}" title="Update your social connections">Update your social account</a>.</p>
      {% endif %}

    </div>
64

BERJON Matthieu's avatar
BERJON Matthieu committed
65
    <div class="clearfix border-bottom pb-3 mb-3">
66 67
        <h5>SSH key</h5>

BERJON Matthieu's avatar
BERJON Matthieu committed
68
        {% if sshkey %}
69 70 71 72 73 74 75 76 77 78 79 80 81
        <p>
        This a list of SSH keys associated with your account. Remove any keys
        that you do not recognize.
        </p>

        <div class="card ssh-keys">
          <div class="card-body">
            <div class="row">

              <div class="col-2">
                <p class="ssh-key"><i class="fas fa-key"></i><span>SSH</span></p>
              </div>

82
              <div class="col-9">
83 84 85 86 87 88 89 90
                <p>
                  {% if ssh_comment %}
                  <strong>{{ ssh_comment }}</strong><br/>
                  {% endif %}
                  <strong>Fingerprint</strong>: {{ ssh_fingerprint }}
                </p>
              </div>

91 92 93 94 95
              <div class="col-1">
                  <a 
                    href="{% url 'main:user_ssh_delete' %}"
                    data-toggle="tooltip"
                    data-placement="top"
96 97 98 99 100
                    title="Delete this SSH key"
                    class="fa-layers fa-2x">
                    <i class="fas fa-square"></i>
                    <i class="fa-inverse fas fa-trash-alt" data-fa-transform="shrink-7 down-.25 left-.25"></i>
                    <span class="text-hide">Delete this SSH key</span>
101
                  </a>
102 103 104 105
              </div>
            </div>


106
          </div>
107 108
        </div>
        {% else %}
BERJON Matthieu's avatar
BERJON Matthieu committed
109
        <p>You don't have any SSH key saved, please <a href="{% url 'main:user_ssh_add' %}" title="Add a SSH key">add one</a>.</p>
110
        {% endif %}
111

BERJON Matthieu's avatar
BERJON Matthieu committed
112
    </div>
113

114
    <div class="clearfix border-bottom mb-3 pb-3">
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
        <h5>Token</h5>

        <p>
        Token generated to be used with the API.
        </p>

          <div class="form-group mb-3">
            <div class="input-group">
              <div class="input-group-prepend">
                <button 
                  class="btn btn-primary js-copy"
                  data-toggle="tooltip"
                  data-copy="{{ token }}"
                  data-placement="top"
                  title="Copy to clipboard" type="button"><i class="fas fa-clipboard"></i><span class="text-hide">Copy to clipboard</span></button>
BERJON Matthieu's avatar
BERJON Matthieu committed
130 131 132
              </div>
              <input type="text" readonly class="form-control" value="{{ token }}">
              <div class="input-group-append">
133 134 135 136
                <a href="{% url 'main:user_token' %}" class="btn btn-primary" role="button">Regenerate</a>
              </div>
            </div>
          </div>
137
    </div>
BERJON Matthieu's avatar
BERJON Matthieu committed
138 139


140 141 142
    {% if agreements %}
    <div class="clearfix mb-3 pb-3">
      <h5>Terms of Service</h5>
BERJON Matthieu's avatar
BERJON Matthieu committed
143

144 145 146 147 148 149 150 151 152
      <p>You agreed to the following Terms of Service:
      <ul>
        {% for agreement in agreements %}
        <li><a href="{{agreement.tos.url}}">Version {{agreement.tos.version}}</a> <i>agreed on {{agreement.created_at}}</i></li>
        {% endfor %}
      </ul>
      </p>
    </div>
    {% endif %}
153 154 155
  </div>
</div>
{% endblock %}
156 157

{% block messages %}
158
{{ block.super }}
BERJON Matthieu's avatar
BERJON Matthieu committed
159
{% include 'partials/_form_messages.html' %}
160
{% endblock %}
161 162 163

{% block javascript %}
{{ block.super }}
BERJON Matthieu's avatar
BERJON Matthieu committed
164
<script defer src="{% static 'js/tooltip.js' %}"></script>
165
<script defer src="{% static 'js/copy.js' %}"></script>
166
{% endblock %}