summaryrefslogtreecommitdiff
path: root/templates/account/userprofileform.html
blob: 96ed2779cd159d688ac201a219a3bd5b9490ebdb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
{%extends "base/page.html"%}
{% load pgfilters %}
{%block title%}Edit user profile{%endblock%}
{%block contents%}
<h1>Edit User Profile <i class="far fa-address-card"></i></h1>

<form method="post" action=".">
  {% csrf_token %}
  {% if userform.errors or profileform.errors or contribform.errors %}
    <div class="alert alert-danger" role="alert">
      Please correct the errors below, and re-submit the form.
    </div>
  {% endif %}
  <div class="form-group row">
    <label class="col-form-label col-sm-3">Username:</label>
    <div class="col-sm-9">
      {{ user.username }}
    </div>
  </div>
  {% for field in userform %}
    <div class="form-group row">
      {% if field.errors %}
        {% for e in field.errors %}
          <div class="col-lg-12 alert alert-danger">{{e}}</div>
        {% endfor %}
      {% endif %}
      <label class="col-form-label col-sm-3" for="{{ field.id }}">
        {{ field.label|title }}
        {% if field.help_text %}
          <p><small>{{ field.help_text }}</small></p>
        {% endif %}
      </label>
      <div class="col-sm-9">
        {{ field|field_class:"form-control" }}
      </div>
    </div>
  {% endfor %}
  {% for field in profileform %}
    <div class="form-group row">
      {% if field.errors %}
        {% for e in field.errors %}
          <div class="col-lg-12 alert alert-danger">{{e}}</div>
        {% endfor %}
      {% endif %}
      <label class="col-form-label col-sm-3" for="{{ field.id }}">
        {{ field.label }}
        {% if field.help_text %}
          <p><small>{{ field.help_text }}</small></p>
        {% endif %}
      </label>
      <div class="col-sm-9">
        {{ field|field_class:"form-control" }}
      </div>
    </div>
  {% endfor %}

    <h2>Secondary email addresses</h2>
    <p>You can add one or more secondary email addresses to your account, which can be used for example to subscribe to mailing lists.</p>
    {%if secondaryaddresses%}
    <p>Note that deleting any address here will cascade to connected system and can for example lead to being unsubscribed from mailing lists automatically.</p>
    <p></p>
    <p>The following secondary addresses are currently registered with your account:</p>
    <ul>
      {% for a in secondaryaddresses %}
      <li>{{a.email}}{%if not a.confirmed%} <em>(awaiting confirmation since {{a.sentat}})</em>{%endif%} (<input type="checkbox" name="deladdr_{{a.id}}" value="1"> Delete)</li>
      {%endfor%}
    </ul>
    {%if secondarypending %}
    <p>
      One or more of the secondary addresses on your account are listed as pending. An email has been sent to the address to confirm that
      you are in control of the address. Open the link in this email (while logged in to this account) to confirm the account. If an email
      address is not confirmed within approximately 24 hours, it will be deleted. If you have not received the confirmation token, you
      can delete the address and re-add it, to have the system re-send the verification email.
    </p>
    {%endif%}
    {%endif%}
    <h3>Add new email address</h3>
    {%for field in secondaryemailform%}
      <div class="form-group row">
        {% if field.errors %}
          {% for e in field.errors %}
            <div class="col-lg-12 alert alert-danger">{{e}}</div>
          {% endfor %}
        {% endif %}
        <label class="col-form-label col-sm-3" for="{{ field.id }}">
          {{ field.label }}
          {% if field.help_text %}
            <p><small>{{ field.help_text }}</small></p>
          {% endif %}
        </label>
        <div class="col-sm-9">
          {{ field|field_class:"form-control" }}
        </div>
      </div>
    {%endfor%}

  {% if contribform %}
    <h2>Edit contributor information</h2>
    <p>You can edit the information that's shown on the <a href="/community/contributors/" target="_blank" rel="noopener">contributors</a> page. Please be careful as your changes will take effect immediately!
    </p>
    {% for field in contribform %}
      <div class="form-group row">
        {% if field.errors %}
          {% for e in field.errors %}
            <div class="col-lg-12 alert alert-danger">{{e}}</div>
          {% endfor %}
        {% endif %}
        <label class="col-form-label col-sm-3" for="{{ field.id }}">
          {{ field.label }}
          {% if field.help_text %}
            <p><small>{{ field.help_text }}</small></p>
          {% endif %}
        </label>
        <div class="col-sm-9">
          {{ field|field_class:"form-control" }}
        </div>
      </div>
    {% endfor %}
  {% endif %}

  <div class="submit-row">
    <input class="btn btn-primary" type="submit" value="Save" />
  </div>
</form>
{%endblock%}