Merge branch 'master' into community

This commit is contained in:
Raimond Garcia
2017-09-05 15:40:03 +02:00
committed by GitHub
31 changed files with 436 additions and 202 deletions

View File

@@ -73,9 +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" %>>
<%= link_to t('admin.menu.poll_booths'), admin_booths_path %>
</li>
<li <%= "class=active" if controller_name == "booths" %>>
<%= link_to t('admin.menu.poll_shifts'), admin_booths_path %>
</li>
</ul>
</li>
<% end %>

View File

@@ -6,6 +6,9 @@
<%= booth.location %>
</td>
<td class="text-right">
<%= link_to t("admin.booths.booth.shifts"),
new_admin_booth_shift_path(booth),
class: "button hollow" %>
<%= link_to t("admin.actions.edit"),
edit_admin_booth_path(booth),
class: "button hollow" %>

View File

@@ -16,6 +16,7 @@
<th><%= t("admin.booths.index.name") %></th>
<th><%= t("admin.booths.index.location") %></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</thead>
<tbody>
<% @booths.each do |booth| %>

View File

@@ -5,35 +5,6 @@
<h2><%= @officer.name %> - <%= @officer.email %></h2>
<%= form_tag(admin_poll_officer_assignments_path(@poll), {id: "officer_assignment_form"}) do %>
<fieldset class="fieldset">
<legend><%= t("admin.poll_officer_assignments.by_officer.new_assignment") %></legend>
<div class="small-12 medium-4 column">
<label><%= t("admin.poll_officer_assignments.by_officer.date") %></label>
<%= select_tag :date,
poll_dates_select_options(@poll) + poll_final_recount_option(@poll),
{ prompt: t("admin.poll_officer_assignments.by_officer.select_date"),
label: false } %>
</div>
<div class="small-12 medium-4 column">
<label><%= t("admin.poll_officer_assignments.by_officer.booth") %></label>
<%= select_tag :booth_id,
poll_booths_select_options(@poll),
{ prompt: t("admin.poll_officer_assignments.by_officer.select_booth"),
label: false } %>
</div>
<div class="small-12 medium-4 column">
<%= hidden_field_tag :officer_id, @officer.id %>
<%= hidden_field_tag :poll_id, @poll.id %>
<%= submit_tag t("admin.poll_officer_assignments.by_officer.add_assignment"),
class: "button expanded hollow margin-top" %>
</div>
</fieldset>
<% end %>
<% if @officer_assignments.empty? %>
<div class="callout primary margin-top">
<%= t("admin.poll_officer_assignments.by_officer.no_assignments") %>
@@ -45,7 +16,6 @@
<tr>
<th><%= t("admin.poll_officer_assignments.by_officer.date") %></th>
<th><%= t("admin.poll_officer_assignments.by_officer.booth") %></th>
<th class="text-right"><%= t("admin.poll_officer_assignments.by_officer.assignment") %></th>
</tr>
</thead>
<tbody>
@@ -53,12 +23,6 @@
<tr id="<%= dom_id officer_assignment %>">
<td><%= officer_assignment.final? ? t('polls.final_date') : l(officer_assignment.date.to_date) %></td>
<td><%= booth_name_with_location(officer_assignment.booth_assignment.booth) %></td>
<td class="text-right">
<%= link_to t("admin.poll_officer_assignments.by_officer.remove_assignment"),
admin_poll_officer_assignment_path(@poll, officer_assignment),
method: :delete,
class: "button hollow alert" %>
</td>
</tr>
<% end %>
</tbody>
@@ -93,6 +57,3 @@
</tbody>
</table>
<% end %>

View File

@@ -0,0 +1,24 @@
<h3><%= t("admin.poll_shifts.new.assignments") %></h3>
<table class="fixed">
<thead>
<tr>
<th><%= t("admin.poll_shifts.new.date") %></th>
<th><%= t("admin.poll_shifts.new.officer") %></th>
<th class="text-right"><%= t("admin.poll_shifts.new.assignment") %></th>
</tr>
</thead>
<tbody>
<% @shifts.each do |shift| %>
<tr id="shift_<%= shift.id %>" class="shift">
<td><%= l(shift.date.to_date, format: :long) %></td>
<td><%= shift.officer.name %></td>
<td class="text-right">
<%= link_to t("admin.poll_shifts.new.remove_assignment"),
admin_booth_shift_path(@booth, shift),
method: :delete,
class: "button hollow alert" %>
</td>
</tr>
<% end %>
</tbody>
</table>

View File

@@ -0,0 +1,46 @@
<%= back_link_to admin_booths_path %>
<h2><%= @booth.name %></h2>
<%= form_for @shift, as: :shift, url: admin_booth_shifts_path do |f| %>
<%= render "shared/errors", resource: @shift %>
<fieldset class="fieldset">
<legend>
<%= t("admin.poll_shifts.new.new_assignment") %>
</legend>
<div class="small-12 medium-4 column">
<label><%= t("admin.poll_shifts.new.date") %></label>
<%= f.select :date,
shift_dates_select_options(@polls),
prompt: t("admin.poll_shifts.new.select_date"),
label: false %>
</div>
<div class="small-12 medium-4 column">
<label><%= t("admin.poll_shifts.new.officer") %></label>
<%= f.select :officer_id,
officer_select_options(@officers),
prompt: t("admin.poll_shifts.new.select_officer"),
label: false %>
</div>
<%= f.hidden_field :booth_id, value: @booth.id %>
<div class="small-12 medium-4 column">
<%= f.submit t("admin.poll_shifts.new.add_assignment"),
class: "button expanded hollow margin-top" %>
</div>
</fieldset>
<% end %>
<div id="shifts">
<% if @shifts.empty? %>
<div class="callout primary margin-top">
<%= t("admin.poll_shifts.new.no_assignments") %>
</div>
<% else %>
<%= render "shifts" %>
<% end %>
</div>