diff --git a/Gemfile b/Gemfile index acb82748b..16da51749 100644 --- a/Gemfile +++ b/Gemfile @@ -7,7 +7,7 @@ gem 'pg', '~> 0.19.0' # Use SCSS for stylesheets gem 'sass-rails', '~> 5.0', '>= 5.0.4' # Use Uglifier as compressor for JavaScript assets -gem 'uglifier', '>= 3.0.3' +gem 'uglifier', '>= 3.0.4' # Use CoffeeScript for .coffee assets and views gem 'coffee-rails', '~> 4.2.1' # See https://github.com/rails/execjs#readme for more supported runtimes @@ -52,7 +52,7 @@ gem 'rollbar', '~> 2.13.3' gem 'delayed_job_active_record', '~> 4.1.0' gem 'daemons' gem 'devise-async' -gem 'newrelic_rpm', '~> 3.17.0.325' +gem 'newrelic_rpm', '~> 3.17.1.326' gem 'whenever', require: false gem 'pg_search' gem 'sitemap_generator' diff --git a/Gemfile.lock b/Gemfile.lock index 60cf9f6cd..1832910e5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -67,7 +67,7 @@ GEM bcrypt (3.1.11) browser (2.3.0) builder (3.2.2) - bullet (5.2.0) + bullet (5.4.2) activesupport (>= 3.0.0) uniform_notifier (~> 1.10.0) byebug (9.0.6) @@ -111,12 +111,12 @@ GEM execjs coffee-script-source (1.10.0) concurrent-ruby (1.0.2) - coveralls (0.8.15) + coveralls (0.8.17) json (>= 1.8, < 3) simplecov (~> 0.12.0) term-ansicolor (~> 1.3) thor (~> 0.19.1) - tins (>= 1.6.0, < 2) + tins (~> 1.6) daemons (1.2.4) dalli (2.7.6) database_cleaner (1.5.3) @@ -172,8 +172,8 @@ GEM activesupport (>= 4.1) railties (>= 4.1) tzinfo (~> 1.2, >= 1.2.2) - fuubar (2.1.1) - rspec (~> 3.0) + fuubar (2.2.0) + rspec-core (~> 3.0) ruby-progressbar (~> 1.4) geocoder (1.4.0) globalid (0.3.7) @@ -200,7 +200,7 @@ GEM httpi (2.4.1) rack i18n (0.7.0) - i18n-tasks (0.9.5) + i18n-tasks (0.9.6) activesupport (>= 4.0.2) ast (>= 2.1.0) easy_translate (>= 0.5.0) @@ -226,7 +226,7 @@ GEM actionpack (>= 3.0.0) activesupport (>= 3.0.0) kgio (2.10.0) - knapsack (1.13.0) + knapsack (1.13.1) rake timecop (>= 0.1.0) launchy (2.4.3) @@ -245,14 +245,14 @@ GEM mime-types-data (~> 3.2015) mime-types-data (3.2016.0521) mini_portile2 (2.1.0) - minitest (5.9.1) + minitest (5.10.1) multi_json (1.12.1) multi_xml (0.5.5) multipart-post (2.0.0) net-scp (1.2.1) net-ssh (>= 2.6.5) net-ssh (3.2.0) - newrelic_rpm (3.17.0.325) + newrelic_rpm (3.17.1.326) nokogiri (1.6.8.1) mini_portile2 (~> 2.1.0) nori (2.6.0) @@ -285,7 +285,7 @@ GEM orm_adapter (0.5.0) paranoia (2.2.0) activerecord (>= 4.0, < 5.1) - parser (2.3.1.4) + parser (2.3.3.1) ast (~> 2.2) pg (0.19.0) pg_search (1.0.6) @@ -332,7 +332,7 @@ GEM thor (>= 0.18.1, < 2.0) rainbow (2.1.0) raindrops (0.17.0) - rake (11.3.0) + rake (12.0.0) redcarpet (3.3.4) referer-parser (0.3.0) request_store (1.3.1) @@ -341,10 +341,6 @@ GEM rinku (2.0.2) rollbar (2.13.3) multi_json - rspec (3.5.0) - rspec-core (~> 3.5.0) - rspec-expectations (~> 3.5.0) - rspec-mocks (~> 3.5.0) rspec-core (3.5.4) rspec-support (~> 3.5.0) rspec-expectations (3.5.0) @@ -417,15 +413,16 @@ GEM sshkit (1.11.4) net-scp (>= 1.1.2) net-ssh (>= 2.8.0) - term-ansicolor (1.3.2) + term-ansicolor (1.4.0) tins (~> 1.0) - terminal-table (1.5.2) - thor (0.19.1) + terminal-table (1.7.3) + unicode-display_width (~> 1.1.1) + thor (0.19.4) thread (0.2.2) thread_safe (0.3.5) tilt (2.0.5) timecop (0.8.1) - tins (1.11.0) + tins (1.13.0) tolk (2.0.0) rails (>= 4.0) safe_yaml (>= 0.8.6) @@ -438,7 +435,7 @@ GEM tilt (>= 1.4, < 3) tzinfo (1.2.2) thread_safe (~> 0.1) - uglifier (3.0.3) + uglifier (3.0.4) execjs (>= 0.3.0, < 3) unf (0.1.4) unf_ext @@ -513,7 +510,7 @@ DEPENDENCIES knapsack launchy letter_opener_web (~> 1.3.0) - newrelic_rpm (~> 3.17.0.325) + newrelic_rpm (~> 3.17.1.326) omniauth omniauth-facebook (~> 3.0.0) omniauth-google-oauth2 (~> 0.4.0) @@ -541,7 +538,7 @@ DEPENDENCIES tolk (~> 2.0.0) turbolinks turnout (~> 2.4.0) - uglifier (>= 3.0.3) + uglifier (>= 3.0.4) unicorn (~> 5.1.0) web-console (= 3.3.0) whenever diff --git a/README.md b/README.md index 8c95f3648..c62fcfeec 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ Citizen Participation and Open Government Application +[![Join the chat at https://gitter.im/consul/consul](https://badges.gitter.im/consul/consul.svg)](https://gitter.im/consul/consul?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://travis-ci.org/consul/consul.svg?branch=master)](https://travis-ci.org/consul/consul) [![Code Climate](https://codeclimate.com/github/consul/consul/badges/gpa.svg)](https://codeclimate.com/github/consul/consul) [![Dependency Status](https://gemnasium.com/consul/consul.svg)](https://gemnasium.com/consul/consul) diff --git a/README_ES.md b/README_ES.md index a18b7d241..1b197e983 100644 --- a/README_ES.md +++ b/README_ES.md @@ -5,6 +5,7 @@ Aplicación de Participación Ciudadana y Gobierno Abierto +[![Join the chat at https://gitter.im/consul/consul](https://badges.gitter.im/consul/consul.svg)](https://gitter.im/consul/consul?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Build Status](https://travis-ci.org/consul/consul.svg?branch=master)](https://travis-ci.org/consul/consul) [![Code Climate](https://codeclimate.com/github/consul/consul/badges/gpa.svg)](https://codeclimate.com/github/consul/consul) [![Dependency Status](https://gemnasium.com/consul/consul.svg)](https://gemnasium.com/consul/consul) diff --git a/app/assets/javascripts/comments.js.coffee b/app/assets/javascripts/comments.js.coffee index 876a89b20..fefe85544 100644 --- a/app/assets/javascripts/comments.js.coffee +++ b/app/assets/javascripts/comments.js.coffee @@ -52,5 +52,6 @@ App.Comments = children_container_id = "#{$(this).data().id}_children" $("##{children_container_id}").toggle('slow') App.Comments.toggle_arrow(children_container_id) + $(this).children('.js-child-toggle').toggle() false ) diff --git a/app/assets/stylesheets/_settings.scss b/app/assets/stylesheets/_settings.scss index 4149020fa..3821f22c7 100644 --- a/app/assets/stylesheets/_settings.scss +++ b/app/assets/stylesheets/_settings.scss @@ -57,15 +57,15 @@ $brand: #004A83; $dark: darken($brand, 10%); $text: #222222; -$text-medium: #999999; -$text-light: #CCCCCC; +$text-medium: #515151; +$text-light: #BFBFBF; $border: #DEE0E3; -$link: #2895F1; +$link: $brand; $link-hover: darken($link, 20%); -$debates: #008CCF; +$debates: $brand; $like: #7BD2A8; $unlike: #EF8585; @@ -74,6 +74,7 @@ $delete: #F04124; $check: #46DB91; $proposals: #FFA42D; +$proposals-dark: #794500; $budget: #454372; $budget-hover: #7571BF; 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 6c6d739af..e5e6562d3 100644 --- a/app/assets/stylesheets/layout.scss +++ b/app/assets/stylesheets/layout.scss @@ -56,6 +56,7 @@ a { } &:focus { + color: $link-hover; outline: 3px solid #ffbf47; } } @@ -245,7 +246,7 @@ a { } } - h2 { + h2, h3 { font-size: $base-font-size; } } @@ -258,6 +259,10 @@ a { margin: 0 $line-height/2; } +.pagination .current { + background: $brand; +} + // 02. Header // ---------- @@ -366,6 +371,10 @@ header { text-decoration: underline; } } + + ul { + margin-bottom: 0; + } } .subnavigation { @@ -509,7 +518,7 @@ footer { p { font-size: $small-font-size; - .info a { + &.info a { text-decoration: underline; } } @@ -546,6 +555,7 @@ footer { .subfooter { border-top: 1px solid $text-light; + font-size: $small-font-size; padding-top: $line-height/2; } @@ -577,7 +587,7 @@ footer { } } -h3.sidebar-title { +h2.sidebar-title { border-top: 2px solid $brand; display: inline-block; font-size: rem-calc(16); @@ -1155,7 +1165,7 @@ table { top: 0; } - &:hover { + &:hover, &:focus { background: white; color: #40A2D1; } @@ -1195,7 +1205,7 @@ table { top: 0; } - &:hover { + &:hover, &:focus { background: white; color: #354F88; } @@ -1235,7 +1245,7 @@ table { top: 0; } - &:hover { + &:hover, &:focus { background: white; color: #CE3E26; } @@ -1279,7 +1289,8 @@ table { top: 0; } - &:hover { + &:hover, &:focus { + background: white; color: #40A2D1; } } @@ -1302,7 +1313,8 @@ table { top: 0; } - &:hover { + &:hover, &:focus { + background: white; color: #354F88; } } @@ -1325,7 +1337,8 @@ table { top: 0; } - &:hover { + &:hover, &:focus { + background: white; color: #CE3E26; } } diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss index 6dbaac394..a5e1d7df2 100644 --- a/app/assets/stylesheets/participation.scss +++ b/app/assets/stylesheets/participation.scss @@ -360,6 +360,13 @@ font-size: rem-calc(15); margin-bottom: rem-calc(15); } + + &.tags, &.geozone { + + li { + margin-bottom: 0; + } + } } .author-photo { @@ -383,7 +390,7 @@ aside { - h3 { + h2 { border-top: 2px solid $brand; display: inline-block; font-size: rem-calc(16); @@ -521,7 +528,7 @@ } .label-proposal { - color: $proposals; + color: $proposals-dark; } .label-investment-project { @@ -559,7 +566,7 @@ } .icon-proposals { - color: $proposals; + color: $proposals-dark; } .icon-budget { @@ -844,11 +851,15 @@ } p { - margin-bottom: 0; &.title { color: #FFD200; } + + &.title-date { + font-size: rem-calc(24); + font-weight: bold; + } } .info { 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/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/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 0dfce6d3e..975ba7a8d 100644 --- a/app/models/abilities/administrator.rb +++ b/app/models/abilities/administrator.rb @@ -43,6 +43,7 @@ module Abilities can [:read, :update, :destroy, :summary], SpendingProposal 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/user.rb b/app/models/user.rb index a54be0a16..c82ae3435 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -164,7 +164,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 7ea48b2c6..3d3e807c7 100644 --- a/app/views/admin/_menu.html.erb +++ b/app/views/admin/_menu.html.erb @@ -83,6 +83,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/comments/_comment.html.erb b/app/views/comments/_comment.html.erb index bf8bfb50d..549b62862 100644 --- a/app/views/comments/_comment.html.erb +++ b/app/views/comments/_comment.html.erb @@ -1,6 +1,6 @@ <% 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 %> @@ -23,7 +23,7 @@ <% end %> <% end %> -
      +
    • <% if comment.as_administrator? %> @@ -74,7 +74,8 @@ <% if comment.children.size > 0 %> <%= link_to "", class: "js-toggle-children relative", data: {'id': "#{dom_id(comment)}"} do %> - <%= t("shared.show") %> + + <%= t("shared.hide") %> <%= t("comments.comment.responses", count: comment.children.size) %> <% end %> <% else %> @@ -91,14 +92,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/_debate.html.erb b/app/views/debates/_debate.html.erb index fdb975c79..d084a0241 100644 --- a/app/views/debates/_debate.html.erb +++ b/app/views/debates/_debate.html.erb @@ -41,7 +41,7 @@

    - <%= link_to debate.description, debate %> + <%= debate.description %>
    <%= render "shared/tags", taggable: debate, limit: 5 %> diff --git a/app/views/debates/_votes.html.erb b/app/views/debates/_votes.html.erb index cc59a3f3a..9bc3ca555 100644 --- a/app/views/debates/_votes.html.erb +++ b/app/views/debates/_votes.html.erb @@ -1,23 +1,41 @@ <% voted_classes = css_classes_for_vote(@debate_votes, debate) %>
    - <%= 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') %> - - <%= votes_percentage('likes', debate) %> + <% if user_signed_in? %> + <%= 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') %> + + <%= votes_percentage('likes', debate) %> + <% end %> + <% else %> + <% end %>
    - <%= 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') %> - - <%= votes_percentage('dislikes', debate) %> + <% 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') %> + + <%= votes_percentage('dislikes', debate) %> + <% end %> + <% else %> +
    + + <%= t('votes.disagree') %> + + <%= votes_percentage('dislikes', debate) %> +
    <% end %>
    @@ -39,10 +57,12 @@

    <% elsif !user_signed_in? %> - diff --git a/app/views/debates/show.html.erb b/app/views/debates/show.html.erb index dca39677e..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" %> @@ -44,12 +44,12 @@
    -
    + <% end %> <%= render "comments" %> diff --git a/app/views/kaminari/_paginator.html.erb b/app/views/kaminari/_paginator.html.erb index 3a1495a1c..de9e89c93 100644 --- a/app/views/kaminari/_paginator.html.erb +++ b/app/views/kaminari/_paginator.html.erb @@ -1,22 +1,19 @@ <%= paginator.render do -%>
    - + <%= next_page_tag unless current_page.last? %> + <%= last_page_tag unless current_page.last? %> +
    <% end -%> diff --git a/app/views/layouts/_footer.html.erb b/app/views/layouts/_footer.html.erb index 324a049af..4f8545fb5 100644 --- a/app/views/layouts/_footer.html.erb +++ b/app/views/layouts/_footer.html.erb @@ -41,13 +41,13 @@
    -

    - <%= t("layouts.footer.copyright", year: Time.current.year) %> |  - <%= link_to t("layouts.footer.more_info"), page_path('more_information') %> |  - <%= link_to t("layouts.footer.privacy"), page_path('privacy') %> |  - <%= link_to t("layouts.footer.conditions"), page_path('conditions') %> |  - <%= link_to t("layouts.footer.accessibility"), page_path('accessibility') %> -

    + <%= t("layouts.footer.copyright", year: Time.current.year) %> | +
      +
    • <%= link_to t("layouts.footer.more_info"), page_path('more_information') %> |
    • +
    • <%= link_to t("layouts.footer.privacy"), page_path('privacy') %> |
    • +
    • <%= link_to t("layouts.footer.conditions"), page_path('conditions') %> |
    • +
    • <%= link_to t("layouts.footer.accessibility"), page_path('accessibility') %>
    • +
    @@ -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/pages/accessibility.html.erb b/app/views/pages/accessibility.html.erb index 8d8d6a34d..a2c2eff30 100644 --- a/app/views/pages/accessibility.html.erb +++ b/app/views/pages/accessibility.html.erb @@ -40,7 +40,7 @@ S - Presupuestos ciudadanos + Presupuestos participativos I diff --git a/app/views/pages/spending_proposals_info.html.erb b/app/views/pages/spending_proposals_info.html.erb index 60e947343..41332bb96 100644 --- a/app/views/pages/spending_proposals_info.html.erb +++ b/app/views/pages/spending_proposals_info.html.erb @@ -8,8 +8,8 @@
    -

    ¿Cómo funcionan los presupuestos ciudadanos?

    +

    ¿Cómo funcionan los Presupuestos participativos?

    Explicación detallada del proceso

    -

    Próximamente se podrá encontrar aquí una descripción del proceso de participación ciudadana en los presupuestos.

    +

    Descripción del proceso de participación ciudadana en los presupuestos.

    diff --git a/app/views/proposal_ballots/index.html.erb b/app/views/proposal_ballots/index.html.erb index 00a07fb9e..fe5bdef70 100644 --- a/app/views/proposal_ballots/index.html.erb +++ b/app/views/proposal_ballots/index.html.erb @@ -1,3 +1,4 @@ +<% provide :title do %><%= t("proposal_ballots.title") %><% end %>
    @@ -11,7 +12,7 @@

    <%= t("proposal_ballots.date_title") %>

    -

    <%= t("proposal_ballots.date") %>

    +

    <%= t("proposal_ballots.date") %>

    diff --git a/app/views/proposals/_categories.html.erb b/app/views/proposals/_categories.html.erb index 4d429b055..ec87fd734 100644 --- a/app/views/proposals/_categories.html.erb +++ b/app/views/proposals/_categories.html.erb @@ -1,9 +1,9 @@ - +
    -
    +
      <% @categories.each do |category| %> - <%= link_to category.name, proposals_path(search: category.name) %> +
    • <%= link_to category.name, proposals_path(search: category.name) %>
    • <% end %> -
    \ No newline at end of file + 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/_geozones.html.erb b/app/views/proposals/_geozones.html.erb index ceec721ce..7e4dbcaa4 100644 --- a/app/views/proposals/_geozones.html.erb +++ b/app/views/proposals/_geozones.html.erb @@ -1,5 +1,5 @@ - +
    <%= link_to map_proposals_path, id: 'map', title: t("shared.tags_cloud.districts_list") do %> <%= image_tag("map.jpg", alt: t("shared.tags_cloud.districts_list")) %> diff --git a/app/views/proposals/_popular.html.erb b/app/views/proposals/_popular.html.erb index 15ef8dccf..7f46ea802 100644 --- a/app/views/proposals/_popular.html.erb +++ b/app/views/proposals/_popular.html.erb @@ -1,5 +1,5 @@ - +

    <%= link_to t("proposals.index.top_link_proposals"), summary_proposals_path, class: "small" %>
    diff --git a/app/views/proposals/_proposal.html.erb b/app/views/proposals/_proposal.html.erb index dc37934d5..69bf8d164 100644 --- a/app/views/proposals/_proposal.html.erb +++ b/app/views/proposals/_proposal.html.erb @@ -44,7 +44,7 @@ <% end %>

    -

    <%= link_to proposal.summary, namespaced_proposal_path(proposal) %>

    +

    <%= proposal.summary %>

    <% end %> @@ -53,20 +53,22 @@
    -
    - <% if proposal.successfull? %> + <% if proposal.successfull? %> +

    <%= t("proposal_ballots.successfull", voting: link_to(t("proposal_ballots.voting"), proposal_ballots_path)).html_safe %>

    - <% elsif proposal.archived? %> +
    + <% elsif proposal.archived? %> +
    <%= t("proposals.proposal.supports", count: proposal.total_votes) %>

    <%= t("proposals.proposal.archived") %>

    - <% else %> - <%= render 'votes', - { proposal: proposal, vote_url: vote_proposal_path(proposal, value: 'yes') } %> - <% end %> -
    +
    + <% else %> + <%= render 'votes', + { proposal: proposal, vote_url: vote_proposal_path(proposal, value: 'yes') } %> + <% end %>
    diff --git a/app/views/proposals/_retired.html.erb b/app/views/proposals/_retired.html.erb index 280265d87..2167b14af 100644 --- a/app/views/proposals/_retired.html.erb +++ b/app/views/proposals/_retired.html.erb @@ -1,5 +1,5 @@ - + <% if params[:retired].blank? %>

    <%= link_to t("proposals.index.retired_proposals_link"), proposals_path(retired: 'all'), class: "small" %>

    diff --git a/app/views/proposals/_votes.html.erb b/app/views/proposals/_votes.html.erb index 4c2a348ca..fb41357af 100644 --- a/app/views/proposals/_votes.html.erb +++ b/app/views/proposals/_votes.html.erb @@ -1,56 +1,66 @@ -
    - - - <%= supports_percentage(proposal) %> / <%= t("proposals.proposal.total_percent") %> - -
    +
    +
    + + + <%= supports_percentage(proposal) %> / <%= t("proposals.proposal.total_percent") %> + +
    - - <%= t("proposals.proposal.supports", count: proposal.total_votes) %>  - - "> - <%= t("proposals.proposal.supports_necessary", number: number_with_delimiter(Proposal.votes_needed_for_success)) %> - + + <%= t("proposals.proposal.supports", count: proposal.total_votes) %>  + + "> + <%= t("proposals.proposal.supports_necessary", number: number_with_delimiter(Proposal.votes_needed_for_success)) %> + + - -
    - <% if voted_for?(@proposal_votes, proposal) %> -
    - <%= t("proposals.proposal.already_supported") %> -
    - <% else %> - <%= link_to vote_url, - class: "button button-support small expanded", - title: t('proposals.proposal.support_title'), method: "post", remote: true do %> - <%= t("proposals.proposal.support") %> +
    + <% if voted_for?(@proposal_votes, proposal) %> +
    + <%= t("proposals.proposal.already_supported") %> +
    + <% elsif user_signed_in? && proposal.votable_by?(current_user) %> + <%= link_to vote_url, + class: "button button-support small expanded", + title: t('proposals.proposal.support_title'), method: "post", remote: true do %> + <%= t("proposals.proposal.support") %> + <% end %> + <% else %> +
    + <%= t("proposals.proposal.support") %> +
    <% end %> +
    + + <% if user_signed_in? && current_user.organization? %> + + <% elsif user_signed_in? && !proposal.votable_by?(current_user) %> +
    + +
    + <% elsif !user_signed_in? %> +
    + +
    + <% end %> + + <% if voted_for?(@proposal_votes, proposal) && setting['twitter_handle'] %> + <% end %>
    - -<% if user_signed_in? && current_user.organization? %> - -<% elsif user_signed_in? && !proposal.votable_by?(current_user)%> - -<% elsif !user_signed_in? %> - -<% end %> - -<% if voted_for?(@proposal_votes, proposal) && setting['twitter_handle'] %> - -<% end %> diff --git a/app/views/proposals/show.html.erb b/app/views/proposals/show.html.erb index c010ed9db..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" %> @@ -101,25 +100,29 @@
    -
    +
    <% end %>
    diff --git a/app/views/shared/_advanced_search.html.erb b/app/views/shared/_advanced_search.html.erb index 7b9d3d6c4..c27c8f8d6 100644 --- a/app/views/shared/_advanced_search.html.erb +++ b/app/views/shared/_advanced_search.html.erb @@ -2,44 +2,52 @@ <%= link_to t("shared.advanced_search.title"), "#", id: 'js-advanced-search-title', class: "advanced-search small" %>
    -
    +
    <%= form_tag search_path, method: :get do %>