AyuntamientoMadrid/participacion

View on GitHub
app/views/legislation/questions/show.html.erb

Summary

Maintainability
Test Coverage
<% provide :title, @question.title %>

<section class="debate-questions">
  <div class="quiz-header row small-collapse">
    <div class="small-12 medium-9 column">
      <div class="quiz-title">
        <p class="quiz-header-title"><%= t("legislation.questions.show.title") %></p>
        <strong><%= link_to @process.title, @process %></strong>
      </div>
    </div>
    <div class="small-12 medium-3 column">
      <% if @question.next_question_id %>
        <%= link_to legislation_process_question_path(@process, @question.next_question_id), class: "quiz-next-link" do %>
          <div class="quiz-next">
            <%= t("legislation.questions.show.next_question") %>
            <span class="icon-angle-right" aria-hidden="true">
          </div>
        <% end %>
      <% elsif @question.first_question_id %>
        <%= link_to legislation_process_question_path(@process, @question.first_question_id), class: "quiz-next-link" do %>
          <div class="quiz-next">
            <%= t("legislation.questions.show.first_question") %>
            <span class="icon-angle-right" aria-hidden="true">
          </div>
        <% end %>
      <% end %>
    </div>
  </div>
  <div class="row">
    <div class="small-12 medium-9 column">
      <h1 class="quiz-question"><%= @question.title %></h1>
      <%= AdminWYSIWYGSanitizer.new.sanitize(@question.description) %>
      <div class="debate-questions" id="legislation-answer-form">
        <%= render "answer_form", process: @process, question: @question, answer: @answer %>
      </div>
    </div>

    <aside class="small-12 medium-3 column">
      <div id="social-share" class="sidebar-divider"></div>
      <h2><%= t("legislation.questions.show.share") %></h2>
      <%= render "/shared/social_share", title: @question.title, url: legislation_process_question_url(@question.process, @question) %>
    </aside>
  </div>
  <%= render Shared::CommentsComponent.new(@question, @comment_tree) do %>
    <h2>
      <%= t("legislation.questions.comments.comments_title") %>
      <span class="js-comments-count">(<%= @question.comments_count %>)</span>
    </h2>
  <% end %>
</section>