openpolitics/groupthink

View on GitHub
app/views/ideas/show.html.erb

Summary

Maintainability
Test Coverage
<h1>
  <%= @idea.title %>
  <a href='<%= @idea.html_url %>'>
    <%= fa_icon 'github' %>
  </a>
</h1>

<hr/>

<div class='row'>

  <div class='col-md-9'>

    <% @activity.each do |x| %>
      <%= render partial: "shared/#{x[0]}", locals: x[1] %>
    <% end %>

    <div style="clear: both">
      <% if signed_in? %>
        <div class='panel panel-primary' id="vote">
          <div class="panel-heading">
            Comment:
          </div>
          <div class='panel-body'>
            <%= form_tag comment_idea_path(@idea['number']) do %>
              <div class="form-group">
                <%= text_area_tag :comment, "", {rows: 5, class: "form-control"} %>
              </div>
              <button type="submit" class="btn btn-primary">Submit</button>
            <% end %>
          </div>
        </div>
      <% else %>
        <%= link_to ("#{t(:sign_in)} to comment "+fa_icon("sign-in")).html_safe, new_user_session_path, class: "btn btn-primary" %>
      <% end %>
    </div>

  </div>

  <div class='col-md-3'>

    <div>
      <div class='alert alert-info'>
        This is just a suggestion for a proposal, not a completed proposal. It
        should be turned into a proper proposal by editing the original document.
        Debate and voting can then happen there.
      </div>

      <p>
        <a href='<%= ENV.fetch("PROJECT_URL")%>' class='btn btn-primary btn-block'>
          <%= fa_icon 'edit' %> Make a proposal on this idea!
        </a>
      </p>
    </div>

  </div>

</div>