From dad200e2cb0b03995eb06024d3fcf788ad2486ff Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 24 Apr 2014 10:24:24 +0200 Subject: add signup and login info on the forms --- app/views/sessions/new.html.haml | 1 + app/views/users/new.html.haml | 2 +- config/locales/en.yml | 2 +- config/locales/users.en.yml | 2 -- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/views/sessions/new.html.haml b/app/views/sessions/new.html.haml index 771dc97..316eec1 100644 --- a/app/views/sessions/new.html.haml +++ b/app/views/sessions/new.html.haml @@ -2,6 +2,7 @@ .span9 = render :partial => 'users/warnings' %h2=t :login + .lead=t :login_info = simple_form_for [:api, @session], :validate => true, :html => { :id => :new_session, :class => 'form-horizontal' } do |f| = f.input :login, :required => false, :label => t(:username), :input_html => { :id => :srp_username } = f.input :password, :required => false, :input_html => { :id => :srp_password } diff --git a/app/views/users/new.html.haml b/app/views/users/new.html.haml index aecf831..173dd8c 100644 --- a/app/views/users/new.html.haml +++ b/app/views/users/new.html.haml @@ -8,8 +8,8 @@ .span9 = render :partial => 'warnings' %h2=t :signup + .lead=t :signup_info = simple_form_for(@user, form_options) do |f| - %legend= t(:signup_message) = f.input :login, :label => t(:username), :required => false, :input_html => { :id => :srp_username } = f.input :password, :required => false, :validate => true, :input_html => { :id => :srp_password } = f.input :password_confirmation, :required => false, :validate => true, :input_html => { :id => :srp_password_confirmation } diff --git a/config/locales/en.yml b/config/locales/en.yml index ac154d6..cebf075 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -30,7 +30,7 @@ en: all_downloads_info: "It is available for %{clients}." other_downloads_info: "Bitmask is also available for %{clients}." login_info: "Log in to change your account settings, create support tickets, and manage payments." - signup_info: "Sign up for a new user account via this website (it is better if you use the Bitmask application to sign up, but this website works too)." + signup_info: "Get a user account via this website. We recommend registering via the Bitmask application instead unless you are only using Bitmask for Android." welcome: "Welcome to %{provider}." get_help: "Get Help" help_info: "Can't login? Create a new support ticket anonymously." diff --git a/config/locales/users.en.yml b/config/locales/users.en.yml index ed6653a..b9889b6 100644 --- a/config/locales/users.en.yml +++ b/config/locales/users.en.yml @@ -3,13 +3,11 @@ en: logout: "Logout" none: "None" signup: "Sign Up" - signup_message: "Please create an account." cancel: "Cancel" login: "Log In" username: "Username" password: "Password" change_password: "Change Password" - login_message: "Please log in with your account." invalid_user_pass: "Not a valid username/password combination" invalid_ephemeral: "Invalid random key used. This looked like an attempt to hack the site to us. If it wasn't please contact support so we can look into the issue." all_strategies_failed: "Could not understand your login attempt. Please first send your login and a SRP ephemeral value A and then send the client_auth in the same session (using cookies)." -- cgit v1.2.3 From 1da12752c3b3aa3d4a03e67ede133e807e9434df Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 24 Apr 2014 11:10:01 +0200 Subject: cleanup homepage buttons some let's devide the partials rather than having super specific parameters (on_user_page) --- app/helpers/core_helper.rb | 4 ++-- app/views/common/_action_buttons.html.haml | 11 +++++++++++ app/views/common/_download_button.html.haml | 6 ++++++ app/views/common/_home_page_buttons.html.haml | 27 ++++++--------------------- app/views/home/_content.html.haml | 2 -- app/views/users/show.html.haml | 2 +- 6 files changed, 26 insertions(+), 26 deletions(-) create mode 100644 app/views/common/_action_buttons.html.haml create mode 100644 app/views/common/_download_button.html.haml diff --git a/app/helpers/core_helper.rb b/app/helpers/core_helper.rb index a6c7479..4126906 100644 --- a/app/helpers/core_helper.rb +++ b/app/helpers/core_helper.rb @@ -6,8 +6,8 @@ module CoreHelper # # insert common buttons (download, login, etc) # - def home_page_buttons(on_user_page = false) - render 'common/home_page_buttons', {:on_user_page => on_user_page} + def home_page_buttons + render 'common/home_page_buttons' end end diff --git a/app/views/common/_action_buttons.html.haml b/app/views/common/_action_buttons.html.haml new file mode 100644 index 0000000..c74fcd1 --- /dev/null +++ b/app/views/common/_action_buttons.html.haml @@ -0,0 +1,11 @@ +.home-buttons + .row-fluid.second + .login.span4 + %span.link= link_to(icon('ok-sign', icon_color) + t(:login), login_path, :class => 'btn') + %span.info= t(:login_info) + .signup.span4 + %span.link= link_to(icon('user', icon_color) + t(:signup), signup_path, :class => 'btn') + %span.info= t(:signup_info) + .help.span4 + %span.link= link_to(icon('question-sign', icon_color) + t(:get_help), new_ticket_path, :class => 'btn') + %span.info= t(:help_info) diff --git a/app/views/common/_download_button.html.haml b/app/views/common/_download_button.html.haml new file mode 100644 index 0000000..157c40a --- /dev/null +++ b/app/views/common/_download_button.html.haml @@ -0,0 +1,6 @@ +.home-buttons + .row-fluid.first + .span2 + .download.span8 + = render partial: 'common/download_for_os', collection: available_clients + ['other'] + .span2 diff --git a/app/views/common/_home_page_buttons.html.haml b/app/views/common/_home_page_buttons.html.haml index c9ea7a2..8c47983 100644 --- a/app/views/common/_home_page_buttons.html.haml +++ b/app/views/common/_home_page_buttons.html.haml @@ -1,23 +1,8 @@ - icon_color = :black -.home-buttons - .row-fluid.first - .span2 - .download.span8 - = render partial: 'common/download_for_os', collection: available_clients + ['other'] - .span2 - - if local_assigns[:divider] - .row-fluid - .span12 - = render local_assigns[:divider] - - if !local_assigns[:on_user_page] - .row-fluid.second - .login.span4 - %span.link= link_to(icon('ok-sign', icon_color) + t(:login), login_path, :class => 'btn') - %span.info= t(:login_info) - .signup.span4 - %span.link= link_to(icon('user', icon_color) + t(:signup), signup_path, :class => 'btn') - %span.info= t(:signup_info) - .help.span4 - %span.link= link_to(icon('question-sign', icon_color) + t(:get_help), new_ticket_path, :class => 'btn') - %span.info= t(:help_info) += render 'common/download_button' +- if local_assigns[:divider] + .row-fluid + .span12 + = render local_assigns[:divider] += render 'common/action_buttons', icon_color: icon_color diff --git a/app/views/home/_content.html.haml b/app/views/home/_content.html.haml index 3d351e9..e47fdaf 100644 --- a/app/views/home/_content.html.haml +++ b/app/views/home/_content.html.haml @@ -8,7 +8,5 @@ - if Rails.env == 'development' .row-fluid %hr - %p - = link_to "fetch a cert", cert_path %p = link_to "make donation", new_payment_path if APP_CONFIG[:payment].present? diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index c587017..3c73147 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -22,4 +22,4 @@ %li= icon('shopping-cart') + link_to(t(:overview_billing), billing_top_link(@user)) if APP_CONFIG[:billing] .container-fluid .row-fluid - = home_page_buttons(true) \ No newline at end of file + = render 'common/download_button' -- cgit v1.2.3