summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/_invalid_input.html.ep4
-rw-r--r--templates/account.html.ep21
-rw-r--r--templates/change_mail.html.ep49
3 files changed, 70 insertions, 4 deletions
diff --git a/templates/_invalid_input.html.ep b/templates/_invalid_input.html.ep
index d79ad03..b6353d7 100644
--- a/templates/_invalid_input.html.ep
+++ b/templates/_invalid_input.html.ep
@@ -69,9 +69,9 @@
<span class="card-title">Passwort-Reset wird durchgeführt</span>
<p>Es wurde bereits ein Reset-Link verschickt.</p>
% }
- % elsif ($invalid eq 'recovery token') {
+ % elsif ($invalid eq 'change token') {
<span class="card-title">Ungültiger Token</span>
- <p>Der Reset-Token ist ungültig oder abgelaufen. Neuen beantragen?</p>
+ <p>Der Token ist ungültig oder abgelaufen. Neuen beantragen?</p>
% }
% elsif ($invalid eq 'deletion password') {
<span class="card-title">Ungültiges Passwort</span>
diff --git a/templates/account.html.ep b/templates/account.html.ep
index ca43340..92b61db 100644
--- a/templates/account.html.ep
+++ b/templates/account.html.ep
@@ -2,6 +2,23 @@
%= include '_invalid_input', invalid => $invalid
% }
+% if (my $success = flash('success')) {
+ <div class="row">
+ <div class="col s12">
+ <div class="card green darken-4">
+ <div class="card-content white-text">
+ % if ($success eq 'mail') {
+ <span class="card-title">Mail-Adresse erfolgreich geändert</span>
+ % }
+ % elsif ($success eq 'password') {
+ <span class="card-title">Passwort erfolgreich geändert</span>
+ % }
+ </div>
+ </div>
+ </div>
+ </div>
+% }
+
<h1>Account</h1>
% my $acc = current_user();
<div class="row">
@@ -13,11 +30,11 @@
</tr>
<tr>
<th scope="row">Mail</th>
- <td><%= $acc->{email} %></td>
+ <td><%= $acc->{email} %><a href="/change_mail" style="margin-left: 1em;"><i class="material-icons">edit</i> ändern</a></td>
</tr>
<tr>
<th scope="row">Passwort</th>
- <td><a href="/change_password" class="waves-effect waves-light btn">ändern</a></td>
+ <td><a href="/change_password"><i class="material-icons">edit</i> ändern</a></td>
</tr>
<tr>
<th scope="row">Registriert am</th>
diff --git a/templates/change_mail.html.ep b/templates/change_mail.html.ep
new file mode 100644
index 0000000..6fde245
--- /dev/null
+++ b/templates/change_mail.html.ep
@@ -0,0 +1,49 @@
+% if (my $invalid = stash('invalid')) {
+ %= include '_invalid_input', invalid => $invalid
+% }
+
+% if (stash('success')) {
+ <div class="row">
+ <div class="col s12">
+ <div class="card green darken-4">
+ <div class="card-content white-text">
+ <span class="card-title">Mail-Änderung wird durchgeführt</span>
+ <p>
+ Ein für zwei Tage gültiger Bestätigungs-Link wurde an die
+ angegebene Mail-Adresse verschickt. Sobald du ihn aufgerufen
+ hast, wird die neue Adresse in deinem Account eingetragen.
+ </p>
+ </div>
+ </div>
+ </div>
+ </div>
+% }
+
+<h1>Mail ändern</h1>
+%= form_for '/change_mail' => (method => 'POST') => begin
+ %= csrf_field
+ <div class="row">
+ <div class="input-field col s12">
+ <i class="material-icons prefix">lock</i>
+ %= password_field 'password', id => 'password', class => 'validate', required => undef, autocomplete => 'current-password'
+ <label for="password">Aktuelles Passwort</label>
+ </div>
+ <div class="input-field col s12">
+ <i class="material-icons prefix">email</i>
+ %= email_field 'email', id => 'email', class => 'validate', required => undef, maxlength => 250
+ <label for="email">Neue Mail-Adresse</label>
+ </div>
+ </div>
+ <div class="row">
+ <div class="col s3 m3 l3">
+ </div>
+ <div class="col s6 m6 l6 center-align">
+ <button class="btn waves-effect waves-light" type="submit" name="action" value="update_mail">
+ Ändern
+ <i class="material-icons right">send</i>
+ </button>
+ </div>
+ <div class="col s3 m3 l3">
+ </div>
+ </div>
+%= end