From a6fbe063c9202a9844bd71b1738c7c801d0d7f7b Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Thu, 22 Dec 2016 18:30:39 +0100 Subject: [PATCH 1/4] adds styles to polls index and show views --- app/assets/stylesheets/participation.scss | 79 +++++++++------- app/views/polls/index.html.erb | 34 +++++-- app/views/polls/show.html.erb | 104 ++++++++++++---------- config/locales/en.yml | 2 + config/locales/es.yml | 2 + 5 files changed, 137 insertions(+), 84 deletions(-) diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss index 4f0b58bf7..6d9bc4216 100644 --- a/app/assets/stylesheets/participation.scss +++ b/app/assets/stylesheets/participation.scss @@ -6,6 +6,7 @@ // 04. List participation // 05. Featured // 06. Proposals successful +// 07. Polls // // 01. Votes and supports @@ -945,37 +946,6 @@ // 06. Proposals successful // ------------------------- -.dark-heading { - background: #2D3E50; - color: white; - - @include breakpoint(medium) { - padding-bottom: $line-height; - } - - &.enquiries { - background: #2D3E50 image-url('heading_enquiries.jpg') no-repeat; - background-position: 70%; - } - - p { - margin-bottom: 0; - - &.title { - color: #FFD200; - } - } - - .info { - background: #314253; - padding-top: $line-height; - - @include breakpoint(medium) { - border-top: rem-calc(6) solid #FFD200; - } - } -} - .sucessfull-proposals-banner { background: #2D3E50 image-url("ballot_tiny.gif") no-repeat; background-position: 75% 0; @@ -1045,3 +1015,50 @@ } } } + +// 07. Polls +// ---------------------- + +.dark-heading { + background: #2D3E50; + color: white; + + .title { + color: #FFD200; + } + + .info { + background: #314253; + padding: $line-height; + + @include breakpoint(medium) { + border-top: rem-calc(6) solid #FFD200; + } + + a { + color: white; + text-decoration: underline; + } + + } + + &.poll-show { + min-height: $line-height*8; + } +} + +.poll, .poll-question { + background: white; + border-bottom: 1px solid $border; + margin-bottom: $line-height/2; + padding: $line-height; + + .date { + color: $brand; + font-size: $small-font-size; + } + + h3 a { + color: $text; + } +} diff --git a/app/views/polls/index.html.erb b/app/views/polls/index.html.erb index b5d98e00f..0b59a17ab 100644 --- a/app/views/polls/index.html.erb +++ b/app/views/polls/index.html.erb @@ -1,7 +1,31 @@ -<%= render 'shared/filter_subnav', i18n_namespace: "polls.index" %> +<% provide :title do %><%= t("polls.index.title") %><% end %> +<% content_for :wrapper_class, "light" %> -<% @polls.each do |poll| %> - <%= link_to poll.name, poll %> (<%= poll_dates(poll) %>) -<% end %> +
+
+
+

<%= t("polls.index.title") %>

+
+
+
-<%= paginate @polls %> +
+
+ <%= render 'shared/filter_subnav_vertical', i18n_namespace: "polls.index" %> +
+ +
+ <% @polls.each do |poll| %> +
+

<%= poll.name %>

+

<%= poll_dates(poll) %>

+ <%= link_to t("polls.index.button"), + poll, + class: "button", + title: t("polls.index.button") + " " + (poll.name) %> +
+ <% end %> + + <%= paginate @polls %> +
+
diff --git a/app/views/polls/show.html.erb b/app/views/polls/show.html.erb index 3006ebc71..63babcfd4 100644 --- a/app/views/polls/show.html.erb +++ b/app/views/polls/show.html.erb @@ -1,54 +1,62 @@ -

<%= @poll.name %>

-

<%= t("polls.show.dates_title") %>: <%= poll_dates(@poll) %>

+<% provide :title do %><%= @poll.name %><% end %> +<% content_for :wrapper_class, "light" %> -<% unless can?(:answer, @poll) %> +
+
+
+ <%= render "shared/back_link" %> + +

<%= @poll.name %>

+
+
+

+ <%= t("polls.show.dates_title") %> +

+

+ <%= poll_dates(@poll) %> +

+
+
+
+ +
- <% if current_user.nil? %> -
- <%= t("polls.show.cant_answer_not_logged_in", - signin: link_to(t("polls.show.signin"), new_user_session_path, class: "probe-message"), - signup: link_to(t("polls.show.signup"), new_user_registration_path, class: "probe-message")).html_safe %> -
- <% elsif current_user.unverified? %> + <% unless can?(:answer, @poll) %> + <% if current_user.nil? %> +
+ <%= t("polls.show.cant_answer_not_logged_in", + signin: link_to(t("polls.show.signin"), new_user_session_path, class: "probe-message"), + signup: link_to(t("polls.show.signup"), new_user_registration_path, class: "probe-message")).html_safe %> +
+ <% elsif current_user.unverified? %> +
+ <%= t('polls.show.cant_answer_verify_html', + verify_link: link_to(t('polls.show.verify_link'), verification_path)) %> +
+ <% elsif @poll.incoming? %> +
+ <%= t('polls.show.cant_answer_incoming') %> +
+ <% elsif @poll.expired? %> +
+ <%= t('polls.show.cant_answer_expired') %> +
+ <% end %> + <% end %> + + <% @answerable_questions.each do |question| %> + <%= render 'polls/questions/question', question: question %> + <% end %> + + <% if can?(:answer, @poll) && + @non_answerable_questions.present? %>
- <%= t('polls.show.cant_answer_verify_html', - verify_link: link_to(t('polls.show.verify_link'), verification_path)) %> -
- <% elsif @poll.incoming? %> -
- <%= t('polls.show.cant_answer_incoming') %> -
- <% elsif @poll.expired? %> -
- <%= t('polls.show.cant_answer_expired') %> + <%= t('polls.show.cant_answer_wrong_geozone') %>
<% end %> + + <% @non_answerable_questions.each do |question| %> + <%= render 'polls/questions/question', question: question %> + <% end %>
-<% end %> - -<% @answerable_questions.each do |question| %> -
- <%= link_to question.title, question_path(question) %> - -
- <%= render 'polls/questions/answers', question: question %> -
-
-<% end %> - -<% if can?(:answer, @poll) && - @non_answerable_questions.present? %> -
- <%= t('polls.show.cant_answer_wrong_geozone') %> -
-<% end %> - -<% @non_answerable_questions.each do |question| %> -
- <%= link_to question.title, question_path(question) %> - -
- <%= render 'polls/questions/answers', question: question %> -
-
-<% end %> +
diff --git a/config/locales/en.yml b/config/locales/en.yml index 4f632166f..f4ba4630d 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -387,6 +387,8 @@ en: current: "Open" incoming: "Incoming" expired: "Expired" + title: "Polls" + button: "Participate in this polls" show: dates_title: "Participation dates" cant_answer_not_logged_in: "You must %{signin} or %{signup} to participate." diff --git a/config/locales/es.yml b/config/locales/es.yml index 8440d2390..5464efb80 100755 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -387,6 +387,8 @@ es: current: "Abiertas" incoming: "Próximamente" expired: "Terminadas" + title: "Votaciones" + button: "Participar en esta votación" show: dates_title: "Fechas de participación" cant_answer_not_logged_in: "Necesitas %{signin} o %{signup} para participar." From 8cbd39df697d3d42e319def1001c5df0733d792c Mon Sep 17 00:00:00 2001 From: Alberto Garcia Cabeza Date: Thu, 22 Dec 2016 18:31:26 +0100 Subject: [PATCH 2/4] adds styles to wrapper and new partial to filter subnav vertical --- app/assets/stylesheets/_settings.scss | 1 + app/assets/stylesheets/layout.scss | 33 +++++++++++++++++-- app/views/layouts/application.html.erb | 2 +- .../shared/_filter_subnav_vertical.html.erb | 14 ++++++++ 4 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 app/views/shared/_filter_subnav_vertical.html.erb diff --git a/app/assets/stylesheets/_settings.scss b/app/assets/stylesheets/_settings.scss index 242a03b82..1fa432704 100644 --- a/app/assets/stylesheets/_settings.scss +++ b/app/assets/stylesheets/_settings.scss @@ -79,6 +79,7 @@ $budget: #454372; $budget-hover: #7571BF; $highlight: #E7F2FC; +$light: #F5F7FA; $featured: #FED900; $footer-border: #BFC1C3; diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index c3dded973..106c0e3e6 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -138,6 +138,10 @@ a { padding-top: $line-height; } +.light { + background: $light; +} + .highlight { background: $highlight; } @@ -198,6 +202,30 @@ a { } } +.menu.vertical { + background: white; + margin: $line-height 0; + padding: $line-height; + + li { + margin-bottom: $line-height; + + a { + color: $text-medium; + padding: 0; + } + + h2 { + font-size: $base-font-size; + } + + &.active { + border-bottom: 2px solid $brand; + color: $brand; + } + } +} + .small { font-size: $small-font-size; } @@ -430,6 +458,7 @@ header { .input-group-button { line-height: $line-height*1.5; + padding-bottom: 0; button { background: $border; @@ -451,7 +480,6 @@ header { } .submenu { - background: white; border-bottom: 1px solid $border; clear: both; margin-bottom: $line-height/2; @@ -544,7 +572,8 @@ footer { // 04. Tags // -------- -.tags a , .tag-cloud a, .categories a, .geozone a, .sidebar-links a { +.tags a , .tag-cloud a, .categories a, .geozone a, .sidebar-links a, +.tags span { background: #ececec; border-radius: rem-calc(6); color: $text; diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 35f8729c8..41351f12a 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -22,7 +22,7 @@ <%= setting['per_page_code'].try(:html_safe) %> -
+
<%= render 'layouts/header' %>