pending_enrollment.mustache 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. <%
  19. pending_enrollment ||= nil
  20. enrollment = pending_enrollment
  21. title_message = t :student_title, "Invited as a student, click to see the Course"
  22. case enrollment.type
  23. when 'TeacherEnrollment'
  24. title_message = t :teacher_title, "Invited as a teacher, click to see the Course"
  25. when 'TaEnrollment'
  26. title_message = t :ta_title, "Invited as a TA, click to see the Course"
  27. when 'ObserverEnrollment'
  28. title_message = t :observer_title, "Invited as an observer, click to see the Course"
  29. when 'DesignerEnrollment'
  30. title_message = t :designer_title, "Invited as a designer, click to see the Course"
  31. end
  32. %>
  33. <li><a href="<%= course_url(enrollment.course, :invitation => enrollment.uuid) %>" title="<%= title_message %>" class="<%= enrollment.type.to_s.underscore %>">
  34. <%=
  35. case enrollment.type
  36. when 'TeacherEnrollment'
  37. t :teacher, "%{course} as a teacher.", :course => enrollment.course.name
  38. when 'TaEnrollment'
  39. t :ta, "%{course} as a TA.", :course => enrollment.course.name
  40. when 'ObserverEnrollment'
  41. t :observer, "%{course} as an observer.", :course => enrollment.course.name
  42. when 'DesignerEnrollment'
  43. t :designer, "%{course} as a designer.", :course => enrollment.course.name
  44. else
  45. t :student, "%{course} as a student.", :course => enrollment.course.name
  46. end
  47. %>
  48. </a></li>