Merge branch 'master' into aperez-fix-for-issue-1848

This commit is contained in:
BertoCQ
2017-09-19 22:54:06 +02:00
committed by GitHub
102 changed files with 514 additions and 1662 deletions

View File

@@ -5,6 +5,8 @@ App.Comments =
this.update_comments_count()
add_reply: (parent_id, response_html) ->
if $("##{parent_id} .comment-children").length == 0
$("##{parent_id}").append("<li><ul id='#{parent_id}_children' class='no-bullet comment-children'></ul></li>")
$("##{parent_id} .comment-children:first").prepend($(response_html))
this.update_comments_count()

View File

@@ -32,22 +32,30 @@
padding: 0;
z-index: 4 !important;
.ui-datepicker-prev {
left: 12px;
}
.ui-datepicker-next {
right: 12px;
}
.ui-datepicker-prev,
.ui-datepicker-next {
color: #fff;
cursor: pointer;
font-family: "icons" !important;
font-size: rem-calc(24);
font-weight: normal;
font-size: $small-font-size;
height: rem-calc(30);
line-height: $line-height;
top: 0;
position: absolute;
top: 4px;
width: rem-calc(30);
&:hover {
text-decoration: none;
}
}
.ui-datepicker-prev::after {
content: '\62';
}
.ui-datepicker-next::after {
content: '\63';
}
table {

View File

@@ -205,7 +205,7 @@ a {
.menu.simple {
border-bottom: 1px solid $border;
margin: $line-height 0;
margin-bottom: $line-height;
li {
padding-bottom: rem-calc(7);

View File

@@ -395,8 +395,8 @@
}
}
&.tags,
&.geozone {
.tags,
.geozone {
li {
margin-bottom: 0;
@@ -478,6 +478,7 @@
.tags {
display: block;
margin-bottom: 0;
a {
margin-right: rem-calc(6);
@@ -610,6 +611,14 @@
}
}
.show-actions-menu {
[class^="icon-"] {
display: inline-block;
vertical-align: middle;
}
}
// 04. List participation
// ----------------------
@@ -896,9 +905,14 @@
}
.help-header {
background: #fafafa;
border-bottom: 1px solid #eee;
padding-bottom: $line-height / 2;
padding-top: $line-height;
h1 {
font-size: rem-calc(24);
text-transform: uppercase;
}
}

View File

@@ -7,7 +7,7 @@ class CommunitiesController < ApplicationController
skip_authorization_check
def show
redirect_to root_path unless Setting['feature.community'].present?
redirect_to root_path if Setting['feature.community'].blank?
end
private

View File

@@ -1,8 +1,8 @@
class DocumentsController < ApplicationController
before_action :authenticate_user!
before_filter :find_documentable, except: :destroy
before_filter :prepare_new_document, only: [:new, :new_nested]
before_filter :prepare_document_for_creation, only: :create
before_action :find_documentable, except: :destroy
before_action :prepare_new_document, only: [:new, :new_nested]
before_action :prepare_document_for_creation, only: :create
load_and_authorize_resource except: :upload
skip_authorization_check only: :upload
@@ -48,6 +48,7 @@ class DocumentsController < ApplicationController
def destroy_upload
@document = Document.new(cached_attachment: params[:path])
@document.set_attachment_from_cached_attachment
@document.cached_attachment = nil
@document.documentable = @documentable
if @document.attachment.destroy

View File

@@ -1,49 +0,0 @@
class Officing::FinalRecountsController < Officing::BaseController
before_action :load_poll
before_action :load_officer_assignment, only: :create
def new
@officer_assignments = ::Poll::OfficerAssignment.
includes(:final_recounts, booth_assignment: [:booth]).
joins(:booth_assignment).
final.
where(id: current_user.poll_officer.officer_assignment_ids).
where("poll_booth_assignments.poll_id = ?", @poll.id).
order(date: :asc)
@final_recounts = @officer_assignments.select {|oa| oa.final_recounts.any?}.map(&:final_recounts).flatten
end
def create
@final_recount = ::Poll::FinalRecount.find_or_initialize_by(booth_assignment_id: @officer_assignment.booth_assignment_id,
date: final_recount_params[:date])
@final_recount.officer_assignment_id = @officer_assignment.id
@final_recount.count = final_recount_params[:count]
if @final_recount.save
msg = { notice: t("officing.final_recounts.flash.create") }
else
msg = { alert: t("officing.final_recounts.flash.error_create") }
end
redirect_to new_officing_poll_final_recount_path(@poll), msg
end
private
def load_poll
@poll = Poll.expired.find(params[:poll_id])
end
def load_officer_assignment
@officer_assignment = current_user.poll_officer.
officer_assignments.final.find_by(id: final_recount_params[:officer_assignment_id])
if @officer_assignment.blank?
redirect_to new_officing_poll_final_recount_path(@poll), alert: t("officing.final_recounts.flash.error_create")
end
end
def final_recount_params
params.permit(:officer_assignment_id, :count, :date)
end
end

View File

@@ -6,10 +6,11 @@ class Officing::PollsController < Officing::BaseController
end
def final
@polls = current_user.poll_officer? ? current_user.poll_officer.final_days_assigned_polls : []
return unless current_user.poll_officer?
@polls = @polls.select {|poll| poll.ends_at > 1.week.ago && poll.expired?}
@polls = if current_user.poll_officer?
current_user.poll_officer.final_days_assigned_polls.select {|poll| poll.ends_at > 2.week.ago && poll.expired?}
else
[]
end
end
end
end

View File

@@ -28,6 +28,7 @@ class Officing::ResultsController < Officing::BaseController
where(date: index_params[:date])
@whites = ::Poll::WhiteResult.where(booth_assignment_id: @booth_assignment.id, date: index_params[:date]).sum(:amount)
@nulls = ::Poll::NullResult.where(booth_assignment_id: @booth_assignment.id, date: index_params[:date]).sum(:amount)
@total = ::Poll::TotalResult.where(booth_assignment_id: @booth_assignment.id, date: index_params[:date]).sum(:amount)
end
end
@@ -70,6 +71,7 @@ class Officing::ResultsController < Officing::BaseController
build_white_results
build_null_results
build_total_results
end
def build_white_results
@@ -96,6 +98,18 @@ class Officing::ResultsController < Officing::BaseController
end
end
def build_total_results
if results_params[:total].present?
total_result = ::Poll::TotalResult.find_or_initialize_by(booth_assignment_id: @officer_assignment.booth_assignment_id,
date: results_params[:date])
total_result.officer_assignment_id = @officer_assignment.id
total_result.amount = results_params[:total].to_i
total_result.author = current_user
total_result.origin = 'booth'
@results << total_result
end
end
def go_back_to_new(alert = nil)
params[:d] = results_params[:date]
params[:oa] = results_params[:officer_assignment_id]
@@ -132,7 +146,7 @@ class Officing::ResultsController < Officing::BaseController
end
def results_params
params.permit(:officer_assignment_id, :date, :questions, :whites, :nulls)
params.permit(:officer_assignment_id, :date, :questions, :whites, :nulls, :total)
end
def index_params

View File

@@ -78,7 +78,7 @@ class ProposalsController < ApplicationController
def proposal_params
params.require(:proposal).permit(:title, :question, :summary, :description, :external_url, :video_url,
:responsible_name, :tag_list, :terms_of_service, :geozone_id,
documents_attributes: [:id, :title, :attachment, :cached_attachment, :user_id] )
documents_attributes: [:id, :title, :attachment, :cached_attachment, :user_id])
end
def retired_params

View File

@@ -36,6 +36,10 @@ module AdminHelper
["banners"].include? controller_name
end
def menu_customization?
["pages", "images", "content_blocks"].include? controller_name
end
def official_level_options
options = [["", 0]]
(1..5).each do |i|

View File

@@ -12,7 +12,7 @@ module CommunitiesHelper
community.from_proposal? ? t("community.show.description.proposal") : t("community.show.description.investment")
end
def is_author?(community, participant)
def author?(community, participant)
if community.from_proposal?
community.proposal.author_id == participant.id
else

View File

@@ -9,7 +9,7 @@ module DocumentablesHelper
end
def max_file_size(documentable)
bytesToMeg(documentable.class.max_file_size)
bytes_to_mega(documentable.class.max_file_size)
end
def accepted_content_types(documentable)
@@ -18,8 +18,8 @@ module DocumentablesHelper
def accepted_content_types_extensions(documentable_class)
documentable_class.accepted_content_types
.collect{ |content_type| ".#{content_type.split("/").last}" }
.join(",")
.collect{ |content_type| ".#{content_type.split('/').last}" }
.join(",")
end
def humanized_accepted_content_types(documentable)
@@ -38,4 +38,4 @@ module DocumentablesHelper
documentable.documents.count >= documentable.class.max_documents_allowed
end
end
end

View File

@@ -8,7 +8,7 @@ module DocumentsHelper
document.errors[:attachment].join(', ') if document.errors.key?(:attachment)
end
def bytesToMeg(bytes)
def bytes_to_mega(bytes)
bytes / Numeric::MEGABYTE
end
@@ -80,10 +80,10 @@ module DocumentsHelper
def document_direct_upload_url(document)
upload_documents_url(
documentable_type: document.documentable_type,
documentable_id: document.documentable_id,
format: :js
)
documentable_type: document.documentable_type,
documentable_id: document.documentable_id,
format: :js
)
end
end

View File

@@ -1,5 +1,8 @@
module EmbedVideosHelper
VIMEO_REGEX = /vimeo.*(staffpicks\/|channels\/|videos\/|video\/|\/)([^#\&\?]*).*/
YOUTUBE_REGEX = /youtu.*(be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/
def embedded_video_code
link = @proposal.video_url
title = t('proposals.show.embed_video_title', proposal: @proposal.title)
@@ -10,10 +13,10 @@ module EmbedVideosHelper
end
if server == "Vimeo"
reg_exp = /vimeo.*(staffpicks\/|channels\/|videos\/|video\/|\/)([^#\&\?]*).*/
reg_exp = VIMEO_REGEX
src = "https://player.vimeo.com/video/"
elsif server == "YouTube"
reg_exp = /youtu.*(be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/
reg_exp = YOUTUBE_REGEX
src = "https://www.youtube.com/embed/"
end
@@ -28,4 +31,11 @@ module EmbedVideosHelper
end
end
end
def valid_video_url?
return if video_url.blank?
return if video_url.match(VIMEO_REGEX)
return if video_url.match(YOUTUBE_REGEX)
errors.add(:video_url, :invalid)
end
end

View File

@@ -32,4 +32,16 @@ module ProposalsHelper
Proposal::RETIRE_OPTIONS.collect { |option| [ t("proposals.retire_options.#{option}"), option ] }
end
def can_create_document?(document, proposal)
can?(:create, document) && proposal.documents.size < Proposal.max_documents_allowed
end
def author_of_proposal?(proposal)
author_of?(proposal, current_user)
end
def current_editable?(proposal)
current_user && proposal.editable_by?(current_user)
end
end

View File

@@ -11,7 +11,7 @@ class Community < ActiveRecord::Base
end
def from_proposal?
self.proposal.present?
proposal.present?
end
private

View File

@@ -10,7 +10,7 @@ module Documentable
private
def documentable(options= {})
def documentable(options = {})
@max_documents_allowed = options[:max_documents_allowed]
@max_file_size = options[:max_file_size]
@accepted_content_types = options[:accepted_content_types]

View File

@@ -40,7 +40,7 @@ class Document < ActiveRecord::Base
attachment.instance.prefix(attachment, style)
end
def prefix(attachment, style)
def prefix(attachment, _style)
if !attachment.instance.persisted?
"cached_attachments/user/#{attachment.instance.user_id}"
else
@@ -75,7 +75,7 @@ class Document < ActiveRecord::Base
end
def remove_cached_document
File.delete(cached_attachment) if File.exists?(cached_attachment)
File.delete(cached_attachment) if File.exist?(cached_attachment)
end
end

View File

@@ -4,6 +4,7 @@ class Poll < ActiveRecord::Base
has_many :partial_results, through: :booth_assignments
has_many :white_results, through: :booth_assignments
has_many :null_results, through: :booth_assignments
has_many :total_results, through: :booth_assignments
has_many :voters
has_many :officer_assignments, through: :booth_assignments
has_many :officers, through: :officer_assignments

View File

@@ -5,7 +5,7 @@ class Poll
has_many :shifts
validates :name, presence: true, uniqueness: true
def self.search(terms)
return Booth.none if terms.blank?
Booth.where("name ILIKE ? OR location ILIKE ?", "%#{terms}%", "%#{terms}%")

View File

@@ -10,5 +10,6 @@ class Poll
has_many :partial_results
has_many :white_results
has_many :null_results
has_many :total_results
end
end

View File

@@ -20,6 +20,7 @@ class Poll::Question < ActiveRecord::Base
validates :title, presence: true
validates :author, presence: true
validates :poll_id, presence: true
validates :title, length: { minimum: 4 }
validates :description, length: { maximum: Poll::Question.description_max_length }

View File

@@ -1,13 +1,13 @@
class Poll
class Shift < ActiveRecord::Base
belongs_to :booth
belongs_to :officer
belongs_to :booth
belongs_to :officer
validates :booth_id, presence: true
validates :officer_id, presence: true
validates :date, presence: true
validates :date, uniqueness: { scope: [:officer_id, :booth_id] }
before_create :persist_data
after_create :create_officer_assignments
@@ -20,10 +20,10 @@ class Poll
end
end
def persist_data
def persist_data
self.officer_name = officer.name
self.officer_email = officer.email
end
end
end
end

View File

@@ -0,0 +1,23 @@
class Poll::TotalResult < ActiveRecord::Base
VALID_ORIGINS = %w{web booth}
belongs_to :author, -> { with_hidden }, class_name: 'User', foreign_key: 'author_id'
belongs_to :booth_assignment
belongs_to :officer_assignment
validates :author, presence: true
validates :origin, inclusion: {in: VALID_ORIGINS}
scope :by_author, ->(author_id) { where(author_id: author_id) }
before_save :update_logs
def update_logs
if amount_changed? && amount_was.present?
self.amount_log += ":#{amount_was.to_s}"
self.officer_assignment_id_log += ":#{officer_assignment_id_was.to_s}"
self.author_id_log += ":#{author_id_was.to_s}"
end
end
end

View File

@@ -15,6 +15,7 @@ class Proposal < ActiveRecord::Base
max_file_size: 3.megabytes,
accepted_content_types: [ "application/pdf" ]
accepts_nested_attributes_for :documents, allow_destroy: true
include EmbedVideosHelper
acts_as_votable
acts_as_paranoid column: :hidden_at
@@ -41,6 +42,8 @@ class Proposal < ActiveRecord::Base
validates :terms_of_service, acceptance: { allow_nil: false }, on: :create
validate :valid_video_url?
before_validation :set_responsible_name
before_save :calculate_hot_score, :calculate_confidence_score

View File

@@ -13,6 +13,6 @@ class Topic < ActiveRecord::Base
scope :sort_by_newest, -> { order(created_at: :desc) }
scope :sort_by_oldest, -> { order(created_at: :asc) }
scope :sort_by_most_commented, -> { reorder(comments_count: :desc) }
scope :sort_by_most_commented, -> { reorder(comments_count: :desc) }
end

View File

@@ -57,13 +57,13 @@ class User < ActiveRecord::Base
scope :officials, -> { where("official_level > 0") }
scope :newsletter, -> { where(newsletter: true) }
scope :for_render, -> { includes(:organization) }
scope :by_document, -> (document_type, document_number) { where(document_type: document_type, document_number: document_number) }
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) }
scope :erased, -> { where.not(erased_at: nil) }
scope :public_for_api, -> { all }
scope :by_comments, -> (query, topics_ids) { joins(:comments).where(query, topics_ids).uniq }
scope :by_authors, -> (author_ids) { where("users.id IN (?)", author_ids) }
scope :by_comments, ->(query, topics_ids) { joins(:comments).where(query, topics_ids).uniq }
scope :by_authors, ->(author_ids) { where("users.id IN (?)", author_ids) }
before_validation :clean_document_number

View File

@@ -60,12 +60,12 @@
<span class="icon-checkmark-circle"></span>
<strong><%= t("admin.menu.title_polls") %></strong>
</a>
<ul id="polls_menu" <%= "class=is-active" if menu_polls? %>>
<li <%= "class=active" if ["polls", "officer_assignments", "booth_assignments", "recounts", "results"].include? controller_name %>>
<ul id="polls_menu" <%= "class=is-active" if menu_polls? && controller.class.parent == Admin::Poll::QuestionsController %>>
<li <%= "class=active" if ["polls", "officer_assignments", "booth_assignments", "recounts", "results"].include? controller_name %>>
<%= link_to t('admin.menu.polls'), admin_polls_path %>
</li>
<li <%= "class=active" if controller_name == "questions" %>>
<li <%= "class=active" if controller_name == "questions" && controller.class.parent == Admin::Poll::QuestionsController %>>
<%= link_to t("admin.menu.poll_questions"), admin_questions_path %>
</li>
@@ -73,13 +73,13 @@
<%= link_to t('admin.menu.poll_officers'), admin_officers_path %>
</li>
<li <%= "class=active" if controller_name == "booths" &&
<li <%= "class=active" if controller_name == "booths" &&
action_name != "available" %>>
<%= link_to t('admin.menu.poll_booths'), admin_booths_path %>
</li>
<li <%= "class=active" if controller_name == "shifts" ||
controller_name == "booths" &&
<li <%= "class=active" if controller_name == "shifts" ||
controller_name == "booths" &&
action_name == "available" %>>
<%= link_to t('admin.menu.poll_shifts'), available_admin_booths_path %>
</li>
@@ -158,7 +158,7 @@
<span class="icon-settings"></span>
<strong><%= t("admin.menu.title_site_customization") %></strong>
</a>
<ul <%= "class=is-active" if menu_profiles? %>>
<ul <%= "class=is-active" if menu_customization? %>>
<li <%= "class=active" if controller_name == "pages" %>>
<%= link_to t("admin.menu.site_customization.pages"), admin_site_customization_pages_path %>
</li>

View File

@@ -14,11 +14,13 @@
<thead>
<th><%= t("admin.results.index.table_whites") %></th>
<th><%= t("admin.results.index.table_nulls") %></th>
<th><%= t("admin.results.index.table_total") %></th>
</thead>
<tbody>
<tr>
<td id="white_results"><%= @poll.white_results.sum(:amount) %></td>
<td id="null_results"><%= @poll.null_results.sum(:amount) %></td>
<td id="total_results"><%= @poll.total_results.sum(:amount) %></td>
</tr>
</tbody>
</table>
@@ -47,4 +49,4 @@
<% end %>
<% end %>
</div>
</div>

View File

@@ -32,6 +32,7 @@
<p class="lead">
<strong><%= t("budgets.index.section_footer.title") %></strong>
</p>
<p><%= t("budgets.index.section_footer.description") %></p>
<p><%= t("budgets.index.section_footer.help_text_1") %></p>
<p><%= t("budgets.index.section_footer.help_text_2") %></p>
<p><%= t("budgets.index.section_footer.help_text_3",

View File

@@ -93,6 +93,7 @@
</div>
<% end %>
</li>
<% unless child_comments_of(comment).empty? %>
<li>
<ul id="<%= dom_id(comment) %>_children" class="no-bullet comment-children">
<% child_comments_of(comment).each do |child| %>
@@ -102,5 +103,6 @@
<% end %>
</ul>
</li>
<% end %>
</ul>
<% end %>

View File

@@ -9,7 +9,7 @@
<%= link_to participant.name, user_path(participant)%>
</span>
<% if is_author?(@community, participant) %>
<% if author?(@community, participant) %>
&nbsp;&bull;&nbsp;
<span class="label round is-author">
<%= t("comments.comment.author") %>

View File

@@ -62,6 +62,7 @@
<p class="lead">
<strong><%= t("debates.index.section_footer.title") %></strong>
</p>
<p><%= t("debates.index.section_footer.description") %></p>
<p><%= t("debates.index.section_footer.help_text_1") %></p>
<p><%= t("debates.index.section_footer.help_text_2",
org: link_to(setting['org_name'], new_user_registration_path)).html_safe %></p>

View File

@@ -23,6 +23,7 @@
<p class="lead">
<strong><%= t("legislation.processes.index.section_footer.title") %></strong>
</p>
<p><%= t("legislation.processes.index.section_footer.description") %></p>
<p><%= t("legislation.processes.index.section_footer.help_text_1") %></p>
<p><%= t("legislation.processes.index.section_footer.help_text_2",
org: setting['org_name']) %></p>

View File

@@ -1,80 +0,0 @@
<% if @officer_assignments.any? %>
<h2><%= t("officing.final_recounts.new.title", poll: @poll.name) %></h2>
<%= form_tag(officing_poll_final_recounts_path(@poll), {id: "officer_assignment_form"}) do %>
<div class="row">
<div class="small-12 medium-6 column">
<label><%= t("officing.final_recounts.new.booth") %></label>
<%= select_tag :officer_assignment_id,
booths_for_officer_select_options(@officer_assignments),
{ prompt: t("officing.final_recounts.new.select_booth"),
label: false } %>
</div>
</div>
<div class="row">
<div class="small-12 medium-6 column">
<label><%= t("officing.final_recounts.new.date") %></label>
<%= select_tag :date,
poll_dates_select_options(@poll),
{ prompt: t("officing.final_recounts.new.select_date"),
label: false } %>
</div>
</div>
<div class="row">
<div class="small-12 medium-6 large-4 column">
<label><%= t("officing.final_recounts.new.count") %></label>
<%= text_field_tag :count, nil, placeholder: t("officing.final_recounts.new.count_placeholder") %>
</div>
</div>
<div class="row">
<div class="small-12 medium-6 large-4 column">
<%= submit_tag t("officing.final_recounts.new.submit"), class: "button expanded" %>
</div>
</div>
<% end %>
<% else %>
<h2><%= @poll.name %></h2>
<div class="callout alert">
<%= t("officing.final_recounts.new.not_allowed") %>
</div>
<% end %>
<% if @final_recounts.any? %>
<hr>
<h3><%= t("officing.final_recounts.new.final_recount_list") %></h3>
<table>
<thead>
<th><%= t("officing.final_recounts.new.date") %></th>
<th><%= t("officing.final_recounts.new.booth") %></th>
<th><%= t("officing.final_recounts.new.count") %></th>
<th><%= t("officing.final_recounts.new.system_count") %></th>
<th>&nbsp;</th>
</thead>
<tbody>
<% @final_recounts.each do |final_recount| %>
<tr id="<%= dom_id(final_recount) %>">
<td>
<%= l(final_recount.date.to_date, format: :long) %>
</td>
<td>
<%= final_recount.booth_assignment.booth.name %>
</td>
<td>
<strong><%= final_recount.count %></strong>
</td>
<td>
<strong><%= system_recount_to_compare_with_final_recount final_recount %></strong>
</td>
<td>
<%= link_to t("officing.final_recounts.new.add_results"), new_officing_poll_result_path(@poll, oa: final_recount.officer_assignment.id, d: l(final_recount.date.to_date) )%>
</td>
</tr>
<% end %>
</tbody>
</table>
<% end %>

View File

@@ -14,9 +14,6 @@
</strong>
</td>
<td class="text-right">
<%= link_to t("officing.polls.final.add_recount"),
new_officing_poll_final_recount_path(poll),
class: "button hollow" %>
<%= link_to t("officing.polls.final.add_results"),
new_officing_poll_result_path(poll),
class: "button hollow" %>
@@ -29,4 +26,4 @@
<div class="callout primary">
<%= t("officing.polls.final.no_polls") %>
</div>
<% end %>
<% end %>

View File

@@ -16,12 +16,14 @@
<tr>
<th><%= t("officing.results.index.table_whites") %></th>
<th><%= t("officing.results.index.table_nulls") %></th>
<th><%= t("officing.results.index.table_total") %></th>
</tr>
</thead>
<tbody>
<tr>
<td id="white_results"><%= @whites %></td>
<td id="null_results"><%= @nulls %></td>
<td id="total_results"><%= @total %></td>
</tr>
</tbody>
</table>
@@ -54,4 +56,4 @@
<div class="callout primary">
<%= t("officing.results.index.no_results") %>
</div>
<% end %>
<% end %>

View File

@@ -47,6 +47,11 @@
<h3><%= t("officing.results.new.ballots_null") %></h3>
<%= text_field_tag :nulls, params[:nulls].presence, placeholder: "0" %>
</div>
<div class="small-12 medium-6 large-3 column end">
<h3><%= t("officing.results.new.ballots_total") %></h3>
<%= text_field_tag :total, params[:total].presence, placeholder: "0" %>
</div>
</div>
<hr>

View File

@@ -27,6 +27,7 @@
<p class="lead">
<strong><%= t("polls.index.section_footer.title") %></strong>
</p>
<p><%= t("polls.index.section_footer.description") %></p>
<p><%= t("polls.index.section_footer.help_text_1") %></p>
<p><%= t("polls.index.section_footer.help_text_2",
org: link_to(setting['org_name'], new_user_registration_path)).html_safe %></p>

View File

@@ -76,6 +76,7 @@
<p class="lead">
<strong><%= t("proposals.index.section_footer.title") %></strong>
</p>
<p><%= t("proposals.index.section_footer.description") %></p>
<p><%= t("proposals.index.section_footer.help_text_1") %></p>
<p><%= t("proposals.index.section_footer.help_text_2",
org: link_to(setting['org_name'], new_user_registration_path)).html_safe %></p>

View File

@@ -16,24 +16,6 @@
<div class="small-12 medium-9 column">
<%= back_link_to %>
<% if can?(:create, @document) && @proposal.documents.size < Proposal.max_documents_allowed %>
<%= link_to t("documents.upload_document"),
new_document_path(documentable_id: @proposal, documentable_type: @proposal.class.name, from: request.url),
class: 'button hollow float-right' %>
<% end %>
<% if author_of?(@proposal, current_user) %>
<%= link_to t("proposals.show.send_notification"),
new_proposal_notification_path(proposal_id: @proposal.id),
class: 'button hollow float-right' %>
<% end %>
<% if current_user && @proposal.editable_by?(current_user) %>
<%= link_to edit_proposal_path(@proposal), class: 'edit-proposal button hollow float-right' do %>
<%= t("proposals.show.edit_proposal_link") %>
<% end %>
<% end %>
<h1><%= @proposal.title %></h1>
<% if @proposal.retired? %>
<div data-alert class="callout alert margin-top proposal-retired">
@@ -122,6 +104,35 @@
</div>
<aside class="small-12 medium-3 column">
<% if can_create_document?(@document, @proposal) || author_of_proposal?(@proposal) || current_editable?(@proposal) %>
<div class="sidebar-divider"></div>
<h2><%= t("proposals.show.author") %></h2>
<div class="show-actions-menu">
<% if can_create_document?(@document, @proposal) %>
<%= link_to new_document_path(documentable_id: @proposal, documentable_type: @proposal.class.name, from: request.url),
class: 'button hollow expanded' do %>
<span class="icon-document"></span>
<%= t("documents.upload_document") %>
<% end %>
<% end %>
<% if author_of_proposal?(@proposal) %>
<%= link_to new_proposal_notification_path(proposal_id: @proposal.id),
class: 'button hollow expanded' do %>
<span class="icon-no-notification"></span>
<%= t("proposals.show.send_notification") %>
<% end %>
<% end %>
<% if current_editable?(@proposal) %>
<%= link_to edit_proposal_path(@proposal), class: 'edit-proposal button hollow expanded' do %>
<span class="icon-edit"></span>
<%= t("proposals.show.edit_proposal_link") %>
<% end %>
<% end %>
</div>
<% end %>
<div class="sidebar-divider"></div>
<h2><%= t("votes.supports") %></h2>
<div id="<%= dom_id(@proposal) %>_votes">

View File

@@ -1,12 +1,9 @@
<div class="highlight jumbo help-header">
<div class="help-header no-margin-top margin-bottom">
<div class="row">
<div class="small-12 medium-9 column" data-magellan>
<div class="small-12 column" data-magellan>
<%= image_tag "help/help_icon_#{image}.png", alt: t("#{i18n_namespace}.icon_alt"), class: "align-top" %>
<h1 class="inline-block"><%= t("#{i18n_namespace}.title") %></h1>
<p>
<%= t("#{i18n_namespace}.description") %><br>
<%= link_to t("#{i18n_namespace}.help"), "#section_help" %>
</p>
<%= link_to t("#{i18n_namespace}.help"), "#section_help", class: "float-right" %>
</div>
</div>
</div>