prerequisites_message.mustache 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <%
  2. # Copyright (C) 2015 - 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. hide_footer = true
  20. prerequisites = []
  21. if editable
  22. hide_footer = context_module && context_module.prerequisites && !context_module.prerequisites.empty?
  23. prerequisites = (context_module.prerequisites || []) if context_module
  24. else
  25. hide_footer = context_module && context_module.active_prerequisites && !context_module.active_prerequisites.empty?
  26. prerequisites = (context_module.active_prerequisites || []) if context_module
  27. end
  28. prereq_list = prerequisite_list(prerequisites)
  29. %>
  30. <div class="prerequisites">
  31. <% if context_module %>
  32. <% prerequisites.each do |pre| %>
  33. <div class="prerequisite_criterion <%= pre[:type] %>_criterion" style="float: left;">
  34. <span class="id" style="display: none;"><%= pre[:id] %></span>
  35. <span class="type" style="display: none;"><%= pre[:type] %></span>
  36. <span class="name" style="display: none;"><%= pre[:name] %></span>
  37. </div>
  38. <% end %>
  39. <% end %>
  40. <div class="prerequisites_message" title='<%= "#{t('Prerequisites:')} #{prereq_list}" %>' style="<%= hidden unless hide_footer%>">
  41. <%= before_label('prerequisites', %{Prerequisites}) %>
  42. <%= prereq_list %>
  43. </div>
  44. </div>