From 11ab061b9be8bac3b5cf6b5efcd04ebbaf0d5935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Checa?= Date: Wed, 6 Sep 2017 17:27:05 +0200 Subject: [PATCH] Added documents to question view Added same subnavigation as proposals for comments and documents in poll questions. --- .../polls/questions/_filter_subnav.html.erb | 22 +++++++++++++++++++ app/views/polls/questions/show.html.erb | 14 +++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 app/views/polls/questions/_filter_subnav.html.erb diff --git a/app/views/polls/questions/_filter_subnav.html.erb b/app/views/polls/questions/_filter_subnav.html.erb new file mode 100644 index 000000000..738fc3700 --- /dev/null +++ b/app/views/polls/questions/_filter_subnav.html.erb @@ -0,0 +1,22 @@ +
+
+
    +
  • + <%= link_to "#tab-comments" do %> +

    + <%= t("proposals.show.comments_tab") %> + (<%= @question.comments_count %>) +

    + <% end %> +
  • +
  • + <%= link_to "#tab-documents" do %> +

    + <%= t("documents.tab") %> + (<%= @question.documents.count %>) +

    + <% end %> +
  • +
+
+
diff --git a/app/views/polls/questions/show.html.erb b/app/views/polls/questions/show.html.erb index da46ebbcc..a11ea5bd7 100644 --- a/app/views/polls/questions/show.html.erb +++ b/app/views/polls/questions/show.html.erb @@ -62,4 +62,16 @@ -<%= render "comments" %> +
+ <%= render "polls/questions/filter_subnav" %> + +
+ <%= render "polls/questions/comments" %> +
+ +
+ <%= render 'documents/documents', + documents: @question.documents, + max_documents_allowed: Poll::Question.max_documents_allowed %> +
+