all_courses_inner.mustache 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <%
  2. # Copyright (C) 2013 - 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. # from https://github.com/instructure/color-slicer, start:270
  20. colors = [
  21. 'rgb(74,118,178)',
  22. 'rgb(79,128,69)',
  23. 'rgb(203,63,119)',
  24. 'rgb(26,127,147)',
  25. 'rgb(146,112,5)',
  26. 'rgb(131,102,180)',
  27. 'rgb(47,130,106)',
  28. 'rgb(203,71,64)',
  29. 'rgb(43,123,169)',
  30. 'rgb(103,125,43)',
  31. 'rgb(184,76,150)',
  32. 'rgb(29,129,133)'
  33. ]
  34. %>
  35. <ul id="course_summaries" class="clearfix">
  36. <% @courses.each_with_index do |c, i| %>
  37. <li class="course_summary span3 border border-trbl">
  38. <div class="course_text">
  39. <h3 class="pad-box-mini border border-b" style="background-color: <%= colors[i % colors.count] %>">
  40. <a href="/courses/<%= c.id %>"><%= c.name %></a>
  41. </h3>
  42. <p class="pad-box-mini"><%= c.public_description %></p>
  43. <% if @current_user && c.open_enrollment && c.self_enrollment_enabled? %>
  44. <p>
  45. <a class="btn course_enrollment_link" aria-label="<%= t('Join %{course}', :course => c.name) %>" data-open-as-dialog="" href="/enroll/<%= c.self_enrollment_code %>">
  46. <i class="icon-user-add"></i>
  47. {{#t}}Join this Course{{/t}}
  48. </a>
  49. </p>
  50. <% end %>
  51. </div>
  52. </li>
  53. <% end %>
  54. </ul>
  55. <% if @prevPage %>
  56. <a class="pull-left" id="previous-link" href="<%= @prevPage %>">{{#t}}Previous{{/t}}</a>
  57. <% end %>
  58. <% if @nextPage %>
  59. <a class="pull-right" id="next-link" href="<%= @nextPage %>">{{#t}}Next{{/t}}</a>
  60. <% end %>