From 2aaf91751092ffbd8c254eebd73c3ee43877770b Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Tue, 17 Jan 2017 18:16:50 +0100 Subject: [PATCH 1/6] adds different back link if headings count equal to 1 --- app/views/budgets/investments/_header.html.erb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/views/budgets/investments/_header.html.erb b/app/views/budgets/investments/_header.html.erb index f7f1ee81a..1358b36b0 100644 --- a/app/views/budgets/investments/_header.html.erb +++ b/app/views/budgets/investments/_header.html.erb @@ -4,8 +4,13 @@
- <%= back_link_to budget_group_path(@budget, @heading.group, unfeasible: params[:unfeasible]) %> - + <% if @heading.group.headings.count == 1 %> + <%= back_link_to budget_path(@budget, unfeasible: params[:unfeasible]) %> + <% else %> + <%= back_link_to budget_group_path(@budget, + @heading.group, + unfeasible: params[:unfeasible]) %> + <% end %> <% if can? :show, @ballot %> <%= link_to t("budgets.investments.header.check_ballot"), budget_ballot_path(@budget), From d890b0a98b4ab425e5879fdbb683d5024b6b730e Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Tue, 17 Jan 2017 18:58:13 +0100 Subject: [PATCH 2/6] adds fixed bar js --- app/assets/javascripts/application.js | 2 ++ app/assets/javascripts/fixed_bar.js.coffee | 13 +++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 app/assets/javascripts/fixed_bar.js.coffee diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 2445c5f3d..fba539eeb 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -46,6 +46,7 @@ //= require valuation_budget_investment_form //= require valuation_spending_proposal_form //= require embed_video +//= require fixed_bar //= require banners //= require social_share //= require custom @@ -70,6 +71,7 @@ var initialize_modules = function() { App.ValuationBudgetInvestmentForm.initialize(); App.ValuationSpendingProposalForm.initialize(); App.EmbedVideo.initialize(); + App.FixedBar.initialize(); App.Banners.initialize(); App.SocialShare.initialize(); }; diff --git a/app/assets/javascripts/fixed_bar.js.coffee b/app/assets/javascripts/fixed_bar.js.coffee new file mode 100644 index 000000000..8ccbf987f --- /dev/null +++ b/app/assets/javascripts/fixed_bar.js.coffee @@ -0,0 +1,13 @@ +App.FixedBar = + initialize: -> + $('[data-fixed-bar]').each -> + $this = $(this) + fixedBarTopPosition = $this.offset().top + + $(window).on 'scroll', -> + if $(window).scrollTop() > fixedBarTopPosition + $this.addClass('is-fixed') + $("#check-ballot").css({ 'display': "inline-block" }); + else + $this.removeClass('is-fixed') + $("#check-ballot").hide() From c5c686ec745fe596864949b5c529e9fb20993004 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Tue, 17 Jan 2017 18:58:32 +0100 Subject: [PATCH 3/6] adds progress bar styles --- app/assets/stylesheets/participation.scss | 39 +++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss index ee9217777..e790c8b02 100644 --- a/app/assets/stylesheets/participation.scss +++ b/app/assets/stylesheets/participation.scss @@ -1155,6 +1155,45 @@ ul.ballot-list { } } +.progress-bar-nav { + padding: $line-height 0; + position: relative; + z-index: 3; + + @include breakpoint(medium) { + background-color: $budget; + -webkit-transition: height 0.3s; + -moz-transition: height 0.3s; + transition: height 0.3s; + + h1 { + -webkit-transition: font-size 0.3s; + -moz-transition: font-size 0.3s; + transition: font-size 0.3s; + } + + h2 { + margin-bottom: 0; + } + + &.is-fixed { + height: auto; + left: 0; + padding: $line-height; + position: fixed; + top: 0; + width: 100%; + + h1 { + font-size: rem-calc(24); + -webkit-transition: font-size 0.3s; + -moz-transition: font-size 0.3s; + transition: font-size 0.3s; + } + } + } +} + // 07. Proposals successfull // ------------------------- From 86360a87195069173c35c2637396d6253aa09056 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Tue, 17 Jan 2017 18:59:12 +0100 Subject: [PATCH 4/6] shows fixed bar only in correct heading on voting phase --- .../budgets/investments/_header.html.erb | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/app/views/budgets/investments/_header.html.erb b/app/views/budgets/investments/_header.html.erb index 1358b36b0..e88a4691c 100644 --- a/app/views/budgets/investments/_header.html.erb +++ b/app/views/budgets/investments/_header.html.erb @@ -21,31 +21,32 @@
-
-

<%= @heading.name %>

- <% if can? :show, @ballot %> - - <% if @ballot.valid_heading?(@heading) %> + <% if can? :show, @ballot %> + + <% if @ballot.valid_heading?(@heading) %> +
+

<%= @heading.name %>

<%= render 'budgets/ballot/progress_bar' %>
- <% else %> -
-

- <%= t("budgets.investments.header.different_heading_assigned_html", - heading_link: link_to( - @assigned_heading.name, - budget_investments_path(@budget, heading: @assigned_heading)) - ) %> -

- <% end %> +
<% else %> -

<%= @budget.formatted_heading_price(@heading) %>

+

<%= @heading.name %>

+

+ <%= t("budgets.investments.header.different_heading_assigned_html", + heading_link: link_to( + @assigned_heading.name, + budget_investments_path(@budget, heading: @assigned_heading)) + ) %> +

<% end %> -
+ <% else %> +

<%= @heading.name %>

+

<%= @budget.formatted_heading_price(@heading) %>

+ <% end %>
From 72ab4f5923a702a819010551f9fd312bbdeccd7a Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Tue, 17 Jan 2017 19:09:46 +0100 Subject: [PATCH 5/6] fixes styles on callout warning --- app/assets/stylesheets/participation.scss | 8 ++++++++ app/views/budgets/investments/_header.html.erb | 16 +++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss index e790c8b02..c72b981c7 100644 --- a/app/assets/stylesheets/participation.scss +++ b/app/assets/stylesheets/participation.scss @@ -921,6 +921,14 @@ color: white; } + .callout.warning { + font-size: $base-font-size; + + a { + color: $color-warning; + } + } + &.welcome { background: $budget image-url('spending_proposals_bg.jpg'); background-position: 50% 50%; diff --git a/app/views/budgets/investments/_header.html.erb b/app/views/budgets/investments/_header.html.erb index e88a4691c..b315f4ac1 100644 --- a/app/views/budgets/investments/_header.html.erb +++ b/app/views/budgets/investments/_header.html.erb @@ -35,13 +35,15 @@
<% else %>

<%= @heading.name %>

-

- <%= t("budgets.investments.header.different_heading_assigned_html", - heading_link: link_to( - @assigned_heading.name, - budget_investments_path(@budget, heading: @assigned_heading)) - ) %> -

+
+
+ <%= t("budgets.investments.header.different_heading_assigned_html", + heading_link: link_to( + @assigned_heading.name, + budget_investments_path(@budget, heading: @assigned_heading)) + ) %> +
+
<% end %> <% else %>

<%= @heading.name %>

From 750909916b26fb5e19c989bd9296bfa19e0aefbf Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Tue, 17 Jan 2017 19:13:31 +0100 Subject: [PATCH 6/6] improves layout on sign in and sign up views --- app/assets/stylesheets/layout.scss | 2 +- app/views/devise/_omniauth_form.html.erb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index 937e5b2a8..7abaee6e2 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -650,7 +650,7 @@ h2.sidebar-title { .auth-divider { border-bottom: 1px solid $border; - height: $line-height/2; + height: rem-calc(14); margin: $line-height 0; text-align: center; diff --git a/app/views/devise/_omniauth_form.html.erb b/app/views/devise/_omniauth_form.html.erb index 328a1ef1e..f2c567259 100644 --- a/app/views/devise/_omniauth_form.html.erb +++ b/app/views/devise/_omniauth_form.html.erb @@ -3,7 +3,7 @@ <% if current_page?(new_user_session_path) %>
-
+
<%= t("omniauth.info_sign_in") %>
@@ -40,7 +40,7 @@ <% elsif current_page?(new_user_registration_path) %>
-
+
<%= t("omniauth.info_sign_up") %>