crowdAI/crowdai

View on GitHub
app/concepts/discussion/views/show.erb

Summary

Maintainability
Test Coverage
<div class="row" data-cell='Discussion::Cell'>
  <div class="discussion-topic">
    <div class="pic">
      <% if topic.participant.is_a? NullParticipant %>
        <%= link_to '#' do %>
          <%= concept(Image::Cell,topic.participant) %>
        <% end %>
      <% else %>
        <%= link_to participant_path(topic.participant) do %>
          <%= concept(Image::Cell,topic.participant) %>
        <% end %>
      <% end %>
    </div>
    <div class="topic-content">
      <%= concept(Vote::Cell, topic, current_participant: current_participant) %>
      <h4><%= topic.topic %></h4>
      <p class="details">Posted by
        <% if topic.participant.is_a? NullParticipant %>
          <%= link_to author.name, '#' %>
        <% else %>
          <%= link_to author.name, participant_path(author) %>
        <% end %>
        <%= time_ago_in_words(topic.created_at) %> ago |&nbsp;
        <a href="#">Quote</a>
      </p>
      <div class="comment">
        <p><%= simple_format(topic.description) %></p>
      </div>
    </div>
  </div>

  <%= concept(Discussion::Cell::CommentForm, topic, current_participant: current_participant) %>
  <%= concept(Discussion::Cell::Comment, collection: comments, current_participant: current_participant) %>
</div>