denny/ShinyCMS-ruby

View on GitHub
plugins/ShinyCMS/app/views/shinycms/discussions/show.html.erb

Summary

Maintainability
Test Coverage
<% if @discussion.show_on_site? %>

<% if @discussion.comments.top_level.present? %>
  <%= render partial: 'discussions/top_level',
             locals: { discussion: @discussion, comments: @discussion.comments.with_authors.top_level } %>
<% else %>
  <section>
    <p>
      <%= t( 'shinycms.empty_list', items: 'comments' ) %>
    </p>
  </section>
<% end %>

<p>
  <button class="button" onclick="toggleHidden('comment_form')" style="font-size: 1em; height: 2em;">
    <%= t( 'shinycms.discussions.new_comment' ) %>
  </button>
</p>

<div id="comment_form" class="comment_form" hidden>
  <section>
    <%= render partial: 'comments/comment_form', locals: { discussion: @discussion } %>
  </section>
</div>

<% end %>