new_course_form.mustache 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. <%= form_for Course.new, :html => { :id => 'new_course_form',
  19. :class => 'bootstrap-form form-horizontal',
  20. 'data-turn-into-dialog' => '{"width":500,"resizable":false}',
  21. :title => t('start_a_new_course', 'Start a New Course'),
  22. :style => 'display:none;' } do |f| %>
  23. <div class="control-group">
  24. <%= f.label :name, :en => "Course Name", :class => "control-label" %>
  25. <div class="controls">
  26. <%= f.text_field :name,
  27. :placeholder => t('new_course_name_placeholder', 'Course Name'),
  28. :class => 'input-xlarge',
  29. :maxlength => '255' %>
  30. </div>
  31. </div>
  32. <div id="course_code_wrapper" class="control-group" style="display:none">
  33. <%= f.label :course_code, :en => "Short Name", :class => "control-label" %>
  34. <div class="controls">
  35. <%= f.text_field :course_code,
  36. :placeholder => t('sample_course_code', 'Course-101'),
  37. :class => 'input-small',
  38. :maxlength => '255' %>
  39. <div><%= t :course_cose_explanation, "This will be displayed in places with little space" %></div>
  40. </div>
  41. </div>
  42. <div class="control-group">
  43. <%= f.label :license,
  44. :en => "Content License",
  45. :class => "control-label" %>
  46. <div class="controls">
  47. <% cc, non_cc = Course.licenses.map { |id, attrs| [attrs[:readable_license].call, id]}.partition{|n, id| id.start_with?('cc')} %>
  48. <select name="course[license]" id="course_license" class="input-xlarge">
  49. <%= options_for_select(non_cc) %>
  50. <%= grouped_options_for_select([[t("Creative Commons Licenses"), cc]]) %>
  51. </select>
  52. </div>
  53. </div>
  54. <div class="control-group">
  55. <div class="controls">
  56. <label class="checkbox" for="course_is_public">
  57. <%= f.check_box :is_public %>
  58. <%= t :course_is_public_explanation, "Make course publicly visible *(student data will remain private)*", wrapper: '<div>\1</div>' %>
  59. </label>
  60. </div>
  61. </div>
  62. <input type="hidden" name="enroll_me" value="true">
  63. <div class="button-container">
  64. <button type="button"
  65. data-text-while-loading="<%= t 'cancel', "Cancel" %>"
  66. class="btn dialog_closer"><%= t 'cancel', "Cancel" %></button>
  67. <button class="btn btn-primary"
  68. data-text-while-loading="<%= t 'creating_course', 'Creating course...' %>"
  69. type="submit"><%= t 'create_course', 'Create course' %></button>
  70. </div>
  71. <% end %>