diff --git a/app/assets/stylesheets/debates.scss b/app/assets/stylesheets/debates.scss index bf379eef8..9a59761d2 100644 --- a/app/assets/stylesheets/debates.scss +++ b/app/assets/stylesheets/debates.scss @@ -305,7 +305,7 @@ .panel { border-radius: 0; box-shadow: 0px 1px 3px 0 $border; - margin-bottom: rem-calc(12); + margin-bottom: rem-calc(4); min-height: rem-calc(192); padding-top: rem-calc(12); diff --git a/app/assets/stylesheets/participacion.scss b/app/assets/stylesheets/participacion.scss index bf4882ef4..c6cd8c4a7 100644 --- a/app/assets/stylesheets/participacion.scss +++ b/app/assets/stylesheets/participacion.scss @@ -259,7 +259,7 @@ h6 { .footer { background: #DEE0E2; - border-top: rem-calc(10) solid $brand; + border-top: rem-calc(6) solid $brand; } // 04. Header @@ -330,8 +330,14 @@ header { } .icon-external { - color: #D01A6C; font-size: rem-calc(12); + opacity: .5; + + @media (min-width: $small-breakpoint) { + position: absolute; + right: -18px; + top: 3px; + } } .selected { @@ -398,6 +404,7 @@ header { color: white; height: rem-calc(48); max-width: 1170px !important; + padding: 0 rem-calc(12); @media (min-width: $small-breakpoint) { height: rem-calc(96); @@ -543,9 +550,11 @@ header { li:not(.has-form) a:not(.button) { background: none; color: white; + padding: 0 rem-calc(6); @media (min-width: $small-breakpoint) { line-height: $line-height*4; + padding: 0 rem-calc(12); } &:hover { @@ -569,6 +578,10 @@ header { color: white; font-size: rem-calc(14); + .row { + padding: 0 rem-calc(12); + } + a { color: white; @@ -725,7 +738,7 @@ footer { color: white; &.info { - background: $brand; + background: rgba(0,0,0,.5); } } @@ -1045,11 +1058,7 @@ img.initialjs-avatar { h2 { display: inline-block; font-size: rem-calc(24); - margin: rem-calc(24) 0 rem-calc(12); - - @media (min-width: $small-breakpoint) { - margin: rem-calc(24) 0; - } + margin-left: rem-calc(-17); } select { @@ -1061,8 +1070,12 @@ img.initialjs-avatar { padding: rem-calc(12); width: auto; + @media (max-width: $small) { + margin-left: rem-calc(-17); + } + @media (min-width: $small-breakpoint) { - margin: 0 rem-calc(6) rem-calc(24); + margin: 0 0 rem-calc(24) rem-calc(12); } optgroup { @@ -1077,6 +1090,18 @@ img.initialjs-avatar { } } } + + .debates-order { + text-align: left; + + @media (min-width: $small-breakpoint) { + text-align: right; + } + + select { + margin-left: 0; + } + } } .search-results { diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index f71ebf723..aa6da3a80 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -96,4 +96,8 @@ class ApplicationController < ActionController::Base redirect_to new_residence_path, alert: t('verification.residence.alert.unconfirmed_residency') end end + + def verify_verified! + redirect_to(account_path, notice: t('verification.redirect_notices.already_verified')) if current_user.level_three_verified? + end end diff --git a/app/controllers/verification/email_controller.rb b/app/controllers/verification/email_controller.rb index cb7542c80..017269095 100644 --- a/app/controllers/verification/email_controller.rb +++ b/app/controllers/verification/email_controller.rb @@ -1,5 +1,6 @@ class Verification::EmailController < ApplicationController before_action :authenticate_user! + before_action :verify_verified! before_action :set_verified_user, only: :create skip_authorization_check diff --git a/app/controllers/verification/letter_controller.rb b/app/controllers/verification/letter_controller.rb index 15d408a5f..e1e23903b 100644 --- a/app/controllers/verification/letter_controller.rb +++ b/app/controllers/verification/letter_controller.rb @@ -2,6 +2,7 @@ class Verification::LetterController < ApplicationController before_action :authenticate_user! before_action :verify_resident! before_action :verify_phone! + before_action :verify_verified! before_action :verify_lock skip_authorization_check diff --git a/app/controllers/verification/residence_controller.rb b/app/controllers/verification/residence_controller.rb index df24454e6..f5a826058 100644 --- a/app/controllers/verification/residence_controller.rb +++ b/app/controllers/verification/residence_controller.rb @@ -1,5 +1,6 @@ class Verification::ResidenceController < ApplicationController before_action :authenticate_user! + before_action :verify_verified! before_action :verify_lock, only: [:new, :create] skip_authorization_check diff --git a/app/controllers/verification/sms_controller.rb b/app/controllers/verification/sms_controller.rb index 87604f726..09e4840a7 100644 --- a/app/controllers/verification/sms_controller.rb +++ b/app/controllers/verification/sms_controller.rb @@ -1,6 +1,7 @@ class Verification::SmsController < ApplicationController before_action :authenticate_user! before_action :verify_resident! + before_action :verify_verified! before_action :verify_lock, only: [:new, :create] before_action :set_phone, only: :create diff --git a/app/controllers/verification/verified_user_controller.rb b/app/controllers/verification/verified_user_controller.rb index bf2bc65fb..6964a2bd5 100644 --- a/app/controllers/verification/verified_user_controller.rb +++ b/app/controllers/verification/verified_user_controller.rb @@ -1,5 +1,6 @@ class Verification::VerifiedUserController < ApplicationController before_action :authenticate_user! + before_action :verify_verified! skip_authorization_check def show diff --git a/app/controllers/verification_controller.rb b/app/controllers/verification_controller.rb new file mode 100644 index 000000000..6d1945af4 --- /dev/null +++ b/app/controllers/verification_controller.rb @@ -0,0 +1,31 @@ +class VerificationController < ApplicationController + before_action :authenticate_user! + before_action :verify_lock + + skip_authorization_check + + def show + redirect_to next_step_path[:path], notice: next_step_path[:notice] + end + + private + + def next_step_path(user = current_user) + if user.level_three_verified? + { path: account_path, notice: t('verification.redirect_notices.already_verified') } + elsif user.verification_letter_sent? + { path: edit_letter_path } + elsif user.level_two_verified? + { path: new_letter_path } + elsif user.verification_sms_sent? + { path: edit_sms_path } + elsif user.verification_email_sent? + { path: verified_user_path, notice: t('verification.redirect_notices.email_already_sent') } + elsif user.residence_verified? + { path: verified_user_path } + else + { path: new_residence_path } + end + end + +end \ No newline at end of file diff --git a/app/models/debate.rb b/app/models/debate.rb index c30bc7b8d..f1e9a621e 100644 --- a/app/models/debate.rb +++ b/app/models/debate.rb @@ -138,7 +138,7 @@ class Debate < ActiveRecord::Base end def self.search(terms) - terms.present? ? where("unaccent(title) ILIKE unaccent(?) OR unaccent(description) ILIKE unaccent(?)", "%#{terms}%", "%#{terms}%") : none + terms.present? ? where("title ILIKE ? OR description ILIKE ?", "%#{terms}%", "%#{terms}%") : none end def conflictive? diff --git a/app/views/account/show.html.erb b/app/views/account/show.html.erb index 413a0e892..d580052e2 100644 --- a/app/views/account/show.html.erb +++ b/app/views/account/show.html.erb @@ -10,9 +10,9 @@ <%= t("account.show.verified_account") %>

<% elsif current_user.level_two_verified? %> - <%= link_to t("account.show.finish_verification"), new_letter_path, class: "button radius small success right" %> + <%= link_to t("account.show.finish_verification"), verification_path, class: "button radius small success right" %> <% else %> - <%= link_to t("account.show.verify_my_account"), new_residence_path, class: "button radius small success right" %> + <%= link_to t("account.show.verify_my_account"), verification_path, class: "button radius small success right" %> <% end %> diff --git a/app/views/debates/_debate.html.erb b/app/views/debates/_debate.html.erb index 0d2cef4ce..e766f5c34 100644 --- a/app/views/debates/_debate.html.erb +++ b/app/views/debates/_debate.html.erb @@ -1,5 +1,5 @@ <% cache [locale_and_user_status, debate, @debate_votes[debate.id]] do %> -
+
diff --git a/app/views/debates/_votes.html.erb b/app/views/debates/_votes.html.erb index c5704b34a..5f38b1e7a 100644 --- a/app/views/debates/_votes.html.erb +++ b/app/views/debates/_votes.html.erb @@ -31,7 +31,7 @@ <% elsif !user_signed_in? %> diff --git a/app/views/debates/index.html.erb b/app/views/debates/index.html.erb index f0db765d2..bbd77577c 100644 --- a/app/views/debates/index.html.erb +++ b/app/views/debates/index.html.erb @@ -3,34 +3,35 @@
-
+
<% if @search_terms %> -

+

<%= page_entries_info @debates %> <%= t("debates.index.search_results", count: @debates.size, search_term: @search_terms) %>

<% elsif @tag_filter %> -

+

<%= page_entries_info @debates %> <%= t("debates.index.filter_topic", count: @debates.size, topic: @tag_filter) %>

<% end %>
-
- <% if @tag_filter || @search_terms %> -
- <%= t("debates.index.select_order") %> -
- <% else %> -

- <%= t("debates.index.select_order_long") %> -

- <% end %> + <% if @tag_filter || @search_terms %> +
+
+ <%= t("debates.index.select_order") %> +
+ <% else %> +
+

+ <%= t("debates.index.select_order_long") %> +

+ <% end %>