<%= content_for :breadcrumbs do %> <%= breadcrumbs0 @debatable, link_to(t(:discussions), item_discussions_path(@debatable))%> <%= breadcrumb_list_item('last', @discussion.friendly.truncate_words(4)) %> <% end %>
<% if current_user && !current_user.moderator? %> <% end %>

<%= @discussion.title %>

<%= label_for_status(@discussion.status) %> ยท <%= @discussion.initiator.name %> <%= discussion_info(@discussion) %>
<%= render partial: 'exercises/read_only', locals: {exercise: @debatable} %>
<% if @discussion.has_messages? || @discussion.commentable_by?(current_user) %>

<%= t :messages %>

<% if @discussion.has_messages? %>
<% if @discussion.description.present? %> <%= render partial: 'discussions/description_message', locals: {discussion: @discussion} %> <% end %> <% @discussion.messages.each do |message| %> <%= render partial: 'discussions/message', locals: {user: message.sender_user, message: message} %> <% end %> <% if @discussion.commentable_by?(current_user) %>
<% end %>
<% end %> <%= render partial: 'discussions/new_message', locals: {user: current_user} if @discussion.commentable_by?(current_user) %> <% end %>
<% @discussion.reachable_statuses_for(current_user).each do |status| %> <%= discussion_update_status_button(status) %> <% end if current_user %>