new.mustache 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. <%
  19. content_for :page_title, t('titles.course_enrollment', 'Enroll in %{course}', :course => @course.name)
  20. js_bundle :self_enrollment
  21. css_bundle :self_enrollment
  22. js_env :SELF_ENROLLMENT_OPTIONS => {:confirmEnrollmentUrl => @confirm_enrollment_url}
  23. if !@current_user && !@embedded_view
  24. css_bundle :login
  25. @headers = false
  26. @body_classes << "full-width body--login-confirmation"
  27. end
  28. %>
  29. <div
  30. id="modal-box"
  31. <% if !@current_user && !@embedded_view %>class="ic-Login-confirmation"<% end %>
  32. >
  33. <% if !@current_user && !@embedded_view %>
  34. <header class="ic-Login-confirmation__header">
  35. <%= image_tag("login/canvas-logo@2x.png", class:"ic-Login-confirmation__logo", alt:"Canvas by Instructure") %>
  36. </header>
  37. <div class="ic-Login-confirmation__content">
  38. <% end %>
  39. <h2 class="ic-Login-confirmation__headline">
  40. <%= t('titles.course_enrollment', 'Enroll in %{course}', :course => @course.name) %>
  41. </h2>
  42. <% if !@course.self_enrollment_enabled? %>
  43. {{> views/enrollment_closed}}
  44. <% elsif @current_user && @course.user_is_student?(@current_user, :include_future => true) %>
  45. <% if params[:enrolled] %>
  46. {{> views/successfully_enrolled}}
  47. <% else %>
  48. {{> views/already_enrolled}}
  49. <% end %>
  50. <% elsif @course.self_enrollment_limit_met? %>
  51. {{> views/course_full}}
  52. <% else %>
  53. <% if @current_user %>
  54. {{> views/confirm_enrollments}}
  55. <% elsif @domain_root_account.self_registration? %>
  56. {{> views/authenticate_or_register}}
  57. <% else %>
  58. {{> views/authenticate}}
  59. <% end %>
  60. <% end %>
  61. <% if !@current_user && !@embedded_view %></div><% end %>
  62. <% if @embedded_view %></div><% end %>
  63. </div>