adds successful proposals list on admin questions index
This commit is contained in:
12
app/views/admin/poll/questions/_filter_subnav.html.erb
Normal file
12
app/views/admin/poll/questions/_filter_subnav.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<ul class="tabs" data-tabs id="questions-tabs">
|
||||
<li class="tabs-title is-active">
|
||||
<%= link_to "#tab-questions" do %>
|
||||
<%= t("admin.questions.index.questions_tab") %>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="tabs-title">
|
||||
<%= link_to "#tab-successful-proposals" do %>
|
||||
<%= t("admin.questions.index.successful_proposals_tab") %>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
23
app/views/admin/poll/questions/_questions.html.erb
Normal file
23
app/views/admin/poll/questions/_questions.html.erb
Normal file
@@ -0,0 +1,23 @@
|
||||
<div class="small-12 medium-4 large-3">
|
||||
<%= render 'filter' %>
|
||||
</div>
|
||||
|
||||
<% if @questions.count == 0 %>
|
||||
<div class="callout primary margin-top">
|
||||
<%= t('admin.questions.index.no_questions') %>
|
||||
</div>
|
||||
<% else %>
|
||||
<table>
|
||||
<% @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>
|
||||
|
||||
<%= paginate @questions %>
|
||||
<% end %>
|
||||
@@ -0,0 +1,20 @@
|
||||
<table>
|
||||
<tbody>
|
||||
<% @proposals.each do |proposal| %>
|
||||
<tr id="<%= dom_id(proposal) %>">
|
||||
<td>
|
||||
<%= link_to proposal.title, proposal_path(proposal) %>
|
||||
<p>
|
||||
<%= proposal.summary %><br>
|
||||
<strong><%= proposal.question %></strong>
|
||||
</p>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<%= link_to t("admin.questions.index.create_question"),
|
||||
new_admin_question_path(proposal_id: proposal.id),
|
||||
class: "button hollow" %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -9,26 +9,14 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-4 large-3">
|
||||
<%= render 'filter' %>
|
||||
</div>
|
||||
<div class="tabs-content" data-tabs-content="questions-tabs">
|
||||
<%= render "filter_subnav" %>
|
||||
|
||||
<% if @questions.count == 0 %>
|
||||
<div class="callout primary margin-top">
|
||||
<%= t('admin.questions.index.no_questions') %>
|
||||
<div class="tabs-panel is-active" id="tab-questions">
|
||||
<%= render "questions" %>
|
||||
</div>
|
||||
<% else %>
|
||||
<table>
|
||||
<% @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>
|
||||
|
||||
<%= paginate @questions %>
|
||||
<% end %>
|
||||
<div class="tabs-panel" id="tab-successful-proposals">
|
||||
<%= render "successful_proposals" %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user