copy.mustache 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. <% content_for :page_title, t('titles.copy_course', 'Copy Course') %>
  19. <% add_crumb t('#crumbs.copy_course', 'Copy Course') %>
  20. <h1><%= t'headings.copy_course', 'Copy %{course}', :course => @context.name %></h1>
  21. <p>
  22. {{#t}}Please enter the details for the new course.{{/t}}
  23. </p>
  24. <%= form_for :course, :url => course_copy_course_url(@context), :html => {:id => "copy_course_form", :class => "form-horizontal"} do |f| %>
  25. <div class="control-group">
  26. <label class="control-label"><strong>{{#t}}Name{{/t}}</strong></label>
  27. <div class="controls"><%= f.text_field :name, :value => @context.name %></div>
  28. </div>
  29. <div class="control-group">
  30. <label class="control-label"><strong>{{#t}}Course Code{{/t}}</strong></label>
  31. <div class="controls"><%= f.text_field :course_code, :value => @context.course_code %></div>
  32. </div>
  33. <div class="control-group">
  34. <label class="control-label">
  35. <strong>{{#t}}Start Date{{/t}}</strong>
  36. </label>
  37. <label class="screenreader-only" id="course_starts_at_label">
  38. {{#t}}Course starts at{{/t}}
  39. <%= datepicker_screenreader_prompt %>
  40. </label>
  41. <div class="controls">
  42. <%= f.text_field :start_at,
  43. class: 'datetime_field',
  44. style: "width: 165px;",
  45. value: datetime_string(@context.start_at, :verbose),
  46. "aria-labelledby" => "course_starts_at_label",
  47. "data-tooltip" => "",
  48. title: accessible_date_format %>
  49. </div>
  50. </div>
  51. <div class="control-group">
  52. <label class="control-label">
  53. <strong>{{#t}}End Date{{/t}}</strong>
  54. </label>
  55. <label class="screenreader-only" id="course_ends_at_label">
  56. {{#t}}Course ends at{{/t}}
  57. <%= datepicker_screenreader_prompt %>
  58. </label>
  59. <div class="controls">
  60. <%= f.text_field :conclude_at,
  61. class: 'datetime_field',
  62. style: "width: 165px;",
  63. value: datetime_string(@context.conclude_at, :verbose),
  64. "aria-labelledby" => "course_ends_at_label",
  65. "data-tooltip" => "",
  66. title: accessible_date_format %>
  67. </div>
  68. </div>
  69. <% if can_do(@context.account, @current_user, :manage_courses) %>
  70. <div class="control-group">
  71. <label class="control-label"><strong>{{#t}}Term{{/t}}</strong></label>
  72. <div class="controls">
  73. <select name="course[enrollment_term_id]" id="course_enrollment_term_id">
  74. <% @context.root_account.enrollment_terms.active.sort_by { |t| t.start_at || CanvasSort::First }.each do |term| %>
  75. <option value="<%= term.id %>" <%= 'selected' if term.id == @context.enrollment_term_id %>><%= term.name %></option>
  76. <% end %>
  77. </select>
  78. </div>
  79. </div>
  80. <% end %>
  81. <div class="control-group">
  82. <div class="control-label">
  83. <strong>{{#t}}Content{{/t}}</strong>
  84. </div>
  85. <div class="controls">
  86. <div class="radio">
  87. <label>
  88. <input type="radio" name="selective_import" checked value=false>
  89. {{#t}}All content{{/t}}
  90. </label>
  91. </div>
  92. <div class="radio">
  93. <label>
  94. <input type="radio" name="selective_import" value=true>
  95. {{#t}}Select specific content{{/t}}
  96. </label>
  97. </div>
  98. </div>
  99. </div>
  100. <div class="control-group">
  101. <div id="date_shift"></div>
  102. </div>
  103. <div class='form-actions'>
  104. <a href="<%= course_settings_url(@context) %>" class="btn button-secondary"><%= t '#buttons.cancel', 'Cancel' %></a>
  105. <button type="submit" class="btn btn-primary">{{#t}}Create Course{{/t}}</button>
  106. </div>
  107. <% end %>
  108. <% js_bundle :copy_course %>