account.html 8.08 KB
Newer Older
1
2
<header id="dialog-header" class="header" v-if="(active_view == 'account' && user)" v-cloak>
  <div v-cloak class="header-left pull-left">
3
    <a class="btn btn-dark btn-md btn-round btn-icon" href="<%= config.endpoint %>/spaces">
4
5
6
7
8
9
      <span class="icon icon-svg icon-sd6"></span>
    </a>
    <h5>Edit Account</h5>
  </div>

  <div class="header-right pull-right">
10
    <a class="btn btn-dark btn-md btn-round btn-icon" href="<%= config.endpoint %>/spaces">
11
12
13
      <span class="icon icon-cross-0"></span>
    </a>
  </div>
mntmn's avatar
mntmn committed
14

15
16
17
</header>

<div class="dialog-freestanding dialog in" v-if="active_view == 'account' && user" v-cloak>
mntmn's avatar
mntmn committed
18
19

  <div class="dialog-tabs" style="margin:auto">
20
21
22
23
24
    <div class="dialog-tab" v-bind:class="{open:account=='profile'}" v-on:click="account='profile'"><span><%=__("profile_caption")%></span></div>
    <div class="dialog-tab" v-bind:class="{open:account=='language'}" v-on:click="account='language'"><span><%=__("language_caption")%></span></div>
    <div class="dialog-tab" v-bind:class="{open:account=='notifications'}" v-on:click="account='notifications'"><span><%=__("notifications_caption")%></span></div>
    <div class="dialog-tab" v-bind:class="{open:account=='password'}" v-on:click="account='password'"><span><%=__("password_caption")%></span></div>
    <div class="dialog-tab" v-bind:class="{open:account=='terminate'}" v-on:click="account='terminate'"><span><%=__("terminate_caption")%></span></div>
mntmn's avatar
mntmn committed
25
26
  </div>

27
  <div class="dialog-section text-left">
mntmn's avatar
mntmn committed
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
    <div class="collapse" v-bind:class="{in:account=='profile'}">
      <div class="labels-inline relative" style="margin-bottom:40px">
        <div class="form-group">
          <div id="profile-image" class="img loaded pull-left" style="margin-right: 50px;">

            <span id="profile-thumbnail" class="btn btn-xl btn-darken btn-icon btn-round" v-bind:style="{'background-image':'url('+user.avatar_thumb_uri+')'}">
              <span class="icon icon-user" v-if="!user.avatar_thumb_uri"></span>
            </span>

            <span class="spinner"></span>
            <button id="remove-profile-image" class="btn btn-xs btn-dark btn-round btn-icon" v-on:click="delete_user_avatar_image()" v-if="has_avatar_image(user)">
              <span class="icon icon-cross-3"></span>
            </button>
          </div>

          <div class="pull-left">
            <div class="form-group">
              <label class="file btn btn-md btn-darken" style="margin-right: 5px;">
                <input type="file" v-on:change="save_user_avatar_image(this)">
47
48
                <span v-if="!uploading_avatar"><%=__("upload_avatar")%></span>
                <span v-if="uploading_avatar"><%=__("uploading_avatar")%></span>
mntmn's avatar
mntmn committed
49
50
              </label>

51
              <p class="message"><%=__("avatar_dimensions")%></p>
mntmn's avatar
mntmn committed
52
53
54
55
56
57
            </div>
          </div>
        </div>
      </div>

      <div>
58
59
60
61
62
63
64
65
66
        <div class="form-group">
          <label class="label">API Token</label>
          <input
          type="text"
          id="api-token"
          class="input input-white no-b"
          v-model="user.api_token"
          placeholder="secret key">
        </div>
mntmn's avatar
mntmn committed
67
68

        <div class="form-group">
69
          <label class="label" ><%=__("profile_name")%></label>
mntmn's avatar
mntmn committed
70
71
72
73
74
75
76
77
          <input type="text" id="user-nickname"
          pattern=".{3,}"
          required title="3 characters minimum"
          class="input input-white no-b" data-i18n="[placeholder]account.username.input"
          v-model="user.nickname" placeholder="Choose a username">
        </div>

        <div class="form-group">
78
          <label class="label"><%=__("profile_email")%></label>
mntmn's avatar
mntmn committed
79
          <input
80
          type="email"
mntmn's avatar
mntmn committed
81
82
83
84
85
          id="new-email"
          class="input input-white no-b"
          v-model="user.email"
          v-on:change="user.email_changed=true"
          placeholder="mail@example.com">
86
        </div>
mntmn's avatar
mntmn committed
87

88
89
        <div class="form-group">
          <button class="btn btn-md btn-dark" v-on:click="save_user()">Save</button>
mntmn's avatar
mntmn committed
90
91
92
93
94
95
96
        </div>
      </div>
    </div>

    <div class="collapse" v-bind:class="{in:account=='language'}">
      <div class="modal-section">
        <label class="radio" v-bind:class="{checked
97
        : user.prefs_language=='en'}" v-on:click="save_user_language('en')">
mntmn's avatar
mntmn committed
98
99
100
          <input type="radio" id="user-preferences_language" name="language" value="en"><span>English</span>
        </label>
        <hr/>
101
        <label class="radio" v-bind:class="{checked: user.prefs_language=='de'}" v-on:click="save_user_language('de')">
mntmn's avatar
mntmn committed
102
103
104
          <input type="radio" id="user-preferences_language" name="language" value="de"><span>Deutsch</span>
        </label>
        <hr/>
105
        <label class="radio" v-bind:class="{checked: user.prefs_language=='fr'}" v-on:click="save_user_language('fr')">
mntmn's avatar
mntmn committed
106
107
          <input type="radio" id="user-preferences_language" name="language" value="fr"><span>Français</span>
        </label>
Mejans's avatar
Mejans committed
108
109
        <label class="radio" v-bind:class="{checked: user.prefs_language=='oc'}" v-on:click="save_user_language('oc')">
          <input type="radio" id="user-preferences_language" name="language" value="oc"><span>Occitan</span>
110
111
112
        </label>
        <label class="radio" v-bind:class="{checked: user.prefs_language=='es'}" v-on:click="save_user_language('es')">
          <input type="radio" id="user-preferences_language" name="language" value="es"><span>Español</span>
Mejans's avatar
Mejans committed
113
        </label>        
mntmn's avatar
mntmn committed
114
115
116
117
118
119
120
      </div>
    </div>

    <div class="collapse" v-bind:class="{in:account=='notifications'}">
      <div class="modal-section labels-inline">
        <div class="form-group">
          <label class="checkbox"
121
122
            v-bind:class="{checked: user.prefs_email_notifications}"
            v-on:click="account_save_user_notifications(!user.prefs_email_notifications);">
123
            <span><%=__('notifications_option_chat')%></span>
mntmn's avatar
mntmn committed
124
125
126
127
128
129
          </label>
        </div>
      </div>
    </div>

    <div class="collapse" v-bind:class="{in:account=='password'}">
130
      <h4>Change Password</h4>
mntmn's avatar
mntmn committed
131
132
      <div class="modal-section labels-inline">
        <div class="form-group">
133
          <label class="label"><%=__("current_password")%></label>
mntmn's avatar
mntmn committed
134
135
136
          <input id="current-password" class="input input-white no-b" v-model="password_change_current" type="password">
        </div>
        <div class="form-group">
137
          <label class="label"><%=__("new_password")%></label>
mntmn's avatar
mntmn committed
138
139
140
          <input id="new-password" class="input input-white no-b" v-model="password_change_new" type="password">
        </div>
        <div class="form-group">
141
          <label class="label"><%=__("verify_password")%></label>
mntmn's avatar
mntmn committed
142
143
144
145
146
147
148
149
          <input id="new-password-confirmation" class="input input-white no-b" v-model="password_change_new_confirmation" type="password">
        </div>

        <div class="center alert alert-danger" v-if="password_change_error">{{password_change_error}}</div>
      </div>

      <div class="modal-footer">
          <button
150
151
            class="btn btn-dark btn-md"
            v-on:click="save_user_password(password_change_current, password_change_new, password_change_new_confirmation);" >
152
            <%=__("change_password")%>
mntmn's avatar
mntmn committed
153
154
155
156
157
          </button>
      </div>
    </div>

    <div class="collapse" v-bind:class="{in:account=='terminate'}">
158
159
      <h4>Terminate Account</h4>
      <div class="modal-section labels-inline">
mntmn's avatar
mntmn committed
160
        <div class="form-group">
161
          <label class="label"><%=__("current_password")%></label>
mntmn's avatar
mntmn committed
162
163
          <input v-model="account_remove_password" class="input input-white no-b" type="password">
        </div>
164
        
mntmn's avatar
mntmn committed
165
        <div class="form-group">
166
          <label class="label"><%=__("terminate_reason")%></label>
mntmn's avatar
mntmn committed
167
          <textarea class="input input-white no-b" v-model="account_remove_feedback"></textarea>
168
          <p class="message"><%=__("terminate_reason_caption")%></p>
mntmn's avatar
mntmn committed
169
        </div>
170
171
172
      </div>
      
      <div class="modal-section labels-inline">
mntmn's avatar
mntmn committed
173
174
        <div class="center alert alert-danger" v-if="account_remove_error">{{account_remove_error}}</div>
      </div>
175
176
177
178
      
      <div class="modal-footer">
        <button class="btn btn-stroke-darken btn-md" v-on:click="remove_account(account_remove_password, account_remove_feedback)">Terminate Account</button>
      </div>
mntmn's avatar
mntmn committed
179
180
181
    </div>
  </div>
</div>