Merge branch 'master' into polls_minor_changes

This commit is contained in:
María Checa
2017-10-03 16:22:33 +02:00
47 changed files with 559 additions and 173 deletions

View File

@@ -2,4 +2,6 @@
<h2><%= t("admin.questions.edit.title") %></h2>
<%= render "form", form_url: admin_question_path(@question) %>
<div class="poll-question-form">
<%= render "form", form_url: admin_question_path(@question) %>
</div>

View File

@@ -2,4 +2,6 @@
<h2><%= t("admin.questions.new.title") %></h2>
<%= render "form", form_url: admin_questions_path %>
<div class="poll-question-form">
<%= render "form", form_url: admin_questions_path %>
</div>

View File

@@ -1,13 +1,15 @@
<div id="<%= dom_id(investment) %>" class="budget-investment clear">
<div class="panel">
<div class="row">
<div class="row" data-equalizer>
<div class="small-12 medium-3 large-2 column">
<% if investment.image.present? %>
<%= image_tag investment.image_url(:thumb), alt: investment.image.title %>
<% else %>
<div class="no-image"></div>
<% end %>
<div data-equalizer-watch>
<% if investment.image.present? %>
<%= image_tag investment.image_url(:thumb), alt: investment.image.title %>
<% else %>
<div class="no-image"></div>
<% end %>
</div>
</div>
<div class="small-12 medium-6 large-7 column">
@@ -53,7 +55,7 @@
<% if investment.should_show_votes? %>
<div id="<%= dom_id(investment) %>_votes"
class="small-12 medium-3 column text-center">
class="small-12 medium-3 column text-center" data-equalizer-watch>
<%= render partial: '/budgets/investments/votes', locals: {
investment: investment,
investment_votes: investment_votes,
@@ -62,7 +64,7 @@
</div>
<% elsif investment.should_show_vote_count? %>
<div id="<%= dom_id(investment) %>_votes"
class="small-12 medium-3 column text-center">
class="small-12 medium-3 column text-center" data-equalizer-watch>
<div class="supports js-participation">
<span class="total-supports no-button">
<%= t("budgets.investments.investment.supports",
@@ -72,7 +74,7 @@
</div>
<% elsif investment.should_show_ballots? %>
<div id="<%= dom_id(investment) %>_ballot"
class="small-12 medium-3 column text-center">
class="small-12 medium-3 column text-center" data-equalizer-watch>
<%= render partial: '/budgets/investments/ballot', locals: {
investment: investment,
investment_ids: investment_ids,
@@ -81,11 +83,13 @@
</div>
<% elsif investment.should_show_price? %>
<div id="<%= dom_id(investment) %>_price"
class="supports small-12 medium-3 column text-center">
class="supports small-12 medium-3 column text-center" data-equalizer-watch>
<p class="investment-project-amount margin-top">
<%= investment.formatted_price %>
</p>
</div>
<% else %>
<div data-equalizer-watch></div>
<% end %>
<% end %>

View File

@@ -36,7 +36,7 @@
<% end %>
<% end %>
<% if @budget.finished? %>
<% if @budget.finished? || (@budget.balloting? && can?(:read_results, @budget)) %>
<%= link_to t("budgets.show.see_results"),
budget_results_path(@budget, heading_id: @budget.headings.first),
class: "button margin-top expanded" %>

View File

@@ -20,7 +20,4 @@
<div id="max-documents-notice" class="max-documents-notice callout warning text-center <%= "hide" unless max_documents_allowed?(documentable) %>">
<%= t "documents.max_documents_allowed_reached_html" %>
</div>
<hr>
</div>
</div>

View File

@@ -28,4 +28,5 @@
<div class="progress-bar-placeholder"><div class="loading-bar"></div></div>
</div>
<hr>
</div>

View File

@@ -1,12 +1,10 @@
<div>
<%= f.label :image, t("images.form.title") %>
<p class="help-text"><%= imageables_note(imageable) %></p>
<%= f.label :image, t("images.form.title") %>
<p class="help-text"><%= imageables_note(imageable) %></p>
<div id="nested-image">
<%= f.fields_for :image do |image_builder| %>
<%= render 'images/image_fields', f: image_builder, imageable: imageable %>
<% end %>
</div>
<div id="nested-image">
<%= f.fields_for :image do |image_builder| %>
<%= render 'images/image_fields', f: image_builder, imageable: imageable %>
<% end %>
</div>
<%= link_to_add_association t('images.form.add_new_image'), f, :image,
@@ -21,5 +19,3 @@
association_insertion_node: "#nested-image",
association_insertion_method: "append"
} %>
<hr>

View File

@@ -33,23 +33,30 @@
<span class="show-for-sr"><%= t("polls.index.cant_answer") %></span>
</div>
<% end %>
<div class="row">
<div class="small-12 column">
<div class="dates"><%= poll_dates(poll) %></div>
<div class="row" data-equalizer>
<div class="small-12 medium-3 column" data-equalizer-watch>
<!-- PENDING TO REPLACE THIS BLOCK WITH POLL MAIN IMAGE -->
<div style="background: #eee; width: 100%; height: 100%; display: block; margin: -12px;">&nbsp;</div>
<!-- /. PENDING TO REPLACE THIS BLOCK WITH POLL MAIN IMAGE -->
</div>
<div class="small-12 medium-6 column" data-equalizer-watch>
<div class="dates"></div>
<% if poll.questions.count == 1 %>
<% poll.questions.each do |question| %>
<h4 class="inline-block"><%= link_to question.title, poll %></h4>
<h4><%= link_to question.title, poll %></h4>
<%= poll_dates(poll) %>
<% end %>
<% else %>
<h4 class="inline-block"><%= link_to poll.name, poll %></h4>
<ul>
<h4><%= link_to poll.name, poll %></h4>
<%= poll_dates(poll) %>
<ul class="margin-top">
<% poll.questions.each do |question| %>
<li><%= link_to question.title, question_path(question) %></li>
<% end %>
</ul>
<% end %>
<% if poll.geozones.any? %>
<p class="inline-block">
<p>
<small><%= t("polls.index.geozone_info") %></small>
</p>
<% end %>
@@ -59,16 +66,18 @@
<% end %>
</ul>
</div>
<div class="small-12 medium-6 large-4 column end">
<%= link_to poll, class: "button expanded" do %>
<% if poll.expired? %>
<%= t("polls.index.participate_button_expired") %>
<% elsif poll.incoming? %>
<%= t("polls.index.participate_button_incoming") %>
<% else %>
<%= t("polls.index.participate_button") %>
<div class="small-12 medium-3 column table" data-equalizer-watch>
<div class="table-cell aling-middle">
<%= link_to poll, class: "button hollow expanded" do %>
<% if poll.expired? %>
<%= t("polls.index.participate_button_expired") %>
<% elsif poll.incoming? %>
<%= t("polls.index.participate_button_incoming") %>
<% else %>
<%= t("polls.index.participate_button") %>
<% end %>
<% end %>
<% end %>
</div>
</div>
</div>
</div>

View File

@@ -6,18 +6,22 @@
<%= render "shared/section_header", i18n_namespace: "polls.index.section_header", image: "polls" %>
<div class="row">
<div class="small-12 medium-9 column">
<div class="small-12 column">
<%= render 'shared/filter_subnav', i18n_namespace: "polls.index" %>
<% polls_by_geozone_restriction = @polls.group_by(&:geozone_restricted) %>
<% if polls_by_geozone_restriction[false].present? %>
<h3 class="section-title-divider"><%= t("polls.index.no_geozone_restricted") %></h3>
<h3 class="section-title-divider">
<span><%= t("polls.index.no_geozone_restricted") %></span>
</h3>
<%= render partial: 'poll_group', locals: {poll_group: polls_by_geozone_restriction[false]} %>
<% end %>
<% if polls_by_geozone_restriction[true].present? %>
<h3 class="section-title-divider"><%= t("polls.index.geozone_restricted") %></h3>
<h3 class="section-title-divider">
<span><%= t("polls.index.geozone_restricted") %></span>
</h3>
<%= render partial: 'poll_group', locals: {poll_group: polls_by_geozone_restriction[true]} %>
<% end %>

View File

@@ -31,8 +31,14 @@
<div class="row margin-top">
<div class="small-12 medium-9 column">
<% @questions.each do |question| %>
<%= render 'polls/questions/question', question: question %>
<% if @poll.voted_in_booth?(current_user) %>
<div class="callout warning">
<%= t("polls.show.already_voted_in_booth") %>
</div>
<% else %>
<% @questions.each do |question| %>
<%= render 'polls/questions/question', question: question %>
<% end %>
<% end %>
</div>

View File

@@ -3,14 +3,16 @@
data-type="proposal">
<div class="panel">
<div class="icon-successful"></div>
<div class="row">
<div class="row" data-equalizer>
<div class="small-12 medium-3 large-2 column">
<% if proposal.image.present? %>
<%= image_tag proposal.image_url(:thumb), alt: proposal.image.title %>
<% else %>
<div class="no-image"></div>
<% end %>
<div data-equalizer-watch>
<% if proposal.image.present? %>
<%= image_tag proposal.image_url(:thumb), alt: proposal.image.title %>
<% else %>
<div class="no-image"></div>
<% end %>
</div>
</div>
<div class="small-12 medium-6 large-7 column">
@@ -58,7 +60,7 @@
</div>
</div>
<div id="<%= dom_id(proposal) %>_votes" class="small-12 medium-3 column supports-container">
<div id="<%= dom_id(proposal) %>_votes" class="small-12 medium-3 column supports-container" data-equalizer-watch>
<% if proposal.successful? %>
<div class="padding text-center">

View File

@@ -117,6 +117,13 @@
<h2><%= t("proposals.show.author") %></h2>
<div class="show-actions-menu">
<% if current_editable?(@proposal) %>
<%= link_to edit_proposal_path(@proposal), class: 'button hollow expanded' do %>
<span class="icon-edit"></span>
<%= t("proposals.show.edit_proposal_link") %>
<% end %>
<% end %>
<% if author_of_proposal?(@proposal) %>
<%= link_to new_proposal_notification_path(proposal_id: @proposal.id),
class: 'button hollow expanded' do %>
@@ -128,20 +135,13 @@
<% if can_destroy_image?(@proposal) %>
<%= link_to image_path(@proposal.image, from: request.url),
method: :delete,
class: 'button hollow expanded',
class: 'button hollow alert expanded',
data: { confirm: t('images.actions.destroy.confirm') } do %>
<span class="icon-document"></span>
<span class="icon-image"></span>
<%= t("images.remove_image") %>
<% 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 %>