From c0c4d9e01f6172f409f657c85aa45fc2987cfe82 Mon Sep 17 00:00:00 2001 From: decabeza Date: Wed, 14 Feb 2018 16:00:01 +0100 Subject: [PATCH 1/7] Fixes back link to on how to use help page --- app/views/pages/help/how_to_use/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/pages/help/how_to_use/index.html.erb b/app/views/pages/help/how_to_use/index.html.erb index 8da48d35d..a37920563 100644 --- a/app/views/pages/help/how_to_use/index.html.erb +++ b/app/views/pages/help/how_to_use/index.html.erb @@ -4,7 +4,7 @@
- <%= back_link_to %> + <%= back_link_to help_path %>

<%= t('pages.help.titles.how_to_use') %>

From f7c7f0201a32538ee82dce6bc6cc26489250a736 Mon Sep 17 00:00:00 2001 From: decabeza Date: Wed, 14 Feb 2018 17:06:26 +0100 Subject: [PATCH 2/7] Fixes heading structure and i18n format on legislation processes --- app/assets/stylesheets/legislation.scss | 3 ++- .../legislation/processes/_process.html.erb | 26 +++++++++---------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/app/assets/stylesheets/legislation.scss b/app/assets/stylesheets/legislation.scss index 130d99ada..a3d46a88d 100644 --- a/app/assets/stylesheets/legislation.scss +++ b/app/assets/stylesheets/legislation.scss @@ -86,7 +86,8 @@ background: #e5ecf2; padding-top: 1rem; - h5 { + h4 { + font-size: rem-calc(16); margin-left: 0.25rem; margin-bottom: 0; color: #61686e; diff --git a/app/views/legislation/processes/_process.html.erb b/app/views/legislation/processes/_process.html.erb index a41fdbe4a..02954030f 100644 --- a/app/views/legislation/processes/_process.html.erb +++ b/app/views/legislation/processes/_process.html.erb @@ -7,8 +7,8 @@
- <%= link_to process, class: "button hollow big expanded", title: t('.see_latest_comments_title') do %> -   <%= t('.see_latest_comments') %> + <%= link_to process, class: "button hollow big expanded", title: t(".see_latest_comments_title") do %> +   <%= t(".see_latest_comments") %> <% end %>
@@ -21,43 +21,43 @@ <% column_width = 12 / process.enabled_phases_and_publications_count %>
-

<%= t('legislation.processes.shared.key_dates') %>

+

<%= t("legislation.processes.shared.key_dates") %>

<% if process.debate_phase.enabled? %>
-
<%= t('legislation.processes.shared.debate_dates') %>
-

<%= format_date(process.debate_start_date) %> - <%= format_date(process.debate_end_date) %>

+

<%= t("legislation.processes.shared.debate_dates") %>

+

<%= format_date(process.debate_start_date) %> - <%= format_date(process.debate_end_date) %>

<% end %> <% if process.draft_publication.enabled? %>
-
<%= t('legislation.processes.shared.draft_publication_date') %>
-

<%= format_date(process.draft_publication_date) %>

+

<%= t("legislation.processes.shared.draft_publication_date") %>

+

<%= format_date(process.draft_publication_date) %>

<% end %> <% if process.proposals_phase.enabled? %>
-
<%= t('legislation.processes.shared.proposals_dates') %>
-

<%= format_date(process.proposals_phase_start_date) %> - <%= format_date(process.proposals_phase_end_date) %>

+

<%= t("legislation.processes.shared.proposals_dates") %>

+

<%= format_date(process.proposals_phase_start_date) %> - <%= format_date(process.proposals_phase_end_date) %>

<% end %> <% if process.allegations_phase.enabled? %>
-
<%= t('legislation.processes.shared.allegations_dates') %>
-

<%= format_date(process.allegations_start_date) %> - <%= format_date(process.allegations_end_date) %>

+

<%= t("legislation.processes.shared.allegations_dates") %>

+

<%= format_date(process.allegations_start_date) %> - <%= format_date(process.allegations_end_date) %>

<% end %> <% if process.result_publication.enabled? %>
-
<%= t('legislation.processes.shared.result_publication_date') %>
-

<%= format_date(process.result_publication_date) %>

+

<%= t("legislation.processes.shared.result_publication_date") %>

+

<%= format_date(process.result_publication_date) %>

<% end %>
From 990dc072be0dfdefbc57e4ad346b757926e0994e Mon Sep 17 00:00:00 2001 From: decabeza Date: Wed, 14 Feb 2018 17:52:10 +0100 Subject: [PATCH 3/7] Refactors custom page view and include specs --- app/views/pages/custom_page.html.erb | 14 ++++--- .../site_customization/custom_pages_spec.rb | 39 +++++++++++++++++++ 2 files changed, 48 insertions(+), 5 deletions(-) diff --git a/app/views/pages/custom_page.html.erb b/app/views/pages/custom_page.html.erb index f14eba7d9..bdd85ab30 100644 --- a/app/views/pages/custom_page.html.erb +++ b/app/views/pages/custom_page.html.erb @@ -4,12 +4,16 @@

<%= @custom_page.title %>

-

<%= @custom_page.subtitle %>

+ <% if @custom_page.subtitle.present? %> +

<%= @custom_page.subtitle%>

+ <% end %> - <%= raw @custom_page.content %> + <%= text_with_links @custom_page.content %>
-
- <%= render '/shared/print' if @custom_page.print_content_flag %> -
+ <% if @custom_page.print_content_flag %> +
+ <%= render '/shared/print' %> +
+ <% end %>
diff --git a/spec/features/site_customization/custom_pages_spec.rb b/spec/features/site_customization/custom_pages_spec.rb index 09ad797dc..85e50841d 100644 --- a/spec/features/site_customization/custom_pages_spec.rb +++ b/spec/features/site_customization/custom_pages_spec.rb @@ -72,6 +72,45 @@ feature "Custom Pages" do expect(page).not_to have_content("Print this info") end + scenario "Show all fields and text with links" do + custom_page = create(:site_customization_page, :published, + slug: "slug-with-all-fields-filled", + title: "Custom page", + subtitle: "This is my new custom page", + content: "Text for new custom page with a link to https://consul.dev", + print_content_flag: true, + locale: "en" + ) + + visit custom_page.url + + expect(page).to have_title("Custom page") + expect(page).to have_selector("h1", text: "Custom page") + expect(page).to have_selector("h2", text: "This is my new custom page") + expect(page).to have_content("Text for new custom page with a link to https://consul.dev") + expect(page).to have_link("https://consul.dev") + expect(page).to have_content("Print this info") + end + + scenario "Don't show subtitle if its blank" do + custom_page = create(:site_customization_page, :published, + slug: "slug-without-subtitle", + title: "Custom page", + subtitle: "", + content: "Text for new custom page", + print_content_flag: false, + locale: "en" + ) + + visit custom_page.url + + expect(page).to have_title("Custom page") + expect(page).to have_selector("h1", text: "Custom page") + expect(page).to have_content("Text for new custom page") + expect(page).not_to have_selector("h2") + expect(page).not_to have_content("Print this info") + end + scenario "Listed in more information page" do custom_page = create(:site_customization_page, :published, slug: "another-slug", title: "Another custom page", From a950bb03a70bb846da13f6061d5050578bf346df Mon Sep 17 00:00:00 2001 From: decabeza Date: Wed, 14 Feb 2018 18:04:17 +0100 Subject: [PATCH 4/7] Removes unnecessary p tag on investment partial --- app/views/budgets/investments/_investment.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/budgets/investments/_investment.html.erb b/app/views/budgets/investments/_investment.html.erb index e999c7f34..87b3dcc6b 100644 --- a/app/views/budgets/investments/_investment.html.erb +++ b/app/views/budgets/investments/_investment.html.erb @@ -45,7 +45,7 @@ <%= investment.heading.name %>

-

<%= investment.description %>

+ <%= investment.description %>
<%= render "shared/tags", taggable: investment, limit: 5 %> From 1cc799ef11a31e3999e31323d028ea67c086e5ba Mon Sep 17 00:00:00 2001 From: decabeza Date: Wed, 14 Feb 2018 18:13:46 +0100 Subject: [PATCH 5/7] Adds links to milestone description --- app/views/budgets/investments/_milestones.html.erb | 2 +- spec/features/budgets/investments_spec.rb | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/views/budgets/investments/_milestones.html.erb b/app/views/budgets/investments/_milestones.html.erb index a9de80429..eb151a9ab 100644 --- a/app/views/budgets/investments/_milestones.html.erb +++ b/app/views/budgets/investments/_milestones.html.erb @@ -18,7 +18,7 @@ <% end %> <%= image_tag(milestone.image_url(:large), { alt: milestone.image.title, class: "margin", id: "image_#{milestone.id}" }) if milestone.image.present? %> -

<%= milestone.description %>

+

<%= text_with_links milestone.description %>

<% if milestone.documents.present? %>