%= content_for :breadcrumbs do %>
<%= breadcrumbs_for_discussion @discussion, @debatable %>
<% end %>
<% if current_user %>
<% end %>
<%= 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 %>