message.mustache 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <%
  2. # Copyright (C) 2012 - 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. <li class="message list-view border border-trbl"
  19. data-message-id="<%= message.id %>"
  20. data-secure-id="<%= IncomingMail::ReplyToAddress.new(message).secure_id %>">
  21. <header>
  22. <span class="h6"><%= message.subject %></span>
  23. <span class="label label-<%= message.workflow_state %>">
  24. <%= message.workflow_state.capitalize %>
  25. </span>
  26. </header>
  27. <div class="tabs">
  28. <ul>
  29. <li><a href="#meta-data-<%= message.id %>">{{#t}}Meta Data{{/t}}</a></li>
  30. <li><a href="#tabs-plain-<%= message.id %>">{{#t}}Plain Text{{/t}}</a></li>
  31. <li><a href="#tabs-plain-html-<%= message.id %>">HTML</a></li>
  32. </ul>
  33. <div id="meta-data-<%= message.id %>">
  34. <table class="ic-Table ic-Table--condensed grid">
  35. <tbody>
  36. <% unless Rails.env.production? %>
  37. <tr>
  38. <td class="td-label"><div>ID</div></td>
  39. <td><%= message.id %></td>
  40. </tr>
  41. <% end %>
  42. <tr>
  43. <td class="td-label"><div>{{#t}}Subject{{/t}}</div></td>
  44. <td><%= message.subject %></td>
  45. </tr>
  46. <tr>
  47. <td class="td-label"><div>{{#t}}To{{/t}}</div></td>
  48. <td><%= message.to %></td>
  49. </tr>
  50. <tr>
  51. <td class="td-label"><div>{{#t}}From Name{{/t}}</div></td>
  52. <td><%= message.from_name %></td>
  53. </tr>
  54. <tr>
  55. <td class="td-label"><div>{{#t}}Reply to{{/t}}</div></td>
  56. <td><span class="message-reply"><%= IncomingMail::ReplyToAddress.new(message).address %></span>
  57. (<a class="reply-button" href="#" role="button">{{#t}}Reply{{/t}}</a>)</td>
  58. </tr>
  59. <tr>
  60. <td class="td-label"><div>{{#t}}Created at{{/t}}</div></td>
  61. <td><%= message.created_at %></td>
  62. </tr>
  63. <tr>
  64. <td class="td-label"><div>{{#t}}Sent at{{/t}}</div></td>
  65. <td><%= message.sent_at %></td>
  66. </tr>
  67. <tr>
  68. <td class="td-label"><div>{{#t}}Delay for{{/t}}</div></td>
  69. <td><%= message.delay_for %></td>
  70. </tr>
  71. <tr>
  72. <td class="td-label"><div>{{#t}}Path type{{/t}}</div></td>
  73. <td><%= message.path_type %></td>
  74. </tr>
  75. <tr>
  76. <td class="td-label"><div>{{#t}}Notification Name{{/t}}</div></td>
  77. <td><%= message.notification_name %></td>
  78. </tr>
  79. </tbody>
  80. </table>
  81. </div>
  82. <div id="tabs-plain-<%= message.id %>">
  83. <pre class="message-body"><%= message.body %></pre>
  84. </div>
  85. <div id="tabs-plain-html-<%= message.id %>">
  86. <iframe class="message-html-body" src="<%= user_message_html_message_path(message.user, message) %>" title="{{#t}}Message Body{{/t}}"></iframe>
  87. <% if message.html_body.present? %>
  88. <%= link_to "Open in new window", user_message_html_message_path(message.user, message), :target => "_blank", :class => "icon-off small" %>
  89. <% end %>
  90. </div>
  91. </div>
  92. </li>