From d656de680d9500000e504a833b5d2ad60c58896d Mon Sep 17 00:00:00 2001 From: Amaia Castro Date: Thu, 9 Feb 2017 15:32:42 +0100 Subject: [PATCH 1/3] Social share buttons for annotation --- app/views/legislation/annotations/show.html.erb | 4 ++++ app/views/legislation/questions/show.html.erb | 6 +----- app/views/legislation/shared/_share_buttons.html.erb | 5 +++++ config/locales/legislation.en.yml | 7 ++++--- config/locales/legislation.es.yml | 7 ++++--- 5 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 app/views/legislation/shared/_share_buttons.html.erb diff --git a/app/views/legislation/annotations/show.html.erb b/app/views/legislation/annotations/show.html.erb index 25d56e99c..89b371821 100644 --- a/app/views/legislation/annotations/show.html.erb +++ b/app/views/legislation/annotations/show.html.erb @@ -8,6 +8,10 @@
<%= render 'version_chooser', process: @process, draft_version: @draft_version %> + +
diff --git a/app/views/legislation/questions/show.html.erb b/app/views/legislation/questions/show.html.erb index b99e7b17f..9a290e364 100644 --- a/app/views/legislation/questions/show.html.erb +++ b/app/views/legislation/questions/show.html.erb @@ -39,11 +39,7 @@

<%= t('.share') %>

diff --git a/app/views/legislation/shared/_share_buttons.html.erb b/app/views/legislation/shared/_share_buttons.html.erb new file mode 100644 index 000000000..acc86f4ea --- /dev/null +++ b/app/views/legislation/shared/_share_buttons.html.erb @@ -0,0 +1,5 @@ + diff --git a/config/locales/legislation.en.yml b/config/locales/legislation.en.yml index 56e34b800..4517e1f31 100644 --- a/config/locales/legislation.en.yml +++ b/config/locales/legislation.en.yml @@ -98,9 +98,6 @@ en: next_question: Next question first_question: First question share: Share - share_twitter: Share on Twitter - share_facebook: Share on Facebook - share_gplus: Share on Google+ title: Collaborative legislation process participation: phase_not_open: This phase is not open @@ -111,3 +108,7 @@ en: verified_only: Only verified users can participate, %{verify_account}. verify_account: verify your account debate_phase_not_open: Debate phase has finished and answers are not accepted anymore + shared: + share_twitter: Share on Twitter + share_facebook: Share on Facebook + share_gplus: Share on Google+ diff --git a/config/locales/legislation.es.yml b/config/locales/legislation.es.yml index fe20128ff..1b91ef5c3 100644 --- a/config/locales/legislation.es.yml +++ b/config/locales/legislation.es.yml @@ -98,9 +98,6 @@ es: next_question: Siguiente pregunta first_question: Primera pregunta share: Compartir - share_twitter: Compartir en Twitter - share_facebook: Compartir en Facebook - share_gplus: Compartir en Google+ title: Proceso de legislación colaborativa participation: phase_not_open: Esta fase no está abierta @@ -111,3 +108,7 @@ es: verified_only: Solo los usuarios verificados pueden participar en el debate, %{verify_account}. verify_account: verifica tu cuenta debate_phase_not_open: La fase de debate previo ya ha finalizado y en este momento no se aceptan respuestas + shared: + share_twitter: Compartir en Twitter + share_facebook: Compartir en Facebook + share_gplus: Compartir en Google+ From af52fb5670f5b86bb8838a49844af48e45340b5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Gonz=C3=A1lez?= Date: Tue, 14 Feb 2017 17:11:02 +0100 Subject: [PATCH 2/3] Improve social share buttons position for the annotations index and specific annotations --- .../stylesheets/legislation_process.scss | 8 +++ app/assets/stylesheets/participation.scss | 3 +- .../_slim_version_chooser.html.erb | 23 +++++++++ .../legislation/annotations/index.html.erb | 49 ++++++++++--------- .../legislation/annotations/show.html.erb | 6 +-- 5 files changed, 61 insertions(+), 28 deletions(-) create mode 100644 app/views/legislation/annotations/_slim_version_chooser.html.erb diff --git a/app/assets/stylesheets/legislation_process.scss b/app/assets/stylesheets/legislation_process.scss index 39a45da93..3fbc509bf 100644 --- a/app/assets/stylesheets/legislation_process.scss +++ b/app/assets/stylesheets/legislation_process.scss @@ -525,7 +525,15 @@ $epigraph-line-height: rem-calc(22); } .draft-panels { + position: relative; padding: 2rem 0; + + aside.absolute { + @include breakpoint(medium) { + position: absolute; + right: 0; + } + } .draft-chooser { margin-bottom: 2rem; diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss index 6609f25df..d57807912 100644 --- a/app/assets/stylesheets/participation.scss +++ b/app/assets/stylesheets/participation.scss @@ -298,7 +298,8 @@ .proposal-show, .investment-project-show, .debate-quiz, -.budget-investment-show { +.budget-investment-show, +.draft-panels { p { word-wrap: break-word; diff --git a/app/views/legislation/annotations/_slim_version_chooser.html.erb b/app/views/legislation/annotations/_slim_version_chooser.html.erb new file mode 100644 index 000000000..cd34736f7 --- /dev/null +++ b/app/views/legislation/annotations/_slim_version_chooser.html.erb @@ -0,0 +1,23 @@ +
+
+

<%= t('legislation.annotations.version_chooser.seeing_version') %>

+
+ <%= form_tag go_to_version_legislation_process_draft_versions_path(process), method: :get, id: "draft_version_go_to_version" do %> + <%= select_tag "draft_version_id", options_from_collection_for_select(process.draft_versions.published, 'id', 'display_title', draft_version.id), "aria-label": t('legislation.draft_versions.show.select_draft_version') %> + <%= hidden_field_tag "redirect_action", "annotations" %> + <%= submit_tag t('legislation.draft_versions.show.select_version_submit'), class: "button" %> + <% end %> +
+ <%= t('legislation.draft_versions.show.updated_at', date: format_date(@draft_version.updated_at)) %> +
+
+ <%= link_to t('legislation.annotations.version_chooser.see_text'), legislation_process_draft_version_path(process, draft_version), title: t('legislation.annotations.version_chooser.see_text'), class: "button strong" %> +
+ +
diff --git a/app/views/legislation/annotations/index.html.erb b/app/views/legislation/annotations/index.html.erb index 87efc3614..7553276f1 100644 --- a/app/views/legislation/annotations/index.html.erb +++ b/app/views/legislation/annotations/index.html.erb @@ -7,29 +7,34 @@
<%= render 'version_chooser', process: @process, draft_version: @draft_version %> - -
-
- - <% @annotations.each do |annotation| %> -
- <%= t('.comments_about') %> - - <%= link_to legislation_process_draft_version_path(@process, @draft_version, anchor: "annotation-id-#{annotation.id}") do %> - <%= t('.see_in_context') %> - <% end %> - -
- <%= annotation.quote %> -
- <%= link_to legislation_process_draft_version_annotation_path(@process, @draft_version, annotation) do %> - <%= t('.comments_count', count: annotation.comments_count) %> - <% end %> -
- <% end %> - + +
+ +
+ +
+ + <% @annotations.each do |annotation| %> +
+ <%= t('.comments_about') %> + + <%= link_to legislation_process_draft_version_path(@process, @draft_version, anchor: "annotation-id-#{annotation.id}") do %> + <%= t('.see_in_context') %> + <% end %> + +
+ <%= annotation.quote %> +
+ <%= link_to legislation_process_draft_version_annotation_path(@process, @draft_version, annotation) do %> + <%= t('.comments_count', count: annotation.comments_count) %> + <% end %> +
+ <% end %>
diff --git a/app/views/legislation/annotations/show.html.erb b/app/views/legislation/annotations/show.html.erb index 89b371821..0d261d27a 100644 --- a/app/views/legislation/annotations/show.html.erb +++ b/app/views/legislation/annotations/show.html.erb @@ -6,11 +6,7 @@
- <%= render 'version_chooser', process: @process, draft_version: @draft_version %> - - + <%= render 'slim_version_chooser', process: @process, draft_version: @draft_version %>
From 311388969dd957c4a75bff32eea42dd7b07cb4d7 Mon Sep 17 00:00:00 2001 From: Amaia Castro Date: Tue, 14 Feb 2017 18:15:01 +0100 Subject: [PATCH 3/3] Changes annotations text for twitter share button --- app/views/legislation/annotations/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/legislation/annotations/index.html.erb b/app/views/legislation/annotations/index.html.erb index db0b79d4f..ddcd9919b 100644 --- a/app/views/legislation/annotations/index.html.erb +++ b/app/views/legislation/annotations/index.html.erb @@ -12,7 +12,7 @@

Compartir