diff --git a/app/assets/stylesheets/layout.scss b/app/assets/stylesheets/layout.scss
index 9428c1982..6a22e92b9 100644
--- a/app/assets/stylesheets/layout.scss
+++ b/app/assets/stylesheets/layout.scss
@@ -2042,7 +2042,6 @@ table {
// ------------
.activity {
- margin-bottom: $line-height * 2;
.accordion li {
margin-bottom: $line-height / 2;
@@ -2074,62 +2073,15 @@ table {
}
}
- table {
- border: 0;
- margin-bottom: 0;
- }
-
- td {
- position: relative;
-
- &:first-child {
- padding-left: $line-height * 1.5;
- width: 75%;
- }
-
- &::before {
- color: $brand;
- font-family: "icons" !important;
- font-size: rem-calc(24);
- left: 4px;
- position: absolute;
- }
- }
-
- .activity-comments td:first-child::before {
- content: 'e';
- top: 18px;
- }
-
- .activity-debates td:first-child::before {
- content: 'i';
- top: 14px;
- }
-
- .activity-proposals {
-
- td:first-child::before {
- content: 'h';
- top: 18px;
- }
-
- .retired {
- text-decoration: line-through;
- }
- }
-
- .activity-investment-projects td:first-child::before,
- .activity-ballot td:first-child::before {
- content: '\53';
- top: 10px;
+ .retired {
+ text-decoration: line-through;
}
}
.public-interests {
- margin-top: $line-height;
- .column {
- padding-left: 0;
+ li {
+ margin-right: $line-height / 4;
}
}
diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss
index 382615739..20b586f23 100644
--- a/app/assets/stylesheets/participation.scss
+++ b/app/assets/stylesheets/participation.scss
@@ -364,10 +364,6 @@
width: rem-calc(48);
}
- .edit-debate {
- margin-bottom: 0;
- }
-
.debate-info,
.proposal-info,
.investment-project-info,
diff --git a/app/controllers/admin/poll/booth_assignments_controller.rb b/app/controllers/admin/poll/booth_assignments_controller.rb
index 8ffa455c8..7998f29a2 100644
--- a/app/controllers/admin/poll/booth_assignments_controller.rb
+++ b/app/controllers/admin/poll/booth_assignments_controller.rb
@@ -18,6 +18,8 @@ class Admin::Poll::BoothAssignmentsController < Admin::Poll::BaseController
@booth_assignment = @poll.booth_assignments.includes(:recounts, :voters,
officer_assignments: [officer: [:user]]).find(params[:id])
@voters_by_date = @booth_assignment.voters.group_by {|v| v.created_at.to_date}
+ @partial_results = @booth_assignment.partial_results
+ @recounts = @booth_assignment.recounts
end
def create
diff --git a/app/helpers/shifts_helper.rb b/app/helpers/shifts_helper.rb
index 3773014ac..3a55feb4f 100644
--- a/app/helpers/shifts_helper.rb
+++ b/app/helpers/shifts_helper.rb
@@ -1,23 +1,23 @@
module ShiftsHelper
- def shift_vote_collection_dates(polls)
- date_options((start_date(polls)..end_date(polls)), Poll::Shift.tasks[:vote_collection])
+ def shift_vote_collection_dates(booth, polls)
+ date_options((start_date(polls)..end_date(polls)), Poll::Shift.tasks[:vote_collection], booth)
end
- def shift_recount_scrutiny_dates(polls)
+ def shift_recount_scrutiny_dates(booth, polls)
dates = polls.map(&:ends_at).map(&:to_date).sort.inject([]) do |total, date|
initial_date = date < Date.current ? Date.current : date
total << (initial_date..date + Poll::RECOUNT_DURATION).to_a
end
- date_options(dates.flatten.uniq, Poll::Shift.tasks[:recount_scrutiny])
+ date_options(dates.flatten.uniq, Poll::Shift.tasks[:recount_scrutiny], booth)
end
- def date_options(dates, task_id)
- valid_dates(dates, task_id).map { |date| [l(date, format: :long), l(date)] }
+ def date_options(dates, task_id, booth)
+ valid_dates(dates, task_id, booth).map { |date| [l(date, format: :long), l(date)] }
end
- def valid_dates(dates, task_id)
- dates.reject { |date| officer_shifts(task_id).include?(date) }
+ def valid_dates(dates, task_id, booth)
+ dates.reject { |date| officer_shifts(task_id, booth).include?(date) }
end
def start_date(polls)
@@ -35,7 +35,7 @@ module ShiftsHelper
private
- def officer_shifts(task_id)
- @officer.shifts.where(task: task_id).map(&:date)
+ def officer_shifts(task_id, booth)
+ @officer.shifts.where(task: task_id, booth: booth).map(&:date)
end
end
diff --git a/app/views/admin/poll/booth_assignments/_results.html.erb b/app/views/admin/poll/booth_assignments/_results.html.erb
new file mode 100644
index 000000000..fdbc4da3f
--- /dev/null
+++ b/app/views/admin/poll/booth_assignments/_results.html.erb
@@ -0,0 +1,12 @@
+
+
<%= t("admin.results.index.title") %>
+
+ <% if @partial_results.empty? %>
+
+ <%= t("admin.results.index.no_results") %>
+
+ <% else %>
+ <%= render "admin/poll/results/recount", resource: @booth_assignment %>
+ <%= render "admin/poll/results/result" %>
+ <% end %>
+
\ No newline at end of file
diff --git a/app/views/admin/poll/booth_assignments/show.html.erb b/app/views/admin/poll/booth_assignments/show.html.erb
index fd303d099..71938cce5 100644
--- a/app/views/admin/poll/booth_assignments/show.html.erb
+++ b/app/views/admin/poll/booth_assignments/show.html.erb
@@ -17,9 +17,12 @@
<%= link_to t("admin.poll_booth_assignments.show.officers"), "#tab-officers" %>
-
+
<%= link_to t("admin.poll_booth_assignments.show.recounts"), "#tab-recounts" %>
+
+ <%= link_to t("admin.poll_booth_assignments.show.results"), "#tab-results" %>
+
@@ -43,7 +46,7 @@
<% end %>
-
+
<%= t("admin.poll_booth_assignments.show.recounts_list") %>
@@ -55,8 +58,12 @@
- <%= total_recounts_by_booth(@booth_assignment) || '-' %>
- <%= @booth_assignment.voters.count %>
+
+ <%= total_recounts_by_booth(@booth_assignment) || '-' %>
+
+
+ <%= @booth_assignment.voters.count %>
+
@@ -79,4 +86,7 @@
+
+ <%= render "results" %>
+
diff --git a/app/views/admin/poll/results/_recount.html.erb b/app/views/admin/poll/results/_recount.html.erb
new file mode 100644
index 000000000..f4ab43954
--- /dev/null
+++ b/app/views/admin/poll/results/_recount.html.erb
@@ -0,0 +1,14 @@
+
+
+ <%= t("admin.results.result.table_whites") %>
+ <%= t("admin.results.result.table_nulls") %>
+ <%= t("admin.results.result.table_total") %>
+
+
+
+ <%= resource.recounts.sum(:white_amount) %>
+ <%= resource.recounts.sum(:null_amount) %>
+ <%= resource.recounts.sum(:total_amount) %>
+
+
+
\ No newline at end of file
diff --git a/app/views/admin/poll/results/_result.html.erb b/app/views/admin/poll/results/_result.html.erb
new file mode 100644
index 000000000..e2fe5f037
--- /dev/null
+++ b/app/views/admin/poll/results/_result.html.erb
@@ -0,0 +1,21 @@
+<% by_question = @partial_results.group_by(&:question_id) %>
+<% @poll.questions.each do |question| %>
+ <%= question.title %>
+
+
+
+ <%= t("admin.results.result.table_answer") %>
+ <%= t("admin.results.result.table_votes") %>
+
+
+
+ <% question.question_answers.each_with_index do |answer, i| %>
+ <% by_answer = by_question[question.id].present? ? by_question[question.id].group_by(&:answer) : {} %>
+
+ <%= answer.title %>
+ <%= by_answer[answer.title].present? ? by_answer[answer.title].sum(&:amount) : 0 %>
+
+ <% end %>
+
+
+<% end %>
\ No newline at end of file
diff --git a/app/views/admin/poll/results/_results_by_booth.html.erb b/app/views/admin/poll/results/_results_by_booth.html.erb
new file mode 100644
index 000000000..f270adaab
--- /dev/null
+++ b/app/views/admin/poll/results/_results_by_booth.html.erb
@@ -0,0 +1,20 @@
+<%= t("admin.results.results_by_booth.title") %>
+
+
+
+ <%= t("admin.results.results_by_booth.booth") %>
+ <%= t("admin.results.results_by_booth.results") %>
+
+
+
+ <% @poll.booth_assignments.sort_by {|ba| ba.booth.name }.each do |booth_assignment| %>
+
+ <%= booth_assignment.booth.name %>
+
+ <%= link_to t("admin.results.results_by_booth.see_results"),
+ admin_poll_booth_assignment_path(@poll, booth_assignment, anchor: "tab-results") %>
+
+
+ <% end %>
+
+
diff --git a/app/views/admin/poll/results/index.html.erb b/app/views/admin/poll/results/index.html.erb
index ab4e94857..7f21e5452 100644
--- a/app/views/admin/poll/results/index.html.erb
+++ b/app/views/admin/poll/results/index.html.erb
@@ -9,44 +9,8 @@
<%= t("admin.results.index.no_results") %>
<% else %>
-
-
-
- <%= t("admin.results.index.table_whites") %>
- <%= t("admin.results.index.table_nulls") %>
- <%= t("admin.results.index.table_total") %>
-
-
-
- <%= @poll.recounts.sum(:white_amount) %>
- <%= @poll.recounts.sum(:null_amount) %>
- <%= @poll.recounts.sum(:total_amount) %>
-
-
-
-
-
- <% by_question = @partial_results.group_by(&:question_id) %>
- <% @poll.questions.each do |question| %>
- <%= question.title %>
-
-
-
- <%= t("admin.results.index.table_answer") %>
- <%= t("admin.results.index.table_votes") %>
-
-
-
- <% question.question_answers.each_with_index do |answer, i| %>
- <% by_answer = by_question[question.id].present? ? by_question[question.id].group_by(&:answer) : {} %>
-
- <%= answer.title %>
- <%= by_answer[answer.title].present? ? by_answer[answer.title].sum(&:amount) : 0 %>
-
- <% end %>
-
-
- <% end %>
-
+ <%= render "recount", resource: @poll %>
+ <%= render "result" %>
+ <%= render "results_by_booth" %>
<% end %>
diff --git a/app/views/admin/poll/shifts/_form.html.erb b/app/views/admin/poll/shifts/_form.html.erb
index 4004a949b..07e07381f 100644
--- a/app/views/admin/poll/shifts/_form.html.erb
+++ b/app/views/admin/poll/shifts/_form.html.erb
@@ -24,12 +24,12 @@
<%= t("admin.poll_shifts.new.date") %>
<%= select 'shift[date]', 'vote_collection_date',
- options_for_select(shift_vote_collection_dates(@booth.polls.current_or_incoming)),
+ options_for_select(shift_vote_collection_dates(@booth, @booth.polls.current_or_incoming)),
{ prompt: t("admin.poll_shifts.new.select_date"),
label: false },
class: 'js-shift-vote-collection-dates' %>
<%= select 'shift[date]', 'recount_scrutiny_date',
- options_for_select(shift_recount_scrutiny_dates(@booth.polls.current_or_recounting_or_incoming)),
+ options_for_select(shift_recount_scrutiny_dates(@booth, @booth.polls.current_or_recounting_or_incoming)),
{ prompt: t("admin.poll_shifts.new.select_date"),
label: false },
class: 'js-shift-recount-scrutiny-dates',
diff --git a/app/views/debates/show.html.erb b/app/views/debates/show.html.erb
index 44fa08a06..5f6d6b50f 100644
--- a/app/views/debates/show.html.erb
+++ b/app/views/debates/show.html.erb
@@ -9,13 +9,6 @@
<%= back_link_to %>
- <% if current_user && @debate.editable_by?(current_user) %>
- <%= link_to edit_debate_path(@debate), class: 'edit-debate button success small float-right' do %>
-
- <%= t("debates.show.edit_debate_link") %>
- <% end %>
- <% end %>
-
<%= @debate.title %>
<% if @debate.conflictive? %>
@@ -47,6 +40,15 @@
+ <% if current_user && @debate.editable_by?(current_user) %>
+
+ <%= t("debates.show.author") %>
+ <%= link_to edit_debate_path(@debate), class: 'button hollow expanded' do %>
+
+ <%= t("debates.show.edit_debate_link") %>
+ <% end %>
+ <% end %>
+
<%= t("votes.supports") %>
diff --git a/app/views/users/_budget_investment.html.erb b/app/views/users/_budget_investment.html.erb
index 774fae777..00a1eab20 100644
--- a/app/views/users/_budget_investment.html.erb
+++ b/app/views/users/_budget_investment.html.erb
@@ -2,10 +2,10 @@
<%= link_to budget_investment.title, budget_investment_path(budget_investment.budget, budget_investment) %>
-
+
<% if can? :destroy, budget_investment %>
<%= link_to t('shared.delete'), budget_investment_path(budget_investment.budget, budget_investment),
- method: :delete, class: "button hollow alert" %>
+ method: :delete, class: "button hollow alert expanded" %>
<% end %>
diff --git a/app/views/users/_budget_investments.html.erb b/app/views/users/_budget_investments.html.erb
index fb782f97c..091861d06 100644
--- a/app/views/users/_budget_investments.html.erb
+++ b/app/views/users/_budget_investments.html.erb
@@ -1,7 +1,13 @@
-
- <% @budget_investments.each do |budget_investment| %>
- <%= render "budget_investment", budget_investment: budget_investment %>
- <% end %>
+
+
+ <%= t("users.show.budget_investments") %>
+ <%= t("users.show.actions") %>
+
+
+ <% @budget_investments.each do |budget_investment| %>
+ <%= render "budget_investment", budget_investment: budget_investment %>
+ <% end %>
+
<%= paginate @budget_investments %>
diff --git a/app/views/users/_comments.html.erb b/app/views/users/_comments.html.erb
index 25bd1fd5b..82efa8570 100644
--- a/app/views/users/_comments.html.erb
+++ b/app/views/users/_comments.html.erb
@@ -1,13 +1,18 @@
-