From f079bdac8a00a6c608d3c239e8b1496afaf42df2 Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Sat, 23 Apr 2016 00:40:28 +0200 Subject: [PATCH] Improves styles for retire proposals --- app/assets/stylesheets/layout.scss | 22 ++++++++++++++++------ app/assets/stylesheets/participation.scss | 4 ++++ app/views/proposals/_retired.html.erb | 14 +++++++------- app/views/proposals/retire_form.html.erb | 21 +++++++++++---------- app/views/proposals/show.html.erb | 14 +++++++++----- app/views/users/_proposals.html.erb | 6 +++--- 6 files changed, 50 insertions(+), 31 deletions(-) diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index fdaf2dd30..2040a02ce 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -545,7 +545,7 @@ footer { // 04. Tags // - - - - - - - - - - - - - - - - - - - - - - - - - -.tags a , .tag-cloud a, .categories a, .geozone a { +.tags a , .tag-cloud a, .categories a, .geozone a, .sidebar-links a { background: #ececec; border-radius: rem-calc(6); color: $text; @@ -1730,9 +1730,12 @@ table { border: 0; td { - padding-left: $line-height*1.5; position: relative; - word-break: break-all; + + &:first-child { + padding-left: $line-height*1.5; + width: 80%; + } &:before { color: $brand; @@ -1753,9 +1756,16 @@ table { top: 14px; } - &.activity-proposals td:first-child:before { - content: "h"; - top: 18px; + &.activity-proposals { + + td:first-child:before { + content: "h"; + top: 18px; + } + + .retired { + text-decoration: line-through; + } } &.activity-investment-projects td:first-child:before { diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss index 8ede20c2b..7ceaf7b99 100644 --- a/app/assets/stylesheets/participation.scss +++ b/app/assets/stylesheets/participation.scss @@ -343,6 +343,10 @@ word-wrap: break-word; } + .callout.proposal-retired { + font-size: $base-font-size; + } + .social-share-full .social-share-button { display:inline; } diff --git a/app/views/proposals/_retired.html.erb b/app/views/proposals/_retired.html.erb index ddf1dc36d..4ab1aba98 100644 --- a/app/views/proposals/_retired.html.erb +++ b/app/views/proposals/_retired.html.erb @@ -1,13 +1,13 @@ -

<% if params[:retired].blank? %> - <%= link_to t("proposals.index.retired_proposals_link"), proposals_path(retired: 'all'), class: "small" %>
+

<%= link_to t("proposals.index.retired_proposals_link"), proposals_path(retired: 'all'), class: "small" %>

<% else %> - <%= link_to t("proposals.index.retired_links.all"), proposals_path(retired: 'all'), ({class: "small"} unless params[:retired] == 'all') %>
- <% Proposal::RETIRE_OPTIONS.each do |option| %> - <%= link_to t("proposals.index.retired_links.#{option}"), proposals_path(retired: option), ({class: "small"} unless params[:retired] == option) %>
- <% end %> + <% end %> -

diff --git a/app/views/proposals/retire_form.html.erb b/app/views/proposals/retire_form.html.erb index 293e523bb..d56277cb3 100644 --- a/app/views/proposals/retire_form.html.erb +++ b/app/views/proposals/retire_form.html.erb @@ -2,33 +2,34 @@
-
- <%= link_to @proposal.title, @proposal %> -
+

<%= t("proposals.retire_form.title") %>

-

<%= t("proposals.retire_form.title") %>

+

<%= link_to @proposal.title, @proposal %>

-
+
<%= t("proposals.retire_form.warning") %>
<%= form_for(@proposal, url: retire_proposal_path(@proposal)) do |f| %> <%= render 'shared/errors', resource: @proposal %>
- -
+
<%= f.label :retired_reason, t("proposals.retire_form.retired_reason_label") %> <%= f.select :retired_reason, retire_proposals_options, {include_blank: t("proposals.retire_form.retired_reason_blank"), label: false} %>
+
-
+
+
<%= f.label :retired_explanation, t("proposals.retire_form.retired_explanation_label") %> <%= f.text_area :retired_explanation, rows: 4, maxlength: 500, label: false, placeholder: t('proposals.retire_form.retired_explanation_placeholder') %>
+
-
- <%= f.submit(class: "button", value: t("proposals.retire_form.submit_button")) %> +
+
+ <%= f.submit(class: "button expanded", value: t("proposals.retire_form.submit_button")) %>
<% end %> diff --git a/app/views/proposals/show.html.erb b/app/views/proposals/show.html.erb index 8fc01b7b4..c319c1409 100644 --- a/app/views/proposals/show.html.erb +++ b/app/views/proposals/show.html.erb @@ -23,8 +23,11 @@

<%= @proposal.title %>

<% if @proposal.retired? %> -
- <%= t("proposals.show.retired_warning") %> <%= link_to t("proposals.show.retired_warning_link_to_explanation"), "#retired_explanation" %> +
+ + <%= t("proposals.show.retired_warning") %>
+ <%= link_to t("proposals.show.retired_warning_link_to_explanation"), "#retired_explanation" %> +
<% elsif @proposal.conflictive? %>
@@ -79,9 +82,10 @@

<%= @proposal.question %>

<% if @proposal.retired? %> - -

<%= t('proposals.show.retired') %>: <%= t("proposals.retire_options.#{@proposal.retired_reason}") unless @proposal.retired_reason == 'other' %>

- <%= simple_format text_with_links(@proposal.retired_explanation), {}, sanitize: false %> +
+

<%= t('proposals.show.retired') %>: <%= t("proposals.retire_options.#{@proposal.retired_reason}") unless @proposal.retired_reason == 'other' %>

+ <%= simple_format text_with_links(@proposal.retired_explanation), {}, sanitize: false %> +
<% end %> <%= render 'shared/tags', taggable: @proposal %> diff --git a/app/views/users/_proposals.html.erb b/app/views/users/_proposals.html.erb index c3aa55ed1..9ec1368bd 100644 --- a/app/views/users/_proposals.html.erb +++ b/app/views/users/_proposals.html.erb @@ -2,13 +2,13 @@ <% @proposals.each do |proposal| %> - <%= link_to proposal.title, proposal, proposal.retired? ? {class: 'delete'} : {} %> + <%= link_to proposal.title, proposal, proposal.retired? ? {class: 'retired'} : {} %>
<%= proposal.summary %> - + <% if proposal.retired? %> - <%= t('users.show.retired') %> + <%= t('users.show.retired') %> <% else %> <%= link_to t('users.show.retire'), retire_form_proposal_path(proposal),