Add views for admin booths

This commit is contained in:
Alberto Garcia Cabeza
2016-09-19 18:32:21 +02:00
committed by kikito
parent faecb51054
commit 7f0d233bce
7 changed files with 136 additions and 9 deletions

View File

@@ -1 +1,28 @@
booth edit
<%= render 'shared/back_link' %>
<h2><%= t("admin.booths.edit.title") %>: <%= t("admin.booths.edit.subtitle") %></h2>
<form>
<div class="row">
<div class="small-12 medium-6 column">
<label><%= t("admin.booths.edit.name") %></label>
<input type="text" placeholder="<%= t('admin.booths.edit.name') %>">
</div>
<div class="small-12 medium-6 column">
<label><%= t("admin.booths.edit.reference") %></label>
<input type="text" placeholder="<%= t('admin.booths.edit.reference') %>">
</div>
<div class="small-12 column">
<label><%= t("admin.booths.edit.location") %></label>
<input type="text" placeholder="<%= t("admin.booths.edit.location") %>">
</div>
</div>
<div class="row">
<div class="small-12 medium-4 column">
<input type="submit" value="<%= t('admin.booths.edit.submit_button') %>" class="button success expanded">
</div>
</div>
</form>

View File

@@ -14,8 +14,9 @@
<div class="callout primary">
<%= t("admin.booths.index.no_booths") %>
</div>
<!-- end -->
<!-- else -->
<%= link_to t("admin.booths.index.add_booth"), new_admin_poll_booth_path, class: "button success" %>
<table>
<thead>
@@ -35,10 +36,10 @@
C/ Isaac Peral, 25. 28003, Madrid
</td>
<td class="text-right">
<%= link_to t("admin.actions.edit"), "/edit", class: "button hollow" %>
<%= link_to t("admin.booths.index.add_officer"), "/edit", class: "button success" %>
<%= link_to t("admin.actions.edit"), "#", class: "button hollow" %>
<%= link_to t("admin.booths.index.add_officer"), "#", class: "button success" %>
</td>
</tr>
<!-- end -->
</tbody>
</table>
</table>

View File

@@ -1 +1,28 @@
booth new
<%= render 'shared/back_link' %>
<h2><%= t("admin.booths.new.title") %>: <%= t("admin.booths.new.subtitle") %></h2>
<form>
<div class="row">
<div class="small-12 medium-6 column">
<label><%= t("admin.booths.new.name") %></label>
<input type="text" placeholder="<%= t('admin.booths.new.name') %>">
</div>
<div class="small-12 medium-6 column">
<label><%= t("admin.booths.new.reference") %></label>
<input type="text" placeholder="<%= t('admin.booths.new.reference') %>">
</div>
<div class="small-12 column">
<label><%= t("admin.booths.new.location") %></label>
<input type="text" placeholder="<%= t("admin.booths.new.location") %>">
</div>
</div>
<div class="row">
<div class="small-12 medium-4 column">
<input type="submit" value="<%= t('admin.booths.new.submit_button') %>" class="button success expanded">
</div>
</div>
</form>

View File

@@ -1 +1,40 @@
booth show
<%= render 'shared/back_link' %>
<div class="clear"></div>
<h2 class="inline-block">Urna Moncloa (REFNUM)</h2>
<%= link_to t("admin.actions.edit"), "#", class: "button hollow float-right" %>
<p><strong><%= t("admin.booths.show.location") %></strong>: C/ Isaac Peral, 25. 28003, Madrid</p>
<h3><%= t("admin.booths.show.officers_list") %></h3>
<!-- If officers in this booth == 0 -->
<div class="callout primary">
<%= t("admin.booths.show.no_officers") %>
</div>
<!-- end -->
<%= link_to t("admin.booths.show.add_officer"), "#", class: "button success" %>
<table>
<%# @officers.each do |officer| %>
<tr>
<td>
<%# officer.name %>
Admin
</td>
<td>
admin@consul.dev
<%# officer.email %>
</td>
<td class="text-right">
<%= link_to t('admin.poll_officers.officer.delete'), "#", class: "button hollow alert" %>
<%# link_to t('admin.poll_officers.officer.delete'),
admin_poll_officer_path(Poll.last, officer),
method: :delete,
class: "button hollow alert"
%>
</td>
</tr>
<%# end %>
</table>

View File

@@ -20,7 +20,7 @@
<tr>
<td>
<strong>
<%= link_to "Votación de propuestas 2016 (REFNUM)", "3" %>
<%= link_to "Votación de propuestas 2016 (REFNUM)", "polls/3" %>
</strong>
</td>
<td>
@@ -28,7 +28,7 @@
<br>(<small>15/12/2016 - 15/02/2017</small>)
</td>
<td class="text-right">
<%= link_to t("admin.actions.edit"), "3/edit", class: "button hollow" %>
<%= link_to t("admin.actions.edit"), "polls/3/edit", class: "button hollow" %>
</td>
</tr>
<!-- end -->

View File

@@ -185,9 +185,29 @@ en:
select_poll: "Select a poll"
title_list: "List of booths of poll %{poll}"
no_booths: "There is no booths in this poll."
add_booth: "Add booth"
name: "Name"
location: "Location"
add_officer: "Add officer"
new:
title: "Poll %{poll}"
subtitle: "New booth"
name: "Name"
reference: "Reference number"
location: "Location"
submit_button: "Create booth"
edit:
title: "Poll %{poll}"
subtitle: "Edit booth"
name: "Name"
reference: "Reference number"
location: "Location"
submit_button: "Update booth"
show:
location: "Location"
add_officer: "Add officer"
officers_list: "List of officers"
no_officers: "There is no officers in this booth."
officials:
edit:
destroy: Remove 'Official' status

View File

@@ -185,9 +185,22 @@ es:
select_poll: "Selecciona una votación"
title_list: "Lista de urnas de la votación %{poll}"
no_booths: "No hay urnas en esta votación."
add_booth: "Añadir urna"
name: "Nombre"
location: "Ubicación"
add_officer: "Añadir presidente"
new:
title: "Votación %{poll}"
subtitle: "Nueva urna"
name: "Nombre"
reference: "Número de referencia"
location: "Ubicación"
submit_button: "Crear urna"
show:
location: "Ubicación"
add_officer: "Añadir presidente de mesa"
officers_list: "Lista de presidentes de mesa"
no_officers: "No hay presidentes de mesa en esta urna."
officials:
edit:
destroy: Eliminar condición de 'Cargo Público'