adds poll CRU actions

This commit is contained in:
rgarcia
2016-09-25 10:20:38 +02:00
committed by kikito
parent 304743f64e
commit c1a9caeab0
13 changed files with 158 additions and 60 deletions

View File

@@ -0,0 +1,34 @@
<%= form_for [:admin, @poll] do |f| %>
<div class="row">
<div class="small-12 medium-6 column">
<%= f.text_field :name,
placeholder: t('admin.polls.new.name'),
label: t("admin.polls.new.name") %>
</div>
<div class="small-12 medium-6 column">
<label><%= t("admin.polls.new.reference") %></label>
<input type="text" placeholder="<%= t('admin.polls.new.reference') %>">
</div>
</div>
<div class="row">
<div class="small-12 medium-6 column">
<label><%= t("admin.polls.new.open_date") %></label>
<input type="date">
</div>
<div class="small-12 medium-6 column">
<label><%= t("admin.polls.new.close_date") %></label>
<input type="date">
</div>
</div>
<div class="row">
<div class="small-12 medium-4 column">
<input type="submit"
value='<%= t("admin.polls.#{admin_submit_action(@poll)}.submit_button") %>'
class="button success expanded">
</div>
</div>
<% end %>

View File

@@ -2,7 +2,7 @@
<td>
<strong>
<%= link_to poll.name, admin_poll_path(poll) %>
</strong>ß
</strong>
</td>
<td>
Próximamente <!-- Estado: Activa, Próximamente o Archivada -->

View File

@@ -1,8 +1,9 @@
<%= render 'shared/back_link' %>
<h2><%= t("admin.polls.edit.title") %></h2>
<%= render "form" %>
<form>
<!-- <form>
<div class="row">
<div class="small-12 medium-6 column">
<label><%= t("admin.polls.edit.name") %></label>
@@ -31,6 +32,6 @@
<div class="small-12 medium-4 column">
<input type="submit" value="<%= t('admin.polls.edit.submit_button') %>" class="button success expanded">
</div>
</div>
</div> -->
</form>

View File

@@ -1,21 +1,22 @@
<h2 class="inline-block"><%= t("admin.polls.index.title") %></h2>
<%= link_to t("admin.polls.index.create"), new_admin_poll_path, class: "button success float-right" %>
<%= link_to t("admin.polls.index.create"),
new_admin_poll_path,
class: "button success float-right" %>
<!-- If polls == 0 -->
<div class="callout primary">
<%= t("admin.polls.index.no_polls") %>
</div>
<!-- else -->
<table>
<thead>
<th><%= t("admin.polls.index.name") %></th>
<th><%= t("admin.polls.index.status") %></th>
<th>&nbsp;</th>
</thead>
<tbody>
<%= render @polls %>
</tbody>
</table>
<% if Poll.any? %>
<table>
<thead>
<th><%= t("admin.polls.index.name") %></th>
<th><%= t("admin.polls.index.status") %></th>
<th>&nbsp;</th>
</thead>
<tbody>
<%= render @polls %>
</tbody>
</table>
<% else %>
<div class="callout primary">
<%= t("admin.polls.index.no_polls") %>
</div>
<% end %>

View File

@@ -2,35 +2,4 @@
<h2><%= t("admin.polls.new.title") %></h2>
<form>
<div class="row">
<div class="small-12 medium-6 column">
<label><%= t("admin.polls.new.name") %></label>
<input type="text" placeholder="<%= t('admin.polls.new.name') %>">
</div>
<div class="small-12 medium-6 column">
<label><%= t("admin.polls.new.reference") %></label>
<input type="text" placeholder="<%= t('admin.polls.new.reference') %>">
</div>
</div>
<div class="row">
<div class="small-12 medium-6 column">
<label><%= t("admin.polls.new.open_date") %></label>
<input type="date">
</div>
<div class="small-12 medium-6 column">
<label><%= t("admin.polls.new.close_date") %></label>
<input type="date">
</div>
</div>
<div class="row">
<div class="small-12 medium-4 column">
<input type="submit" value="<%= t('admin.polls.new.submit_button') %>" class="button success expanded">
</div>
</div>
</form>
<%= render "form" %>

View File

@@ -5,7 +5,7 @@
<%= @poll.name %>
</h2>
<%= link_to t("admin.actions.edit"), "#", class: "button hollow float-right" %>
<%= link_to t("admin.actions.edit"), edit_admin_poll_path(@poll), class: "button hollow float-right" %>
<p>(REFNUM)</p>
<p>Próximamente <small>(15/12/2016 - 15/02/2017)</small></p>
@@ -26,7 +26,7 @@
<th>&nbsp;</th>
</thead>
<tbody>
<!-- @booths.each do |booth| -->
<%= @poll.booths.each do |booth| %>
<tr>
<td>
<strong>
@@ -40,6 +40,6 @@
<%= link_to t("admin.actions.edit"), "#", class: "button hollow" %>
</td>
</tr>
<!-- end -->
<% end %>
</tbody>
</table>