From 62071c50e01e3cded26936cecc710d53006b0213 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Mon, 12 Jun 2017 12:10:55 +0200 Subject: [PATCH 1/7] updates mail --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9e76ebda4..800b14763 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -234,7 +234,7 @@ GEM railties (>= 3.2) loofah (2.0.3) nokogiri (>= 1.5.9) - mail (2.6.6.rc1) + mail (2.6.6) mime-types (>= 1.16, < 4) mime-types (3.1) mime-types-data (~> 3.2015) @@ -551,4 +551,4 @@ DEPENDENCIES whenever BUNDLED WITH - 1.15.0 + 1.15.1 From 3f11dbe1d56773987f382d67b13985bf7ac1fd88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Mon, 12 Jun 2017 17:26:38 +0200 Subject: [PATCH 2/7] allows login using username or email --- app/models/user.rb | 14 +++++++++++++- app/views/devise/sessions/new.html.erb | 2 +- config/locales/activerecord.en.yml | 1 + config/locales/activerecord.es.yml | 1 + config/locales/devise_views.en.yml | 2 +- config/locales/devise_views.es.yml | 2 +- spec/features/users_auth_spec.rb | 14 +++++++++++++- 7 files changed, 31 insertions(+), 5 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 7d696297e..c9aae0143 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -3,7 +3,8 @@ class User < ActiveRecord::Base include Verification devise :database_authenticatable, :registerable, :confirmable, :recoverable, :rememberable, - :trackable, :validatable, :omniauthable, :async, :password_expirable, :secure_validatable + :trackable, :validatable, :omniauthable, :async, :password_expirable, :secure_validatable, + authentication_keys: [:login] acts_as_voter acts_as_paranoid column: :hidden_at @@ -48,6 +49,7 @@ class User < ActiveRecord::Base attr_accessor :skip_password_validation attr_accessor :use_redeemable_code + attr_accessor :login scope :administrators, -> { joins(:administrators) } scope :moderators, -> { joins(:moderator) } @@ -286,6 +288,16 @@ class User < ActiveRecord::Base end delegate :can?, :cannot?, to: :ability + # overwritting of Devise method to allow login using email OR username + def self.find_for_database_authentication(warden_conditions) + conditions = warden_conditions.dup + if login = conditions.delete(:login) + where(conditions.to_hash).where(["lower(email) = ? OR username = ?", login.downcase, login]).first + elsif conditions.has_key?(:username) || conditions.has_key?(:email) + where(conditions.to_hash).first + end + end + private def clean_document_number diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index 910135853..da8e74528 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -11,7 +11,7 @@ <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
- <%= f.email_field :email, autofocus: true, placeholder: t("devise_views.sessions.new.email_label") %> + <%= f.text_field :login, autofocus: true, placeholder: t("devise_views.sessions.new.login_label") %>
diff --git a/config/locales/activerecord.en.yml b/config/locales/activerecord.en.yml index c9fd00aab..d36a481ae 100644 --- a/config/locales/activerecord.en.yml +++ b/config/locales/activerecord.en.yml @@ -113,6 +113,7 @@ en: description: "Description" terms_of_service: "Terms of service" user: + login: "Email or username" email: "Email" username: "Username" password_confirmation: "Password confirmation" diff --git a/config/locales/activerecord.es.yml b/config/locales/activerecord.es.yml index 7b4fbebeb..f42577ef2 100644 --- a/config/locales/activerecord.es.yml +++ b/config/locales/activerecord.es.yml @@ -108,6 +108,7 @@ es: description: "Descripción" terms_of_service: "Términos de servicio" user: + login: Email o nombre de usuario email: "Correo electrónico" username: "Nombre de usuario" password_confirmation: "Confirmación de contraseña" diff --git a/config/locales/devise_views.en.yml b/config/locales/devise_views.en.yml index bcd1f1a77..4110fb60e 100755 --- a/config/locales/devise_views.en.yml +++ b/config/locales/devise_views.en.yml @@ -68,7 +68,7 @@ en: title: Forgotten password? sessions: new: - email_label: Email + login_label: Email or username password_label: Password remember_me: Remember me submit: Enter diff --git a/config/locales/devise_views.es.yml b/config/locales/devise_views.es.yml index be8aff97b..184454654 100644 --- a/config/locales/devise_views.es.yml +++ b/config/locales/devise_views.es.yml @@ -68,7 +68,7 @@ es: title: "¿Has olvidado tu contraseña?" sessions: new: - email_label: Email + login_label: Email o nombre de usuario password_label: Contraseña remember_me: Recordarme submit: Entrar diff --git a/spec/features/users_auth_spec.rb b/spec/features/users_auth_spec.rb index e978e7bd2..ce272684a 100644 --- a/spec/features/users_auth_spec.rb +++ b/spec/features/users_auth_spec.rb @@ -35,7 +35,19 @@ feature 'Users' do visit '/' click_link 'Sign in' - fill_in 'user_email', with: 'manuela@consul.dev' + fill_in 'user_login', with: 'manuela@consul.dev' + fill_in 'user_password', with: 'judgementday' + click_button 'Enter' + + expect(page).to have_content 'You have been signed in successfully.' + end + + scenario 'Sign in with username' do + create(:user, username: 'larry', email: 'manuela@consul.dev', password: 'judgementday') + + visit '/' + click_link 'Sign in' + fill_in 'user_login', with: 'larry' fill_in 'user_password', with: 'judgementday' click_button 'Enter' From ed30051653976daa06d3fa21c75ea7f23e49c456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Mon, 12 Jun 2017 18:54:39 +0200 Subject: [PATCH 3/7] avoids conflicts with users using email as username --- app/models/user.rb | 3 +- spec/features/users_auth_spec.rb | 117 ++++++++++++++++++++++--------- 2 files changed, 84 insertions(+), 36 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index c9aae0143..0eacd47bd 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -292,7 +292,8 @@ class User < ActiveRecord::Base def self.find_for_database_authentication(warden_conditions) conditions = warden_conditions.dup if login = conditions.delete(:login) - where(conditions.to_hash).where(["lower(email) = ? OR username = ?", login.downcase, login]).first + where(conditions.to_hash).where(["lower(email) = ?", login.downcase]).first || + where(conditions.to_hash).where(["username = ?", login]).first elsif conditions.has_key?(:username) || conditions.has_key?(:email) where(conditions.to_hash).first end diff --git a/spec/features/users_auth_spec.rb b/spec/features/users_auth_spec.rb index ce272684a..0e3d7b5e5 100644 --- a/spec/features/users_auth_spec.rb +++ b/spec/features/users_auth_spec.rb @@ -3,55 +3,102 @@ require 'rails_helper' feature 'Users' do context 'Regular authentication' do - scenario 'Sign up' do - visit '/' - click_link 'Register' + context 'Sign up' do - fill_in 'user_username', with: 'Manuela Carmena' - fill_in 'user_email', with: 'manuela@consul.dev' - fill_in 'user_password', with: 'judgementday' - fill_in 'user_password_confirmation', with: 'judgementday' - check 'user_terms_of_service' + scenario 'Success' do + visit '/' + click_link 'Register' - click_button 'Register' + fill_in 'user_username', with: 'Manuela Carmena' + fill_in 'user_email', with: 'manuela@consul.dev' + fill_in 'user_password', with: 'judgementday' + fill_in 'user_password_confirmation', with: 'judgementday' + check 'user_terms_of_service' - expect(page).to have_content "You have been sent a message containing a verification link. Please click on this link to activate your account." + click_button 'Register' - confirm_email + expect(page).to have_content "You have been sent a message containing a verification link. Please click on this link to activate your account." + + confirm_email + + expect(page).to have_content "Your account has been confirmed." + end + + scenario 'Errors on sign up' do + visit '/' + click_link 'Register' + click_button 'Register' + + expect(page).to have_content error_message + end - expect(page).to have_content "Your account has been confirmed." end - scenario 'Errors on sign up' do - visit '/' - click_link 'Register' - click_button 'Register' + context 'Sign in' do - expect(page).to have_content error_message - end + scenario 'sign in with email' do + create(:user, email: 'manuela@consul.dev', password: 'judgementday') - scenario 'Sign in' do - create(:user, email: 'manuela@consul.dev', password: 'judgementday') + visit '/' + click_link 'Sign in' + fill_in 'user_login', with: 'manuela@consul.dev' + fill_in 'user_password', with: 'judgementday' + click_button 'Enter' - visit '/' - click_link 'Sign in' - fill_in 'user_login', with: 'manuela@consul.dev' - fill_in 'user_password', with: 'judgementday' - click_button 'Enter' + expect(page).to have_content 'You have been signed in successfully.' + end - expect(page).to have_content 'You have been signed in successfully.' - end + scenario 'Sign in with username' do + create(:user, username: '👻👽👾🤖', email: 'ash@nostromo.dev', password: 'xenomorph') - scenario 'Sign in with username' do - create(:user, username: 'larry', email: 'manuela@consul.dev', password: 'judgementday') + visit '/' + click_link 'Sign in' + fill_in 'user_login', with: '👻👽👾🤖' + fill_in 'user_password', with: 'xenomorph' + click_button 'Enter' - visit '/' - click_link 'Sign in' - fill_in 'user_login', with: 'larry' - fill_in 'user_password', with: 'judgementday' - click_button 'Enter' + expect(page).to have_content 'You have been signed in successfully.' + end - expect(page).to have_content 'You have been signed in successfully.' + scenario 'Avoid username-email collisions' do + u1 = create(:user, username: 'Spidey', email: 'peter@nyc.dev', password: 'greatpower') + u2 = create(:user, username: 'peter@nyc.dev', email: 'venom@nyc.dev', password: 'symbiote') + + visit '/' + click_link 'Sign in' + fill_in 'user_login', with: 'peter@nyc.dev' + fill_in 'user_password', with: 'greatpower' + click_button 'Enter' + + expect(page).to have_content 'You have been signed in successfully.' + + visit account_path + + expect(page).to have_link 'My activity', href: user_path(u1) + + visit '/' + click_link 'Sign out' + + expect(page).to have_content 'You have been signed out successfully.' + + click_link 'Sign in' + fill_in 'user_login', with: 'peter@nyc.dev' + fill_in 'user_password', with: 'symbiote' + click_button 'Enter' + + expect(page).to_not have_content 'You have been signed in successfully.' + expect(page).to have_content 'Invalid login or password.' + + fill_in 'user_login', with: 'venom@nyc.dev' + fill_in 'user_password', with: 'symbiote' + click_button 'Enter' + + expect(page).to have_content 'You have been signed in successfully.' + + visit account_path + + expect(page).to have_link 'My activity', href: user_path(u2) + end end end From c4ba6a7e940c43053e21adb48da1b576bf3c343e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Mon, 12 Jun 2017 19:48:57 +0200 Subject: [PATCH 4/7] updates specs --- spec/features/account_spec.rb | 2 +- spec/features/moderation/users_spec.rb | 4 ++-- spec/features/welcome_spec.rb | 2 +- spec/support/common_actions.rb | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/features/account_spec.rb b/spec/features/account_spec.rb index ef24226f1..1ed0a4a01 100644 --- a/spec/features/account_spec.rb +++ b/spec/features/account_spec.rb @@ -138,6 +138,6 @@ feature 'Account' do login_through_form_as(@user) - expect(page).to have_content "Invalid email or password" + expect(page).to have_content "Invalid login or password" end end diff --git a/spec/features/moderation/users_spec.rb b/spec/features/moderation/users_spec.rb index 053d29590..e34b4383e 100644 --- a/spec/features/moderation/users_spec.rb +++ b/spec/features/moderation/users_spec.rb @@ -42,11 +42,11 @@ feature 'Moderate users' do visit root_path click_link 'Sign in' - fill_in 'user_email', with: citizen.email + fill_in 'user_login', with: citizen.email fill_in 'user_password', with: citizen.password click_button 'Enter' - expect(page).to have_content 'Invalid email or password' + expect(page).to have_content 'Invalid login or password' expect(current_path).to eq(new_user_session_path) end diff --git a/spec/features/welcome_spec.rb b/spec/features/welcome_spec.rb index 73cd65f5c..ce06befcc 100644 --- a/spec/features/welcome_spec.rb +++ b/spec/features/welcome_spec.rb @@ -18,7 +18,7 @@ feature "Welcome screen" do visit email_path(email_verification_token: encrypted) - fill_in 'user_email', with: user.email + fill_in 'user_login', with: user.email fill_in 'user_password', with: user.password click_button 'Enter' diff --git a/spec/support/common_actions.rb b/spec/support/common_actions.rb index e0fdfe425..327943931 100644 --- a/spec/support/common_actions.rb +++ b/spec/support/common_actions.rb @@ -18,7 +18,7 @@ module CommonActions visit root_path click_link 'Sign in' - fill_in 'user_email', with: user.email + fill_in 'user_login', with: user.email fill_in 'user_password', with: user.password click_button 'Enter' From 2f895d2f6be3c1ef7f60cd50eb8378b19475d8b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Tue, 13 Jun 2017 12:22:48 +0200 Subject: [PATCH 5/7] removes else case --- app/models/user.rb | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index 0eacd47bd..a9318aed0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -291,12 +291,9 @@ class User < ActiveRecord::Base # overwritting of Devise method to allow login using email OR username def self.find_for_database_authentication(warden_conditions) conditions = warden_conditions.dup - if login = conditions.delete(:login) - where(conditions.to_hash).where(["lower(email) = ?", login.downcase]).first || - where(conditions.to_hash).where(["username = ?", login]).first - elsif conditions.has_key?(:username) || conditions.has_key?(:email) - where(conditions.to_hash).first - end + login = conditions.delete(:login) + where(conditions.to_hash).where(["lower(email) = ?", login.downcase]).first || + where(conditions.to_hash).where(["username = ?", login]).first end private From b1fa2d22f7654e3faec80b6da33b5137c8cb8594 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Tue, 13 Jun 2017 12:59:04 +0200 Subject: [PATCH 6/7] only count active users in stats --- app/controllers/admin/stats_controller.rb | 10 ++--- spec/features/admin/stats_spec.rb | 52 ++++++++++++++++++----- 2 files changed, 47 insertions(+), 15 deletions(-) diff --git a/app/controllers/admin/stats_controller.rb b/app/controllers/admin/stats_controller.rb index 9989da796..5a50d03b4 100644 --- a/app/controllers/admin/stats_controller.rb +++ b/app/controllers/admin/stats_controller.rb @@ -13,11 +13,11 @@ class Admin::StatsController < Admin::BaseController @comment_votes = Vote.where(votable_type: 'Comment').count @votes = Vote.count - @user_level_two = User.with_hidden.level_two_verified.count - @user_level_three = User.with_hidden.level_three_verified.count - @verified_users = User.with_hidden.level_two_or_three_verified.count - @unverified_users = User.with_hidden.unverified.count - @users = User.with_hidden.count + @user_level_two = User.active.level_two_verified.count + @user_level_three = User.active.level_three_verified.count + @verified_users = User.active.level_two_or_three_verified.count + @unverified_users = User.active.unverified.count + @users = User.active.count @user_ids_who_voted_proposals = ActsAsVotable::Vote.where(votable_type: 'Proposal').distinct.count(:voter_id) @user_ids_who_didnt_vote_proposals = @verified_users - @user_ids_who_voted_proposals @spending_proposals = SpendingProposal.count diff --git a/spec/features/admin/stats_spec.rb b/spec/features/admin/stats_spec.rb index 7f343d1bc..c0aefe4e5 100644 --- a/spec/features/admin/stats_spec.rb +++ b/spec/features/admin/stats_spec.rb @@ -42,7 +42,11 @@ feature 'Stats' do expect(page).to have_content "Total votes 6" end - scenario 'Users' do + end + + context "Users" do + + scenario 'Summary' do 1.times { create(:user, :level_three) } 2.times { create(:user, :level_two) } 3.times { create(:user) } @@ -56,18 +60,46 @@ feature 'Stats' do expect(page).to have_content "Total users 7" end - end + scenario "Do not count erased users" do + 1.times { create(:user, :level_three, erased_at: Time.current) } + 2.times { create(:user, :level_two, erased_at: Time.current) } + 3.times { create(:user, erased_at: Time.current) } - scenario 'Level 2 user' do - create(:geozone) - visit account_path - click_link 'Verify my account' - verify_residence - confirm_phone + visit admin_stats_path - visit admin_stats_path + expect(page).to have_content "Level three users 0" + expect(page).to have_content "Level two users 0" + expect(page).to have_content "Verified users 0" + expect(page).to have_content "Unverified users 1" + expect(page).to have_content "Total users 1" + end + + scenario "Do not count hidden users" do + 1.times { create(:user, :level_three, hidden_at: Time.current) } + 2.times { create(:user, :level_two, hidden_at: Time.current) } + 3.times { create(:user, hidden_at: Time.current) } + + visit admin_stats_path + + expect(page).to have_content "Level three users 0" + expect(page).to have_content "Level two users 0" + expect(page).to have_content "Verified users 0" + expect(page).to have_content "Unverified users 1" + expect(page).to have_content "Total users 1" + end + + scenario 'Level 2 user Graph' do + create(:geozone) + visit account_path + click_link 'Verify my account' + verify_residence + confirm_phone + + visit admin_stats_path + + expect(page).to have_content "Level 2 User (1)" + end - expect(page).to have_content "Level 2 User (1)" end context "Proposal notifications" do From 3bcfaeb61acb01c007515c876daa43c2d00bcf4f Mon Sep 17 00:00:00 2001 From: decabeza Date: Tue, 13 Jun 2017 17:51:57 +0200 Subject: [PATCH 7/7] replaces sr-only class to show-for-sr --- app/assets/javascripts/social_share.js.coffee | 2 +- app/assets/stylesheets/layout.scss | 11 ----------- app/helpers/layouts_helper.rb | 2 +- .../ballot/_investment_for_sidebar.html.erb | 2 +- .../budgets/results/_results_table.html.erb | 4 ++-- app/views/comments/_comment.html.erb | 4 ++-- app/views/comments/_votes.html.erb | 16 ++++++++-------- app/views/debates/_votes.html.erb | 8 ++++---- app/views/debates/index.html.erb | 2 +- app/views/devise/menu/_login_items.html.erb | 2 +- app/views/layouts/_footer.html.erb | 12 ++++++------ app/views/layouts/application.html.erb | 2 +- .../legislation/shared/_share_buttons.html.erb | 2 +- app/views/pages/accessibility.html.erb | 4 ++-- app/views/polls/_poll_group.html.erb | 10 +++++----- app/views/proposals/index.html.erb | 2 +- .../sandbox/admin_legislation_index.html.erb | 2 +- .../sandbox/legislation_debate_quiz.html.erb | 10 +++++----- app/views/shared/_filter_subnav.html.erb | 2 +- .../shared/_filter_subnav_vertical.html.erb | 2 +- app/views/shared/_order_selector.html.erb | 2 +- app/views/shared/_search_form.html.erb | 6 +++--- app/views/shared/_social_share.html.erb | 2 +- app/views/spending_proposals/index.html.erb | 2 +- app/views/verification/residence/new.html.erb | 2 +- 25 files changed, 52 insertions(+), 63 deletions(-) diff --git a/app/assets/javascripts/social_share.js.coffee b/app/assets/javascripts/social_share.js.coffee index a61f2d8f4..823488fe8 100644 --- a/app/assets/javascripts/social_share.js.coffee +++ b/app/assets/javascripts/social_share.js.coffee @@ -4,4 +4,4 @@ App.SocialShare = $(".social-share-button a").each -> element = $(this) site = element.data('site') - element.append("#{site}") \ No newline at end of file + element.append("#{site}") \ No newline at end of file diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index 77de0628c..bf62319c4 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -183,17 +183,6 @@ a { } } -.sr-only { - position: absolute; - width: 1px; - height: 1px; - padding: 0; - margin: -1px; - overflow: hidden; - clip: rect(0, 0, 0, 0); - border: 0; -} - .menu.simple { border-bottom: 1px solid $border; margin: $line-height 0; diff --git a/app/helpers/layouts_helper.rb b/app/helpers/layouts_helper.rb index 40c8b0b98..b6da582b5 100644 --- a/app/helpers/layouts_helper.rb +++ b/app/helpers/layouts_helper.rb @@ -2,7 +2,7 @@ module LayoutsHelper def layout_menu_link_to(text, path, is_active, options) if is_active - content_tag(:span, t('shared.you_are_in'), class: 'sr-only') + ' ' + + content_tag(:span, t('shared.you_are_in'), class: 'show-for-sr') + ' ' + link_to(text, path, options.merge(class: "active")) else link_to(text, path, options) diff --git a/app/views/budgets/ballot/_investment_for_sidebar.html.erb b/app/views/budgets/ballot/_investment_for_sidebar.html.erb index 5dc288aaa..b7b1d1242 100644 --- a/app/views/budgets/ballot/_investment_for_sidebar.html.erb +++ b/app/views/budgets/ballot/_investment_for_sidebar.html.erb @@ -9,7 +9,7 @@ class: "remove-investment-project", method: :delete, remote: true do %> - <%= t('budgets.ballots.show.remove') %> + <%= t('budgets.ballots.show.remove') %> <% end %> <% end %> diff --git a/app/views/budgets/results/_results_table.html.erb b/app/views/budgets/results/_results_table.html.erb index 9024899b6..9c40a1d22 100644 --- a/app/views/budgets/results/_results_table.html.erb +++ b/app/views/budgets/results/_results_table.html.erb @@ -40,13 +40,13 @@ <% if investment.winner? %> - + <%= t("budgets.results.accepted") %> <% else %> - + <%= t("budgets.results.discarded") %> diff --git a/app/views/comments/_comment.html.erb b/app/views/comments/_comment.html.erb index 969995ee0..c22e7aa19 100644 --- a/app/views/comments/_comment.html.erb +++ b/app/views/comments/_comment.html.erb @@ -73,8 +73,8 @@ <% if comment.children.size > 0 %> <%= link_to "#{dom_id(comment)}", class: "js-toggle-children relative", data: {'id': "#{dom_id(comment)}"} do %> - - <%= t("shared.hide") %> + + <%= t("shared.hide") %> <%= t("comments.comment.responses", count: comment.children.size) %> <% end %> <% else %> diff --git a/app/views/comments/_votes.html.erb b/app/views/comments/_votes.html.erb index 93af5b2dd..5b97d2242 100644 --- a/app/views/comments/_votes.html.erb +++ b/app/views/comments/_votes.html.erb @@ -8,13 +8,13 @@ <%= link_to vote_comment_path(comment, value: 'yes'), method: "post", remote: true, title: t('votes.agree') do %> - <%= t('votes.agree') %> + <%= t('votes.agree') %> <% end %> <% else %> <%= link_to new_user_session_path do %> - <%= t('votes.agree') %> + <%= t('votes.agree') %> <% end %> <% end %> @@ -26,12 +26,12 @@ <%= link_to vote_comment_path(comment, value: 'no'), method: "post", remote: true, title: t('votes.disagree') do %> - <%= t('votes.disagree') %> + <%= t('votes.disagree') %> <% end %> <% else %> - <%= t('votes.disagree') %> + <%= t('votes.disagree') %> <% end %> <%= comment.total_dislikes %> @@ -48,13 +48,13 @@ <%= link_to vote_comment_path(comment, value: 'yes'), method: "post", remote: true, title: t('votes.agree') do %> - <%= t('votes.agree') %> + <%= t('votes.agree') %> <% end %> <% else %> <%= link_to new_user_session_path do %> - <%= t('votes.agree') %> + <%= t('votes.agree') %> <% end %> <% end %> @@ -66,13 +66,13 @@ <%= link_to vote_comment_path(comment, value: 'no'), method: "post", remote: true, title: t('votes.disagree') do %> - <%= t('votes.disagree') %> + <%= t('votes.disagree') %> <% end %> <% else %> <%= link_to new_user_session_path do %> - <%= t('votes.disagree') %> + <%= t('votes.disagree') %> <% end %> <% end %> diff --git a/app/views/debates/_votes.html.erb b/app/views/debates/_votes.html.erb index 9bc3ca555..9430d4a22 100644 --- a/app/views/debates/_votes.html.erb +++ b/app/views/debates/_votes.html.erb @@ -5,14 +5,14 @@ <%= link_to vote_debate_path(debate, value: 'yes'), class: "like #{voted_classes[:in_favor]}", title: t('votes.agree'), method: "post", remote: true do %> - <%= t('votes.agree') %> + <%= t('votes.agree') %> <%= votes_percentage('likes', debate) %> <% end %> <% else %> @@ -25,14 +25,14 @@ <% if user_signed_in? %> <%= link_to vote_debate_path(debate, value: 'no'), class: "unlike #{voted_classes[:against]}", title: t('votes.disagree'), method: "post", remote: true do %> - <%= t('votes.disagree') %> + <%= t('votes.disagree') %> <%= votes_percentage('dislikes', debate) %> <% end %> <% else %>
- <%= t('votes.disagree') %> + <%= t('votes.disagree') %> <%= votes_percentage('dislikes', debate) %>
diff --git a/app/views/debates/index.html.erb b/app/views/debates/index.html.erb index 73cafe392..b6356ffb2 100644 --- a/app/views/debates/index.html.erb +++ b/app/views/debates/index.html.erb @@ -9,7 +9,7 @@ <% end %>
-

<%= t("shared.outline.debates") %>

+

<%= t("shared.outline.debates") %>

<% if @search_terms || @advanced_search_terms || @tag_filter %>
diff --git a/app/views/devise/menu/_login_items.html.erb b/app/views/devise/menu/_login_items.html.erb index 5d493131d..ea2c6a44c 100644 --- a/app/views/devise/menu/_login_items.html.erb +++ b/app/views/devise/menu/_login_items.html.erb @@ -1,7 +1,7 @@ <% if user_signed_in? %>
  • <%= link_to notifications_path, rel: "nofollow", class: "notifications" do %> - <%= t("layouts.header.notifications") %> + <%= t("layouts.header.notifications") %> <% if current_user.notifications_count > 0 %>
  • <%= link_to "https://twitter.com/#{setting['twitter_handle']}", target: "_blank", title: t("shared.go_to_page") + t("social.twitter", org: setting['org_name']) + t('shared.target_blank_html') do %> - <%= t("social.twitter", org: setting['org_name']) %> + <%= t("social.twitter", org: setting['org_name']) %> <% end %>
  • @@ -59,7 +59,7 @@
  • <%= link_to "https://www.facebook.com/#{setting['facebook_handle']}/", target: "_blank", title: t("shared.go_to_page") + t("social.facebook", org: setting['org_name']) + t('shared.target_blank_html') do %> - <%= t("social.facebook", org: setting['org_name']) %> + <%= t("social.facebook", org: setting['org_name']) %> <% end %>
  • @@ -68,7 +68,7 @@
  • <%= link_to setting['blog_url'], target: "_blank", title: t("shared.go_to_page") + t("social.blog", org: setting['org_name']) + t('shared.target_blank_html') do %> - <%= t("social.blog", org: setting['org_name']) %> + <%= t("social.blog", org: setting['org_name']) %> <% end %>
  • @@ -77,7 +77,7 @@
  • <%= link_to "https://www.youtube.com/#{setting['youtube_handle']}", target: "_blank", title: t("shared.go_to_page") + t("social.youtube", org: setting['org_name']) + t('shared.target_blank_html') do %> - <%= t("social.youtube", org: setting['org_name']) %> + <%= t("social.youtube", org: setting['org_name']) %> <% end %>
  • @@ -86,7 +86,7 @@
  • <%= link_to "https://www.telegram.me/#{setting['telegram_handle']}", target: "_blank", title: t("shared.go_to_page") + t("social.telegram", org: setting['org_name']) + t('shared.target_blank_html') do %> - <%= t("social.telegram", org: setting['org_name']) %> + <%= t("social.telegram", org: setting['org_name']) %> <% end %>
  • @@ -95,7 +95,7 @@
  • <%= link_to "https://www.instagram.com/#{setting['instagram_handle']}", target: "_blank", title: t("shared.go_to_page") + t("social.instagram", org: setting['org_name']) + t('shared.target_blank_html') do %> - <%= t("social.instagram", org: setting['org_name']) %> + <%= t("social.instagram", org: setting['org_name']) %> <% end %>
  • diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index d410140e5..f88a4f136 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -26,7 +26,7 @@ <%= setting['per_page_code_body'].try(:html_safe) %> -

    <%= setting['org_name'] %>

    +

    <%= setting['org_name'] %>

    <%= render 'layouts/header' %> diff --git a/app/views/legislation/shared/_share_buttons.html.erb b/app/views/legislation/shared/_share_buttons.html.erb index 0486b9d2d..971402628 100644 --- a/app/views/legislation/shared/_share_buttons.html.erb +++ b/app/views/legislation/shared/_share_buttons.html.erb @@ -3,7 +3,7 @@ <% if browser.device.mobile? %> - <%= t("social.whatsapp") %> + <%= t("social.whatsapp") %> <% end %>
    diff --git a/app/views/pages/accessibility.html.erb b/app/views/pages/accessibility.html.erb index cd9af91a0..87ef99ffe 100644 --- a/app/views/pages/accessibility.html.erb +++ b/app/views/pages/accessibility.html.erb @@ -23,7 +23,7 @@
    - + @@ -63,7 +63,7 @@
    Atajos de teclado para el menú de navegaciónAtajos de teclado para el menú de navegación
    Tecla
    - + diff --git a/app/views/polls/_poll_group.html.erb b/app/views/polls/_poll_group.html.erb index f4dcc5423..6e0b85f16 100644 --- a/app/views/polls/_poll_group.html.erb +++ b/app/views/polls/_poll_group.html.erb @@ -4,7 +4,7 @@ <%= link_to poll, class: "icon-poll-answer can-answer", title: t("polls.index.can_answer") do %> - + <%= t("polls.index.can_answer") %> <% end %> @@ -12,7 +12,7 @@ <%= link_to new_user_session_path, class: "icon-poll-answer not-logged-in", title: t("polls.index.cant_answer_not_logged_in") do %> - + <%= t("polls.index.cant_answer_not_logged_in") %> <% end %> @@ -20,17 +20,17 @@ <%= link_to verification_path, class: "icon-poll-answer unverified", title: t("polls.index.cant_answer_verify") do %> - + <%= t("polls.index.cant_answer_verify") %> <% end %> <% elsif !poll.votable_by?(current_user) %>
    "> - <%= t("polls.index.already_answer") %> + <%= t("polls.index.already_answer") %>
    <% else %>
    "> - <%= t("polls.index.cant_answer") %> + <%= t("polls.index.cant_answer") %>
    <% end %>
    diff --git a/app/views/proposals/index.html.erb b/app/views/proposals/index.html.erb index 77a551fc6..e1c04c607 100644 --- a/app/views/proposals/index.html.erb +++ b/app/views/proposals/index.html.erb @@ -9,7 +9,7 @@ <% end %>
    -

    <%= t("shared.outline.proposals") %>

    +

    <%= t("shared.outline.proposals") %>

    <% if @search_terms || @advanced_search_terms || @tag_filter || params[:retired].present? %>
    diff --git a/app/views/sandbox/admin_legislation_index.html.erb b/app/views/sandbox/admin_legislation_index.html.erb index f4365116c..48bf0f950 100644 --- a/app/views/sandbox/admin_legislation_index.html.erb +++ b/app/views/sandbox/admin_legislation_index.html.erb @@ -9,7 +9,7 @@
    diff --git a/app/views/shared/_filter_subnav.html.erb b/app/views/shared/_filter_subnav.html.erb index 80767f4a7..7364015e2 100644 --- a/app/views/shared/_filter_subnav.html.erb +++ b/app/views/shared/_filter_subnav.html.erb @@ -1,5 +1,5 @@
    Combinación de teclas dependiendo del sistema operativo y navegadorCombinación de teclas dependiendo del sistema operativo y navegador
    Navegador