From c2435695bfa17034989e463225bc64d71f3e0899 Mon Sep 17 00:00:00 2001 From: Benjamin ter Kuile Date: Wed, 25 Feb 2015 14:44:28 +0100 Subject: [PATCH] Add devise defaults --- Gemfile | 3 +- Gemfile.lock | 70 +++++++------- .../javascripts/theme1/application.js.coffee | 4 +- .../theme1/_foundation_and_overrides.css.sass | 2 +- .../stylesheets/theme1/_mixins.css.sass | 1 + .../theme1/elements/_devise.css.sass | 8 +- app/helpers/devise_helper.rb | 2 +- app/models/employee.rb | 2 +- app/views/devise/_links.html.slim | 18 ++-- app/views/devise/confirmations/new.html.erb | 16 ++++ .../mailer/confirmation_instructions.html.erb | 5 + .../reset_password_instructions.html.erb | 8 ++ .../mailer/unlock_instructions.html.erb | 7 ++ app/views/devise/registrations/edit.html.erb | 39 ++++++++ app/views/devise/registrations/new.html.erb | 29 ++++++ app/views/devise/sessions/new.html.erb | 26 +++++ app/views/devise/shared/_links.html.erb | 25 +++++ app/views/devise/unlocks/new.html.erb | 16 ++++ .../reset_password_instructions.html.erb | 2 +- .../passwords/edit.html.slim | 8 +- .../passwords/new.html.slim | 4 +- app/views/new_suppliers/new.html.slim | 1 + app/views/suppliers/sessions/new.html.slim | 12 +-- app/views/theme1/_alerts.html.slim | 4 +- app/views/theme1/_social.html.slim | 3 +- config/locales/devise.en.yml | 80 +++------------- config/locales/devise.nl.yml | 96 ++----------------- 27 files changed, 266 insertions(+), 225 deletions(-) create mode 100644 app/views/devise/confirmations/new.html.erb create mode 100644 app/views/devise/mailer/confirmation_instructions.html.erb create mode 100644 app/views/devise/mailer/reset_password_instructions.html.erb create mode 100644 app/views/devise/mailer/unlock_instructions.html.erb create mode 100644 app/views/devise/registrations/edit.html.erb create mode 100644 app/views/devise/registrations/new.html.erb create mode 100644 app/views/devise/sessions/new.html.erb create mode 100644 app/views/devise/shared/_links.html.erb create mode 100644 app/views/devise/unlocks/new.html.erb rename app/views/{suppliers => employees}/passwords/edit.html.slim (75%) rename app/views/{suppliers => employees}/passwords/new.html.slim (80%) diff --git a/Gemfile b/Gemfile index 34426427..dff74f62 100644 --- a/Gemfile +++ b/Gemfile @@ -54,8 +54,9 @@ gem 'couch_potato' , github: 'bterkuile/couch_potato' #gem 'simply_stored', path: './../components/simply_stored' #, github: 'bterkuile/simply_stored' gem 'simply_stored', github: 'bterkuile/simply_stored' #gem 'orm_adapter', github: 'bterkuile/orm_adapter' -gem 'devise', github: 'plataformatec/devise', branch: 'lm-rails-4-2' #, '3.1.0' #, '2.0.4' +gem 'devise' #, github: 'plataformatec/devise', branch: 'lm-rails-4-2' #, '3.1.0' #, '2.0.4' gem 'devise_simply_stored', github: 'bterkuile/devise_simply_stored' +gem 'devise-i18n' gem "omniauth-facebook" gem "omniauth-instagram" #gem 'simple_form' diff --git a/Gemfile.lock b/Gemfile.lock index 1ec6013c..844cd3c3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -43,19 +43,6 @@ GIT ember_script (>= 0.0.4) rails -GIT - remote: git://github.com/plataformatec/devise.git - revision: 1d8890b77372b9c4fd3ec8e9b4963d76774ed33c - branch: lm-rails-4-2 - specs: - devise (3.3.0) - bcrypt (~> 3.0) - orm_adapter (~> 0.1) - railties (>= 3.2.6, < 5) - responders - thread_safe (~> 0.1) - warden (~> 1.2.3) - GEM remote: https://rubygems.org/ specs: @@ -81,7 +68,7 @@ GEM active_attr (0.8.5) activemodel (>= 3.0.2, < 5.0) activesupport (>= 3.0.2, < 5.0) - active_decorator (0.4.0) + active_decorator (0.5.0) active_model_serializers (0.9.0) activemodel (>= 3.2) activejob (4.2.0) @@ -157,7 +144,7 @@ GEM coffee-script (2.3.0) coffee-script-source execjs - coffee-script-source (1.9.0) + coffee-script-source (1.9.1) colored (1.2) colorize (0.7.5) cookiejar (0.3.2) @@ -168,6 +155,14 @@ GEM crack (0.4.2) safe_yaml (~> 1.0.0) debug_inspector (0.0.2) + devise (3.4.1) + bcrypt (~> 3.0) + orm_adapter (~> 0.1) + railties (>= 3.2.6, < 5) + responders + thread_safe (~> 0.1) + warden (~> 1.2.3) + devise-i18n (0.11.3) diff-lcs (1.2.5) docile (1.1.5) em-http-request (1.1.2) @@ -180,9 +175,9 @@ GEM eventmachine (>= 1.0.0.beta.4) email_validator (1.5.0) activemodel - ember-data-source (1.0.0.beta.14.1) + ember-data-source (1.0.0.beta.15) ember-source (~> 1.8) - ember-rails (0.16.3) + ember-rails (0.16.4) active_model_serializers barber (>= 0.6.0) ember-data-source (>= 1.0.0.beta.5) @@ -203,7 +198,7 @@ GEM emblem-rails (0.2.2) barber-emblem (~> 0.1.1) ember-rails (>= 0.14.0) - emblem-source (0.3.18) + emblem-source (0.4.0) erubis (2.7.0) eventmachine (1.0.7) execjs (2.3.0) @@ -214,7 +209,7 @@ GEM railties (>= 3.0.0) faraday (0.9.1) multipart-post (>= 1.2, < 3) - faye (1.1.0) + faye (1.1.1) cookiejar (>= 0.3.0) em-http-request (>= 0.3.0) eventmachine (>= 0.12.0) @@ -254,7 +249,7 @@ GEM railties (>= 3.2) sprockets-rails json (1.8.2) - jwt (1.2.1) + jwt (1.3.0) kaminari (0.16.3) actionpack (>= 3.0.0) activesupport (>= 3.0.0) @@ -268,7 +263,7 @@ GEM mime-types (>= 1.16, < 3) method_source (0.8.2) mime-types (1.25.1) - mini_magick (4.0.4) + mini_magick (4.1.0) mini_portile (0.6.2) minitest (5.5.1) multi_json (1.10.1) @@ -289,7 +284,7 @@ GEM omniauth (1.2.2) hashie (>= 1.2, < 4) rack (~> 1.0) - omniauth-facebook (2.0.0) + omniauth-facebook (2.0.1) omniauth-oauth2 (~> 1.2) omniauth-instagram (1.0.1) omniauth (~> 1.0) @@ -353,26 +348,26 @@ GEM rspec-core (~> 3.2.0) rspec-expectations (~> 3.2.0) rspec-mocks (~> 3.2.0) - rspec-core (3.2.0) + rspec-core (3.2.1) rspec-support (~> 3.2.0) rspec-expectations (3.2.0) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.2.0) - rspec-its (1.1.0) + rspec-its (1.2.0) rspec-core (>= 3.0.0) rspec-expectations (>= 3.0.0) - rspec-mocks (3.2.0) + rspec-mocks (3.2.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.2.0) - rspec-rails (3.2.0) - actionpack (>= 3.0, <= 4.2) - activesupport (>= 3.0, <= 4.2) - railties (>= 3.0, <= 4.2) + rspec-rails (3.2.1) + actionpack (>= 3.0, < 4.3) + activesupport (>= 3.0, < 4.3) + railties (>= 3.0, < 4.3) rspec-core (~> 3.2.0) rspec-expectations (~> 3.2.0) rspec-mocks (~> 3.2.0) rspec-support (~> 3.2.0) - rspec-support (3.2.1) + rspec-support (3.2.2) ruby-progressbar (1.7.1) rubyzip (1.1.7) safe_yaml (1.0.4) @@ -388,11 +383,11 @@ GEM multi_json (~> 1.0) rubyzip (~> 1.0) websocket (~> 1.0) - simplecov (0.9.1) + simplecov (0.9.2) docile (~> 1.1.0) multi_json (~> 1.0) - simplecov-html (~> 0.8.0) - simplecov-html (0.8.0) + simplecov-html (~> 0.9.0) + simplecov-html (0.9.0) slim (3.0.2) temple (~> 0.7.3) tilt (>= 1.3.3, < 2.1) @@ -403,7 +398,7 @@ GEM railties (>= 3.1, < 5.0) slim (~> 3.0) slop (3.6.0) - spring (1.3.1) + spring (1.3.2) spring-commands-rspec (1.0.4) spring (>= 0.9.1) sprockets (2.12.3) @@ -444,9 +439,9 @@ GEM addressable (>= 2.3.6) crack (>= 0.3.2) websocket (1.2.1) - websocket-driver (0.5.1) + websocket-driver (0.5.3) websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.1) + websocket-extensions (0.1.2) xpath (2.0.0) nokogiri (~> 1.3) @@ -467,7 +462,8 @@ DEPENDENCIES cmtool! coffee-rails couch_potato! - devise! + devise + devise-i18n devise_simply_stored! ember-rails ember-source (= 1.8.1) diff --git a/app/assets/javascripts/theme1/application.js.coffee b/app/assets/javascripts/theme1/application.js.coffee index e78ef1b3..6c37c48d 100644 --- a/app/assets/javascripts/theme1/application.js.coffee +++ b/app/assets/javascripts/theme1/application.js.coffee @@ -1,7 +1,9 @@ #= require jquery #= require jquery_ujs +#= require vendor/modernizr +#= require foundation #= require_directory . #= require_self -$(document).on 'click', '.flash-box', -> $(@).slideUp() $ -> $('.menu-secondary-toggle').click -> $('.nav.secondary').toggleClass('active') + $(document).foundation() diff --git a/app/assets/stylesheets/theme1/_foundation_and_overrides.css.sass b/app/assets/stylesheets/theme1/_foundation_and_overrides.css.sass index df27059a..613e5272 100644 --- a/app/assets/stylesheets/theme1/_foundation_and_overrides.css.sass +++ b/app/assets/stylesheets/theme1/_foundation_and_overrides.css.sass @@ -1,7 +1,7 @@ // Taken from the bootstrap and overrides source, application not // verified body - .nav + .nav > li > a &:hover diff --git a/app/assets/stylesheets/theme1/_mixins.css.sass b/app/assets/stylesheets/theme1/_mixins.css.sass index f2d7e7c2..212c9046 100644 --- a/app/assets/stylesheets/theme1/_mixins.css.sass +++ b/app/assets/stylesheets/theme1/_mixins.css.sass @@ -27,6 +27,7 @@ padding-left: 8px padding-right: 8px line-height: 30px + box-shadow: 2px 6px 10px #333 &:hover color: white text-decoration: underline diff --git a/app/assets/stylesheets/theme1/elements/_devise.css.sass b/app/assets/stylesheets/theme1/elements/_devise.css.sass index 32324508..311914ec 100644 --- a/app/assets/stylesheets/theme1/elements/_devise.css.sass +++ b/app/assets/stylesheets/theme1/elements/_devise.css.sass @@ -1,3 +1,5 @@ -ul.devise-nav - +inline-list - +.devise-links + +sub-nav + margin-top: 22px + background-color: #f2f2f2 + padding: 10px 10px 10px 0 diff --git a/app/helpers/devise_helper.rb b/app/helpers/devise_helper.rb index 5cf0b9b0..e1839bf8 100644 --- a/app/helpers/devise_helper.rb +++ b/app/helpers/devise_helper.rb @@ -2,7 +2,7 @@ module DeviseHelper def devise_error_messages! if resource.errors.present? content_tag(:div, - content_tag(:h3, t("errors.messages.not_saved.#{resource.errors.size == 1 ? 'one' : 'other'}", count: resource.errors.size)) + + content_tag(:h3, t("errors.messages.not_saved.#{resource.errors.size == 1 ? 'one' : 'other'}", resource: resource.class.model_name.human, count: resource.errors.size)) + content_tag(:ul, resource.errors.full_messages.map{|m| content_tag(:li, m)}.join.html_safe), class: 'form-errors' ) diff --git a/app/models/employee.rb b/app/models/employee.rb index 46c359da..596e25e0 100644 --- a/app/models/employee.rb +++ b/app/models/employee.rb @@ -16,7 +16,7 @@ class Employee end #view :by_confirmation_token, key: :confirmation_token # devise confirmable - devise :database_authenticatable, :recoverable, :rememberable, :trackable #, :registerable #, :confirmable + devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable #, :registerable #, :confirmable property :unconfirmed_email property :name diff --git a/app/views/devise/_links.html.slim b/app/views/devise/_links.html.slim index 8b0b88cb..dbfb13d5 100644 --- a/app/views/devise/_links.html.slim +++ b/app/views/devise/_links.html.slim @@ -1,19 +1,23 @@ -ul.nav.nav-pills.devise-nav +dl.devise-links + - devise_mapping = Devise.mappings[resource_name] + dt= t 'devise.links.prefix' - if controller_name != 'sessions' - li= link_to t('devise.sessions.button'), new_session_path(resource_name), class: [:devise, :btn] + dd= link_to t('devise.sign_in.link'), new_session_path(resource_name), class: ['devise-link', 'new-session'] - if devise_mapping.registerable? && controller_name != 'registrations' - li= link_to t('devise.registrations.button'), new_registration_path(resource_name), class: [:devise, :btn] + dd= link_to t('devise.registrations.link'), new_registration_path(resource_name), class: ['devise-link', 'new-registration'] + - if resource_name == :employee and controller_name != 'new_suppliers' + dd= link_to t('devise.registrations.link'), new_suppliers_path, class: ['devise-link', 'new-registration'] - if devise_mapping.recoverable? && controller_name != 'passwords' - li= link_to t('devise.sessions.forgot_your_password'), new_password_path(resource_name), class: [:devise, :btn] + dd= link_to t('devise.passwords.link'), new_password_path(resource_name), class: ['devise-link', 'forgot-password'] - if devise_mapping.confirmable? && controller_name != 'confirmations' - li= link_to t('devise.confirmations.did_not_receive_instructions_link'), new_confirmation_path(resource_name), class: [:devise, :btn] + dd= link_to t('devise.confirmations.did_not_receive_instructions_link'), new_confirmation_path(resource_name), class: ['devise-link', 'did-not-receive-instructions'] - if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' - li= link_to t('devise.unlocks.did_not_receive_instructions_link'), new_unlock_path(resource_name), class: [:devise, :btn] + dd= link_to t('devise.unlocks.did_not_receive_instructions_link'), new_unlock_path(resource_name), class: ['devise-link', 'did-not-receive-instructions'] - if devise_mapping.omniauthable? - resource_class.omniauth_providers.each do |provider| - li= link_to t('devise.omniauth_callbacks.sign_in_with', provider: provider.to_s.titleize), omniauth_authorize_path(resource_name, provider), class: [:devise, :btn] + dd= link_to t('devise.omniauth_callbacks.sign_in_with', provider: provider.to_s.titleize), omniauth_authorize_path(resource_name, provider), class: ['devise-link', 'omniauth', provider] diff --git a/app/views/devise/confirmations/new.html.erb b/app/views/devise/confirmations/new.html.erb new file mode 100644 index 00000000..45408119 --- /dev/null +++ b/app/views/devise/confirmations/new.html.erb @@ -0,0 +1,16 @@ +

Resend confirmation instructions

+ +<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %> + <%= devise_error_messages! %> + +
+ <%= f.label :email %>
+ <%= f.email_field :email, autofocus: true %> +
+ +
+ <%= f.submit "Resend confirmation instructions" %> +
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb new file mode 100644 index 00000000..dc55f64f --- /dev/null +++ b/app/views/devise/mailer/confirmation_instructions.html.erb @@ -0,0 +1,5 @@ +

Welcome <%= @email %>!

+ +

You can confirm your account email through the link below:

+ +

<%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %>

diff --git a/app/views/devise/mailer/reset_password_instructions.html.erb b/app/views/devise/mailer/reset_password_instructions.html.erb new file mode 100644 index 00000000..f667dc12 --- /dev/null +++ b/app/views/devise/mailer/reset_password_instructions.html.erb @@ -0,0 +1,8 @@ +

Hello <%= @resource.email %>!

+ +

Someone has requested a link to change your password. You can do this through the link below.

+ +

<%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %>

+ +

If you didn't request this, please ignore this email.

+

Your password won't change until you access the link above and create a new one.

diff --git a/app/views/devise/mailer/unlock_instructions.html.erb b/app/views/devise/mailer/unlock_instructions.html.erb new file mode 100644 index 00000000..41e148bf --- /dev/null +++ b/app/views/devise/mailer/unlock_instructions.html.erb @@ -0,0 +1,7 @@ +

Hello <%= @resource.email %>!

+ +

Your account has been locked due to an excessive number of unsuccessful sign in attempts.

+ +

Click the link below to unlock your account:

+ +

<%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %>

diff --git a/app/views/devise/registrations/edit.html.erb b/app/views/devise/registrations/edit.html.erb new file mode 100644 index 00000000..3ea40f01 --- /dev/null +++ b/app/views/devise/registrations/edit.html.erb @@ -0,0 +1,39 @@ +

Edit <%= resource_name.to_s.humanize %>

+ +<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %> + <%= devise_error_messages! %> + +
+ <%= f.label :email %>
+ <%= f.email_field :email, autofocus: true %> +
+ + <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %> +
Currently waiting confirmation for: <%= resource.unconfirmed_email %>
+ <% end %> + +
+ <%= f.label :password %> (leave blank if you don't want to change it)
+ <%= f.password_field :password, autocomplete: "off" %> +
+ +
+ <%= f.label :password_confirmation %>
+ <%= f.password_field :password_confirmation, autocomplete: "off" %> +
+ +
+ <%= f.label :current_password %> (we need your current password to confirm your changes)
+ <%= f.password_field :current_password, autocomplete: "off" %> +
+ +
+ <%= f.submit "Update" %> +
+<% end %> + +

Cancel my account

+ +

Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete %>

+ +<%= link_to "Back", :back %> diff --git a/app/views/devise/registrations/new.html.erb b/app/views/devise/registrations/new.html.erb new file mode 100644 index 00000000..343b2656 --- /dev/null +++ b/app/views/devise/registrations/new.html.erb @@ -0,0 +1,29 @@ +

Sign up

+ +<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> + <%= devise_error_messages! %> + +
+ <%= f.label :email %>
+ <%= f.email_field :email, autofocus: true %> +
+ +
+ <%= f.label :password %> + <% if @validatable %> + (<%= @minimum_password_length %> characters minimum) + <% end %>
+ <%= f.password_field :password, autocomplete: "off" %> +
+ +
+ <%= f.label :password_confirmation %>
+ <%= f.password_field :password_confirmation, autocomplete: "off" %> +
+ +
+ <%= f.submit "Sign up" %> +
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb new file mode 100644 index 00000000..b261cfd1 --- /dev/null +++ b/app/views/devise/sessions/new.html.erb @@ -0,0 +1,26 @@ +

Log in

+ +<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> +
+ <%= f.label :email %>
+ <%= f.email_field :email, autofocus: true %> +
+ +
+ <%= f.label :password %>
+ <%= f.password_field :password, autocomplete: "off" %> +
+ + <% if devise_mapping.rememberable? -%> +
+ <%= f.check_box :remember_me %> + <%= f.label :remember_me %> +
+ <% end -%> + +
+ <%= f.submit "Log in" %> +
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/devise/shared/_links.html.erb b/app/views/devise/shared/_links.html.erb new file mode 100644 index 00000000..cd795adb --- /dev/null +++ b/app/views/devise/shared/_links.html.erb @@ -0,0 +1,25 @@ +<%- if controller_name != 'sessions' %> + <%= link_to "Log in", new_session_path(resource_name) %>
+<% end -%> + +<%- if devise_mapping.registerable? && controller_name != 'registrations' %> + <%= link_to "Sign up", new_registration_path(resource_name) %>
+<% end -%> + +<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %> + <%= link_to "Forgot your password?", new_password_path(resource_name) %>
+<% end -%> + +<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> + <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
+<% end -%> + +<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> + <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %>
+<% end -%> + +<%- if devise_mapping.omniauthable? %> + <%- resource_class.omniauth_providers.each do |provider| %> + <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %>
+ <% end -%> +<% end -%> diff --git a/app/views/devise/unlocks/new.html.erb b/app/views/devise/unlocks/new.html.erb new file mode 100644 index 00000000..16586bc7 --- /dev/null +++ b/app/views/devise/unlocks/new.html.erb @@ -0,0 +1,16 @@ +

Resend unlock instructions

+ +<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %> + <%= devise_error_messages! %> + +
+ <%= f.label :email %>
+ <%= f.email_field :email, autofocus: true %> +
+ +
+ <%= f.submit "Resend unlock instructions" %> +
+<% end %> + +<%= render "devise/shared/links" %> diff --git a/app/views/employees/mailer/reset_password_instructions.html.erb b/app/views/employees/mailer/reset_password_instructions.html.erb index ae9e888a..7913e88b 100644 --- a/app/views/employees/mailer/reset_password_instructions.html.erb +++ b/app/views/employees/mailer/reset_password_instructions.html.erb @@ -2,7 +2,7 @@

Someone has requested a link to change your password, and you can do this through the link below.

-

<%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %>

+

<%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %>

If you didn't request this, please ignore this email.

Your password won't change until you access the link above and create a new one.

diff --git a/app/views/suppliers/passwords/edit.html.slim b/app/views/employees/passwords/edit.html.slim similarity index 75% rename from app/views/suppliers/passwords/edit.html.slim rename to app/views/employees/passwords/edit.html.slim index e6ec6029..8530022d 100644 --- a/app/views/suppliers/passwords/edit.html.slim +++ b/app/views/employees/passwords/edit.html.slim @@ -1,12 +1,12 @@ h2= t('devise.passwords.edit.title') -= form_for(resource, :as => resource_name, :url => password_path(resource_name), html: {class: 'form-horizontal', method: :put}) do |f| += form_for(resource, :as => resource_name, :url => password_path(resource_name), html: {method: :put}) do |f| = devise_error_messages! = f.hidden_field :reset_password_token - .form-row + = f.row :password .form-label= f.label :password .form-field= f.password_field :password - = f.row :password_confirmation do + = f.row :password_confirmation .form-label= f.label :password_confirmation .form-field= f.password_field :password_confirmation .form-row= f.submit t('devise.passwords.edit.button'), class: 'button' -= render "links" += render "devise/links" diff --git a/app/views/suppliers/passwords/new.html.slim b/app/views/employees/passwords/new.html.slim similarity index 80% rename from app/views/suppliers/passwords/new.html.slim rename to app/views/employees/passwords/new.html.slim index 549eb8dd..f246458e 100644 --- a/app/views/suppliers/passwords/new.html.slim +++ b/app/views/employees/passwords/new.html.slim @@ -1,8 +1,8 @@ h2= t('devise.passwords.title') -= form_for(resource, :as => resource_name, :url => password_path(resource_name), html: {class: 'form-horizontal'}) do |f| += form_for(resource, :as => resource_name, :url => password_path(resource_name)) do |f| = devise_error_messages! = f.row :email do .form-label= f.label :email, class: 'control-label' .form-field= f.email_field :email .form-row.form-actions= f.submit t('devise.passwords.button'), class: 'button' -= render "links" += render "devise/links" diff --git a/app/views/new_suppliers/new.html.slim b/app/views/new_suppliers/new.html.slim index 79181385..9d76b2a1 100644 --- a/app/views/new_suppliers/new.html.slim +++ b/app/views/new_suppliers/new.html.slim @@ -37,3 +37,4 @@ .form-actions = f.submit class: 'button' += render "devise/links", resource_name: :employee diff --git a/app/views/suppliers/sessions/new.html.slim b/app/views/suppliers/sessions/new.html.slim index cb0c88b5..21b2a767 100644 --- a/app/views/suppliers/sessions/new.html.slim +++ b/app/views/suppliers/sessions/new.html.slim @@ -1,17 +1,17 @@ -h2= t('devise.sessions.title') -= form_for(resource, :as => resource_name, :url => session_path(resource_name), html: {class: 'form-horizontal'}) do |f| +h2= t('devise.sign_in.title') += form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| = devise_error_messages! = f.row :email do .form-label= f.label :email .form-field= f.email_field :email = f.row :email do - .form-label= f.label :password, class: 'control-label' + .form-label= f.label :password .form-field= f.password_field :password .form-row = f.label :remember_me do = f.check_box :remember_me |  - = t('devise.sessions.remember_me') + = t('devise.sign_in.remember_me') .form-row - = f.submit t('devise.sessions.button'), class: 'new-session-button' -= render "links" + = f.submit t('devise.sign_in.button'), class: 'devise-button new-session-button' += render "devise/links" diff --git a/app/views/theme1/_alerts.html.slim b/app/views/theme1/_alerts.html.slim index f00bd0e6..4f5c75d1 100644 --- a/app/views/theme1/_alerts.html.slim +++ b/app/views/theme1/_alerts.html.slim @@ -1,8 +1,8 @@ - if flash[:alert].present? - .alert-box.warning + .alert-box.warning data-alert=true = flash[:alert] a.close data-dismiss="alert" × - if flash[:notice].present? - .alert-box.info + .alert-box.info data-alert=true = flash[:notice] a.close data-dismiss="alert" × diff --git a/app/views/theme1/_social.html.slim b/app/views/theme1/_social.html.slim index 1cf6b9e3..0e285fdc 100644 --- a/app/views/theme1/_social.html.slim +++ b/app/views/theme1/_social.html.slim @@ -1,4 +1,3 @@ -a.theme-button Test .social a.wsite-social-facebook href="https://www.facebook.com/mozo.bar" target=:_blank span.wsite-social-inner @@ -8,3 +7,5 @@ a.theme-button Test span.wsite-social-inner /a.wsite-social-rss span.wsite-social-inner +.pull-right + = link_to t('devise.registrations.link'), new_suppliers_path, class: 'theme-button' diff --git a/config/locales/devise.en.yml b/config/locales/devise.en.yml index c272abf3..3b194112 100644 --- a/config/locales/devise.en.yml +++ b/config/locales/devise.en.yml @@ -1,76 +1,18 @@ -# Additional translations at https://github.com/plataformatec/devise/wiki/I18n - en: devise: - confirmations: - title: "Resend confirmation instructions" - submit_text: "Resend confirmation instructions" - confirmed: "Your account was successfully confirmed. Please sign in." - confirmed_and_signed_in: "Your account was successfully confirmed. You are now signed in." - send_instructions: "You will receive an email with instructions about how to confirm your account in a few minutes." - send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions about how to confirm your account in a few minutes." - failure: - already_authenticated: "You are already signed in." - inactive: "Your account is not activated yet." - invalid: "Invalid email or password." - invalid_token: "Invalid authentication token." - locked: "Your account is locked." - not_found_in_database: "Invalid email or password." - timeout: "Your session expired. Please sign in again to continue." - unauthenticated: "You need to sign in or sign up before continuing." - unconfirmed: "You have to confirm your account before continuing." - not_found_in_database: "You are not yet known in our system. Sign up to use mozo.bar!" - mailer: - confirmation_instructions: - supplier_subject: "Confirmation instructions2" - supplier: - salutation: "Welcome to mozo.bar %{email}!" - body: | -

- You requested a mozo.bar account or want to change data that need reconfirmation. - If this is not wat you requested please ignore this email.
- To activate your account click the link below:
-
- Confirm my account or changes %{unconfirmed_email} -

- reset_password_instructions: - subject: "Reset password instructions" - unlock_instructions: - subject: "Unlock Instructions" - omniauth_callbacks: - failure: "Could not authenticate you from %{kind} because \"%{reason}\"." - success: "Successfully authenticated from %{kind} account." + sign_in: + title: Sign in + remember_me: Remember me + link: Sign in + button: Sign in passwords: - no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided." - send_instructions: "You will receive an email with instructions about how to reset your password in a few minutes." - send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes." - updated: "Your password was changed successfully. You are now signed in." - updated_not_active: "Your password was changed successfully." + title: Forgot password + link: Forgot password + button: Send reset edit: title: Change your password button: Change password registrations: - destroyed: "Bye! Your account was successfully cancelled. We hope to see you again soon." - signed_up: "Welcome! You have signed up successfully." - signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated." - signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked." - signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please open the link to activate your account." - update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address." - updated: "You updated your account successfully." - sessions: - signed_in: "Signed in successfully." - signed_out: "Signed out successfully." - unlocks: - send_instructions: "You will receive an email with instructions about how to unlock your account in a few minutes." - send_paranoid_instructions: "If your account exists, you will receive an email with instructions about how to unlock it in a few minutes." - unlocked: "Your account has been unlocked successfully. Please sign in to continue." - errors: - messages: - already_confirmed: "was already confirmed, please try signing in" - confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one" - expired: "has expired, please request a new one" - not_found: "not found" - not_locked: "was not locked" - not_saved: - one: "1 error prohibited this %{resource} from being saved:" - other: "%{count} errors prohibited this %{resource} from being saved:" + link: Sign up + links: + prefix: 'OR:' diff --git a/config/locales/devise.nl.yml b/config/locales/devise.nl.yml index cd59dd37..59727ef6 100644 --- a/config/locales/devise.nl.yml +++ b/config/locales/devise.nl.yml @@ -1,92 +1,12 @@ nl: - errors: - messages: - not_found: "bestaat niet" - already_confirmed: "was reeds bevestigd" - not_locked: "was niet vergrendeld" - not_saved: - one: "Een fout verhinderde het uitvoeren van de actie:" - other: "%{count} fouten verhinderden het uitvoeren van de actie:" - devise: - confirmations: - title: "Struur opnieuw bevestigingsinstructies" - submit_text: "Stuur opnieuw bevestigingsinstructies" - send_instructions: 'Er wordt een een e-mail naar je toe gestuurd waarin je je account kan bevestigen.' - confirmed: 'De activatie van je account is succesvol. Je bent nu aangemeld!' - did_not_receive_instructions_link: "Heeft u geen bevestigingsinstructies ontvangen?" - did_not_receive: 'Heeft u geen bevestigingsinstructies ontvangen?' - supplier: - confirmed_and_signed_in: Account bevestigd en ingelogd - failure: - already_authenticated: 'U bent reeds ingelogd.' - unauthenticated: 'U moet inloggen voordat u verder kunt' - unconfirmed: 'U dient deze account te bevestigen voordat u verder kunt.' - locked: 'Uw account is geblokkeerd.' - invalid: 'Deze login gegevens zijn niet geldig' - invalid_token: 'Invalid authentication token.' - timeout: 'Uw sessie is verlopen. U moet opnieuw inloggen om verder te gaan.' - inactive: 'Your account was not activated yet.' - not_found_in_database: "Je bent nog niet bij ons bekend. Meld je aan om mozo.bar te kunnen gebruiken!" - sessions: - title: Inloggen voor horeca + sign_in: + title: Inloggen + remember_me: Mij onthouden button: Inloggen - signed_in: Succesvol ingelogd - signed_out: Succesvol uitgelogd - signed_in_as: Ingelogd als - forgot_your_password: Wachtwoord vergeten? - sign_out: Uitloggen - sign_in: Inloggen - remember_me: Ingelogd blijven? - passwords: - title: Wachtwoord vergeten? - button: 'Stuur mij instructies voor het vernieuwen van mijn wachtwoord' - send_instructions: 'U ontvangt binnen enkele minuten een e-mail met instructies voor het resetten van uw wachtwoord' - updated: 'Uw wachtwoord is succesvol gewijzigd. U bent nu ingelogd.' - forgot_password: Wachtwoord vergeten? - no_token: Geen token gegeven - send_instructions_button: Stuur mij reset instructies - edit: - title: Verander je wachtwoord - button: Verander wachtwoord + recoverable: + button: Wachtwoord vergeten registrations: - title: Nieuwe aanmelding als horeca - button: Nieuwe aanmelding als horeca - signed_up_but_unconfirmed: 'A message with a confirmation link has been sent to your email address. Please open the link to activate your account.' - signed_up_but_inactive: 'You have signed up successfully. However, we could not sign you in because your account is not yet activated.' - signed_up_but_locked: 'You have signed up successfully. However, we could not sign you in because your account is locked.' - updated: 'You updated your account successfully.' - update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and click on the confirm link to finalize confirming your new email address." - - signed_up: 'Je hebt je succesvol aangemeld! Er wordt een bevestigingsmail toegestuurd' - updated: 'You updated your account successfully.' - destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.' - sign_up: Acount aanvragen - unlocks: - did_not_receive_instructions_link: "Didn't receive unlock instructions?" - send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.' - unlocked: 'Your account was successfully unlocked. You are now signed in.' - did_not_receive: Heeft u geen deblokkeerinstructies ontvangen? - send_paranoid_instructions: 'If your account exists, you will receive an email with instructions about how to unlock it in a few minutes.' - omniauth_callbacks: - sign_in_with: "Sign in with %{provider}" - success: 'Successfully authorized from %{kind} account.' - failure: 'Could not authorize you from %{kind} because "%{reason}".' - mailer: - confirmation_instructions: - subject: 'Bevestigingsinstructies' - #supplier_subject: "Confirmation instructions" - supplier: - salutation: "Welkom bij mozo.bar %{email}!" - body: | -

- Je hebt een account aangevraag bij mozo.bar of wil een wijziging doorvoeren waarvoor bevestiging nodig is. - Als dit niet de bedoeling is kan je deze email negeren.
- Om je account te activeren of de aangevraagde wijziging door te voeren moet je op de bevestigingslink hieronder klikken:
-
- Bevestig mijn mozo.bar account of verandering %{unconfirmed_email} -

- reset_password_instructions: - subject: 'Wachtwoord reset instructies' - unlock_instructions: - subject: 'Ontsluitings instructies' + button: Aanmelden + links: + prefix: 'OF:'