diff --git a/app/assets/stylesheets/foundation_and_overrides.scss b/app/assets/stylesheets/foundation_and_overrides.scss index 403d5566d..cd33ac92d 100644 --- a/app/assets/stylesheets/foundation_and_overrides.scss +++ b/app/assets/stylesheets/foundation_and_overrides.scss @@ -34,3 +34,4 @@ @include foundation-thumbnail; @include foundation-title-bar; @include foundation-top-bar; +@include foundation-menu-icon; diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss index 4add38b19..85b29861c 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -221,7 +221,6 @@ a { float: left; } -//<<<<<<< HEAD //.table-fixed { // table-layout: fixed; //======= @@ -261,9 +260,46 @@ a { // //.button.float-right ~ .button.float-right { // margin: 0 $line-height/2; -//>>>>>>> budget //} +.tabs-content { + border: 0; +} + +.tabs { + border: { + left: 0; + right: 0; + top: 0; + }; + margin-bottom: $line-height; + + .tabs-title > a { + color: $text-medium; + margin-bottom: rem-calc(-1); + margin-right: $line-height; + + &[aria-selected='true'], + &.is-active { + color: $brand; + border-bottom: 2px solid $brand; + font-weight: bold; + } + } + + h2, h3 { + font-size: $base-font-size; + } +} + +.no-max-width { + max-width: none; +} + +.button.float-right ~ .button.float-right { + margin: 0 $line-height/2; +} + .pagination .current { background: $brand; } diff --git a/app/controllers/admin/banners_controller.rb b/app/controllers/admin/banners_controller.rb index c96c7c72b..b919e0861 100644 --- a/app/controllers/admin/banners_controller.rb +++ b/app/controllers/admin/banners_controller.rb @@ -2,7 +2,6 @@ class Admin::BannersController < Admin::BaseController has_filters %w{all with_active with_inactive}, only: :index - before_action :find_banner, only: [:edit, :update, :destroy] before_action :banner_styles, only: [:edit, :new, :create, :update] before_action :banner_imgs, only: [:edit, :new, :create, :update] @@ -24,7 +23,6 @@ class Admin::BannersController < Admin::BaseController end def update - @banner.assign_attributes(banner_params) if @banner.update(banner_params) redirect_to admin_banners_path else @@ -43,10 +41,6 @@ class Admin::BannersController < Admin::BaseController params.require(:banner).permit(:title, :description, :target_url, :style, :image, :post_started_at, :post_ended_at) end - def find_banner - @banner = Banner.find(params[:id]) - end - def banner_styles @banner_styles = Setting.all.banner_style.map { |banner_style| [banner_style.value, banner_style.key.split('.')[1]] } end diff --git a/app/controllers/admin/geozones_controller.rb b/app/controllers/admin/geozones_controller.rb new file mode 100644 index 000000000..b73c13422 --- /dev/null +++ b/app/controllers/admin/geozones_controller.rb @@ -0,0 +1,49 @@ +class Admin::GeozonesController < Admin::BaseController + + respond_to :html + + load_and_authorize_resource + + def index + @geozones = Geozone.all.order("LOWER(name)") + end + + def new + end + + def edit + end + + def create + @geozone = Geozone.new(geozone_params) + + if @geozone.save + redirect_to admin_geozones_path + else + render :new + end + end + + def update + if @geozone.update(geozone_params) + redirect_to admin_geozones_path + else + render :edit + end + end + + def destroy + if @geozone.safe_to_destroy? + @geozone.destroy + redirect_to admin_geozones_path, notice: t('admin.geozones.delete.success') + else + redirect_to admin_geozones_path, flash: { error: t('admin.geozones.delete.error') } + end + end + + private + + def geozone_params + params.require(:geozone).permit(:name, :external_code, :census_code, :html_map_coordinates) + end +end diff --git a/app/controllers/admin/signature_sheets_controller.rb b/app/controllers/admin/signature_sheets_controller.rb new file mode 100644 index 000000000..60299c5a6 --- /dev/null +++ b/app/controllers/admin/signature_sheets_controller.rb @@ -0,0 +1,32 @@ +class Admin::SignatureSheetsController < Admin::BaseController + + def index + @signature_sheets = SignatureSheet.all + end + + def new + @signature_sheet = SignatureSheet.new + end + + def create + @signature_sheet = SignatureSheet.new(signature_sheet_params) + @signature_sheet.author = current_user + if @signature_sheet.save + @signature_sheet.delay.verify_signatures + redirect_to [:admin, @signature_sheet], notice: I18n.t('flash.actions.create.signature_sheet') + else + render :new + end + end + + def show + @signature_sheet = SignatureSheet.find(params[:id]) + end + + private + + def signature_sheet_params + params.require(:signature_sheet).permit(:signable_type, :signable_id, :document_numbers) + end + +end \ No newline at end of file diff --git a/app/helpers/layouts_helper.rb b/app/helpers/layouts_helper.rb new file mode 100644 index 000000000..c92f57898 --- /dev/null +++ b/app/helpers/layouts_helper.rb @@ -0,0 +1,12 @@ +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') + ' ' + + link_to(text, path, options.merge(class: "active")) + else + link_to(text, path, options) + end + end + +end diff --git a/app/helpers/signature_sheets_helper.rb b/app/helpers/signature_sheets_helper.rb new file mode 100644 index 000000000..acd75a5ab --- /dev/null +++ b/app/helpers/signature_sheets_helper.rb @@ -0,0 +1,8 @@ +module SignatureSheetsHelper + + def signable_options + [[t("activerecord.models.proposal", count: 1), Proposal], + [t("activerecord.models.spending_proposal", count: 1), SpendingProposal]] + end + +end \ No newline at end of file diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index 1dbc5baa2..ea1d4fa40 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -1,5 +1,5 @@ class ApplicationMailer < ActionMailer::Base helper :settings - default from: "Consul " + default from: "#{Setting['mailer_from_name']} <#{Setting['mailer_from_address']}>" layout 'mailer' end diff --git a/app/models/abilities/administrator.rb b/app/models/abilities/administrator.rb index f3f0b8f9b..037289226 100644 --- a/app/models/abilities/administrator.rb +++ b/app/models/abilities/administrator.rb @@ -50,6 +50,7 @@ module Abilities can :create, Budget::ValuatorAssignment can [:search, :edit, :update, :create, :index, :destroy], Banner + can [:index, :create, :edit, :update, :destroy], Geozone end end end diff --git a/app/models/geozone.rb b/app/models/geozone.rb index 787e2b7e2..7e38ce97d 100644 --- a/app/models/geozone.rb +++ b/app/models/geozone.rb @@ -1,9 +1,17 @@ class Geozone < ActiveRecord::Base + has_many :proposals has_many :spending_proposals + has_many :debates + has_many :users validates :name, presence: true def self.names Geozone.pluck(:name) end + def safe_to_destroy? + Geozone.reflect_on_all_associations(:has_many).all? do |association| + association.klass.where(geozone: self).empty? + end + end end diff --git a/app/models/signature.rb b/app/models/signature.rb new file mode 100644 index 000000000..47408858a --- /dev/null +++ b/app/models/signature.rb @@ -0,0 +1,85 @@ +class Signature < ActiveRecord::Base + belongs_to :signature_sheet + belongs_to :user + + validates :document_number, presence: true + validates :signature_sheet, presence: true + + scope :verified, -> { where(verified: true) } + scope :unverified, -> { where(verified: false) } + + delegate :signable, to: :signature_sheet + + def verified? + user_exists? || in_census? + end + + def verify + if verified? + assign_vote + mark_as_verified + end + end + + def assign_vote + if user_exists? + assign_vote_to_user + else + create_user + assign_vote_to_user + end + end + + def assign_vote_to_user + set_user + signable.register_vote(user, "yes") + assign_signature_to_vote + end + + def assign_signature_to_vote + vote = Vote.where(votable: signable, voter: user).first + vote.update(signature: self) + end + + def user_exists? + User.where(document_number: document_number).any? + end + + def create_user + user_params = { + document_number: document_number, + created_from_signature: true, + verified_at: Time.now, + erased_at: Time.now, + password: random_password, + terms_of_service: '1', + email: nil + } + User.create!(user_params) + end + + def random_password + (0...20).map { ('a'..'z').to_a[rand(26)] }.join + end + + def in_census? + response = document_types.detect do |document_type| + CensusApi.new.call(document_type, document_number).valid? + end + response.present? + end + + def set_user + user = User.where(document_number: document_number).first + update(user: user) + end + + def mark_as_verified + update(verified: true) + end + + def document_types + %w(1 2 3 4) + end + +end \ No newline at end of file diff --git a/app/models/signature_sheet.rb b/app/models/signature_sheet.rb new file mode 100644 index 000000000..6852820bb --- /dev/null +++ b/app/models/signature_sheet.rb @@ -0,0 +1,38 @@ +class SignatureSheet < ActiveRecord::Base + belongs_to :signable, polymorphic: true + belongs_to :author, class_name: 'User', foreign_key: 'author_id' + + VALID_SIGNABLES = %w( Proposal SpendingProposal ) + + has_many :signatures + + validates :author, presence: true + validates :signable_type, inclusion: {in: VALID_SIGNABLES} + validates :document_numbers, presence: true + validates :signable, presence: true + validate :signable_found + + def name + "#{signable_name} #{signable_id}" + end + + def signable_name + I18n.t("activerecord.models.#{signable_type.underscore}", count: 1) + end + + def verify_signatures + parsed_document_numbers.each do |document_number| + signature = signatures.create(document_number: document_number) + signature.verify + end + update(processed: true) + end + + def parsed_document_numbers + document_numbers.split(/\W+/) + end + + def signable_found + errors.add(:signable_id, :not_found) if errors.messages[:signable].present? + end +end \ No newline at end of file diff --git a/app/models/user.rb b/app/models/user.rb index 8214b8309..5cb4743d3 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -169,7 +169,6 @@ class User < ActiveRecord::Base username: nil, email: nil, unconfirmed_email: nil, - document_number: nil, phone_number: nil, encrypted_password: "", confirmation_token: nil, diff --git a/app/models/verification/management/document.rb b/app/models/verification/management/document.rb index f01c132bb..17ea065bd 100644 --- a/app/models/verification/management/document.rb +++ b/app/models/verification/management/document.rb @@ -10,7 +10,7 @@ class Verification::Management::Document delegate :username, :email, to: :user, allow_nil: true def user - @user = User.by_document(document_type, document_number).first + @user = User.active.by_document(document_type, document_number).first end def user? diff --git a/app/views/admin/_menu.html.erb b/app/views/admin/_menu.html.erb index d1feaeb1e..d603dbf16 100644 --- a/app/views/admin/_menu.html.erb +++ b/app/views/admin/_menu.html.erb @@ -35,13 +35,21 @@ <% end %> - <%# if feature?(:budgets) %> + <% if feature?(:budgets) %>
  • > <%= link_to admin_budgets_path do %> <%= t("admin.menu.budgets") %> <% end %>
  • - <%# end %> + <% end %> + + <% if feature?(:signature_sheets) %> +
  • > + <%= link_to admin_signature_sheets_path do %> + <%= t("admin.menu.signature_sheets") %> + <% end %> +
  • + <% end %>
  • > <%= link_to admin_banners_path do %> @@ -91,6 +99,12 @@ <% end %>
  • +
  • > + <%= link_to admin_geozones_path do %> + <%= t('admin.menu.geozones') %> + <% end %> +
  • +
  • > <%= link_to admin_activity_path do %> <%= t('admin.menu.activity') %> diff --git a/app/views/admin/geozones/_errors.html.erb b/app/views/admin/geozones/_errors.html.erb new file mode 100644 index 000000000..d0f3b849f --- /dev/null +++ b/app/views/admin/geozones/_errors.html.erb @@ -0,0 +1,15 @@ + +<% if @geozone.errors.any? %> + +
    + + + + <%= @geozone.errors.count %> + <%= t("admin.geozones.errors.form.error", count: @geozone.errors.count) %> + +
    + +<% end %> diff --git a/app/views/admin/geozones/_form.html.erb b/app/views/admin/geozones/_form.html.erb new file mode 100644 index 000000000..e92b98c0b --- /dev/null +++ b/app/views/admin/geozones/_form.html.erb @@ -0,0 +1,29 @@ +<%= form_for [:admin, @geozone] do |f| %> + + <%= render 'errors' %> + +
    +
    + <%= f.label :name, t("admin.geozones.geozone.name") %> + <%= f.text_field :name, label: false %> +
    +
    + <%= f.label :html_map_coordinates, t("admin.geozones.geozone.coordinates") %> + <%= f.text_field :html_map_coordinates, label: false %> +
    +
    + <%= f.label :external_code, t("admin.geozones.geozone.external_code") %> + <%= f.text_field :external_code, label: false %> +
    +
    + <%= f.label :census_code, t("admin.geozones.geozone.census_code") %> + <%= f.text_field :census_code, label: false %> +
    +
    + +
    +
    + <%= f.submit(class: "button expanded", value: t("admin.geozones.edit.form.submit_button")) %> +
    +
    +<% end %> diff --git a/app/views/admin/geozones/edit.html.erb b/app/views/admin/geozones/edit.html.erb new file mode 100644 index 000000000..b6b8c3fd9 --- /dev/null +++ b/app/views/admin/geozones/edit.html.erb @@ -0,0 +1,13 @@ +
    + +
    + <%= link_to admin_geozones_path, class: "back" do %> + + <%= t("admin.geozones.edit.back") %> + <% end %> + +

    <%= t("admin.geozones.edit.editing") %>

    + + <%= render "form" %> +
    +
    diff --git a/app/views/admin/geozones/index.html.erb b/app/views/admin/geozones/index.html.erb new file mode 100644 index 000000000..5a524e46e --- /dev/null +++ b/app/views/admin/geozones/index.html.erb @@ -0,0 +1,33 @@ +<%= link_to t("admin.geozones.index.create"), + new_admin_geozone_path, class: "button success float-right" %> + +

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

    + + + + + + + + + + + + + + <% @geozones.each do |geozone| %> + + + + + + + + + <% end %> + +
    <%= t("admin.geozones.geozone.name") %><%= t("admin.geozones.geozone.external_code") %><%= t("admin.geozones.geozone.census_code") %><%= t("admin.geozones.geozone.coordinates") %>
    <%= geozone.name %><%= geozone.external_code %><%= geozone.census_code %><%= geozone.html_map_coordinates %> + <%= link_to t("admin.geozones.index.edit"), edit_admin_geozone_path(geozone), class: 'edit-banner button hollow' %> + + <%= link_to t("admin.geozones.index.delete"), admin_geozone_path(geozone), method: :delete, class: 'button hollow alert' %> +
    diff --git a/app/views/admin/geozones/new.html.erb b/app/views/admin/geozones/new.html.erb new file mode 100644 index 000000000..0d5080337 --- /dev/null +++ b/app/views/admin/geozones/new.html.erb @@ -0,0 +1,13 @@ +
    + +
    + <%= link_to admin_geozones_path, class: "back" do %> + + <%= t("admin.geozones.new.back") %> + <% end %> + +

    <%= t("admin.geozones.new.creating") %>

    + + <%= render "form" %> +
    +
    diff --git a/app/views/admin/signature_sheets/index.html.erb b/app/views/admin/signature_sheets/index.html.erb new file mode 100644 index 000000000..74241b5b0 --- /dev/null +++ b/app/views/admin/signature_sheets/index.html.erb @@ -0,0 +1,31 @@ +

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

    + +<%= link_to t("admin.signature_sheets.index.new"), new_admin_signature_sheet_path, + class: "button success float-right" %> + +<% if @signature_sheets.any? %> + + + + + + + <% @signature_sheets.each do |signature_sheet| %> + + + + + + <% end %> +
    <%= t("admin.signature_sheets.name") %><%= t("admin.signature_sheets.author") %><%= t("admin.signature_sheets.created_at") %>
    + <%= link_to signature_sheet.name, [:admin, signature_sheet] %> + + <%= signature_sheet.author.name %> + + <%= l(signature_sheet.created_at, format: :short) %> +
    +<% else %> +
    + <%= t("admin.signature_sheets.no_signature_sheets") %> +
    +<% end %> diff --git a/app/views/admin/signature_sheets/new.html.erb b/app/views/admin/signature_sheets/new.html.erb new file mode 100644 index 000000000..f471e1ea5 --- /dev/null +++ b/app/views/admin/signature_sheets/new.html.erb @@ -0,0 +1,22 @@ +<%= render 'shared/back_link' %> + +

    <%= t("admin.signature_sheets.new.title") %>

    + +<%= form_for [:admin, @signature_sheet] do |f| %> + <%= render 'shared/errors', + resource: @signature_sheet %> + +
    + <%= f.select :signable_type, signable_options %> +
    + +
    + <%= f.text_field :signable_id %> +
    + + <%= f.label :document_numbers %> +

    <%= t("admin.signature_sheets.new.document_numbers_note") %>

    + <%= f.text_area :document_numbers, rows: "6", label: false %> + + <%= f.submit(class: "button", value: t("admin.signature_sheets.new.submit")) %> +<% end %> \ No newline at end of file diff --git a/app/views/admin/signature_sheets/show.html.erb b/app/views/admin/signature_sheets/show.html.erb new file mode 100644 index 000000000..a3787b67d --- /dev/null +++ b/app/views/admin/signature_sheets/show.html.erb @@ -0,0 +1,39 @@ +

    <%= @signature_sheet.name %>

    + +
    + <%= t("admin.signature_sheets.show.created_at") %> + <%= l(@signature_sheet.created_at, format: :short) %> +  •  + <%= t("admin.signature_sheets.show.author") %> + <%= @signature_sheet.author.name %> +
    + +
    +

    <%= t("admin.signature_sheets.show.documents") %>

    + <%= simple_format @signature_sheet.document_numbers %> +
    + + +
    + + <%= t("admin.signature_sheets.show.verified", + count: @signature_sheet.signatures.verified.count ) %> + +
    + +
    +

    + + <%= t("admin.signature_sheets.show.unverified", + count: @signature_sheet.signatures.unverified.count ) %> + <%= t("admin.signature_sheets.show.unverified_error") %> + +

    + <%= @signature_sheet.signatures.unverified.map(&:document_number).join(", ") %> +
    + +<% unless @signature_sheet.processed? %> +
    + <%= t("admin.signature_sheets.show.loading") %> +
    +<% end %> \ No newline at end of file diff --git a/app/views/comments/_comment.html.erb b/app/views/comments/_comment.html.erb index 94df7c7a3..8322489dd 100644 --- a/app/views/comments/_comment.html.erb +++ b/app/views/comments/_comment.html.erb @@ -1,7 +1,7 @@ <% comment_flags ||= @comment_flags %> <% cache [locale_and_user_status(comment), comment, commentable_cache_key(comment.commentable), comment.author, (comment_flags[comment.id] if comment_flags)] do %>
    -
    +
      <% if comment.hidden? || comment.user.hidden? %> <% if comment.children.size > 0 %> @@ -24,7 +24,7 @@ <% end %> <% end %> -
      +
    • <% if comment.as_administrator? %> @@ -93,14 +93,13 @@ <%= render 'comments/form', {commentable: comment.commentable, parent_id: comment.id, toggeable: true} %> <% end %>
      -
    • + <% end %> - -
      +
        <% child_comments_of(comment).each do |child| %> <%= render 'comments/comment', comment: child %> <% end %> -
      -
    + +
    <% end %> diff --git a/app/views/debates/_comments.html.erb b/app/views/debates/_comments.html.erb index cc96ab4ba..e7475662d 100644 --- a/app/views/debates/_comments.html.erb +++ b/app/views/debates/_comments.html.erb @@ -1,31 +1,29 @@ <% cache [locale_and_user_status, @current_order, commentable_cache_key(@debate), @comment_tree.comments, @comment_tree.comment_authors, @debate.comments_count, @comment_flags] do %> -
    -
    -
    -

    - <%= t("debates.show.comments_title") %> - (<%= @debate.comments_count %>) -

    +
    +
    +

    + <%= t("debates.show.comments_title") %> + (<%= @debate.comments_count %>) +

    - <%= render 'shared/wide_order_selector', i18n_namespace: "comments" %> + <%= render 'shared/wide_order_selector', i18n_namespace: "comments" %> - <% if user_signed_in? %> - <%= render 'comments/form', {commentable: @debate, parent_id: nil, toggeable: false} %> - <% else %> -
    + <% if user_signed_in? %> + <%= render 'comments/form', {commentable: @debate, parent_id: nil, toggeable: false} %> + <% else %> +
    -
    - <%= t("debates.show.login_to_comment", - signin: link_to(t("votes.signin"), new_user_session_path), - signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %> -
    - <% end %> +
    + <%= t("debates.show.login_to_comment", + signin: link_to(t("votes.signin"), new_user_session_path), + signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %> +
    + <% end %> - <% @comment_tree.root_comments.each do |comment| %> - <%= render 'comments/comment', comment: comment %> - <% end %> - <%= paginate @comment_tree.root_comments %> -
    + <% @comment_tree.root_comments.each do |comment| %> + <%= render 'comments/comment', comment: comment %> + <% end %> + <%= paginate @comment_tree.root_comments %>
    -
    + <% end %> diff --git a/app/views/debates/_form.html.erb b/app/views/debates/_form.html.erb index 30152b366..c88045f26 100644 --- a/app/views/debates/_form.html.erb +++ b/app/views/debates/_form.html.erb @@ -1,6 +1,5 @@ <%= form_for(@debate) do |f| %> - <%= render 'shared/errors', resource: @debate %>
    diff --git a/app/views/debates/show.html.erb b/app/views/debates/show.html.erb index 7a528ffa7..e2e2c84c9 100644 --- a/app/views/debates/show.html.erb +++ b/app/views/debates/show.html.erb @@ -1,6 +1,6 @@ <% provide :title do %><%= @debate.title %><% end %> <% cache [locale_and_user_status(@debate), @debate, @debate.author, Flag.flagged?(current_user, @debate), @debate_votes] do %> -
    +
    <%= render "shared/back_link" %> @@ -59,7 +59,7 @@ <% end %>
    -
    +
    <% end %> <%= render "comments" %> diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 2ad2303f8..6de8ed89e 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -16,12 +16,7 @@
    <%= link_to root_path, class: "hide-for-small-only", accesskey: "/" do %> <%= image_tag('logo_header.png', class: 'hide-for-small-only float-left', size: '80x80', alt: t("layouts.header.logo")) %> - <% if opendata_page? %> - <%= t("layouts.header.open_gov", open: "#{t('layouts.header.open')}") %> | - <%= t("layouts.header.open_data") %> - <% else %> - <%= setting['org_name'] %> - <% end %> + <%= setting['org_name'] %> <% end %>
    @@ -34,9 +29,6 @@
    @@ -48,9 +40,9 @@
    <%= render "shared/subnavigation" %> -
    - <%= yield :header_addon %> -
    +
    +
    + <%= yield :header_addon %>
    diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 70ae90b11..34e7776fb 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -14,7 +14,7 @@ <%= csrf_meta_tags %> <%= favicon_link_tag "favicon.ico" %> <%= favicon_link_tag "apple-touch-icon-200.png", - rel: "apple-touch-icon", + rel: "icon apple-touch-icon", sizes: "200x200", type: "image/png" %> <%= content_for :social_media_meta_tags %> diff --git a/app/views/proposals/_comments.html.erb b/app/views/proposals/_comments.html.erb index ed52b1b66..c304bc4dd 100644 --- a/app/views/proposals/_comments.html.erb +++ b/app/views/proposals/_comments.html.erb @@ -1,26 +1,24 @@ <% cache [locale_and_user_status, @current_order, commentable_cache_key(@proposal), @comment_tree.comments, @comment_tree.comment_authors, @proposal.comments_count, @comment_flags] do %> -
    -
    -
    - <%= render 'shared/wide_order_selector', i18n_namespace: "comments" %> +
    +
    + <%= render 'shared/wide_order_selector', i18n_namespace: "comments" %> - <% if user_signed_in? %> - <%= render 'comments/form', {commentable: @proposal, parent_id: nil, toggeable: false} %> - <% else %> -
    + <% if user_signed_in? %> + <%= render 'comments/form', {commentable: @proposal, parent_id: nil, toggeable: false} %> + <% else %> +
    -
    - <%= t("proposals.show.login_to_comment", - signin: link_to(t("votes.signin"), new_user_session_path), - signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %> -
    - <% end %> +
    + <%= t("proposals.show.login_to_comment", + signin: link_to(t("votes.signin"), new_user_session_path), + signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %> +
    + <% end %> - <% @comment_tree.root_comments.each do |comment| %> - <%= render 'comments/comment', comment: comment %> - <% end %> - <%= paginate @comment_tree.root_comments %> -
    + <% @comment_tree.root_comments.each do |comment| %> + <%= render 'comments/comment', comment: comment %> + <% end %> + <%= paginate @comment_tree.root_comments %>
    -
    + <% end %> diff --git a/app/views/proposals/_filter_subnav.html.erb b/app/views/proposals/_filter_subnav.html.erb index b7bc85dd6..fe875c9a9 100644 --- a/app/views/proposals/_filter_subnav.html.erb +++ b/app/views/proposals/_filter_subnav.html.erb @@ -3,18 +3,18 @@ diff --git a/app/views/proposals/show.html.erb b/app/views/proposals/show.html.erb index ba6cb677f..6209805cf 100644 --- a/app/views/proposals/show.html.erb +++ b/app/views/proposals/show.html.erb @@ -6,8 +6,7 @@ social_description: @proposal.summary %> <% end %> <% cache [locale_and_user_status(@proposal), @proposal, @proposal.author, Flag.flagged?(current_user, @proposal), @proposal_votes] do %> - -
    +
    <%= render "shared/back_link" %> @@ -134,7 +133,7 @@
    -
    + <% end %>
    diff --git a/app/views/shared/_advanced_search.html.erb b/app/views/shared/_advanced_search.html.erb index 00db85b9c..c27c8f8d6 100644 --- a/app/views/shared/_advanced_search.html.erb +++ b/app/views/shared/_advanced_search.html.erb @@ -15,14 +15,14 @@
    - + <%= select_tag('advanced_search[official_level]', official_level_search_options, include_blank: t("shared.advanced_search.author_type_blank")) %>
    - + <%= select_tag('advanced_search[date_min]', date_range_options, include_blank: t("shared.advanced_search.date_range_blank"), id: 'js-advanced-search-date-min') %> @@ -31,14 +31,18 @@
  • + <%= link_to current_path_with_query_params(order: order, page: 1), class: order == @current_order ? 'active' : '' do %> + <%= content_tag(order == @current_order ? :h2 : :span) do %> + <%= t("#{i18n_namespace}.orders.#{order}") %> + <% end %> <% end %> - <% end %> +
  • <% end %> - + diff --git a/app/views/shared/_subnavigation.html.erb b/app/views/shared/_subnavigation.html.erb index 8c654743f..dee5f53c2 100644 --- a/app/views/shared/_subnavigation.html.erb +++ b/app/views/shared/_subnavigation.html.erb @@ -2,22 +2,36 @@ diff --git a/app/views/shared/_tags.html.erb b/app/views/shared/_tags.html.erb index b3fa48bdd..ddb6fc7f2 100644 --- a/app/views/shared/_tags.html.erb +++ b/app/views/shared/_tags.html.erb @@ -1,7 +1,7 @@ <%- limit ||= nil %> <% if taggable.tags.any? %> -