add_context_module_form.mustache 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <%
  2. # Copyright (C) 2015 - 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. <%= form_for :context_module, :url => context_url(@context, :context_context_modules_url), :html => {:id => "add_context_module_form", :style => "display: none;", :class => "form-dialog"} do |f| %>
  19. <div class="form-dialog-content">
  20. <div class="ic-Form-control form-element">
  21. <div class="module_name form-element">
  22. <label class="screenreader-only" for="context_module_name">{{#t}}Module Name{{/t}}</label>
  23. <%= f.text_field :name, :placeholder => t('Module Name'), :id => 'context_module_name', :class => 'ic-Input' %>
  24. </div>
  25. <div class="ic-Checkbox-group form-element">
  26. <div class="ic-Form-control ic-Form-control--checkbox">
  27. <input type="checkbox" id="unlock_module_at">
  28. <label class="ic-Label" for="unlock_module_at">
  29. {{#t}}Lock until{{/t}}
  30. </label>
  31. </div>
  32. <div class="unlock_module_at_details form-element">
  33. <label class='screenreader-only' id='unlock_at_date_label'>
  34. {{#t}}Unlock module on date{{/t}}
  35. <%= datepicker_screenreader_prompt %>
  36. </label>
  37. <%= f.text_field :unlock_at,
  38. class: "datetime_field",
  39. 'aria-labelledby' => 'unlock_at_date_label',
  40. 'data-tooltip' => '',
  41. :placeholder => t("Unlock At"),
  42. title: accessible_date_format %>
  43. </div>
  44. </div>
  45. <div class="prerequisites_entry form-section border border-t">
  46. <%= f.label :before_viewing, :en => "Prerequisites", class: "ic-Label form-element" %>
  47. <div class="prerequisites_list">
  48. <div class="criteria_list" style="display: none;"></div>
  49. <div id="criterion_blank_prereq" class="criterion clearfix" style="display: none;">
  50. <div class="prereq-req-item">
  51. <span class="prereq_desc"></span>
  52. <div class="option"></div>
  53. </div>
  54. <div class="prereq-req-item-delete">
  55. <button class="delete_criterion_link dim-till-hover" aria-label="{{#t}}Delete prerequisites{{/t}}">
  56. <i class="icon-end standalone-icon" alt="{{#t}}remove icon{{/t}}" ></i>
  57. </button>
  58. </div>
  59. </div>
  60. <div class="add-item">
  61. <button class="Button Button-link add_prerequisite_link add_prerequisite_or_requirement_link" tabindex="0">
  62. <i class="icon-add" alt="{{#t}}add icon{{/t}}"></i>{{#t}}Add prerequisite{{/t}}
  63. </button>
  64. </div>
  65. </div>
  66. </div>
  67. <div class="completion_entry form-section border border-t">
  68. <%= f.label :module_complete_when, :en => "Requirements", class: "ic-Label form-element" %>
  69. <div class="ic-Form-control ic-Form-control--radio requirement-count-radio">
  70. <div class="ic-Radio">
  71. <%= f.radio_button :requirement_count, "" %>
  72. <%= f.label :requirement_count, t("Students must complete all of these requirements"), class: "ic-Label", value: "" %>
  73. </div>
  74. <div class="form-element require-sequential ic-Form-control ic-Form-control--checkbox">
  75. <%= f.check_box :require_sequential_progress, :id => "require_sequential_progress" %>
  76. <%= f.label :require_sequential_progress, :en => "Students must move through requirements in sequential order", :for => "require_sequential_progress", class: 'ic-Label' %>
  77. </div>
  78. <div class="ic-Radio">
  79. <%= f.radio_button :requirement_count, 1 %>
  80. <%= f.label :requirement_count, t("Student must complete one of these requirements"), class: "ic-Label", value: 1 %>
  81. </div>
  82. </div>
  83. <div class="no_items_message form-element" style="display: none;">
  84. <div class="alert alert-info">
  85. {{#t}}No items in module{{/t}}
  86. </div>
  87. </div>
  88. <div class="criteria_list" style="display: none;"></div>
  89. <div id="criterion_blank_req" class="criterion clearfix" style="display: none;">
  90. <div class="prereq-req-item">
  91. <span class="prereq_desc">{{#t}}Must complete{{/t}}</span>
  92. <div class="option"></div>
  93. </div>
  94. <div class="prereq-req-item-delete">
  95. <button class="delete_criterion_link dim-till-hover Button" aria-label="{{#t}}Delete requirement') %>" title="<%= t('Delete requirement{{/t}}">
  96. <i class="icon-end standalone-icon" alt="{{#t}}remove icon{{/t}}"></i>
  97. </button>
  98. </div>
  99. </div>
  100. <div class="add-item">
  101. <button class="Button Button-link add_completion_criterion_link add_prerequisite_or_requirement_link" tabindex="0">
  102. <i class="icon-add" alt="{{#t}}add icon{{/t}}"></i>{{#t}}Add requirement{{/t}}
  103. </button>
  104. </div>
  105. </div>
  106. <% if Canvas::Plugin.find!('grade_export').enabled? %>
  107. <div class="form-element">
  108. <%= f.check_box :publish_final_grade, :id => "publish_final_grade" %>
  109. <%= f.label :publish_final_grade, :en => "Publish final grade for the student when this module is completed", :for => "publish_final_grade" %>
  110. </div>
  111. <% end %>
  112. </div>
  113. </div>
  114. <div class="form-controls">
  115. <button type="button" class="btn cancel_button">{{#t}}Cancel{{/t}}</button>
  116. <button type="submit" class="btn btn-primary submit_button">{{#t}}Add Module{{/t}}</button>
  117. <a href="<%= context_url(@context, :context_context_modules_url) %>" style="display: none;" class="add_context_module_url">&nbsp;</a>
  118. </div>
  119. <% end %>