crowdAI/crowdai

View on GitHub
app/views/comments/_form.html.erb

Summary

Maintainability
Test Coverage
<div class="discussion-comment" id='comment-<%= comment.id %>'>
  <div class="pic">
    <%= link_to participant_path(current_participant) do %>
      <%= concept(Image::Cell,current_participant) %>
    <% end %>
  </div>
  <%= form_for [topic, comment], html: { class: 'add-comment', id: 'new_comment' } do |f| %>
    <%= f.text_area :comment_markdown, placeholder: "Add a comment...", data: { behavior: "mentions" } %>
    <% if comment.persisted? %>
      <%= f.hidden_field :participant_id, value: comment.participant.id %>
    <% else %>
      <%= f.hidden_field :participant_id, value: current_participant.id %>
    <% end %>
    <%= f.hidden_field :mentions_cache %>
    <%= f.submit (f.object.new_record? ? "Add Comment" : "Update Comment"), class: 'btn btn-primary pull-right' %>
    <p class='markdown-instructions'>You can use
      <a href="https://kramdown.gettalong.org/">kramdown</a> and <b>@mentions</b> in this field.
    </p>
  <% end %>
</div>