50 lines
No EOL
2 KiB
Text
50 lines
No EOL
2 KiB
Text
<% provide(:title, @subject.title ) %>
|
|
|
|
<h1 id="SubjectTitle">
|
|
<%= best_in_place @subject, :title %>
|
|
</h1>
|
|
|
|
<%= image_tag @subject.picture.url, class:"subject-main-image", alt:"#{@subject.title}" if @subject.picture? %>
|
|
|
|
<% if allowed_to(:delete_subject) %>
|
|
<%= link_to "Supprimer", @subject, method: :delete, data: { confirm: "Supprimer \"#{@subject.title}\" ?" }, class: "btn btn-primary btn-danger" %>
|
|
<% end %>
|
|
|
|
<p class="SubjectPresentationText"><%= best_in_place @subject, :presentation, as: :textarea %></p>
|
|
|
|
<h2>Problématique</h2>
|
|
|
|
<p class="subject-problem"><%= best_in_place @subject, :problem, as: :textarea, nil: "Indiquez ici la problématique" %></p>
|
|
|
|
<section class="Positions">
|
|
|
|
<h2>Les positions</h2>
|
|
|
|
<p><%= pluralize(@subject.positions.count, 'positions') %>, <%= pluralize(@subject.statements.count, 'prise de position') %></p>
|
|
|
|
<% if @subject.positions.any? %>
|
|
<ul class="Positions">
|
|
|
|
<%= render @subject.positions.select { |p| p.id } %>
|
|
|
|
<% if false && logged_in? && allowed_to(:add_position) && allowed_to(:add_statement) %>
|
|
<li id="new-position">
|
|
<%= form_for(@new_position) do |f| %>
|
|
<%= render 'shared/error_messages', object: f.object %>
|
|
<%= f.hidden_field :subject_id, :value => @subject.id %>
|
|
<span class="PositionTitle"><%= f.text_field :title, placeholder: "Nouvelle position" %></span>
|
|
<span class="PositionDescription"><%= f.text_area :description, placeholder: "Description" %></span>
|
|
|
|
<!-- Il est obligatoire d'ajouter une première prise de position pour valider une nouvelle position, donc on la met tout de suite dans le même formulaire -->
|
|
<p>Qui a pris cette position ?</p>
|
|
|
|
|
|
<%= f.submit "Ajouter", class: "btn btn-primary" %>
|
|
<% end %>
|
|
|
|
</li>
|
|
<% end %>
|
|
</ul>
|
|
<% end %>
|
|
|
|
</section> |