Merge branch 'budget' into budget-public-controllers
This commit is contained in:
0
app/assets/images/custom/.keep
Normal file
0
app/assets/images/custom/.keep
Normal file
@@ -16,7 +16,7 @@
|
||||
//= require jquery-ui/datepicker-es
|
||||
//= require foundation
|
||||
//= require turbolinks
|
||||
//= require ckeditor/init
|
||||
//= require ckeditor/loader
|
||||
//= require_directory ./ckeditor
|
||||
//= require social-share-button
|
||||
//= require initial
|
||||
@@ -45,6 +45,7 @@
|
||||
//= require valuation_spending_proposal_form
|
||||
//= require embed_video
|
||||
//= require banners
|
||||
//= require custom
|
||||
|
||||
var initialize_modules = function() {
|
||||
App.Comments.initialize();
|
||||
|
||||
3
app/assets/javascripts/ckeditor/loader.js.erb
Normal file
3
app/assets/javascripts/ckeditor/loader.js.erb
Normal file
@@ -0,0 +1,3 @@
|
||||
//= require ckeditor/init
|
||||
|
||||
CKEDITOR.config.customConfig = '<%= javascript_path 'ckeditor/config.js' %>';
|
||||
7
app/assets/javascripts/custom.js
Normal file
7
app/assets/javascripts/custom.js
Normal file
@@ -0,0 +1,7 @@
|
||||
// Overrides and adds customized javascripts in this file
|
||||
// Read more on documentation:
|
||||
// * English: https://github.com/consul/consul/blob/master/CUSTOMIZE_EN.md#javascript
|
||||
// * Spanish: https://github.com/consul/consul/blob/master/CUSTOMIZE_ES.md#javascript
|
||||
//
|
||||
//
|
||||
|
||||
@@ -36,12 +36,21 @@ body.admin {
|
||||
input[type="text"], textarea {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.input-group input[type="text"] {
|
||||
border-radius: 0;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
table {
|
||||
|
||||
th {
|
||||
text-align: left;
|
||||
|
||||
&.with-button {
|
||||
line-height: $line-height*2;
|
||||
}
|
||||
}
|
||||
|
||||
tr {
|
||||
|
||||
@@ -1,2 +1,5 @@
|
||||
// Overrides and adds customized styles in this file
|
||||
//
|
||||
// Read more on documentation:
|
||||
// * English: https://github.com/consul/consul/blob/master/CUSTOMIZE_EN.md#css
|
||||
// * Spanish: https://github.com/consul/consul/blob/master/CUSTOMIZE_ES.md#css
|
||||
//
|
||||
|
||||
15
app/controllers/admin/budget_groups_controller.rb
Normal file
15
app/controllers/admin/budget_groups_controller.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
class Admin::BudgetGroupsController < Admin::BaseController
|
||||
|
||||
def create
|
||||
@budget = Budget.find params[:budget_id]
|
||||
@budget.groups.create(budget_group_params)
|
||||
@groups = @budget.groups.includes(:headings)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def budget_group_params
|
||||
params.require(:budget_group).permit(:name)
|
||||
end
|
||||
|
||||
end
|
||||
16
app/controllers/admin/budget_headings_controller.rb
Normal file
16
app/controllers/admin/budget_headings_controller.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
class Admin::BudgetHeadingsController < Admin::BaseController
|
||||
|
||||
def create
|
||||
@budget = Budget.find params[:budget_id]
|
||||
@budget_group = @budget.groups.find params[:budget_group_id]
|
||||
@budget_group.headings.create(budget_heading_params)
|
||||
@headings = @budget_group.headings
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def budget_heading_params
|
||||
params.require(:budget_heading).permit(:name, :price, :geozone_id)
|
||||
end
|
||||
|
||||
end
|
||||
34
app/controllers/admin/budgets_controller.rb
Normal file
34
app/controllers/admin/budgets_controller.rb
Normal file
@@ -0,0 +1,34 @@
|
||||
class Admin::BudgetsController < Admin::BaseController
|
||||
|
||||
has_filters %w{open finished}, only: :index
|
||||
|
||||
load_and_authorize_resource
|
||||
|
||||
def index
|
||||
@budgets = Budget.send(@current_filter).order(created_at: :desc).page(params[:page])
|
||||
end
|
||||
|
||||
def show
|
||||
@budget = Budget.includes(groups: :headings).find(params[:id])
|
||||
end
|
||||
|
||||
def new
|
||||
@budget = Budget.new
|
||||
end
|
||||
|
||||
def create
|
||||
@budget = Budget.new(budget_params)
|
||||
if @budget.save
|
||||
redirect_to admin_budget_path(@budget), notice: t('admin.budgets.create.notice')
|
||||
else
|
||||
render :new
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def budget_params
|
||||
params.require(:budget).permit(:name, :description, :phase, :currency_symbol)
|
||||
end
|
||||
|
||||
end
|
||||
11
app/helpers/budgets_helper.rb
Normal file
11
app/helpers/budgets_helper.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
module BudgetsHelper
|
||||
|
||||
def budget_phases_select_options
|
||||
Budget::VALID_PHASES.map { |ph| [ t("budget.phase.#{ph}"), ph ] }
|
||||
end
|
||||
|
||||
def budget_currency_symbol_select_options
|
||||
Budget::CURRENCY_SYMBOLS.map { |cs| [ cs, cs ] }
|
||||
end
|
||||
|
||||
end
|
||||
@@ -8,4 +8,9 @@ module GeozonesHelper
|
||||
Geozone.all.order(name: :asc).collect { |g| [ g.name, g.id ] }
|
||||
end
|
||||
|
||||
def geozone_name_from_id(g_id)
|
||||
@all_geozones ||= Geozone.all.collect{ |g| [ g.id, g.name ] }.to_h
|
||||
@all_geozones[g_id] || t("geozones.none")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -60,8 +60,8 @@ class Mailer < ApplicationMailer
|
||||
end
|
||||
end
|
||||
|
||||
def proposal_notification_digest(user)
|
||||
@notifications = user.notifications.where(notifiable_type: "ProposalNotification")
|
||||
def proposal_notification_digest(user, notifications)
|
||||
@notifications = notifications
|
||||
|
||||
with_user(user) do
|
||||
mail(to: user.email, subject: t('mailers.proposal_notification_digest.title', org_name: Setting['org_name']))
|
||||
|
||||
@@ -42,7 +42,9 @@ module Abilities
|
||||
|
||||
can [:read, :update, :valuate, :destroy, :summary], SpendingProposal
|
||||
|
||||
can [:create, :update], Budget
|
||||
can [:index, :read, :new, :create, :update, :destroy], Budget
|
||||
can [:read, :create, :update, :destroy], Budget::Group
|
||||
can [:read, :create, :update, :destroy], Budget::Heading
|
||||
can [:hide, :update], Budget::Investment
|
||||
can :valuate, Budget::Investment, budget: { valuating: true }
|
||||
can :create, Budget::ValuatorAssignment
|
||||
|
||||
@@ -3,7 +3,9 @@ class Budget < ActiveRecord::Base
|
||||
include Sanitizable
|
||||
|
||||
VALID_PHASES = %W{on_hold accepting selecting balloting finished}
|
||||
CURRENCY_SYMBOLS = %W{€ $ £ ¥}
|
||||
|
||||
validates :name, presence: true
|
||||
validates :phase, inclusion: { in: VALID_PHASES }
|
||||
validates :currency_symbol, presence: true
|
||||
|
||||
@@ -13,6 +15,9 @@ class Budget < ActiveRecord::Base
|
||||
has_many :headings, through: :groups
|
||||
has_many :investments, through: :headings
|
||||
|
||||
scope :open, -> { where.not(phase: "finished") }
|
||||
scope :finished, -> { where(phase: "finished") }
|
||||
|
||||
def on_hold?
|
||||
phase == "on_hold"
|
||||
end
|
||||
|
||||
0
app/models/custom/.keep
Normal file
0
app/models/custom/.keep
Normal file
29
app/models/custom/verification/residence.rb
Normal file
29
app/models/custom/verification/residence.rb
Normal file
@@ -0,0 +1,29 @@
|
||||
|
||||
require_dependency Rails.root.join('app', 'models', 'verification', 'residence').to_s
|
||||
|
||||
class Verification::Residence
|
||||
|
||||
validate :postal_code_in_madrid
|
||||
validate :residence_in_madrid
|
||||
|
||||
def postal_code_in_madrid
|
||||
errors.add(:postal_code, I18n.t('verification.residence.new.error_not_allowed_postal_code')) unless valid_postal_code?
|
||||
end
|
||||
|
||||
def residence_in_madrid
|
||||
return if errors.any?
|
||||
|
||||
unless residency_valid?
|
||||
errors.add(:residence_in_madrid, false)
|
||||
store_failed_attempt
|
||||
Lock.increase_tries(user)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def valid_postal_code?
|
||||
postal_code =~ /^280/
|
||||
end
|
||||
|
||||
end
|
||||
@@ -2,9 +2,11 @@ class Notification < ActiveRecord::Base
|
||||
belongs_to :user, counter_cache: true
|
||||
belongs_to :notifiable, polymorphic: true
|
||||
|
||||
scope :unread, -> { all }
|
||||
scope :recent, -> { order(id: :desc) }
|
||||
scope :for_render, -> { includes(:notifiable) }
|
||||
scope :unread, -> { all }
|
||||
scope :recent, -> { order(id: :desc) }
|
||||
scope :not_emailed, -> { where(emailed_at: nil) }
|
||||
scope :for_render, -> { includes(:notifiable) }
|
||||
|
||||
|
||||
def timestamp
|
||||
notifiable.created_at
|
||||
|
||||
@@ -95,7 +95,7 @@ class Proposal < ActiveRecord::Base
|
||||
end
|
||||
|
||||
def voters
|
||||
votes_for.voters
|
||||
User.active.where(id: votes_for.voters)
|
||||
end
|
||||
|
||||
def editable?
|
||||
|
||||
@@ -53,6 +53,7 @@ class User < ActiveRecord::Base
|
||||
scope :for_render, -> { includes(:organization) }
|
||||
scope :by_document, -> (document_type, document_number) { where(document_type: document_type, document_number: document_number) }
|
||||
scope :email_digest, -> { where(email_digest: true) }
|
||||
scope :active, -> { where(erased_at: nil) }
|
||||
|
||||
before_validation :clean_document_number
|
||||
|
||||
|
||||
@@ -16,8 +16,6 @@ class Verification::Residence
|
||||
|
||||
validate :allowed_age
|
||||
validate :document_number_uniqueness
|
||||
validate :postal_code_in_madrid
|
||||
validate :residence_in_madrid
|
||||
|
||||
def initialize(attrs={})
|
||||
self.date_of_birth = parse_date('date_of_birth', attrs)
|
||||
@@ -45,20 +43,6 @@ class Verification::Residence
|
||||
errors.add(:document_number, I18n.t('errors.messages.taken')) if User.where(document_number: document_number).any?
|
||||
end
|
||||
|
||||
def postal_code_in_madrid
|
||||
errors.add(:postal_code, I18n.t('verification.residence.new.error_not_allowed_postal_code')) unless valid_postal_code?
|
||||
end
|
||||
|
||||
def residence_in_madrid
|
||||
return if errors.any?
|
||||
|
||||
unless residency_valid?
|
||||
errors.add(:residence_in_madrid, false)
|
||||
store_failed_attempt
|
||||
Lock.increase_tries(user)
|
||||
end
|
||||
end
|
||||
|
||||
def store_failed_attempt
|
||||
FailedCensusCall.create({
|
||||
user: user,
|
||||
@@ -97,8 +81,4 @@ class Verification::Residence
|
||||
self.document_number = self.document_number.gsub(/[^a-z0-9]+/i, "").upcase unless self.document_number.blank?
|
||||
end
|
||||
|
||||
def valid_postal_code?
|
||||
postal_code =~ /^280/
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -35,6 +35,14 @@
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<%# if feature?(:budgets) %>
|
||||
<li <%= "class=active" if controller_name == "budgets" %>>
|
||||
<%= link_to admin_budgets_path do %>
|
||||
<span class="icon-budget"></span><%= t("admin.menu.budgets") %>
|
||||
<% end %>
|
||||
</li>
|
||||
<%# end %>
|
||||
|
||||
<li <%= "class=active" if controller_name == "banners" %>>
|
||||
<%= link_to admin_banners_path do %>
|
||||
<span class="icon-eye"></span><%= t("admin.menu.banner") %>
|
||||
|
||||
2
app/views/admin/budget_groups/create.js.erb
Normal file
2
app/views/admin/budget_groups/create.js.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
$("#<%= dom_id(@budget) %>_groups").html('<%= j render("admin/budgets/groups", groups: @groups) %>');
|
||||
App.Forms.toggleLink();
|
||||
2
app/views/admin/budget_headings/create.js.erb
Normal file
2
app/views/admin/budget_headings/create.js.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
$("#<%= dom_id(@budget_group) %>").html('<%= j render("admin/budgets/group", group: @budget_group, headings: @headings) %>');
|
||||
App.Forms.toggleLink();
|
||||
76
app/views/admin/budgets/_group.html.erb
Normal file
76
app/views/admin/budgets/_group.html.erb
Normal file
@@ -0,0 +1,76 @@
|
||||
<div class="small-12 column">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3" class="with-button">
|
||||
<%= group.name %>
|
||||
<%= link_to t("admin.budgets.form.add_heading"), "#", class: "button float-right js-toggle-link", data: { "toggle-selector" => "#group-#{group.id}-new-heading-form" } %>
|
||||
</th>
|
||||
</tr>
|
||||
|
||||
<% if headings.blank? %>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td colspan="3">
|
||||
<div class="callout primary">
|
||||
<%= t("admin.budgets.form.no_heading") %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<% else %>
|
||||
<tr>
|
||||
<th><%= t("admin.budgets.form.table_heading") %></th>
|
||||
<th><%= t("admin.budgets.form.table_amount") %></th>
|
||||
<th><%= t("admin.budgets.form.table_geozone") %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% end %>
|
||||
|
||||
<!-- new heading form -->
|
||||
<tr id="group-<%= group.id %>-new-heading-form" style="display:none">
|
||||
<td colspan="3">
|
||||
<%= form_for [:admin, @budget, group, Budget::Heading.new], remote: true do |f| %>
|
||||
<label><%= t("admin.budgets.form.heading") %></label>
|
||||
<%= f.text_field :name,
|
||||
label: false,
|
||||
maxlength: 50,
|
||||
placeholder: t("admin.budgets.form.heading") %>
|
||||
|
||||
<div class="row">
|
||||
<div class="small-12 medium-6 column">
|
||||
<label><%= t("admin.budgets.form.amount") %></label>
|
||||
<%= f.text_field :price,
|
||||
label: false,
|
||||
maxlength: 8,
|
||||
placeholder: t("admin.budgets.form.amount") %>
|
||||
</div>
|
||||
<div class="small-12 medium-6 column">
|
||||
<label><%= t("admin.budgets.form.geozone") %></label>
|
||||
<%= f.select :geozone_id, geozone_select_options, {include_blank: t("geozones.none"), label: false} %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= f.submit t("admin.budgets.form.save_heading"), class: "button success" %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- /. new heading form -->
|
||||
<!-- headings list -->
|
||||
<% headings.each do |heading| %>
|
||||
<tr>
|
||||
<td>
|
||||
<%= heading.name %>
|
||||
</td>
|
||||
<td>
|
||||
<%= heading.price %>
|
||||
</td>
|
||||
<td>
|
||||
<%= geozone_name_from_id heading.geozone_id %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<!-- /. headings list -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
34
app/views/admin/budgets/_groups.html.erb
Normal file
34
app/views/admin/budgets/_groups.html.erb
Normal file
@@ -0,0 +1,34 @@
|
||||
<div class="small-12 column">
|
||||
<h3 class="inline-block"><%= t('admin.budgets.show.groups') %></h3>
|
||||
<% if groups.blank? %>
|
||||
<div class="callout primary">
|
||||
<%= t("admin.budgets.form.no_groups") %>
|
||||
<strong><%= link_to t("admin.budgets.form.add_group"), "#",
|
||||
class: "js-toggle-link",
|
||||
data: { "toggle-selector" => "#new-group-form" } %></strong>
|
||||
</div>
|
||||
<% else %>
|
||||
<%= link_to t("admin.budgets.form.add_group"), "#", class: "button float-right js-toggle-link", data: { "toggle-selector" => "#new-group-form" } %>
|
||||
<% end %>
|
||||
|
||||
<%= form_for [:admin, @budget, Budget::Group.new], html: {id: "new-group-form", style: "display:none"}, remote: true do |f| %>
|
||||
<div class="input-group">
|
||||
<span class="input-group-label">
|
||||
<label><%= f.label :name,t("admin.budgets.form.group") %></label>
|
||||
</span>
|
||||
<%= f.text_field :name,
|
||||
label: false,
|
||||
maxlength: 50,
|
||||
placeholder: t("admin.budgets.form.group") %>
|
||||
<div class="input-group-button">
|
||||
<%= f.submit t("admin.budgets.form.create_group"), class: "button success" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% groups.each do |group| %>
|
||||
<div class="row" id="<%= dom_id(group) %>">
|
||||
<%= render "admin/budgets/group", group: group, headings: group.headings %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
25
app/views/admin/budgets/index.html.erb
Normal file
25
app/views/admin/budgets/index.html.erb
Normal file
@@ -0,0 +1,25 @@
|
||||
<h2 class="inline-block"><%= t("admin.budgets.index.title") %></h2>
|
||||
|
||||
<%= link_to t("admin.budgets.index.new_link"),
|
||||
new_admin_budget_path,
|
||||
class: "button float-right margin-right" %>
|
||||
|
||||
<%= render 'shared/filter_subnav', i18n_namespace: "admin.budgets.index" %>
|
||||
|
||||
|
||||
<h3><%= page_entries_info @budgets %></h3>
|
||||
|
||||
<table>
|
||||
<% @budgets.each do |budget| %>
|
||||
<tr id="<%= dom_id(budget) %>" class="budget">
|
||||
<td>
|
||||
<%= link_to budget.name, admin_budget_path(budget) %>
|
||||
</td>
|
||||
<td class="small">
|
||||
<%= t("budget.phase.#{budget.phase}") %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<%= paginate @budgets %>
|
||||
29
app/views/admin/budgets/new.html.erb
Normal file
29
app/views/admin/budgets/new.html.erb
Normal file
@@ -0,0 +1,29 @@
|
||||
<div class="row">
|
||||
<div class="small-12 medium-9 column">
|
||||
<h2><%= t("admin.budgets.new.title") %></h2>
|
||||
|
||||
<%= form_for [:admin, @budget] do |f| %>
|
||||
|
||||
<%= f.label :name, t("admin.budgets.new.name") %>
|
||||
<%= f.text_field :name,
|
||||
label: false,
|
||||
maxlength: 30,
|
||||
placeholder: t("admin.budgets.new.name") %>
|
||||
|
||||
<%= f.label :description, t("admin.budgets.new.description") %>
|
||||
<%= f.text_area :description, rows: 3, maxlength: 6000, label: false, placeholder: t("admin.budgets.new.description") %>
|
||||
|
||||
<div class="row">
|
||||
<div class="small-12 medium-9 column">
|
||||
<%= f.label :description, t("admin.budgets.new.phase") %>
|
||||
<%= f.select :phase, budget_phases_select_options, {label: false} %>
|
||||
</div>
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= f.label :description, t("admin.budgets.new.currency") %>
|
||||
<%= f.select :currency_symbol, budget_currency_symbol_select_options, {label: false} %>
|
||||
</div>
|
||||
</div>
|
||||
<%= f.submit t("admin.budgets.new.create"), class: "button success" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
16
app/views/admin/budgets/show.html.erb
Normal file
16
app/views/admin/budgets/show.html.erb
Normal file
@@ -0,0 +1,16 @@
|
||||
<div class="row">
|
||||
<div class="small-12 medium-9 column">
|
||||
<h2><%= @budget.name %></h2>
|
||||
|
||||
<%= simple_format(text_with_links(@budget.description), {}, sanitize: false) %>
|
||||
|
||||
<p>
|
||||
<strong><%= t('admin.budgets.show.phase') %>:</strong> <%= t("budget.phase.#{@budget.phase}") %> |
|
||||
<strong><%= t('admin.budgets.show.currency') %>:</strong> <%= @budget.currency_symbol %>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="<%= dom_id @budget %>_groups" class="row">
|
||||
<%= render "groups", groups: @budget.groups %>
|
||||
</div>
|
||||
@@ -74,6 +74,7 @@
|
||||
|
||||
<% if comment.children.size > 0 %>
|
||||
<%= link_to "", class: "js-toggle-children relative", data: {'id': "#{dom_id(comment)}"} do %>
|
||||
<span class="sr-only"><%= t("shared.show") %></span>
|
||||
<span id="<%= dom_id(comment) %>_children_arrow" class="icon-arrow-down"></span> <%= t("comments.comment.responses", count: comment.children.size) %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
<% if can?(:vote, comment) %>
|
||||
<%= link_to vote_comment_path(comment, value: 'yes'),
|
||||
method: "post", remote: true do %>
|
||||
<span class="icon-angle-up"></span>
|
||||
<span class="icon-angle-up">
|
||||
<span class="sr-only"><%= t('votes.agree') %></span>
|
||||
</span>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<span class="icon-angle-up"></span>
|
||||
@@ -19,7 +21,9 @@
|
||||
<% if can?(:vote, comment) %>
|
||||
<%= link_to vote_comment_path(comment, value: 'no'),
|
||||
method: "post", remote: true do %>
|
||||
<span class="icon-angle-down"></span>
|
||||
<span class="icon-angle-down">
|
||||
<span class="sr-only"><%= t('votes.disagree') %></span>
|
||||
</span>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<span class="icon-angle-down"></span>
|
||||
|
||||
0
app/views/custom/.keep
Normal file
0
app/views/custom/.keep
Normal file
@@ -3,7 +3,9 @@
|
||||
<div class="in-favor inline-block">
|
||||
<%= link_to vote_debate_path(debate, value: 'yes'),
|
||||
class: "like #{voted_classes[:in_favor]}", title: t('votes.agree'), method: "post", remote: true do %>
|
||||
<span class="icon-like"></span>
|
||||
<span class="icon-like">
|
||||
<span class="sr-only"><%= t('votes.agree') %></span>
|
||||
</span>
|
||||
<span class="percentage"><%= votes_percentage('likes', debate) %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -12,7 +14,9 @@
|
||||
|
||||
<div class="against inline-block">
|
||||
<%= link_to vote_debate_path(debate, value: 'no'), class: "unlike #{voted_classes[:against]}", title: t('votes.disagree'), method: "post", remote: true do %>
|
||||
<span class="icon-unlike"></span>
|
||||
<span class="icon-unlike">
|
||||
<span class="sr-only"><%= t('votes.disagree') %></span>
|
||||
</span>
|
||||
<span class="percentage"><%= votes_percentage('dislikes', debate) %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<% if user_signed_in? %>
|
||||
<li>
|
||||
<%= link_to notifications_path, class: "notifications", accesskey: "n" do %>
|
||||
<span class="sr-only"><%= t("layouts.header.notifications") %></span>
|
||||
<% if current_user.notifications_count > 0 %>
|
||||
<span class="icon-circle" aria-hidden="true"></span>
|
||||
<span class="icon-notification" aria-hidden="true" title="<%= t('layouts.header.new_notifications', count: current_user.notifications_count).html_safe %>">
|
||||
|
||||
@@ -5,13 +5,13 @@
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<% if current_user.moderator? || current_user.administrator? %>
|
||||
<% if current_user.administrator? || current_user.moderator? %>
|
||||
<li>
|
||||
<%= link_to t("layouts.header.moderation"), moderation_root_path %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<% if feature?(:spending_proposals) && (current_user.valuator? || current_user.administrator?) %>
|
||||
<% if feature?(:spending_proposals) && (current_user.administrator? || current_user.valuator?) %>
|
||||
<li>
|
||||
<%= link_to t("layouts.header.valuation"), valuation_root_path %>
|
||||
</li>
|
||||
|
||||
@@ -21,24 +21,24 @@
|
||||
<main>
|
||||
<div class="row text-center margin">
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= image_tag("icon_home_debate.png", size: "168x168", alt: t("welcome.debates.alt"), title: t("welcome.debates.title")) %>
|
||||
<%= image_tag("icon_home_debate.png", size: "168x168", alt: "", title: t("welcome.debates.title")) %>
|
||||
<h2><%= t("welcome.debates.title") %></h2>
|
||||
<p><%= t("welcome.debates.description") %></p>
|
||||
|
||||
</div>
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= image_tag("icon_home_proposal.png", size: "168x168", alt: t("welcome.proposal.alt"), title: t("welcome.proposal.title")) %>
|
||||
<%= image_tag("icon_home_proposal.png", size: "168x168", alt: "", title: t("welcome.proposal.title")) %>
|
||||
<h2><%= t("welcome.proposal.title") %></h2>
|
||||
<p><%= t("welcome.proposal.description") %></p>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= image_tag("icon_home_decide.png", size: "168x168", alt: t("welcome.decide.alt"), title: t("welcome.decide.title")) %>
|
||||
<%= image_tag("icon_home_decide.png", size: "168x168", alt: "", title: t("welcome.decide.title")) %>
|
||||
<h2><%= t("welcome.decide.title") %></h2>
|
||||
<p><%= t("welcome.decide.description") %></p>
|
||||
</div>
|
||||
<div class="small-12 medium-3 column">
|
||||
<%= image_tag("icon_home_do.png", size: "168x168", alt: t("welcome.do.alt"), title: t("welcome.do.title")) %>
|
||||
<%= image_tag("icon_home_do.png", size: "168x168", alt: "", title: t("welcome.do.title")) %>
|
||||
<h2><%= t("welcome.do.title") %></h2>
|
||||
<p><%= t("welcome.do.description") %></p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user