Commit 78a16da2 authored by Birger Schacht's avatar Birger Schacht
Browse files

Redesign the recovery email page

The controller now redirects back to the recovery email page after
the form was submitted.
The recovery_email_help_crypt text is not directly related to the
recovery email functionality so I removed it.
parent fe4c4e3d
Pipeline #571 failed with stage
......@@ -13,7 +13,7 @@ class RecoveryEmailController < ApplicationController
api.set_recovery_email(@recovery_email, @email_recovery_token, params[:password])
flash[:notice] = :success
update_account_properties
redirect_to '/'
redirect_to recovery_email_path
rescue ApiBackend::ApiError => e
if e.api_msg
flash[:notice] = e.api_msg
......
<h3><%= @page_title = t(:recovery_email) %></h3>
<p>
<div class="alert alert-info" role="alert">
<%= t :recovery_email_help %>
<% if mail_crypt_enabled? %>
<%= t :recovery_email_help_crypt %>
<% end %>
</p>
</div>
<%= form_tag(recovery_email_path, method: "post") do %>
<%= label_tag(:recovery_email, (t :recovery_email) + (recovery_email_set? ? " (#{t(:present)})" : '')) %>
<%= text_field_tag(:recovery_email, '', value: @recovery_email) %>
<div class="form-group row">
<%= label_tag(:recovery_email, (t :recovery_email) + (recovery_email_set? ? " (#{t(:present)})" : ''), class: "col-form-label col-sm-3") %>
<div class="col-sm-8">
<%= text_field_tag(:recovery_email, '', value: @recovery_email, class: "form-control") %>
</div>
<div class="col-sm-1">
</div>
</div>
<% if mail_crypt_enabled? %>
<br />
<input style="margin:2px 0 5px 0;"
type="checkbox"
id="email_recovery_token"
name="email_recovery_token" <%= if @email_recovery_token then 'checked="checked"' else '' end %>
/>
<%= t(:backup_recovery_token_email) %>
<div class="form-group row">
<%= label_tag(:email_recovery_token, (t :backup_recovery_token_email), class: "col-form-label col-sm-3") %>
<div class="col-sm-8">
<input style="margin:2px 0 5px 0;" type="checkbox" id="email_recovery_token" name="email_recovery_token" <%= if @email_recovery_token then 'checked="checked"' else '' end %> class="form-control" />
</div>
<div class="col-sm-1">
</div>
</div>
<% end %>
<br />
<%= label_tag(:password, t(:your_main_pw)) %><%= password_field_tag(:password, nil, placeholder: t(:enter_your_current_pw)) %>
<br />
<%= submit_tag(recovery_email_set? ? t(:overwrite) : t(:submit)) %>
<%= link_to t(:back), root_path %>
<div class="form-group row">
<%= label_tag(:password, t(:your_main_pw), class: "col-form-label col-sm-3") %>
<div class="col-sm-8">
<%= password_field_tag(:password, nil, placeholder: t(:enter_your_current_pw), class: "form-control") %>
</div>
<div class="col-sm-1">
</div>
</div>
<div class="form-group row">
<div class="col-sm-10"><%= submit_tag(recovery_email_set? ? t(:overwrite) : t(:submit), class: "btn btn-primary") %></div>
</div>
<% end %>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment