From de8f3e532d857ec64a9ba17bf9e5a4de272a6cbd Mon Sep 17 00:00:00 2001 From: Azul Date: Sat, 26 Mar 2016 17:36:37 +0100 Subject: upgrade: use bootstrap3 row and col-md-* --- app/views/common/_action_buttons.html.haml | 10 +++++----- app/views/common/_download_button.html.haml | 8 ++++---- app/views/common/_home_page_buttons.html.haml | 4 ++-- app/views/home/_content.html.haml | 6 +++--- app/views/layouts/_content.html.haml | 6 +++--- app/views/layouts/application.html.haml | 8 ++++---- app/views/sessions/new.html.haml | 4 ++-- app/views/users/new.html.haml | 4 ++-- app/views/users/show.html.haml | 2 +- 9 files changed, 26 insertions(+), 26 deletions(-) (limited to 'app/views') diff --git a/app/views/common/_action_buttons.html.haml b/app/views/common/_action_buttons.html.haml index 81ebf67..eb663c0 100644 --- a/app/views/common/_action_buttons.html.haml +++ b/app/views/common/_action_buttons.html.haml @@ -1,14 +1,14 @@ .home-buttons - .row-fluid.second - .login.span4 + .row.second + .login.col-md-4 %span.link= btn icon('ok-sign') + t(:login), login_path %span.info= t(:login_info, default: "") - if APP_CONFIG[:allow_registration] - .signup.span4 + .signup.col-md-4 %span.link= btn icon('user') + t(:signup), signup_path %span.info= t(:signup_info, default: "") - else - .signup.span4 - .help.span4 + .signup.col-md-4 + .help.col-md-4 %span.link= btn icon('question-sign') + t(:get_help), new_ticket_path %span.info= t(:support_info, default: "") diff --git a/app/views/common/_download_button.html.haml b/app/views/common/_download_button.html.haml index 9c26860..1278230 100644 --- a/app/views/common/_download_button.html.haml +++ b/app/views/common/_download_button.html.haml @@ -1,8 +1,8 @@ .home-buttons - .row-fluid.first - .span2 - .download.span8 + .row.first + .col-md-2 + .download.col-md-8 = btn client_download_url, type: [:large, :primary] do = big_icon('download') = t(:download_bitmask) - .span2 + .col-md-2 diff --git a/app/views/common/_home_page_buttons.html.haml b/app/views/common/_home_page_buttons.html.haml index fc6348e..cfe3734 100644 --- a/app/views/common/_home_page_buttons.html.haml +++ b/app/views/common/_home_page_buttons.html.haml @@ -1,6 +1,6 @@ = render 'common/download_button' - if local_assigns[:divider] - .row-fluid - .span12 + .row + .col-md-12 = render local_assigns[:divider] = render 'common/action_buttons' diff --git a/app/views/home/_content.html.haml b/app/views/home/_content.html.haml index d96a1e0..67e4533 100644 --- a/app/views/home/_content.html.haml +++ b/app/views/home/_content.html.haml @@ -1,12 +1,12 @@ -.row-fluid +.row %h1= t(:welcome, :provider => APP_CONFIG[:domain]) .p=t(:welcome_message_html) -.row-fluid +.row = home_page_buttons - if Rails.env == 'development' - .row-fluid + .row %hr %p = link_to "make donation", new_payment_path if APP_CONFIG[:payment].present? diff --git a/app/views/layouts/_content.html.haml b/app/views/layouts/_content.html.haml index d5c2fa3..21d2e12 100644 --- a/app/views/layouts/_content.html.haml +++ b/app/views/layouts/_content.html.haml @@ -8,12 +8,12 @@ - content = yield - if @show_navigation - .span2 + .col-md-2 = render 'layouts/navigation' - .span10 + .col-md-10 = render 'layouts/messages' = content - else - .span12 + .col-md-12 = render 'layouts/messages' = content diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 0aeda8b..e242a5f 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -15,13 +15,13 @@ #main .container-fluid - if @show_navigation && !admin? - .row-fluid + .row %h1= t(:user_control_panel) - if logged_in? - .row-fluid - .span12 + .row + .col-md-12 = render 'layouts/header' - .row-fluid + .row = render 'layouts/content' #push -# #push is used for sticky footer in bootstrap 2. remove when upgrading to bootstrap 3 diff --git a/app/views/sessions/new.html.haml b/app/views/sessions/new.html.haml index bb7e4bd..942c485 100644 --- a/app/views/sessions/new.html.haml +++ b/app/views/sessions/new.html.haml @@ -1,5 +1,5 @@ -.span1 -.span9 +.col-md-1 +.col-md-9 %h2=t :login .lead=t :login_info = render :partial => 'users/warnings' diff --git a/app/views/users/new.html.haml b/app/views/users/new.html.haml index bc0b1af..1b257d9 100644 --- a/app/views/users/new.html.haml +++ b/app/views/users/new.html.haml @@ -8,8 +8,8 @@ - form_options = {url: '/not-used', html: {id: 'new_user', class: user_form_class('form-horizontal'), style: 'display:none'}, validate: true} -.span1 -.span9 +.col-md-1 +.col-md-9 %h2=t :signup .lead=t :signup_info = render :partial => 'warnings' diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index da8e467..3bdf952 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -1,6 +1,6 @@ = render 'overview' .container-fluid - .row-fluid + .row %h4 To use bitmask services: = btn client_download_url, type: "primary" do %i.icon-arrow-down.icon-white -- cgit v1.2.3 From 70d8ffc40ef57efaf75cd51e0c1ca654dc37dd4c Mon Sep 17 00:00:00 2001 From: Azul Date: Sat, 26 Mar 2016 18:22:22 +0100 Subject: upgrade: bootstrap control-group -> form-group --- app/views/users/_change_password.html.haml | 2 +- app/views/users/_change_pgp_key.html.haml | 2 +- app/views/users/_change_service_level.html.haml | 2 +- app/views/users/_contact_email.html.haml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'app/views') diff --git a/app/views/users/_change_password.html.haml b/app/views/users/_change_password.html.haml index 425e3ee..64a4d0a 100644 --- a/app/views/users/_change_password.html.haml +++ b/app/views/users/_change_password.html.haml @@ -15,7 +15,7 @@ = 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, :input_html => { :id => :srp_password_confirmation } - .control-group + .form-group .controls = f.submit t(:save), :class => 'btn btn-primary' diff --git a/app/views/users/_change_pgp_key.html.haml b/app/views/users/_change_pgp_key.html.haml index e465125..af3eb5e 100644 --- a/app/views/users/_change_pgp_key.html.haml +++ b/app/views/users/_change_pgp_key.html.haml @@ -8,6 +8,6 @@ = simple_form_for [:api, @user], form_options do |f| %legend= t(:advanced_options) = f.input :public_key, :as => :text, :hint => t(:use_ascii_key), :input_html => {:class => "full-width", :rows => 4} - .control-group + .form-group .controls = f.submit t(:save), :class => 'btn', :data => {"loading-text" => "Saving..."} diff --git a/app/views/users/_change_service_level.html.haml b/app/views/users/_change_service_level.html.haml index 42315a2..a2e9956 100644 --- a/app/views/users/_change_service_level.html.haml +++ b/app/views/users/_change_service_level.html.haml @@ -13,6 +13,6 @@ %p = t(:effective_service_level) = f.select :effective_service_level_code, ServiceLevel.select_options, :selected => @user.effective_service_level.id - .control-group + .form-group .controls = f.submit t(:save), :class => 'btn', :data => {"loading-text" => "Saving..."} diff --git a/app/views/users/_contact_email.html.haml b/app/views/users/_contact_email.html.haml index ad768b7..1627ff6 100644 --- a/app/views/users/_contact_email.html.haml +++ b/app/views/users/_contact_email.html.haml @@ -4,6 +4,6 @@ = f.input :contact_email, :label => false -# %p= t(:public_key) -# = f.text_area :contact_email_key, {:class => "full-width", :rows => 4} - .control-group + .form-group .controls = f.submit t(:save), :class => 'btn', :data => {"loading-text" => "Saving..."} \ No newline at end of file -- cgit v1.2.3 From a1b494e334406660a1f49fb7de9b043493809640 Mon Sep 17 00:00:00 2001 From: Azul Date: Fri, 13 May 2016 16:23:10 +0200 Subject: ensure invalid user ids still render the ticket form We still have strange urls requested like /pt/users/AnonymousUser.../tickets/new Not sure where they are coming from - but this should make sure we respond with sth. meaningful instead of erroring out. Conflicts: app/views/layouts/_content.html.haml --- app/views/layouts/_content.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/views') diff --git a/app/views/layouts/_content.html.haml b/app/views/layouts/_content.html.haml index 21d2e12..8e0bfbc 100644 --- a/app/views/layouts/_content.html.haml +++ b/app/views/layouts/_content.html.haml @@ -7,7 +7,7 @@ - else - content = yield -- if @show_navigation +- if @show_navigation && @user .col-md-2 = render 'layouts/navigation' .col-md-10 -- cgit v1.2.3 From e05a1b0f5ae40a2aa17976b3009cd563b8e4660a Mon Sep 17 00:00:00 2001 From: Azul Date: Sun, 1 May 2016 10:55:33 -0300 Subject: api: allow version bumping - bump to 2 --- app/views/api/sessions/new.json.erb | 3 +++ app/views/v1/sessions/new.json.erb | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 app/views/api/sessions/new.json.erb delete mode 100644 app/views/v1/sessions/new.json.erb (limited to 'app/views') diff --git a/app/views/api/sessions/new.json.erb b/app/views/api/sessions/new.json.erb new file mode 100644 index 0000000..36154b8 --- /dev/null +++ b/app/views/api/sessions/new.json.erb @@ -0,0 +1,3 @@ +{ +"errors": <%= raw @errors.to_json %> +} diff --git a/app/views/v1/sessions/new.json.erb b/app/views/v1/sessions/new.json.erb deleted file mode 100644 index 36154b8..0000000 --- a/app/views/v1/sessions/new.json.erb +++ /dev/null @@ -1,3 +0,0 @@ -{ -"errors": <%= raw @errors.to_json %> -} -- cgit v1.2.3 From 7f0c42a5fa6d6c1952e53b9b73bad0202f746f3e Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 23 May 2016 11:59:41 +0200 Subject: cleanup: remove service level code from users_controller There's no route to this right now and it also seems to be tested nowhere. Since i am about to split up the users_controller let's get rid of this and put it in the place we want it once we actually finish the implementation --- app/views/users/_change_service_level.html.haml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'app/views') diff --git a/app/views/users/_change_service_level.html.haml b/app/views/users/_change_service_level.html.haml index a2e9956..32ea8c0 100644 --- a/app/views/users/_change_service_level.html.haml +++ b/app/views/users/_change_service_level.html.haml @@ -1,8 +1,13 @@ --# TODO: probably won't want here, but here for now. Also, we will need way to ensure payment if they pick a non-free plan. --# --# SERVICE LEVEL --# -- if APP_CONFIG[:service_levels] +:ruby + # DISABLED! this form points to a route that does not exist. + # It's a draft for implementing service levels. + # TODO: probably won't want here, but here for now. + # We will need way to ensure payment for a non-free plan. + # + # SERVICE LEVEL + # + # +- if APP_CONFIG[:service_levels] && false - form_options = {:html => {:class => user_form_class('form-horizontal'), :id => 'update_service_level', :data => {token: session[:token]}}, :validate => true} = simple_form_for @user, form_options do |f| %legend= t(:service_level) -- cgit v1.2.3 From f47fc9d6522886cf81cfea26ec1f396219c539ba Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 23 May 2016 12:17:31 +0200 Subject: move signup from users to account_controller There was a lot of special case handling going on in the users_controller for this. Lot simpler this way. --- app/views/account/new.html.haml | 27 +++++++++++++++++++++++++++ app/views/sessions/_warnings.html.haml | 12 ++++++++++++ app/views/sessions/new.html.haml | 2 +- app/views/users/_warnings.html.haml | 12 ------------ app/views/users/new.html.haml | 27 --------------------------- 5 files changed, 40 insertions(+), 40 deletions(-) create mode 100644 app/views/account/new.html.haml create mode 100644 app/views/sessions/_warnings.html.haml delete mode 100644 app/views/users/_warnings.html.haml delete mode 100644 app/views/users/new.html.haml (limited to 'app/views') diff --git a/app/views/account/new.html.haml b/app/views/account/new.html.haml new file mode 100644 index 0000000..d40259e --- /dev/null +++ b/app/views/account/new.html.haml @@ -0,0 +1,27 @@ +-# +-# This form is handled entirely by javascript +-# Please take care when changing element ids. +-# +-# The form is hidden when no js is available +-# to prevent submission in the clear. +-# + +- form_options = {url: '/not-used', html: {id: 'new_user', class: user_form_class('form-horizontal'), style: 'display:none'}, validate: true} + +.col-md-1 +.col-md-9 + %h2=t :signup + .lead=t :signup_info + = render "sessions/warnings" + = simple_form_for(@user, form_options) do |f| + = f.input :login, :label => t(:username), :required => false, :input_html => { :id => :srp_username } + = f.input :password, :label => t(:password), :required => false, :validate => true, :input_html => { :id => :srp_password } + = f.input :password_confirmation, :label => t(:password_confirmation), :required => false, :validate => true, :input_html => { :id => :srp_password_confirmation } + + - if APP_CONFIG[:invite_required] + = f.input :invite_code, :label => t(:invite_code), :input_html => { :id => :srp_invite_code } + - else + = f.input :invite_code, :as => "hidden", :input_html => { :value => " ", :id => :srp_invite_code } + + = f.button :wrapped, cancel: home_path +-# diff --git a/app/views/sessions/_warnings.html.haml b/app/views/sessions/_warnings.html.haml new file mode 100644 index 0000000..baf80a4 --- /dev/null +++ b/app/views/sessions/_warnings.html.haml @@ -0,0 +1,12 @@ +%noscript + %div.alert.alert-error=t :js_required_html +#cookie_warning.alert.alert-error{:style => "display:none"} + =t :cookie_disabled_warning +:javascript + document.cookie = "testing=cookies_enabled; path=/"; + if(document.cookie.indexOf("testing=cookies_enabled") < 0) + { + document.getElementById('cookie_warning').style.display = 'block'; + } else { + document.getElementById('cookie_warning').style.display = 'none'; + } diff --git a/app/views/sessions/new.html.haml b/app/views/sessions/new.html.haml index 942c485..6695123 100644 --- a/app/views/sessions/new.html.haml +++ b/app/views/sessions/new.html.haml @@ -2,7 +2,7 @@ .col-md-9 %h2=t :login .lead=t :login_info - = render :partial => 'users/warnings' + = render 'warnings' = simple_form_for [:api, @session], validate: true, html: { id: :new_session, class: 'form-horizontal hidden js-show', style: "display:none;" } 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/_warnings.html.haml b/app/views/users/_warnings.html.haml deleted file mode 100644 index baf80a4..0000000 --- a/app/views/users/_warnings.html.haml +++ /dev/null @@ -1,12 +0,0 @@ -%noscript - %div.alert.alert-error=t :js_required_html -#cookie_warning.alert.alert-error{:style => "display:none"} - =t :cookie_disabled_warning -:javascript - document.cookie = "testing=cookies_enabled; path=/"; - if(document.cookie.indexOf("testing=cookies_enabled") < 0) - { - document.getElementById('cookie_warning').style.display = 'block'; - } else { - document.getElementById('cookie_warning').style.display = 'none'; - } diff --git a/app/views/users/new.html.haml b/app/views/users/new.html.haml deleted file mode 100644 index 1b257d9..0000000 --- a/app/views/users/new.html.haml +++ /dev/null @@ -1,27 +0,0 @@ --# --# This form is handled entirely by javascript --# Please take care when changing element ids. --# --# The form is hidden when no js is available --# to prevent submission in the clear. --# - -- form_options = {url: '/not-used', html: {id: 'new_user', class: user_form_class('form-horizontal'), style: 'display:none'}, validate: true} - -.col-md-1 -.col-md-9 - %h2=t :signup - .lead=t :signup_info - = render :partial => 'warnings' - = simple_form_for(@user, form_options) do |f| - = f.input :login, :label => t(:username), :required => false, :input_html => { :id => :srp_username } - = f.input :password, :label => t(:password), :required => false, :validate => true, :input_html => { :id => :srp_password } - = f.input :password_confirmation, :label => t(:password_confirmation), :required => false, :validate => true, :input_html => { :id => :srp_password_confirmation } - - - if APP_CONFIG[:invite_required] - = f.input :invite_code, :label => t(:invite_code), :input_html => { :id => :srp_invite_code } - - else - = f.input :invite_code, :as => "hidden", :input_html => { :value => " ", :id => :srp_invite_code } - - = f.button :wrapped, cancel: home_path --# -- cgit v1.2.3 From e1e98d0229b8b79de2105515f0312903a23dc335 Mon Sep 17 00:00:00 2001 From: luca-marie Date: Wed, 24 Aug 2016 15:23:07 +0200 Subject: Update with Twitter --- app/views/home/_content.html.haml | 6 ++++-- app/views/home/index.html.haml | 3 ++- app/views/twitter/_index.html.erb | 26 ++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 app/views/twitter/_index.html.erb (limited to 'app/views') diff --git a/app/views/home/_content.html.haml b/app/views/home/_content.html.haml index 67e4533..725c391 100644 --- a/app/views/home/_content.html.haml +++ b/app/views/home/_content.html.haml @@ -1,10 +1,12 @@ -.row +.left.column %h1= t(:welcome, :provider => APP_CONFIG[:domain]) .p=t(:welcome_message_html) -.row = home_page_buttons +.right.column + = render :partial => 'twitter/index' + - if Rails.env == 'development' .row %hr diff --git a/app/views/home/index.html.haml b/app/views/home/index.html.haml index 147cacd..7f07460 100644 --- a/app/views/home/index.html.haml +++ b/app/views/home/index.html.haml @@ -3,7 +3,8 @@ #main .container-fluid = render 'home/content' + #push -# #push is used for sticky footer in bootstrap 2. remove when upgrading to bootstrap 3 #footer - = render 'layouts/footer' \ No newline at end of file + = render 'layouts/footer' diff --git a/app/views/twitter/_index.html.erb b/app/views/twitter/_index.html.erb new file mode 100644 index 0000000..9825afa --- /dev/null +++ b/app/views/twitter/_index.html.erb @@ -0,0 +1,26 @@ +<% unless Rails.application.secrets.twitter['enabled'] == false %> + + <% end %> -- cgit v1.2.3 From fecc0e9e1985be2d3767664453d4776ac20897c0 Mon Sep 17 00:00:00 2001 From: luca-marie Date: Thu, 25 Aug 2016 20:50:12 +0200 Subject: Twitter controller now as helper, some more styling in CSS, bug fix --- app/views/home/_content.html.haml | 13 +++++++------ app/views/twitter/_index.html.erb | 38 ++++++++++++++++++-------------------- 2 files changed, 25 insertions(+), 26 deletions(-) (limited to 'app/views') diff --git a/app/views/home/_content.html.haml b/app/views/home/_content.html.haml index 725c391..6efd2d0 100644 --- a/app/views/home/_content.html.haml +++ b/app/views/home/_content.html.haml @@ -1,14 +1,15 @@ -.left.column +.row %h1= t(:welcome, :provider => APP_CONFIG[:domain]) .p=t(:welcome_message_html) - = home_page_buttons - -.right.column - = render :partial => 'twitter/index' +.row + .col-md-9 + = home_page_buttons + .col-md-3 + = render 'twitter/index' - if Rails.env == 'development' .row %hr %p - = link_to "make donation", new_payment_path if APP_CONFIG[:payment].present? += link_to "make donation", new_payment_path if APP_CONFIG[:payment].present? diff --git a/app/views/twitter/_index.html.erb b/app/views/twitter/_index.html.erb index 9825afa..3dab567 100644 --- a/app/views/twitter/_index.html.erb +++ b/app/views/twitter/_index.html.erb @@ -1,26 +1,24 @@ -<% unless Rails.application.secrets.twitter['enabled'] == false %> -