diff --git a/app/assets/stylesheets/participacion.scss b/app/assets/stylesheets/participacion.scss index 0b027001b..bd8759c98 100644 --- a/app/assets/stylesheets/participacion.scss +++ b/app/assets/stylesheets/participacion.scss @@ -16,6 +16,7 @@ // 14. Tables // 15. Social // 16. Pages +// 17. Verification // // 01. Variables @@ -126,6 +127,7 @@ h6 { } .button { + font-size: rem-calc(13); padding: rem-calc(15) rem-calc(32); } @@ -221,6 +223,11 @@ h6 { } } +.progress { + background-color: rgba(0,0,0,.06); + border: 0; +} + // 04. Header // - - - - - - - - - - - - - - - - - - - - - - - - - @@ -229,7 +236,7 @@ header { background-position: 50% 50%; background-size: cover; color: $text; - min-height: rem-calc(600); + min-height: rem-calc(624); &.results { min-height: rem-calc(48); @@ -543,9 +550,14 @@ footer { a { color: white; - &.link:hover { + &:hover { color: white; opacity: .5; + transition: opacity 275ms; + } + + &:active, &:focus { + color: white; } } @@ -554,7 +566,14 @@ footer { text-decoration: underline; &:hover { - color: rgba(255,255,255,.6); + color: white; + opacity: .5; + transition: opacity 275ms; + } + + &:active, &:focus { + color: white; + opacity: 1; } } } @@ -752,6 +771,13 @@ form { } } +.captcha { + + label { + display: none; + } +} + // 09. Alerts // - - - - - - - - - - - - - - - - - - - - - - - - - @@ -847,22 +873,8 @@ form { margin-right: rem-calc(12); } - .date { - - select { - float: left; - width: 25%; - } - } - .verify-account { padding-right: rem-calc(12); - - .verified { - color: $check; - font-weight: bold; - line-height: rem-calc(42); - } } } @@ -1122,13 +1134,23 @@ table { .page { background: white; - min-height: 100%; + min-height: rem-calc(600); .menu { margin-top: rem-calc(24); + ul { + list-style-type: none; + margin-left: 0; + + & ul { + margin-left: rem-calc(12); + } + } + a { display: block; + font-size: rem-calc(13); margin-bottom: rem-calc(12); } } @@ -1137,7 +1159,12 @@ table { margin-top: rem-calc(24); text-align: justify; - ul { + h1, h2, h3, h4, h5, h6 { + text-align: left; + } + + ul, ol { + margin-left: rem-calc(12); li { font-size: rem-calc(13); @@ -1147,7 +1174,91 @@ table { } } +// 17. Verification +// - - - - - - - - - - - - - - - - - - - - - - - - - +.verification { + min-height: 60%; + @media (min-width: $small-breakpoint) { + .left + .left { + margin-left: rem-calc(12); + } + } + .verify-account { + padding-right: rem-calc(12); + .verified { + color: $check; + font-weight: bold; + line-height: rem-calc(42); + } + } + + .date { + + select { + float: left; + width: 30%; + + @media (min-width: $small-breakpoint) { + width: 25%; + } + } + } + + .progress { + height: rem-calc(48); + + @media (min-width: $small-breakpoint) { + height: rem-calc(24); + } + + .meter { + background: #63D1C4; + } + } + + .verification-step { + font-size: rem-calc(11); + padding-top: rem-calc(10); + + @media (min-width: $small-breakpoint) { + line-height: $line-height; + padding-top: 0; + } + + &.active { + color: white; + } + + &.completed { + color: rgba(255,255,255,.5); + } + } + + .send-letter { + background: none; + color: $link; + + &:hover { + color: $link-hover; + } + } + + .button + form { + display: inline-block; + margin-left: rem-calc(12); + } + + .verification-list { + font-size: rem-calc(13); + list-style-type: none; + margin-left: 0; + + span { + display: inline-block; + } + } +} diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 23af8c91b..625452196 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -1,5 +1,4 @@ class AccountController < ApplicationController - before_action :authenticate_user! before_action :set_account load_and_authorize_resource class: "User" diff --git a/app/controllers/admin/comments_controller.rb b/app/controllers/admin/comments_controller.rb index 40f9b31dc..3ca25b23a 100644 --- a/app/controllers/admin/comments_controller.rb +++ b/app/controllers/admin/comments_controller.rb @@ -1,11 +1,10 @@ class Admin::CommentsController < Admin::BaseController - before_filter :set_valid_filters, only: :index - before_filter :parse_filter, only: :index + has_filters %w{all with_confirmed_hide} - before_filter :load_comment, only: [:confirm_hide, :restore] + before_action :load_comment, only: [:confirm_hide, :restore] def index - @comments = Comment.only_hidden.send(@filter).page(params[:page]) + @comments = Comment.only_hidden.send(@current_filter).page(params[:page]) end def confirm_hide @@ -23,13 +22,4 @@ class Admin::CommentsController < Admin::BaseController @comment = Comment.with_hidden.find(params[:id]) end - def set_valid_filters - @valid_filters = %w{all with_confirmed_hide} - end - - def parse_filter - @filter = params[:filter] - @filter = 'all' unless @valid_filters.include?(@filter) - end - end diff --git a/app/controllers/admin/debates_controller.rb b/app/controllers/admin/debates_controller.rb index 4487fcf81..da1acc7fe 100644 --- a/app/controllers/admin/debates_controller.rb +++ b/app/controllers/admin/debates_controller.rb @@ -1,11 +1,10 @@ class Admin::DebatesController < Admin::BaseController - before_filter :set_valid_filters, only: :index - before_filter :parse_filter, only: :index + has_filters %w{all with_confirmed_hide}, only: :index - before_filter :load_debate, only: [:confirm_hide, :restore] + before_action :load_debate, only: [:confirm_hide, :restore] def index - @debates = Debate.only_hidden.send(@filter).page(params[:page]) + @debates = Debate.only_hidden.send(@current_filter).page(params[:page]) end def confirm_hide @@ -24,13 +23,4 @@ class Admin::DebatesController < Admin::BaseController @debate = Debate.with_hidden.find(params[:id]) end - def set_valid_filters - @valid_filters = %w{all with_confirmed_hide} - end - - def parse_filter - @filter = params[:filter] - @filter = 'all' unless @valid_filters.include?(@filter) - end - end diff --git a/app/controllers/admin/moderators_controller.rb b/app/controllers/admin/moderators_controller.rb index f2ef6f1c3..e15e9273f 100644 --- a/app/controllers/admin/moderators_controller.rb +++ b/app/controllers/admin/moderators_controller.rb @@ -1,5 +1,4 @@ class Admin::ModeratorsController < Admin::BaseController - load_and_authorize_resource def index diff --git a/app/controllers/admin/organizations_controller.rb b/app/controllers/admin/organizations_controller.rb index bb623702a..e5ba390e1 100644 --- a/app/controllers/admin/organizations_controller.rb +++ b/app/controllers/admin/organizations_controller.rb @@ -1,11 +1,10 @@ class Admin::OrganizationsController < Admin::BaseController - before_filter :set_valid_filters, only: :index - before_filter :parse_filter, only: :index + has_filters %w{all pending verified rejected}, only: :index load_and_authorize_resource except: :search def index - @organizations = @organizations.send(@filter) + @organizations = @organizations.send(@current_filter) @organizations = @organizations.includes(:user).order(:name, 'users.email').page(params[:page]) end @@ -23,14 +22,4 @@ class Admin::OrganizationsController < Admin::BaseController redirect_to request.query_parameters.merge(action: :index) end - private - def set_valid_filters - @valid_filters = %w{all pending verified rejected} - end - - def parse_filter - @filter = params[:filter] - @filter = 'all' unless @valid_filters.include?(@filter) - end - end diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index 61c0f5650..8bbbcdc8c 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -1,11 +1,10 @@ class Admin::UsersController < Admin::BaseController - before_filter :set_valid_filters, only: :index - before_filter :parse_filter, only: :index + has_filters %w{all with_confirmed_hide}, only: :index - before_filter :load_user, only: [:confirm_hide, :restore] + before_action :load_user, only: [:confirm_hide, :restore] def index - @users = User.only_hidden.send(@filter).page(params[:page]) + @users = User.only_hidden.send(@current_filter).page(params[:page]) end def show @@ -30,13 +29,4 @@ class Admin::UsersController < Admin::BaseController @user = User.with_hidden.find(params[:id]) end - def set_valid_filters - @valid_filters = %w{all with_confirmed_hide} - end - - def parse_filter - @filter = params[:filter] - @filter = 'all' unless @valid_filters.include?(@filter) - end - end diff --git a/app/controllers/api/stats_controller.rb b/app/controllers/api/stats_controller.rb index d44262b45..fc0bf3563 100644 --- a/app/controllers/api/stats_controller.rb +++ b/app/controllers/api/stats_controller.rb @@ -1,4 +1,5 @@ class Api::StatsController < Api::ApiController + def show unless params[:events].present? || params[:visits].present? return render json: {}, status: :bad_request @@ -19,4 +20,5 @@ class Api::StatsController < Api::ApiController render json: ds.build end + end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 5d207e463..d5b05c6ae 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,29 +1,28 @@ require "application_responder" class ApplicationController < ActionController::Base - before_filter :authenticate_http_basic - - before_filter :authenticate_user!, unless: :devise_controller?, if: :beta_site? - before_filter :authenticate_beta_tester!, unless: :devise_controller?, if: :beta_site? - - check_authorization unless: :devise_controller? include SimpleCaptcha::ControllerHelpers - self.responder = ApplicationResponder - respond_to :html + include HasFilters - before_action :set_locale - layout :set_layout - - # Prevent CSRF attacks by raising an exception. - # For APIs, you may want to use :null_session instead. - protect_from_forgery with: :exception + before_action :authenticate_http_basic + before_action :authenticate_user!, unless: :devise_controller?, if: :beta_site? + before_action :authenticate_beta_tester!, unless: :devise_controller?, if: :beta_site? before_action :ensure_signup_complete + before_action :set_locale + + check_authorization unless: :devise_controller? + self.responder = ApplicationResponder + + protect_from_forgery with: :exception rescue_from CanCan::AccessDenied do |exception| redirect_to main_app.root_url, alert: exception.message end + layout :set_layout + respond_to :html + private def authenticate_http_basic diff --git a/app/controllers/concerns/has_filters.rb b/app/controllers/concerns/has_filters.rb new file mode 100644 index 000000000..eeca1745f --- /dev/null +++ b/app/controllers/concerns/has_filters.rb @@ -0,0 +1,13 @@ +module HasFilters + extend ActiveSupport::Concern + + class_methods do + def has_filters(valid_filters, *args) + before_action(*args) do + @valid_filters = valid_filters + @current_filter = params[:filter] + @current_filter = @valid_filters.first unless @valid_filters.include?(@current_filter) + end + end + end +end diff --git a/app/controllers/debates_controller.rb b/app/controllers/debates_controller.rb index a9e7325eb..3845afebf 100644 --- a/app/controllers/debates_controller.rb +++ b/app/controllers/debates_controller.rb @@ -1,14 +1,16 @@ class DebatesController < ApplicationController - before_action :parse_order, :parse_tag_filter, only: :index + before_action :parse_order, only: :index + before_action :parse_tag_filter, only: :index before_action :authenticate_user!, except: [:index, :show] load_and_authorize_resource respond_to :html, :js def index - @debates = Debate.search(params).page(params[:page]).for_render.send("sort_by_#{@order}") - @tags = ActsAsTaggableOn::Tag.all - @tag_cloud = Debate.tag_counts.order('count desc, name asc') + @debates = Debate.all + @debates = @debates.tagged_with(@tag_filter) if @tag_filter + @debates = @debates.page(params[:page]).for_render.send("sort_by_#{@order}") + @tag_cloud = Debate.tag_counts.order(taggings_count: :desc, name: :asc).limit(20) set_debate_votes(@debates) end @@ -85,8 +87,9 @@ class DebatesController < ApplicationController end def parse_tag_filter - valid_tags = ActsAsTaggableOn::Tag.all.map(&:name) - @tag_filter = params[:tag] if valid_tags.include?(params[:tag]) + if params[:tag].present? + @tag_filter = params[:tag] if ActsAsTaggableOn::Tag.where(name: params[:tag]).exists? + end end end diff --git a/app/controllers/moderation/base_controller.rb b/app/controllers/moderation/base_controller.rb index f2a794526..de0c46a79 100644 --- a/app/controllers/moderation/base_controller.rb +++ b/app/controllers/moderation/base_controller.rb @@ -2,9 +2,9 @@ class Moderation::BaseController < ApplicationController layout 'admin' before_action :authenticate_user! + before_action :verify_moderator skip_authorization_check - before_action :verify_moderator private diff --git a/app/controllers/moderation/comments_controller.rb b/app/controllers/moderation/comments_controller.rb index 3622d02ac..b53785e81 100644 --- a/app/controllers/moderation/comments_controller.rb +++ b/app/controllers/moderation/comments_controller.rb @@ -1,12 +1,12 @@ class Moderation::CommentsController < Moderation::BaseController - before_filter :set_valid_filters, only: :index - before_filter :parse_filter, only: :index - before_filter :load_comments, only: :index + has_filters %w{all pending_flag_review with_ignored_flag}, only: :index + + before_action :load_comments, only: :index load_and_authorize_resource def index - @comments = @comments.send(@filter) + @comments = @comments.send(@current_filter) @comments = @comments.page(params[:page]) end @@ -30,13 +30,4 @@ class Moderation::CommentsController < Moderation::BaseController @comments = Comment.accessible_by(current_ability, :hide).flagged.sorted_for_moderation.includes(:commentable) end - def set_valid_filters - @valid_filters = %w{all pending_flag_review with_ignored_flag} - end - - def parse_filter - @filter = params[:filter] - @filter = 'all' unless @valid_filters.include?(@filter) - end - end diff --git a/app/controllers/moderation/debates_controller.rb b/app/controllers/moderation/debates_controller.rb index abb8e964b..85441d3f2 100644 --- a/app/controllers/moderation/debates_controller.rb +++ b/app/controllers/moderation/debates_controller.rb @@ -1,13 +1,12 @@ class Moderation::DebatesController < Moderation::BaseController - before_filter :set_valid_filters, only: :index - before_filter :parse_filter, only: :index - before_filter :load_debates, only: :index + has_filters %w{all pending_flag_review with_ignored_flag}, only: :index + + before_action :load_debates, only: :index load_and_authorize_resource def index - @debates = @debates.send(@filter) - @debates = @debates.page(params[:page]) + @debates = @debates.send(@current_filter).page(params[:page]) end def hide @@ -30,13 +29,4 @@ class Moderation::DebatesController < Moderation::BaseController @debates = Debate.accessible_by(current_ability, :hide).flagged.sorted_for_moderation end - def set_valid_filters - @valid_filters = %w{all pending_flag_review with_ignored_flag} - end - - def parse_filter - @filter = params[:filter] - @filter = 'all' unless @valid_filters.include?(@filter) - end - end diff --git a/app/controllers/organizations/registrations_controller.rb b/app/controllers/organizations/registrations_controller.rb index 630cc64e4..6445622e2 100644 --- a/app/controllers/organizations/registrations_controller.rb +++ b/app/controllers/organizations/registrations_controller.rb @@ -1,4 +1,5 @@ class Organizations::RegistrationsController < Devise::RegistrationsController + def new super do |user| user.build_organization diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index 845f82920..11f715960 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -1,25 +1,36 @@ class PagesController < ApplicationController - skip_authorization_check - def help + def census_terms end - def privacy + def conditions end - def legal + def cooming_soon end def general_terms end - def census_terms + def how_it_works end - def transparency + def how_to_use + end + + def more_information end def opendata end + + def participation + end + + def privacy + end + + def transparency + end end diff --git a/app/controllers/stats_controller.rb b/app/controllers/stats_controller.rb index 1e76feb42..fe224eb8d 100644 --- a/app/controllers/stats_controller.rb +++ b/app/controllers/stats_controller.rb @@ -1,6 +1,6 @@ class StatsController < ApplicationController - skip_authorization_check before_action :verify_administrator + skip_authorization_check def show @event_types = Ahoy::Event.select(:name).uniq.pluck(:name) diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb index 8588ba243..423ecedad 100644 --- a/app/controllers/users/omniauth_callbacks_controller.rb +++ b/app/controllers/users/omniauth_callbacks_controller.rb @@ -1,4 +1,5 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController + def self.provides_callback_for(provider) class_eval %Q{ def #{provider} @@ -26,4 +27,5 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController finish_signup_path end end + end diff --git a/app/controllers/users/registrations_controller.rb b/app/controllers/users/registrations_controller.rb index 7c8ad9535..112d8f8b0 100644 --- a/app/controllers/users/registrations_controller.rb +++ b/app/controllers/users/registrations_controller.rb @@ -1,5 +1,5 @@ class Users::RegistrationsController < Devise::RegistrationsController - prepend_before_filter :authenticate_scope!, only: [:edit, :update, :destroy, :finish_signup, :do_finish_signup] + prepend_before_action :authenticate_scope!, only: [:edit, :update, :destroy, :finish_signup, :do_finish_signup] def create build_resource(sign_up_params) diff --git a/app/controllers/verification/letter_controller.rb b/app/controllers/verification/letter_controller.rb index 401ae0ed2..e302a1bc6 100644 --- a/app/controllers/verification/letter_controller.rb +++ b/app/controllers/verification/letter_controller.rb @@ -1,7 +1,7 @@ class Verification::LetterController < ApplicationController before_action :authenticate_user! before_action :verify_resident! - before_action :verify_phone_or_email! + before_action :verify_phone! skip_authorization_check def new @@ -11,22 +11,37 @@ class Verification::LetterController < ApplicationController def create @letter = Verification::Letter.new(user: current_user) if @letter.save - redirect_to account_path, notice: t('verification.letter.create.flash.success') + redirect_to edit_letter_path, notice: t('verification.letter.create.flash.success') else flash.now.alert = t('verification.letter.create.alert.failure') render :new end end + def edit + @letter = Verification::Letter.new(user: current_user) + end + + def update + @letter = Verification::Letter.new(letter_params.merge(user: current_user)) + if @letter.verify? + current_user.update(verified_at: Time.now) + redirect_to account_path, notice: t('verification.letter.update.flash.success') + else + @error = t('verification.letter.update.error') + render :edit + end + end + private def letter_params - params.require(:letter).permit() + params.require(:letter).permit(:verification_code) end - def verify_phone_or_email! + def verify_phone! unless current_user.confirmed_phone? - redirect_to verified_user_path, alert: t('verification.letter.alert.unconfirmed_personal_data') + redirect_to verified_user_path, alert: t('verification.letter.alert.unconfirmed_code') end end end \ No newline at end of file diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 77afc1317..33fc7e0fa 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,4 +1,5 @@ module ApplicationHelper + def percentage(vote, debate) return "0%" if debate.total_votes == 0 debate.send(vote).percent_of(debate.total_votes).to_s + "%" diff --git a/app/helpers/cache_keys_helper.rb b/app/helpers/cache_keys_helper.rb index 9aa6000cc..38445ae02 100644 --- a/app/helpers/cache_keys_helper.rb +++ b/app/helpers/cache_keys_helper.rb @@ -1,4 +1,5 @@ module CacheKeysHelper + def locale_and_user_status @cache_key_user ||= calculate_user_status "#{I18n.locale}/#{@cache_key_user}" @@ -17,4 +18,5 @@ module CacheKeysHelper user_status end + end \ No newline at end of file diff --git a/app/helpers/flags_helper.rb b/app/helpers/flags_helper.rb index b54c86b48..b5ba67f41 100644 --- a/app/helpers/flags_helper.rb +++ b/app/helpers/flags_helper.rb @@ -1,4 +1,5 @@ module FlagsHelper + def show_flag_action?(flaggable) current_user && !own_flaggable?(flaggable) && !flagged?(flaggable) end @@ -24,4 +25,5 @@ module FlagsHelper flaggable.author_id == current_user.id end end + end diff --git a/app/helpers/stats_helper.rb b/app/helpers/stats_helper.rb index e517767e3..b852afe9c 100644 --- a/app/helpers/stats_helper.rb +++ b/app/helpers/stats_helper.rb @@ -1,4 +1,5 @@ module StatsHelper + def events_chart_tag(events, opt={}) events = events.join(',') if events.is_a? Array opt[:data] ||= {} diff --git a/app/models/debate.rb b/app/models/debate.rb index 6f0543caf..61e6546b4 100644 --- a/app/models/debate.rb +++ b/app/models/debate.rb @@ -35,14 +35,6 @@ class Debate < ActiveRecord::Base # Ahoy setup visitable # Ahoy will automatically assign visit_id on create - def self.search(params) - if params[:tag] - tagged_with(params[:tag]) - else - all - end - end - def likes cached_votes_up end diff --git a/app/models/flag.rb b/app/models/flag.rb index a8be6da76..2d13d26d9 100644 --- a/app/models/flag.rb +++ b/app/models/flag.rb @@ -1,5 +1,4 @@ class Flag < ActiveRecord::Base - belongs_to :user belongs_to :flaggable, polymorphic: true, counter_cache: true diff --git a/app/models/organization.rb b/app/models/organization.rb index a4561ba7f..fa991fc05 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -1,5 +1,4 @@ class Organization < ActiveRecord::Base - belongs_to :user validates :name, presence: true diff --git a/app/models/setting.rb b/app/models/setting.rb index 8e1504bf3..f696ceefd 100644 --- a/app/models/setting.rb +++ b/app/models/setting.rb @@ -1,5 +1,4 @@ class Setting < ActiveRecord::Base - validates :key, presence: true, uniqueness: true default_scope { order(key: :desc) } diff --git a/app/models/verification/letter.rb b/app/models/verification/letter.rb index 566fe1fd7..077890600 100644 --- a/app/models/verification/letter.rb +++ b/app/models/verification/letter.rb @@ -1,16 +1,12 @@ class Verification::Letter include ActiveModel::Model - attr_accessor :user, :address + attr_accessor :user, :address, :verification_code validates :user, presence: true validates :address, presence: true validate :correct_address - def initialize(attrs={}) - @user = attrs[:user] - end - def save valid? && letter_requested! && @@ -22,7 +18,11 @@ class Verification::Letter end def letter_requested! - user.update(letter_requested_at: Time.now) + user.update(letter_requested_at: Time.now, letter_verification_code: four_digit_code) + end + + def verify? + user.letter_verification_code == verification_code end def update_user_address @@ -50,4 +50,8 @@ class Verification::Letter district: address[:nombre_distrito] } end + def four_digit_code + rand.to_s[2..5] + end + end diff --git a/app/models/verified_user.rb b/app/models/verified_user.rb index ca32eea5c..2113ef238 100644 --- a/app/models/verified_user.rb +++ b/app/models/verified_user.rb @@ -1,4 +1,3 @@ -# make sure document_type is being stored and queried in the correct format (Is it DNI? a number, a string?) class VerifiedUser < ActiveRecord::Base scope :by_user, -> (user) { where(document_number: user.document_number, document_type: user.document_type) } diff --git a/app/views/account/show.html.erb b/app/views/account/show.html.erb index bf749bbd2..41ae068c0 100644 --- a/app/views/account/show.html.erb +++ b/app/views/account/show.html.erb @@ -1,21 +1,26 @@
- <%= link_to t("account.show.change_credentials_link"), edit_user_registration_path, class: 'button radius small secondary right' %> + <%= link_to t("account.show.change_credentials_link"), edit_user_registration_path, class: "button radius small secondary right" %> - +
+ +

<%= t("account.show.title") %>

<%= form_for @account, as: :account, url: account_path do |f| %> - <%= render 'shared/errors', resource: @account %> + <%= render "shared/errors", resource: @account %>
diff --git a/app/views/admin/comments/index.html.erb b/app/views/admin/comments/index.html.erb index 87178c66b..f0639047f 100644 --- a/app/views/admin/comments/index.html.erb +++ b/app/views/admin/comments/index.html.erb @@ -1,17 +1,6 @@

<%= t("admin.comments.index.title") %>

- +<%= render 'shared/filter_subnav', i18n_namespace: "admin.comments.index" %>

<%= page_entries_info @comments %>

diff --git a/app/views/admin/debates/index.html.erb b/app/views/admin/debates/index.html.erb index 9ac89b5e1..7caa8ecc3 100644 --- a/app/views/admin/debates/index.html.erb +++ b/app/views/admin/debates/index.html.erb @@ -1,17 +1,6 @@

<%= t("admin.debates.index.title") %>

- +<%= render 'shared/filter_subnav', i18n_namespace: "admin.debates.index" %>

<%= page_entries_info @debates %>

diff --git a/app/views/admin/organizations/index.html.erb b/app/views/admin/organizations/index.html.erb index 524d65a68..464168746 100644 --- a/app/views/admin/organizations/index.html.erb +++ b/app/views/admin/organizations/index.html.erb @@ -13,18 +13,7 @@ <% end %> - +<%= render 'shared/filter_subnav', i18n_namespace: "admin.organizations.index" %>

<%= page_entries_info @organizations %>

diff --git a/app/views/admin/users/index.html.erb b/app/views/admin/users/index.html.erb index b6f3f1cfe..0d18c8b61 100644 --- a/app/views/admin/users/index.html.erb +++ b/app/views/admin/users/index.html.erb @@ -1,17 +1,6 @@

<%= t("admin.users.index.title") %>

- +<%= render 'shared/filter_subnav', i18n_namespace: "admin.users.index" %>

<%= page_entries_info @users %>

diff --git a/app/views/debates/_form.html.erb b/app/views/debates/_form.html.erb index 096d88b22..dd4ed2e29 100644 --- a/app/views/debates/_form.html.erb +++ b/app/views/debates/_form.html.erb @@ -4,14 +4,12 @@
<%= f.label :title, t("debates.form.debate_title") %> - <%= t("debates.form.title_instructions") %> - <%= f.text_field :title, maxlength: Debate::TITLE_LENGTH, placeholder: t("debates.form.debate_title") %> + <%= f.text_field :title, maxlength: Debate::TITLE_LENGTH, placeholder: t("debates.form.debate_title"), label: false %>
<%= f.label :description, t("debates.form.debate_text") %> - <%= t("debates.form.text_instructions") %> - <%= f.cktext_area :description, ckeditor: { language: I18n.locale } %> + <%= f.cktext_area :description, ckeditor: { language: I18n.locale }, label: false %>
@@ -22,7 +20,7 @@ <%= tag.name %> <% end %> - <%= f.text_field :tag_list, value: @debate.tag_list.to_s %> + <%= f.text_field :tag_list, value: @debate.tag_list.to_s, label: false %>
@@ -36,7 +34,7 @@
- <%= f.submit(class: "button radius") %> + <%= f.submit(class: "button radius", value: t("debates.form.start_debate")) %>
<% end %> diff --git a/app/views/debates/index.html.erb b/app/views/debates/index.html.erb index 701110af3..cd64b3819 100644 --- a/app/views/debates/index.html.erb +++ b/app/views/debates/index.html.erb @@ -3,30 +3,24 @@
-
- <% if @tag_filter %> -

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

- <% else %> -

<%= t("debates.index.select_topic") %>

-
- -
- <% end %> -
+ <% if @tag_filter %> +
+

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

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