submission_comment.mustache 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <%
  2. # Copyright (C) 2011 - present Instructure, Inc.
  3. #
  4. # This file is part of Canvas.
  5. #
  6. # Canvas is free software: you can redistribute it and/or modify it under
  7. # the terms of the GNU Affero General Public License as published by the Free
  8. # Software Foundation, version 3 of the License.
  9. #
  10. # Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
  11. # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. # A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
  13. # details.
  14. #
  15. # You should have received a copy of the GNU Affero General Public License along
  16. # with this program. If not, see <http://www.gnu.org/licenses/>.
  17. %>
  18. <% submission_comment ||= nil; show_context ||= false; brief ||= false %>
  19. <% context = submission_comment.context rescue @context %>
  20. <div class="communication_message submission_comment" style="<%= hidden unless submission_comment %>" id="submission_comment_<%= submission_comment ? submission_comment.id : "blank" %>">
  21. <div class="header">
  22. <div class="post_date created_at"><%= datetime_string(submission_comment.created_at) rescue nbsp %></div>
  23. <%= image_tag "grading_icon.png", :class => "topic_icon", :alt => t(:grading_alt, "grading"), :title => t(:submission_comment, "Submission Comment"), :style => brief ? "padding: 2px;" : "" %>
  24. <a href="<%= context_url(context, :context_assignment_submission_url, submission_comment.submission.assignment_id, submission_comment.submission.user_id) %>" class="title subject"><%= submission_comment.submission.assignment.title rescue t(:assignment, "Assignment") %>, <%= context_user_name(context, submission_comment.submission.user) %></a>
  25. <a span="padding-left: 10px;" href="<%= context_url(context, :context_user_url, submission_comment ? submission_comment.author_id : '{{ user_id }}') %>" class="user_name"><%= context_user_name(context, submission_comment.author) rescue nbsp %></a>
  26. <div class="clear"></div>
  27. </div>
  28. <div class="content">
  29. <div style="float: left; margin: 0 5px 0 -10px;"><%= avatar((submission_comment.author_id rescue nil), context.asset_string, 30) %></div>
  30. <div class="message user_content formatted_body"><%= user_content(submission_comment.try(:formatted_body)) || nbsp %></div>
  31. <div class="attachments_list" style="margin-top: 5px; <%= hidden unless submission_comment && !submission_comment.attachments.empty? %>">
  32. <% (submission_comment.attachments rescue []).each do |attachment| %>
  33. <div class="attachment">
  34. <a href="<%= context_url(context, :context_assignment_submission_url, submission_comment.submission.assignment_id, submission_comment.submission.user_id, :comment_id => submission_comment.id, :download => attachment.id) %>" class="comment_attachment_link download"> <%= attachment.display_name %> - <%= attachment.readable_size %></a>
  35. </div>
  36. <% end %>
  37. </div>
  38. <div class="clear"></div>
  39. </div>
  40. </div>