module_item_conditional_next.mustache 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <%
  2. # Copyright (C) 2016 - 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. module_item_conditional_next ||= nil
  20. module_item ||= module_item_conditional_next
  21. item_data ||= { published_status: 'unpublished' }
  22. completion_criteria ||= nil
  23. editable ||= false
  24. criterion = completion_criteria && completion_criteria.find{|c| c[:id] == module_item.id}
  25. %>
  26. <li
  27. id="context_module_item_<%= module_item ? module_item.id : 'blank' %>"
  28. class="context_module_item context_module_item_conditional_info indent_<%= module_item.try_rescue(:indent) || '0' %>"
  29. >
  30. <div class="ig-row">
  31. <%
  32. if item_data[:mastery_paths][:locked]
  33. %>
  34. <span class="type_icon" title="{{#t}}Locked Content{{/t}}">
  35. <span class="ig-type-icon">
  36. <i class="icon-lock" aria-label="{{#t}}Item type: Locked{{/t}}"></i>
  37. </span>
  38. </span>
  39. <div class="ig-info">
  40. <div class="module-item-title">
  41. <span class="item_name" id="module-item-locked-<%= module_item.id %>">
  42. <em class="ig-title">
  43. <%= t('Locked until "%{item_name}" is graded', {item_name: module_item.content.title}) %>
  44. </em>
  45. </span>
  46. </div>
  47. </div>
  48. <%
  49. else
  50. %>
  51. <span class="type_icon" title="{{#t}}Content Choice{{/t}}">
  52. <span class="ig-type-icon">
  53. <i class="icon-unlock" aria-label="{{#t}}Item type: Choice{{/t}}"></i>
  54. </span>
  55. </span>
  56. <div class="ig-info">
  57. <div class="module-item-title">
  58. <span class="item_name">
  59. <a href="<%= item_data[:choose_url] %>" title="{{#t}}Choose Assignment Group{{/t}}" class="ig-title">
  60. {{#t}}Choose Assignment Group{{/t}}
  61. </a>
  62. </span>
  63. <span class='conditional_options_count'>
  64. <%= t({ one: '1 Option', other: '%{count} Options' }, { count: item_data[:mastery_paths][:assignment_sets].count }) %>
  65. </span>
  66. </div>
  67. </div>
  68. <%
  69. end
  70. %>
  71. </div>
  72. </li>