master_course_restrictions.mustache 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <%
  2. # Copyright (C) 2017 - 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 ||= nil %>
  19. <% course ||= nil %>
  20. <% master_template = course.master_course_templates.for_full_course.first %>
  21. <% default_restrictions = master_template&.default_restrictions || { :content => true } %>
  22. <div id="master_course_restrictions" class="master_course_restrictions">
  23. <fieldset class="ic-Fieldset ic-Fieldset--radio-checkbox">
  24. <legend class="ic-Legend">
  25. <span class="master-course-cell"><i class="icon-blueprint-lock"></i></span>
  26. {{#t}}Locked object configuration:{{/t}}
  27. </legend>
  28. <div class="ic-Checkbox-group">
  29. <%= form.fields_for :blueprint_restrictions do |f| %>
  30. <div class="ic-Form-control ic-Form-control--checkbox">
  31. <%= f.check_box :content, :checked => default_restrictions[:content] %>
  32. <%= f.label :content, :class => 'ic-Label', :en => "Content" %>
  33. </div>
  34. <div class="ic-Form-control ic-Form-control--checkbox">
  35. <%= f.check_box :points, :checked => default_restrictions[:points] %>
  36. <%= f.label :points, :class => 'ic-Label', :en => "Points" %>
  37. </div>
  38. <div class="ic-Form-control ic-Form-control--checkbox">
  39. <%= f.check_box :due_dates, :checked => default_restrictions[:due_dates] %>
  40. <%= f.label :due_dates, :class => 'ic-Label', :en => "Due Dates" %>
  41. </div>
  42. <div class="ic-Form-control ic-Form-control--checkbox">
  43. <%= f.check_box :availability_dates, :checked => default_restrictions[:availability_dates] %>
  44. <%= f.label :availability_dates, :class => 'ic-Label', :en => "Availability Dates" %>
  45. </div>
  46. <% end %>
  47. </div>
  48. </fieldset>
  49. </div>