Add user model through devise. Add some basic layout. Start testing in travis.

This commit is contained in:
2020-08-20 11:01:27 +01:00
parent 1bc17c462a
commit b7b1e2b3fd
45 changed files with 599 additions and 155 deletions
+21 -27
View File
@@ -1,43 +1,37 @@
<h2>Edit <%= resource_name.to_s.humanize %></h2>
<h1><%= t('.title', resource: resource_name.to_s.humanize) %></h1>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>
<%= bootstrap_devise_error_messages! %>
<div class="field">
<%= f.label :email %><br />
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
<div class="form-group">
<%= f.label :email %>
<%= f.email_field :email, autofocus: true, autocomplete: 'email', class: 'form-control' %>
</div>
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
<div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
<% end %>
<div class="form-group">
<%= f.label :password %>
<%= f.password_field :password, autocomplete: 'new-password', class: 'form-control' %>
<div class="field">
<%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br />
<%= f.password_field :password, autocomplete: "new-password" %>
<% if @minimum_password_length %>
<br />
<em><%= @minimum_password_length %> characters minimum</em>
<% end %>
<small class="form-text text-muted"><%= t('.leave_blank_if_you_don_t_want_to_change_it') %></small>
</div>
<div class="field">
<%= f.label :password_confirmation %><br />
<%= f.password_field :password_confirmation, autocomplete: "new-password" %>
<div class="form-group">
<%= f.label :password_confirmation %>
<%= f.password_field :password_confirmation, autocomplete: 'new-password', class: 'form-control' %>
</div>
<div class="field">
<%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
<%= f.password_field :current_password, autocomplete: "current-password" %>
<div class="form-group">
<%= f.label :current_password %>
<%= f.password_field :current_password, autocomplete: 'current-password', class: 'form-control' %>
<small class="form-text text-muted"><%= t('.we_need_your_current_password_to_confirm_your_changes') %></small>
</div>
<div class="actions">
<%= f.submit "Update" %>
<div class="form-group">
<%= f.submit t('.update'), class: 'btn btn-primary' %>
</div>
<% end %>
<h3>Cancel my account</h3>
<p><%= t('.unhappy') %>? <%= link_to t('.cancel_my_account'), registration_path(resource_name), data: { confirm: t('.are_you_sure') }, method: :delete %>.</p>
<p>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %></p>
<%= link_to "Back", :back %>
<%= link_to t('.back'), :back %>