index.mustache 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <title>%1</title>
  2. <% content_for :auto_discovery do %>
  3. <% if @current_user %>
  4. <%= auto_discovery_link_tag(:atom, feeds_user_format_path(@current_user.feed_code, :atom), {:title => t('titles.rss.course_announcements', "Course Announcements Atom Feed")}) %>
  5. <% end %>
  6. <% end %>
  7. <% css_bundle :context_list, :course_list %>
  8. <% js_bundle :course_list %>
  9. <% @favorite_course_ids = @current_user.courses_with_primary_enrollment(:favorite_courses).map(&:id) %>
  10. <% @show_star_column = true %>
  11. <div class="header-bar">
  12. <h2>{{#t}}All Courses{{/t}}</h2>
  13. </div>
  14. <div class="ic-Action-header content--hasMarginTop">
  15. <div class="ic-Action-header__Secondary">
  16. <% if @domain_root_account.feature_enabled?(:course_catalog) %>
  17. <%= link_to t('browse_more_courses', 'Browse More Courses'), "/search/all_courses/", class:"Button" %>
  18. <% end %>
  19. <% if show_user_create_course_button(@current_user) %>
  20. <button type="button"
  21. id="start_new_course"
  22. class="Button element_toggler"
  23. aria-controls="new_course_form"
  24. aria-label="{{#t}}Add a Course{{/t}}">
  25. <i class="icon-plus"></i> {{#t}}Course{{/t}}</button>
  26. {{> views/shared/new_course_form}}
  27. <% end %>
  28. </div>
  29. </div>
  30. <% if @current_enrollments.empty? %>
  31. {{#t}}You are not enrolled in any courses.{{/t}}
  32. <% else %>
  33. <table id="my_courses_table" class="ic-Table ic-Table--bordered course-list-table">
  34. <thead>
  35. <tr>
  36. <th scope="col" class="course-list-star-column"></th>
  37. <th scope="col" class="course-list-course-title-column course-list-no-left-border">{{#t}}Course{{/t}}</th>
  38. <th scope="col" class="course-list-nickname-column course-list-no-left-border">{{#t}}Nickname{{/t}}</th>
  39. <th scope="col" class="course-list-term-column course-list-no-left-border">{{#t}}Term{{/t}}</th>
  40. <th scope="col" class="course-list-enrolled-as-column course-list-no-left-border">{{#t}}Enrolled as{{/t}}</th>
  41. <th scope="col" class="course-list-published-column course-list-no-left-border">{{#t}}Published{{/t}}</th>
  42. </tr>
  43. </thead>
  44. <tbody>
  45. <% @current_enrollments.each do |enrollment| %>
  46. {{> views/shared/current_enrollment}}
  47. <% end %>
  48. </tbody>
  49. </table>
  50. <% end %>
  51. <% @show_star_column = true %>
  52. <% unless @past_enrollments.empty? %>
  53. <div class="content--hasMarginTop">
  54. <h2>{{#t}}Past Enrollments{{/t}}</h2>
  55. </div>
  56. <table id="past_enrollments_table" class="ic-Table ic-Table--bordered course-list-table">
  57. <thead>
  58. <tr>
  59. <th scope="col" class="course-list-star-column"></th>
  60. <th scope="col" class="course-list-course-title-column course-list-no-left-border">{{#t}}Course{{/t}}</th>
  61. <th scope="col" class="course-list-nickname-column course-list-no-left-border">{{#t}}Nickname{{/t}}</th>
  62. <th scope="col" class="course-list-term-column course-list-no-left-border">{{#t}}Term{{/t}}</th>
  63. <th scope="col" class="course-list-enrolled-as-column course-list-no-left-border">{{#t}}Enrolled as{{/t}}</th>
  64. <th scope="col" class="course-list-published-column course-list-no-left-border">{{#t}}Published{{/t}}</th>
  65. </tr>
  66. </thead>
  67. <tbody>
  68. <% @past_enrollments.each do |enrollment| %>
  69. {{> views/shared/current_enrollment}}
  70. <% end %>
  71. </tbody>
  72. </table>
  73. <% end %>
  74. <% unless @future_enrollments.empty? %>
  75. <div class="content--hasMarginTop">
  76. <h2>{{#t}}Future Enrollments{{/t}}</h2>
  77. </div>
  78. <table id="future_enrollments_table" class="ic-Table ic-Table--bordered course-list-table">
  79. <thead>
  80. <tr>
  81. <th scope="col" class="course-list-star-column"></th>
  82. <th scope="col" class="course-list-course-title-column course-list-no-left-border">{{#t}}Course{{/t}}</th>
  83. <th scope="col" class="course-list-nickname-column course-list-no-left-border">{{#t}}Nickname{{/t}}</th>
  84. <th scope="col" class="course-list-term-column course-list-no-left-border">{{#t}}Term{{/t}}</th>
  85. <th scope="col" class="course-list-enrolled-as-column course-list-no-left-border">{{#t}}Enrolled as{{/t}}</th>
  86. <th scope="col" class="course-list-published-column course-list-no-left-border">{{#t}}Published{{/t}}</th>
  87. </tr>
  88. </thead>
  89. <tbody>
  90. <% @future_enrollments.each do |enrollment| %>
  91. {{> views/shared/current_enrollment}}
  92. <% end %>
  93. </tbody>
  94. </table>
  95. <% end %>
  96. <% @show_star_column = false %>
  97. <% unless @visible_groups.empty? %>
  98. <div class="content--hasMarginTop">
  99. <h2>{{#t}}My Groups{{/t}}</h2>
  100. </div>
  101. <table id="my_groups_table" class="ic-Table ic-Table--bordered course-list-table">
  102. <thead>
  103. <tr>
  104. <th scope="col" class="course-list-group-column">{{#t}}Group{{/t}}</th>
  105. <th scope="col" class="course-list-course-title-column course-list-no-left-border">{{#t}}Course{{/t}}</th>
  106. <th scope="col" class="course-list-term-column course-list-no-left-border">{{#t}}Term{{/t}}</th>
  107. </tr>
  108. </thead>
  109. <tbody>
  110. <% @visible_groups.each do |group| %>
  111. <% group_name = group.name %>
  112. <tr>
  113. <td>
  114. <a href=<%= group_path(group) %>>
  115. <span class="name" title="<%= group_name %>">
  116. <%= group_name %>
  117. </span>
  118. </a>
  119. </td>
  120. <td class="course-list-no-left-border">
  121. <span class="name"><%= group.context.name %></span>
  122. </td>
  123. <td class="course-list-no-left-border">
  124. <% if group.context_type == 'Course' && !group.context.enrollment_term.default_term? %>
  125. <%= group.context.enrollment_term.name %>
  126. <% end %>
  127. </td>
  128. </tr>
  129. <% end %>
  130. </tbody>
  131. </table>
  132. <% end %>