From 5fd493cd2cc319aca12e41195528cfc427e4e277 Mon Sep 17 00:00:00 2001 From: decabeza Date: Thu, 30 May 2019 00:31:49 +0200 Subject: [PATCH] Add link to process on legislation processes proposals --- app/assets/stylesheets/legislation.scss | 2 +- .../stylesheets/legislation_process.scss | 26 ++++++++++++++++++- app/views/legislation/proposals/show.html.erb | 11 ++++++++ config/locales/en/legislation.yml | 1 + config/locales/es/legislation.yml | 1 + spec/features/legislation/proposals_spec.rb | 11 ++++++++ 6 files changed, 50 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/legislation.scss b/app/assets/stylesheets/legislation.scss index 6247b64b9..b70783789 100644 --- a/app/assets/stylesheets/legislation.scss +++ b/app/assets/stylesheets/legislation.scss @@ -83,7 +83,7 @@ } .legislation-calendar { - background: #e5ecf2; + background: $highlight; padding-top: 1rem; h4 { diff --git a/app/assets/stylesheets/legislation_process.scss b/app/assets/stylesheets/legislation_process.scss index 474d80bbb..cb4488004 100644 --- a/app/assets/stylesheets/legislation_process.scss +++ b/app/assets/stylesheets/legislation_process.scss @@ -212,7 +212,7 @@ } .quiz-title { - background: #e5ecf2; + background: $highlight; .quiz-header-title { font-size: $small-font-size; @@ -982,3 +982,27 @@ margin-top: 0; } } + +.process-proposal { + margin-bottom: $line-height; + + .header { + background: $highlight; + padding: $line-height; + + @include breakpoint(medium) { + height: $line-height * 4; + } + } + + .process-title { + font-size: $small-font-size; + margin-bottom: 0; + text-transform: uppercase; + } + + .process-link { + font-size: rem-calc(19); + font-weight: bold; + } +} diff --git a/app/views/legislation/proposals/show.html.erb b/app/views/legislation/proposals/show.html.erb index e8e213b06..55b01499a 100644 --- a/app/views/legislation/proposals/show.html.erb +++ b/app/views/legislation/proposals/show.html.erb @@ -10,6 +10,17 @@ <%= render "shared/canonical", href: legislation_process_proposal_url(process_id: @process) %> <% end %> +
+
+
+

+ <%= t("legislation.proposals.process_title") %> +

+ <%= link_to @process.title, @process, class: "process-link" %> +
+
+
+ <% cache [locale_and_user_status(@proposal), @proposal, @proposal.author, Flag.flagged?(current_user, @proposal), @legislation_proposal_votes] do %>
diff --git a/config/locales/en/legislation.yml b/config/locales/en/legislation.yml index ab83e4b0d..8d24194ae 100644 --- a/config/locales/en/legislation.yml +++ b/config/locales/en/legislation.yml @@ -123,3 +123,4 @@ en: form: tags_label: "Categories" not_verified: "For vote proposals %{verify_account}." + process_title: Collaborative legislation process diff --git a/config/locales/es/legislation.yml b/config/locales/es/legislation.yml index 797f5d26b..6d45afca8 100644 --- a/config/locales/es/legislation.yml +++ b/config/locales/es/legislation.yml @@ -123,3 +123,4 @@ es: form: tags_label: "Categorías" not_verified: "Para votar propuestas %{verify_account}." + process_title: Proceso de legislación colaborativa diff --git a/spec/features/legislation/proposals_spec.rb b/spec/features/legislation/proposals_spec.rb index 91af4b109..76a76f4d0 100644 --- a/spec/features/legislation/proposals_spec.rb +++ b/spec/features/legislation/proposals_spec.rb @@ -190,4 +190,15 @@ describe "Legislation Proposals" do visit legislation_process_proposal_path(process, legislation_proposal_negative) expect(page).to have_content("-6 votes") end + + scenario "Show link to process on show" do + create(:legislation_proposal, legislation_process_id: process.id) + + visit legislation_process_proposal_path(proposal.process, proposal) + + within(".process-proposal") do + expect(page).to have_content("Collaborative legislation process") + expect(page).to have_link(process.title) + end + end end