@@ -1,4 +1,4 @@
|
||||
<nav class="admin-sidebar" data-equalizer-watch>
|
||||
<div class="admin-sidebar" data-equalizer-watch>
|
||||
<ul id="admin_menu" data-accordion-menu>
|
||||
|
||||
<li class="section-title">
|
||||
@@ -119,4 +119,4 @@
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
<h2><%= t("admin.booths.index.title") %></h2>
|
||||
<h2 class="inline-block"><%= t("admin.booths.index.title") %></h2>
|
||||
|
||||
<%= link_to t("admin.booths.index.add_booth"), new_admin_booth_path,
|
||||
class: "button success float-right" %>
|
||||
|
||||
<% if @booths.empty? %>
|
||||
<div class="callout primary">
|
||||
@@ -6,10 +9,6 @@
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= link_to t("admin.booths.index.add_booth"),
|
||||
new_admin_booth_path,
|
||||
class: "button success" %>
|
||||
|
||||
<% if @booths.any? %>
|
||||
<h3><%= page_entries_info @booths %></h3>
|
||||
<table>
|
||||
|
||||
@@ -1,26 +1,30 @@
|
||||
<div class="small-12 column">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<%= officer.name %>
|
||||
</td>
|
||||
<td>
|
||||
<%= officer.email %>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<% if officer.persisted? %>
|
||||
<%= link_to t('admin.poll_officers.officer.delete'),
|
||||
admin_poll_officer_path(officer),
|
||||
method: :delete,
|
||||
class: "button hollow alert" %>
|
||||
<% else %>
|
||||
<%= link_to t('admin.poll_officers.officer.add'),{ controller: "admin/poll/officers", action: :create, user_id: officer.user_id },
|
||||
method: :post,
|
||||
class: "button success" %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t('admin.poll_officers.officer.name') %></th>
|
||||
<th colspan="2"><%= t('admin.poll_officers.officer.email') %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<%= officer.name %>
|
||||
</td>
|
||||
<td>
|
||||
<%= officer.email %>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<% if officer.persisted? %>
|
||||
<%= link_to t('admin.poll_officers.officer.delete'),
|
||||
admin_poll_officer_path(officer),
|
||||
method: :delete,
|
||||
class: "button hollow alert" %>
|
||||
<% else %>
|
||||
<%= link_to t('admin.poll_officers.officer.add'),{ controller: "admin/poll/officers", action: :create, user_id: officer.user_id },
|
||||
method: :post,
|
||||
class: "button success" %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
9
app/views/admin/poll/officers/_search.html.erb
Normal file
9
app/views/admin/poll/officers/_search.html.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
<%= form_tag search_admin_officers_path, method: :get, remote: true do %>
|
||||
<div class="input-group">
|
||||
<%= text_field_tag :email, '',
|
||||
placeholder: t("admin.poll_officers.search.email_placeholder") %>
|
||||
<div class="input-group-button">
|
||||
<%= submit_tag t("admin.poll_officers.search.search"), class: "button" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -1,21 +1,25 @@
|
||||
<h2><%= t("admin.poll_officers.index.title") %></h2>
|
||||
|
||||
<div class="row">
|
||||
<%= form_tag search_admin_officers_path, method: :get, remote: true do %>
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= text_field_tag :email, '', placeholder: t('admin.poll_officers.search.email_placeholder') %>
|
||||
</div>
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= submit_tag t('admin.poll_officers.search.search'), class: 'button' %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= render 'search' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="search-result" class="row"></div>
|
||||
<div id="search-result"></div>
|
||||
|
||||
<h3><%= page_entries_info @officers %></h3>
|
||||
<h3>
|
||||
<%= page_entries_info @officers, entry_name: t('admin.poll_officers.officer.entry_name') %>
|
||||
</h3>
|
||||
|
||||
<table id="officers">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t('admin.poll_officers.officer.name') %></th>
|
||||
<th colspan="2"><%= t('admin.poll_officers.officer.email') %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @officers.each do |officer| %>
|
||||
<tr>
|
||||
<td>
|
||||
@@ -41,6 +45,7 @@
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<%= paginate @officers %>
|
||||
|
||||
@@ -1,39 +1,34 @@
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<% if @poll.booths.empty? %>
|
||||
<div class="callout primary text-center">
|
||||
<%= t("admin.polls.show.no_booths") %>
|
||||
</div>
|
||||
<% else %>
|
||||
<h3><%= t("admin.polls.show.booths_title") %></h3>
|
||||
|
||||
<h2><%= t("admin.polls.show.booths_title") %></h2>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<th><%= t("admin.polls.show.name") %></th>
|
||||
<th><%= t("admin.polls.show.location") %></th>
|
||||
<th> </th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @poll.booths.each do |booth| %>
|
||||
<tr id="booth_<%= booth.id %>" class="booth">
|
||||
<td>
|
||||
<strong>
|
||||
<%= link_to booth.name, admin_booth_path(booth) %>
|
||||
</strong>
|
||||
</td>
|
||||
<td>
|
||||
<%= booth.location %>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<%= link_to t("admin.polls.show.remove_booth"),
|
||||
"#",
|
||||
class: "button hollow alert" %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
<% if @poll.booths.empty? %>
|
||||
<div class="callout primary margin-top">
|
||||
<%= t("admin.polls.show.no_booths") %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<table>
|
||||
<thead>
|
||||
<th><%= t("admin.polls.show.name") %></th>
|
||||
<th><%= t("admin.polls.show.location") %></th>
|
||||
<th> </th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @poll.booths.each do |booth| %>
|
||||
<tr id="booth_<%= booth.id %>" class="booth">
|
||||
<td>
|
||||
<strong>
|
||||
<%= link_to booth.name, admin_booth_path(booth) %>
|
||||
</strong>
|
||||
</td>
|
||||
<td>
|
||||
<%= booth.location %>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<%= link_to t("admin.polls.show.remove_booth"),
|
||||
"#",
|
||||
class: "button hollow alert" %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
|
||||
@@ -1,30 +1,20 @@
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<ul class="tabs" data-tabs id="example-tabs">
|
||||
<li class="tabs-title is-active">
|
||||
<%= link_to "#tab-questions" do %>
|
||||
<h2>
|
||||
<%= t("admin.polls.show.questions_tab") %>
|
||||
<span class="js-comments-count">(<%= @poll.questions.count %>)</span>
|
||||
</h2>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="tabs-title">
|
||||
<%= link_to "#tab-booths" do %>
|
||||
<h2>
|
||||
<%= t("admin.polls.show.booths_tab") %>
|
||||
(<%= @poll.booths.count %>)
|
||||
</h2>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="tabs-title">
|
||||
<%= link_to "#tab-officers" do %>
|
||||
<h2>
|
||||
<%= t("admin.polls.show.officers_tab") %>
|
||||
(<%= @poll.officers.count %>)
|
||||
</h2>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="tabs" data-tabs id="example-tabs">
|
||||
<li class="tabs-title is-active">
|
||||
<%= link_to "#tab-questions" do %>
|
||||
<%= t("admin.polls.show.questions_tab") %>
|
||||
<span class="js-comments-count">(<%= @poll.questions.count %>)</span>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="tabs-title">
|
||||
<%= link_to "#tab-booths" do %>
|
||||
<%= t("admin.polls.show.booths_tab") %>
|
||||
(<%= @poll.booths.count %>)
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="tabs-title">
|
||||
<%= link_to "#tab-officers" do %>
|
||||
<%= t("admin.polls.show.officers_tab") %>
|
||||
(<%= @poll.officers.count %>)
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -1,33 +1,28 @@
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<% if @poll.officers.empty? %>
|
||||
<div class="callout primary text-center">
|
||||
<%= t("admin.polls.show.no_officers") %>
|
||||
</div>
|
||||
<% else %>
|
||||
<h3><%= t("admin.polls.show.officers_title") %></h3>
|
||||
|
||||
<h2><%= t("admin.polls.show.officers_title") %></h2>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<th><%= t("admin.polls.show.name") %></th>
|
||||
<th><%= t("admin.polls.show.email") %></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @poll.officers.each do |officer| %>
|
||||
<tr id="officer_<%= officer.id %>" class="officer">
|
||||
<td>
|
||||
<strong>
|
||||
<%= officer.name %>
|
||||
</strong>
|
||||
</td>
|
||||
<td>
|
||||
<%= officer.email %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
<% if @poll.officers.empty? %>
|
||||
<div class="callout primary margin-top">
|
||||
<%= t("admin.polls.show.no_officers") %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<table>
|
||||
<thead>
|
||||
<th><%= t("admin.polls.show.name") %></th>
|
||||
<th><%= t("admin.polls.show.email") %></th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% @poll.officers.each do |officer| %>
|
||||
<tr id="officer_<%= officer.id %>" class="officer">
|
||||
<td>
|
||||
<strong>
|
||||
<%= officer.name %>
|
||||
</strong>
|
||||
</td>
|
||||
<td>
|
||||
<%= officer.email %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<% end %>
|
||||
|
||||
@@ -1,29 +1,24 @@
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<% if @poll.questions.empty? %>
|
||||
<div class="callout primary text-center">
|
||||
<%= t('admin.polls.show.no_questions') %>
|
||||
</div>
|
||||
<% else %>
|
||||
<h3><%= t("admin.polls.show.questions_title") %></h3>
|
||||
|
||||
<h2><%= t("admin.polls.show.questions_title") %></h2>
|
||||
|
||||
<table>
|
||||
<% @poll.questions.each do |question| %>
|
||||
<tr id="<%= dom_id(question) %>">
|
||||
<td><%= link_to question.title, admin_question_path(question) %></td>
|
||||
<td class="text-right">
|
||||
<%= link_to t('shared.edit'),
|
||||
edit_admin_question_path(question),
|
||||
class: "button hollow" %>
|
||||
<%= link_to t('shared.delete'),
|
||||
admin_question_path(question),
|
||||
class: "button hollow alert",
|
||||
method: :delete %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
<% end %>
|
||||
<% if @poll.questions.empty? %>
|
||||
<div class="callout primary margin-top">
|
||||
<%= t('admin.polls.show.no_questions') %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<table class="margin-top">
|
||||
<% @poll.questions.each do |question| %>
|
||||
<tr id="<%= dom_id(question) %>">
|
||||
<td><%= link_to question.title, admin_question_path(question) %></td>
|
||||
<td class="text-right">
|
||||
<%= link_to t('shared.edit'),
|
||||
edit_admin_question_path(question),
|
||||
class: "button hollow" %>
|
||||
<%= link_to t('shared.delete'),
|
||||
admin_question_path(question),
|
||||
class: "button hollow alert",
|
||||
method: :delete %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
<% end %>
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
<div class="small-12 medium-6">
|
||||
<%= form_tag '', method: :get do %>
|
||||
<%= select_tag "poll_id",
|
||||
poll_select_options(true),
|
||||
prompt: t("admin.questions.index.select_poll"),
|
||||
class: "js-location-changer" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<%= form_tag '', method: :get do %>
|
||||
<%= label_tag :poll_id, t("admin.questions.index.filter_poll") %>
|
||||
<%= select_tag "poll_id",
|
||||
poll_select_options(true),
|
||||
prompt: t("admin.questions.index.select_poll"),
|
||||
class: "js-location-changer" %>
|
||||
<% end %>
|
||||
|
||||
@@ -7,15 +7,19 @@
|
||||
<div class="row">
|
||||
|
||||
<div class="small-12 column">
|
||||
<div class="small-12 medium-6">
|
||||
<%= f.select :poll_id,
|
||||
options_for_select(Poll.pluck(:name, :id)),
|
||||
prompt: t("admin.questions.index.select_poll") %>
|
||||
<div class="small-12 medium-6 large-4">
|
||||
<%= f.select :poll_id,
|
||||
options_for_select(Poll.pluck(:name, :id)),
|
||||
prompt: t("admin.questions.index.select_poll"),
|
||||
label: t("admin.questions.new.poll_label") %>
|
||||
</div>
|
||||
|
||||
<%= f.text_field :title, maxlength: Poll::Question.title_max_length %>
|
||||
|
||||
<%= f.text_field :valid_answers %>
|
||||
<%= f.label :valid_answers %>
|
||||
<p class="note"><%= t("admin.questions.new.valid_answers_note") %></p>
|
||||
<%= f.text_field :valid_answers, label: false %>
|
||||
|
||||
|
||||
<%= f.text_area :summary, rows: 4, maxlength: 200 %>
|
||||
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
<%= form_tag(admin_questions_path, method: :get) do |f| %>
|
||||
<div class="row">
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= text_field_tag :search,
|
||||
@search,
|
||||
placeholder: t("admin.shared.spending_proposal_search.placeholder") %>
|
||||
</div>
|
||||
<div class="form-inline small-12 medium-3 column end">
|
||||
<div class="input-group">
|
||||
<%= text_field_tag :search,
|
||||
@search,
|
||||
placeholder: t("admin.shared.spending_proposal_search.placeholder") %>
|
||||
<div class="input-group-button">
|
||||
<%= submit_tag t("admin.shared.spending_proposal_search.button"), class: "button" %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -3,11 +3,18 @@
|
||||
<%= link_to t('admin.questions.index.create'), new_admin_question_path,
|
||||
class: "button success float-right" %>
|
||||
|
||||
<%= render 'filter' %>
|
||||
<%= render 'search' %>
|
||||
<div class="row">
|
||||
<div class="small-12 medium-6 column">
|
||||
<%= render 'search' %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-4 large-3">
|
||||
<%= render 'filter' %>
|
||||
</div>
|
||||
|
||||
<% if @questions.count == 0 %>
|
||||
<div class="callout primary">
|
||||
<div class="callout primary margin-top">
|
||||
<%= t('admin.questions.index.no_questions') %>
|
||||
</div>
|
||||
<% else %>
|
||||
|
||||
Reference in New Issue
Block a user