From c3bfeed6203ca1f58a3a55fb8c58b6b412b8859d Mon Sep 17 00:00:00 2001 From: Markus Graf Date: Fri, 31 Mar 2017 14:42:37 +0200 Subject: [PATCH] Translations, design and content --- Gemfile | 9 ++++- Gemfile.lock | 9 +++-- app/assets/javascripts/application.js | 1 - app/assets/stylesheets/application.sass | 8 +++- app/controllers/application_controller.rb | 7 ++++ app/models/supporter.rb | 5 +-- app/views/layouts/application.html.slim | 6 +-- app/views/shared/_topnavigation.slim | 3 +- .../supporters/confirmations/new.html.slim | 10 +++++ .../confirmation_instructions.html.slim | 7 ++++ .../supporters/mailer/email_changed.html.slim | 14 +++++++ .../mailer/password_change.html.slim | 5 +++ .../reset_password_instructions.html.slim | 11 ++++++ .../mailer/unlock_instructions.html.slim | 9 +++++ app/views/supporters/new.slim | 38 ++++++++++++++++++- app/views/supporters/passwords/edit.html.slim | 11 ++++++ app/views/supporters/passwords/new.html.slim | 8 ++++ .../supporters/registrations/edit.html.slim | 28 ++++++++++++++ .../supporters/registrations/new.html.slim | 11 ++++++ app/views/supporters/sessions/new.html.slim | 9 +++++ app/views/supporters/shared/_links.html.slim | 20 ++++++++++ app/views/supporters/unlocks/new.html.slim | 10 +++++ config/environments/test.rb | 2 + config/initializers/devise.rb | 4 +- config/locales/de.yml | 23 ++++++++++- config/locales/fr.yml | 28 ++++++++++++-- config/locales/it.yml | 22 ++++++++++- config/routes.rb | 3 +- 28 files changed, 296 insertions(+), 25 deletions(-) create mode 100644 app/views/supporters/confirmations/new.html.slim create mode 100644 app/views/supporters/mailer/confirmation_instructions.html.slim create mode 100644 app/views/supporters/mailer/email_changed.html.slim create mode 100644 app/views/supporters/mailer/password_change.html.slim create mode 100644 app/views/supporters/mailer/reset_password_instructions.html.slim create mode 100644 app/views/supporters/mailer/unlock_instructions.html.slim create mode 100644 app/views/supporters/passwords/edit.html.slim create mode 100644 app/views/supporters/passwords/new.html.slim create mode 100644 app/views/supporters/registrations/edit.html.slim create mode 100644 app/views/supporters/registrations/new.html.slim create mode 100644 app/views/supporters/sessions/new.html.slim create mode 100644 app/views/supporters/shared/_links.html.slim create mode 100644 app/views/supporters/unlocks/new.html.slim diff --git a/Gemfile b/Gemfile index a4e862c..beb6c19 100644 --- a/Gemfile +++ b/Gemfile @@ -13,8 +13,7 @@ gem 'coffee-rails', '~> 4.1.0' # Use jquery as the JavaScript library gem 'jquery-rails' -# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks -gem 'turbolinks' + # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.0' # bundle exec rake doc:rails generates the API under doc/api. @@ -32,6 +31,12 @@ gem 'roadie-rails', '~> 1.0' # Devise is a flexible authentication solution for Rails based on Warden. gem 'devise' +# Translations for devise +gem 'devise-i18n' + +# Simulate data +gem 'faker' + # Use ActiveModel has_secure_password # gem 'bcrypt', '~> 3.1.7' diff --git a/Gemfile.lock b/Gemfile.lock index da8132a..cdfb45e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -76,6 +76,7 @@ GEM railties (>= 4.1.0, < 5.1) responders warden (~> 1.2.3) + devise-i18n (1.1.2) diff-lcs (1.3) dotenv (2.2.0) dotenv-rails (2.2.0) @@ -84,6 +85,8 @@ GEM erubis (2.7.0) excon (0.55.0) execjs (2.7.0) + faker (1.7.2) + i18n (~> 0.5) font-awesome-rails (4.7.0.1) railties (>= 3.2, < 5.1) gem_config (0.3.1) @@ -272,9 +275,6 @@ GEM thor (0.19.4) thread_safe (0.3.6) tilt (2.0.7) - turbolinks (5.0.1) - turbolinks-source (~> 5) - turbolinks-source (5.0.0) tzinfo (1.2.3) thread_safe (~> 0.1) uglifier (3.1.10) @@ -298,7 +298,9 @@ DEPENDENCIES capybara coffee-rails (~> 4.1.0) devise + devise-i18n dotenv-rails + faker geocoder jbuilder (~> 2.0) jquery-rails @@ -321,7 +323,6 @@ DEPENDENCIES simple_form slim slim-rails - turbolinks uglifier (>= 1.3.0) web-console (~> 2.0) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 092baf9..04c72e7 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -12,7 +12,6 @@ // //= require jquery //= require jquery_ujs -//= require turbolinks //= require bootstrap-sprockets //= require typeahead.bundle //= require markerclusterer_compiled diff --git a/app/assets/stylesheets/application.sass b/app/assets/stylesheets/application.sass index fb31298..71d1a2e 100644 --- a/app/assets/stylesheets/application.sass +++ b/app/assets/stylesheets/application.sass @@ -29,10 +29,16 @@ $font-size-h3: floor($font-size-base * 1.2) @import "bootstrap" @import "typeaheadjs" +.alert-alert + @extend .alert-danger + +.alert-notice + @extend .alert-info + body > .container box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19) - padding-top: 20px + padding: 20px header h1 diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 3c75543..97edce3 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -4,6 +4,7 @@ class ApplicationController < ActionController::Base protect_from_forgery with: :exception before_action :set_locale + before_action :configure_permitted_parameters, if: :devise_controller? INPUT_TIMEOUT = 2.seconds # We estimate that a user needs more then x seconds to enter some informations @@ -27,4 +28,10 @@ class ApplicationController < ActionController::Base def default_url_options(options = {}) options.merge locale: I18n.locale end + + protected + + def configure_permitted_parameters + devise_parameter_sanitizer.permit(:account_update, keys: [:first_name, :last_name, :street, :city, :zip, :support, :language, :age_category, :unsubscribed]) + end end diff --git a/app/models/supporter.rb b/app/models/supporter.rb index f52c9af..80070e6 100644 --- a/app/models/supporter.rb +++ b/app/models/supporter.rb @@ -6,8 +6,8 @@ class Supporter :recoverable, :rememberable, :trackable, :validatable ## Database authenticatable - field :email, type: String, default: "" - field :encrypted_password, type: String, default: "" + field :email, type: String, default: '' + field :encrypted_password, type: String, default: '' ## Recoverable field :reset_password_token, type: String @@ -47,7 +47,6 @@ class Supporter field :street, type: String field :zip, type: Integer field :city, type: String - field :email, type: String field :support, type: String # Indicates the type of support field :li_membership, type: Boolean, default: false field :age_category, type: String diff --git a/app/views/layouts/application.html.slim b/app/views/layouts/application.html.slim index f7c5b25..cab7d1f 100644 --- a/app/views/layouts/application.html.slim +++ b/app/views/layouts/application.html.slim @@ -4,8 +4,8 @@ html lang="#{I18n.locale}" - flash.each do |type, message| = message | #CH420 - #{content_for(:title)} - = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true - = javascript_include_tag 'application', 'data-turbolinks-track' => true + = stylesheet_link_tag 'application', media: 'all' + = javascript_include_tag 'application' = csrf_meta_tags link href="/apple-icon-57x57.png" rel="apple-touch-icon" sizes="57x57" / link href="/apple-icon-60x60.png" rel="apple-touch-icon" sizes="60x60" / @@ -37,7 +37,7 @@ html lang="#{I18n.locale}" / = console if Rails.env.development? .container + = render 'shared/flashes' = render 'shared/header' = render 'shared/topnavigation' - = render 'shared/flashes' = yield diff --git a/app/views/shared/_topnavigation.slim b/app/views/shared/_topnavigation.slim index f454fd9..af91a3d 100644 --- a/app/views/shared/_topnavigation.slim +++ b/app/views/shared/_topnavigation.slim @@ -4,4 +4,5 @@ = navbar_group id: 'topnav' do = navbar_item "Home", "/#{I18n.locale}" = navbar_item t('.donation'), spenden_path - = navbar_item t('.sign_in'), new_supporter_session_path if current_supporter.blank? + = navbar_item t('.sign_in'), new_supporter_session_path unless supporter_signed_in? + = navbar_item t('.sign_out'), destroy_supporter_session_path, nil, 'data-method' => :delete if supporter_signed_in? diff --git a/app/views/supporters/confirmations/new.html.slim b/app/views/supporters/confirmations/new.html.slim new file mode 100644 index 0000000..9086cfb --- /dev/null +++ b/app/views/supporters/confirmations/new.html.slim @@ -0,0 +1,10 @@ +h2 + = t(".resend_confirmation_instructions") += simple_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| + = f.error_notification + = f.full_error :confirmation_token + .form-inputs + = f.input :email, required: true, autofocus: true + .form-actions + = f.button :submit, t(".resend_confirmation_instructions") += render "supporters/shared/links" diff --git a/app/views/supporters/mailer/confirmation_instructions.html.slim b/app/views/supporters/mailer/confirmation_instructions.html.slim new file mode 100644 index 0000000..e9ff77b --- /dev/null +++ b/app/views/supporters/mailer/confirmation_instructions.html.slim @@ -0,0 +1,7 @@ +- require 'devise/version' +p + = t('.greeting', recipient: @resource.email) +p + = t('.instruction') +p + = link_to t('.action'), confirmation_url(@resource, confirmation_token: (Devise::VERSION.start_with?('3.') ? @token : @resource.confirmation_token)) diff --git a/app/views/supporters/mailer/email_changed.html.slim b/app/views/supporters/mailer/email_changed.html.slim new file mode 100644 index 0000000..5978f6c --- /dev/null +++ b/app/views/supporters/mailer/email_changed.html.slim @@ -0,0 +1,14 @@ +p + | Hello + = @email + | ! +- if @resource.try(:unconfirmed_email?) + p + | We're contacting you to notify you that your email is being changed to + = @resource.unconfirmed_email + | . +- else + p + | We're contacting you to notify you that your email has been changed to + = @resource.email + | . diff --git a/app/views/supporters/mailer/password_change.html.slim b/app/views/supporters/mailer/password_change.html.slim new file mode 100644 index 0000000..b1bf457 --- /dev/null +++ b/app/views/supporters/mailer/password_change.html.slim @@ -0,0 +1,5 @@ +- require 'devise/version' +p + = t('.greeting', recipient: @resource.email) +p + = t('.message') diff --git a/app/views/supporters/mailer/reset_password_instructions.html.slim b/app/views/supporters/mailer/reset_password_instructions.html.slim new file mode 100644 index 0000000..3636d6d --- /dev/null +++ b/app/views/supporters/mailer/reset_password_instructions.html.slim @@ -0,0 +1,11 @@ +- require 'devise/version' +p + = t('devise.mailer.reset_password_instructions.greeting', recipient: "#{@resource.first_name} #{@resource.last_name}") +p + = t('devise.mailer.reset_password_instructions.instruction') +p + = link_to t('devise.mailer.reset_password_instructions..action'), edit_password_url(@resource, reset_password_token: (Devise::VERSION.start_with?('3.', '4.') ? @token : @resource.reset_password_token), locale: I18n.locale) +p + = t('devise.mailer.reset_password_instructions.instruction_2') +p + = t('devise.mailer.reset_password_instructions.instruction_3') diff --git a/app/views/supporters/mailer/unlock_instructions.html.slim b/app/views/supporters/mailer/unlock_instructions.html.slim new file mode 100644 index 0000000..163377a --- /dev/null +++ b/app/views/supporters/mailer/unlock_instructions.html.slim @@ -0,0 +1,9 @@ +- require 'devise/version' +p + = t('.greeting', recipient: @resource.email) +p + = t('.message') +p + = t('.instruction') +p + = link_to t('.action'), unlock_url(@resource, unlock_token: (Devise::VERSION.start_with?('3.') ? @token :@resource.unlock_token)) diff --git a/app/views/supporters/new.slim b/app/views/supporters/new.slim index 2a70959..7a937e3 100644 --- a/app/views/supporters/new.slim +++ b/app/views/supporters/new.slim @@ -1,2 +1,38 @@ -= render 'form' +- if supporter_signed_in? + h1.sr-only = title t('.title', name: current_supporter.first_name) + .row + .col-xs-12.col-md-7 + .panel.panel-default + .panel-heading + h2.panel-title = t '.my_data' + .panel-body + dl.dl-horizontal + dt = Supporter.human_attribute_name(:email) + dd = current_supporter.email + dt = Supporter.human_attribute_name(:first_name) + dd = current_supporter.first_name + dt = Supporter.human_attribute_name(:last_name) + dd = current_supporter.last_name + dt = Supporter.human_attribute_name(:street) + dd = current_supporter.street + dt = Supporter.human_attribute_name(:city) + dd = "#{current_supporter.zip} #{current_supporter.city}" + dt = Supporter.human_attribute_name(:support) + dd == t("support_type.#{current_supporter.support}") + dt = Supporter.human_attribute_name(:age_category) + dd == t("age_category.#{current_supporter.age_category}") + dt = Supporter.human_attribute_name(:language) + dd = t("languages.#{current_supporter.language}") + dt = Supporter.human_attribute_name(:unsubscribed) + dd = current_supporter.unsubscribed? ? t('shared.yes') : t('shared.no') + + p + = link_to t('.edit'), edit_supporter_registration_path(), class: 'pull-right' + + + aside.col-md-5.col-xs-12 + = render 'right_side' + +- else + = render 'form' diff --git a/app/views/supporters/passwords/edit.html.slim b/app/views/supporters/passwords/edit.html.slim new file mode 100644 index 0000000..0cd76c3 --- /dev/null +++ b/app/views/supporters/passwords/edit.html.slim @@ -0,0 +1,11 @@ +h2 + = t("devise.passwords.edit.change_your_password") += simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| + = f.input :reset_password_token, as: :hidden + = f.full_error :reset_password_token + .form-inputs + = f.input :password, label: t("devise.passwords.edit.new_password"), required: true, autofocus: true + = f.input :password_confirmation, label: t("devise.passwords.edit.confirm_new_password"), required: true + .form-actions + = f.button :submit, t("devise.passwords.edit.change_my_password") += render "supporters/shared/links" diff --git a/app/views/supporters/passwords/new.html.slim b/app/views/supporters/passwords/new.html.slim new file mode 100644 index 0000000..3479387 --- /dev/null +++ b/app/views/supporters/passwords/new.html.slim @@ -0,0 +1,8 @@ +h1= title t("devise.passwords.new.forgot_your_password") += simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| + = f.error_notification + .form-inputs + = f.input :email, required: true, autofocus: true + .form-actions + = f.button :submit, t("devise.passwords.new.send_me_reset_password_instructions") += render "supporters/shared/links" diff --git a/app/views/supporters/registrations/edit.html.slim b/app/views/supporters/registrations/edit.html.slim new file mode 100644 index 0000000..e6a1d47 --- /dev/null +++ b/app/views/supporters/registrations/edit.html.slim @@ -0,0 +1,28 @@ +.panel.panel-default + .panel-heading + h1.panel-title = title t("devise.registrations.edit.title", resource: resource_class.model_name.human) + .panel-body + = simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| + .form-inputs + = f.input :current_password, hint: t("devise.registrations.edit.we_need_your_current_password_to_confirm_your_changes"), required: true + = f.input :email, required: true, autofocus: true + - if devise_mapping.confirmable? && resource.pending_reconfirmation? + p + = t(".currently_waiting_confirmation_for_email", email: resource.unconfirmed_email) + = f.input :password, autocomplete: "off", hint: t("devise.registrations.edit.leave_blank_if_you_don_t_want_to_change_it"), required: false + = f.input :password_confirmation, required: false + = f.input :first_name + = f.input :last_name + = f.input :street + = f.input :city + = f.input :zip + = f.input :support, as: :radio_buttons, collection: t('support_type').map{ |x| [x.first, raw(x.last)]}, label_method: :last, value_method: :first + = f.input :age_category, as: :radio_buttons, collection: t('age_category'), label_method: :last, value_method: :first + = f.input :language, as: :radio_buttons, collection: t('languages').map{ |x| [x.first, raw(x.last)]}, label_method: :last, value_method: :first + = f.input :unsubscribed, as: :boolean + .form-actions + = f.button :submit, t("devise.registrations.edit.update"), class: 'btn btn-primary' + p = link_to t("devise.shared.links.back"), :back +hr +p = link_to t("devise.registrations.edit.cancel_my_account"), registration_path(resource_name), data: { confirm: t("devise.registrations.edit.are_you_sure") }, method: :delete, class: 'btn btn-danger btn-sm pull-right' + diff --git a/app/views/supporters/registrations/new.html.slim b/app/views/supporters/registrations/new.html.slim new file mode 100644 index 0000000..220f82c --- /dev/null +++ b/app/views/supporters/registrations/new.html.slim @@ -0,0 +1,11 @@ +h2 + = t(".sign_up") += simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| + = f.error_notification + .form-inputs + = f.input :email, required: true, autofocus: true + = f.input :password, required: true + = f.input :password_confirmation, required: true + .form-actions + = f.button :submit, t(".sign_up") += render "supporters/shared/links" diff --git a/app/views/supporters/sessions/new.html.slim b/app/views/supporters/sessions/new.html.slim new file mode 100644 index 0000000..b7ed856 --- /dev/null +++ b/app/views/supporters/sessions/new.html.slim @@ -0,0 +1,9 @@ +h1= title t(".sign_in") += simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| + .form-inputs + = f.input :email, required: false, autofocus: true + = f.input :password, required: false + = f.input :remember_me, as: :boolean if devise_mapping.rememberable? + .form-actions + = f.button :submit, t("devise.sessions.new.sign_in") += render "supporters/shared/links" diff --git a/app/views/supporters/shared/_links.html.slim b/app/views/supporters/shared/_links.html.slim new file mode 100644 index 0000000..717f0ff --- /dev/null +++ b/app/views/supporters/shared/_links.html.slim @@ -0,0 +1,20 @@ +- if controller_name != 'sessions' + = link_to t("devise.shared.links.sign_in"), new_session_path(resource_name) + br +- if devise_mapping.registerable? && controller_name != 'registrations' + /= link_to t("devise.shared.links.sign_up"), new_registration_path(resource_name) + = link_to t("devise.shared.links.sign_up"), new_supporter_path + br +- if devise_mapping.recoverable? && controller_name != 'passwords' + = link_to t("devise.shared.links.forgot_your_password"), new_password_path(resource_name) + br +- if devise_mapping.confirmable? && controller_name != 'confirmations' + = link_to t('devise.shared.links.didn_t_receive_confirmation_instructions'), new_confirmation_path(resource_name) + br +- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' + = link_to t('devise.shared.links.didn_t_receive_unlock_instructions'), new_unlock_path(resource_name) + br +- if devise_mapping.omniauthable? + - resource_class.omniauth_providers.each do |provider| + = link_to t('devise.shared.links.sign_in_with_provider', provider: provider.to_s.titleize), omniauth_authorize_path(resource_name, provider) + br diff --git a/app/views/supporters/unlocks/new.html.slim b/app/views/supporters/unlocks/new.html.slim new file mode 100644 index 0000000..9aeadd1 --- /dev/null +++ b/app/views/supporters/unlocks/new.html.slim @@ -0,0 +1,10 @@ +h2 + = t(".resend_unlock_instructions") += simple_form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| + = f.error_notification + = f.full_error :unlock_token + .form-inputs + = f.input :email, required: true, autofocus: true + .form-actions + = f.button :submit, t(".resend_unlock_instructions") += render "supporters/shared/links" diff --git a/config/environments/test.rb b/config/environments/test.rb index 1c19f08..463e587 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -39,4 +39,6 @@ Rails.application.configure do # Raises error for missing translations # config.action_view.raise_on_missing_translations = true + config.action_mailer.default_url_options = { host: 'localhost:3000' } + config.action_mailer.asset_host = 'http://localhost:3000' end diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 497a0bb..0718b27 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -157,7 +157,7 @@ Devise.setup do |config| # ==> Configuration for :validatable # Range for password length. - config.password_length = 6..128 + config.password_length = 4..128 # Email regex used to validate email formats. It simply asserts that # one (and only one) @ exists in the given string. This is mainly @@ -223,7 +223,7 @@ Devise.setup do |config| # Turn scoped views on. Before rendering "sessions/new", it will first check for # "users/sessions/new". It's turned off by default because it's slower if you # are using only default views. - # config.scoped_views = false + config.scoped_views = true # Configure the default scope given to Warden. By default it's the first # devise role declared in your routes (usually :user). diff --git a/config/locales/de.yml b/config/locales/de.yml index 2c4b4b4..c3f5820 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1,11 +1,14 @@ de: shared: + "yes": Ja + "no": Nein header: logo: Logo der Initiative title_html: Ja, ich will Cannabis in der Schweiz legalisieren topnavigation: donation: Spenden sign_in: Anmelden + sign_out: Abmelden counter: supporters: "Unterstützer:" amount_of_supporters: Zurzeit haben wir %{amount} Unterstützer. @@ -26,6 +29,11 @@ de: young: Ich bin 18 bis 30 Jahre alt middle: Ich bin 30 bis 64 Jahre alt retired: Ich bin über 64 Jahre alt + + languages: + de: Deutsch + fr: Français + it: Italiano supporters: form: @@ -45,13 +53,20 @@ de: create: timeout: Ihre Eingabe war zu schnell. + + new: + title: Hallo %{name} + edit: Meine Daten bearbeiten... + my_data: Meine Daten pages: thanks: title: Besten Dank für deine Unterstützung! mongoid: - attributes: + models: + supporter: Konto + attributes: supporter: first_name: Vorname last_name: Nachname @@ -63,3 +78,9 @@ de: age_category: Alterskategorie li_membership: Ich bin interessiert an einer Mitgliedschaft beim Verein Legalize it! (50 Franken pro Jahr) comments: Kommentar / Feedback (optional) + remember_me: Angemeldet bleiben + password: Passwort + language: Sprache + unsubscribed: Kein Newsletter + password_confirmation: Passwort bestätigen + current_password: Aktuelles Passwort diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 5c54e3f..3ba4af8 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -2,6 +2,8 @@ fr: input_error: Vos entrées ne peuvent pas être enregistrées. Vérifiez les entrées. shared: + "yes": Oui + "no": Non counter: supporters: "Militant:" amount_of_supporters: Nous avons actuellement %{amount} supporters. @@ -10,6 +12,8 @@ fr: title_html: Oui, je veux légaliser le cannabis en Suisse. topnavigation: donation: Donation + sign_out: déconnecter + sign_in: Connexion welcome_email: subject: Merci beaucoup pour ton soutien! @@ -25,7 +29,12 @@ fr: young: J’ai entre 18 et 30 ans middle: J’ai entre 30 et 64 ans retired: J’ai plus que 64 ans - + + languages: + de: Deutsch + fr: Français + it: Italiano + supporters: form: form: Formulaire @@ -42,13 +51,20 @@ fr: create: timeout: Ihre Eingabe war zu schnell. - + + new: + title: Salut %{name} + edit: Modifier mes données ... + my_data: Mes données + pages: thanks: title: Merci beaucoup pour ton soutien! mongoid: - attributes: + models: + supporter: compte + attributes: supporter: first_name: Prénom last_name: Nom @@ -60,3 +76,9 @@ fr: age_category: Catégorie d’âge li_membership: Je suis intéressé à joindre l'association Legalize It! (50 francs par an). comments: Commentaires / Feedback (facultatif) + remember_me: Se souvenir de moi + password: mot de passe + language: Langue + unsubscribed: pas de newslettre + password_confirmation: confirmer le mot de passe + current_password: Mot de passe actuel diff --git a/config/locales/it.yml b/config/locales/it.yml index b2ac702..a653ed4 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -2,11 +2,15 @@ it: input_error: I dati immessi non potevano essere salvati. Verificare i dati immessi. shared: + "yes": Si + "No": No header: logo: Logo dell'iniziativa title_html: Si, voglio legalizzare la cannabis in Svizzera topnavigation: donation: Donazione + sign_out: Disconnettersi + sign_in: Registro counter: supporters: "Sostenitore:" amount_of_supporters: Al momento abbiamo %{amount} sostenitori. @@ -26,6 +30,11 @@ it: young: Ho tra 18 e 30 anni middle: Ho tra i 30 ed i 64 anni retired: Ho più di 64 anni + + languages: + de: Deutsch + fr: Français + it: Italiano supporters: form: @@ -44,7 +53,12 @@ it: create: timeout: Ihre Eingabe war zu schnell. - + + new: + title: Ciao %{name} + edit: Modifica i miei dati ... + my_data: Miei dati + pages: thanks: title: Grazie mille per il tuo sostegno! @@ -62,3 +76,9 @@ it: age_category: Categoria Età li_membership: Sono interessato a diventare membro attivo di Verein Legalize It (50 franchi annuali di tassa). comments: Commenti / Feedback (opzionale) + remember_me: Ricordati di mel + password: Password + language: Lingua + unsubscribed: No Newsletter + password_confirmation: conferma password + current_password: Password corrente diff --git a/config/routes.rb b/config/routes.rb index fa3b222..071701c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,6 @@ Rails.application.routes.draw do devise_for :supporters - root to: redirect("/#{I18n.default_locale}") + root to: 'supporters#new' namespace :admin do get '/map', to: 'pages#map', as: :map @@ -12,7 +12,6 @@ Rails.application.routes.draw do scope '/:locale' do get '/', to: 'supporters#new' resources :supporters - get '/thanks', to: 'pages#thanks', as: :thanks get '/spenden', to: 'pages#spenden', as: :spenden get '/terms_and_conditions', to: 'pages#terms_and_conditions', as: :terms_and_conditions