Added documents to question view
Added same subnavigation as proposals for comments and documents in poll questions.
This commit is contained in:
22
app/views/polls/questions/_filter_subnav.html.erb
Normal file
22
app/views/polls/questions/_filter_subnav.html.erb
Normal file
@@ -0,0 +1,22 @@
|
||||
<div class="row">
|
||||
<div class="small-12 column">
|
||||
<ul class="tabs" data-tabs id="questions-tabs">
|
||||
<li class="tabs-title is-active">
|
||||
<%= link_to "#tab-comments" do %>
|
||||
<h3>
|
||||
<%= t("proposals.show.comments_tab") %>
|
||||
<span class="js-comments-count">(<%= @question.comments_count %>)</span>
|
||||
</h3>
|
||||
<% end %>
|
||||
</li>
|
||||
<li class="tabs-title">
|
||||
<%= link_to "#tab-documents" do %>
|
||||
<h3>
|
||||
<%= t("documents.tab") %>
|
||||
(<%= @question.documents.count %>)
|
||||
</h3>
|
||||
<% end %>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
@@ -62,4 +62,16 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= render "comments" %>
|
||||
<div class="tabs-content" data-tabs-content="questions-tabs" role="tablist">
|
||||
<%= render "polls/questions/filter_subnav" %>
|
||||
|
||||
<div class="tabs-panel is-active" id="tab-comments">
|
||||
<%= render "polls/questions/comments" %>
|
||||
</div>
|
||||
|
||||
<div class="tabs-panel" id="tab-documents">
|
||||
<%= render 'documents/documents',
|
||||
documents: @question.documents,
|
||||
max_documents_allowed: Poll::Question.max_documents_allowed %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user