diff --git a/app/controllers/polls/questions_controller.rb b/app/controllers/polls/questions_controller.rb index 1849dff97..74266a6fc 100644 --- a/app/controllers/polls/questions_controller.rb +++ b/app/controllers/polls/questions_controller.rb @@ -5,15 +5,6 @@ class Polls::QuestionsController < ApplicationController has_orders %w{most_voted newest oldest}, only: :show - def show - @commentable = @question.proposal.present? ? @question.proposal : @question - @comment_tree = CommentTree.new(@commentable, params[:page], @current_order) - set_comment_flags(@comment_tree.comments) - - question_answer = @question.answers.where(author_id: current_user.try(:id)).first - @answers_by_question_id = {@question.id => question_answer.try(:answer)} - end - def answer answer = @question.answers.find_or_initialize_by(author: current_user) diff --git a/app/views/polls/_poll_group.html.erb b/app/views/polls/_poll_group.html.erb index 9372aee17..fe12c341b 100644 --- a/app/views/polls/_poll_group.html.erb +++ b/app/views/polls/_poll_group.html.erb @@ -51,7 +51,7 @@ <%= poll_dates(poll) %> <% end %> diff --git a/app/views/polls/questions/_answers.html.erb b/app/views/polls/questions/_answers.html.erb deleted file mode 100644 index c88156b68..000000000 --- a/app/views/polls/questions/_answers.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -
- <% if can? :answer, question %> - <% question.valid_answers.each do |answer| %> - <% if @answers_by_question_id[question.id] == answer %> - "> - <%= answer %> - - <% else %> - <%= link_to answer, - answer_question_path(question, answer: answer), - method: :post, - remote: true, - title: t("poll_questions.show.vote_answer", answer: answer), - class: "button secondary hollow" %> - <% end %> - <% end %> - <% else %> - <% question.valid_answers.each do |answer| %> - <%= answer %> - <% end %> - <% end %> -
diff --git a/app/views/polls/questions/_comments.html.erb b/app/views/polls/questions/_comments.html.erb deleted file mode 100644 index a967406aa..000000000 --- a/app/views/polls/questions/_comments.html.erb +++ /dev/null @@ -1,31 +0,0 @@ -<% cache [locale_and_user_status, @current_order, commentable_cache_key(@commentable), @comment_tree.comments, @comment_tree.comment_authors, @commentable.comments_count, @comment_flags] do %> -
-
-
-

- <%= t("shared.comments.title") %> - (<%= @commentable.comments_count %>) -

- - <%= render 'shared/wide_order_selector', i18n_namespace: "comments" %> - - <% if user_signed_in? %> - <%= render 'comments/form', {commentable: @commentable, parent_id: nil, toggeable: false} %> - <% else %> -
- -
- <%= t("shared.comments.login_to_comment", - signin: link_to(t("votes.signin"), new_user_session_path), - signup: link_to(t("votes.signup"), new_user_registration_path)).html_safe %> -
- <% end %> - - <% @comment_tree.root_comments.each do |comment| %> - <%= render 'comments/comment', comment: comment %> - <% end %> - <%= paginate @comment_tree.root_comments %> -
-
-
-<% end %> \ No newline at end of file diff --git a/app/views/polls/questions/_filter_subnav.html.erb b/app/views/polls/questions/_filter_subnav.html.erb deleted file mode 100644 index 738fc3700..000000000 --- a/app/views/polls/questions/_filter_subnav.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -
-
- -
-
diff --git a/app/views/polls/questions/_question.html.erb b/app/views/polls/questions/_question.html.erb deleted file mode 100644 index f0958b6e4..000000000 --- a/app/views/polls/questions/_question.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -
-

- <%= link_to question.title, question_path(question) %> -

- -
- <%= render 'polls/questions/answers', question: question %> -
-
diff --git a/app/views/polls/questions/answer.js.erb b/app/views/polls/questions/answer.js.erb deleted file mode 100644 index aabbd8d89..000000000 --- a/app/views/polls/questions/answer.js.erb +++ /dev/null @@ -1 +0,0 @@ -$("#<%= dom_id(@question) %>_answers").html('<%= j render("polls/questions/answers", question: @question) %>'); diff --git a/app/views/polls/questions/show.html.erb b/app/views/polls/questions/show.html.erb deleted file mode 100644 index f67633129..000000000 --- a/app/views/polls/questions/show.html.erb +++ /dev/null @@ -1,92 +0,0 @@ -<% provide :title do %><%= @question.title %><% end %> - -
-
-
- <%= back_link_to %> - -

<%= @question.title %>

- - <% if @question.proposal.present? %> -
- <%= link_to t('poll_questions.show.original_proposal'), @question.proposal %> -
- <% end %> - - <% if can? :answer, @question %> - <%= link_to t('poll_questions.show.answer_this_question'), - @question.poll, - class: 'large button' %> - <% else %> - <%= render 'polls/reasons_for_not_answering', poll: @question.poll %> - <% end %> -
- -
-

- - <%= t('poll_questions.show.author') %> - -
- <% if @question.author_visible_name.present? %> - <%= @question.author_visible_name %> - <% else %> - <%= link_to @question.author.name, @question.author %> - <% end %> - -

- -

- - <%= t('poll_questions.show.poll') %> - -
- <%= link_to @question.poll.name, @question.poll %> -

- -

- - <%= t('poll_questions.show.dates_title') %> - -
- <%= poll_dates(@question.poll) %> -

-
-
-
- -<% if @question.video_url.present? %> -
-
- -
-
- -<% end %> - -
-
-

<%= t('poll_questions.show.more_info') %>

- <%= @question.description %> -
-
- -
- <%= render "polls/questions/filter_subnav" %> - -
- <%= render "polls/questions/comments" %> -
- -
- <%= render 'documents/documents', - documents: @question.documents, - max_documents_allowed: Poll::Question.max_documents_allowed %> -
-
diff --git a/config/routes.rb b/config/routes.rb index 410f2dced..6c893c24a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -112,11 +112,7 @@ Rails.application.routes.draw do get :search, on: :collection end - resources :polls, only: [:show, :index] do - resources :questions, only: [:show], controller: 'polls/questions', shallow: true do - post :answer, on: :member - end - end + resources :polls, only: [:show, :index] namespace :legislation do resources :processes, only: [:index, :show] do