alert.mustache 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. <% alert ||= Alert.new; alert_counter ||= -1 %>
  19. <% if alert_counter > 0 %>
  20. <div class="alert_separator"></div>
  21. <% end %>
  22. <% alert_counter = '{{id}}' if alert_counter == -1 %>
  23. <%= form_for [@context, alert], :html => { :class => "alert displaying #{'blank' if alert.new_record?}" } do |f| %>
  24. <div class="links">
  25. <a href="#" class="displaying edit_link no-hover" title="{{#t}}Edit alert{{/t}}"><i class="icon-edit"></i></a>
  26. <a href="#" class="delete_link no-hover" title="{{#t}}Delete this alert{{/t}}"><i class="icon-trash"></i></a>
  27. </div>
  28. <div class="labelled_region">
  29. <span class="alert-label"><%= before_label :criteria, "Trigger an alert when" %></span>
  30. <ul class="criteria"></ul>
  31. <div class="add_criteria_line editing">
  32. <select title="<%= t :criteria, "Trigger an alert when" %>"></select>
  33. <a href="#" class="add_criterion_link icon-add" title="{{#t}}Add Trigger') %>" aria-label="<%= t('Add Trigger{{/t}}"><%= t 'buttons.add_criterion', "Trigger" %></a>
  34. </div>
  35. </div>
  36. <div class="labelled_region">
  37. <span class="alert-label"><%= before_label :recipients, "Send a notification to" %></span>
  38. <ul class="recipients"></ul>
  39. <div class="add_recipients_line editing">
  40. <select title="<%= t :recipients, "Send a notification to" %>"></select>
  41. <a href="#" class="add_recipient_link icon-add" title="{{#t}}Add Recipient') %>" aria-label="<%= t('Add Recipient{{/t}}"><%= t 'buttons.add_recipient', "Recipient" %></a>
  42. </div>
  43. </div>
  44. <div class="labelled_region">
  45. <span class="alert-label"><%= before_label :repetition, "Repetition" %></span>
  46. <div class="repetition_group">
  47. <input type="radio" class="editing" name="repetition" value="none" checked="checked" id="repetition_none_<%= alert_counter %>" /> <label for="repetition_none_<%= alert_counter %>" class="no_repetition">{{#t}}Do not re-send alert{{/t}}</label><br class="editing"/>
  48. <input type="radio" class="editing" name="repetition" value="value" id="repetition_repetition_<%= alert_counter %>" /> <label for="repetition_repetition_<%= alert_counter %>" class="repetition" style="display:none;"><%= t('repetition_description', "Re-send alert every %{count} days until resolved", :count => "<span class='displaying'></span><input type='text' name='alert[repetition]' class='editing' size='2' />".html_safe) %></label>
  49. </div>
  50. </div>
  51. <div class="form-actions">
  52. <button class="editing Button cancel_button">{{#t}}Cancel{{/t}}</button>
  53. <button type="submit" class="editing Button Button--primary submit_button">{{#t}}Save Alert{{/t}}</button>
  54. </div>
  55. <% end %>