schedule.underscore 5.29 KB
Newer Older
1 2
  <div align="right">
    <button id="ccx_expand_all_btn" class="ccx-button-link">
3
      <span class="fa fa-expand" aria-hidden="true"></span> <%- gettext('Expand All') %>
4 5
    </button>
    <button id="ccx_collapse_all_btn" class="ccx-button-link">
6
      <span class="fa fa-compress" aria-hidden="true"></span> <%- gettext('Collapse All') %>
7 8 9
    </button>
  </div>
  <br/>
cewing committed
10
  <table class="ccx-schedule">
11 12 13 14 15
    <thead>
      <tr>
        <th><%- gettext('Unit') %></th>
        <th><%- gettext('Start Date') %></th>
        <th><%- gettext('Due Date') %></th>
16
        <td><button id="remove-all" class="ccx-button-link">
17
          <span class="fa fa-remove" aria-hidden="true"></span> <%- gettext('remove all') %>
18
        </button></td>
19 20 21 22
      </tr>
    </thead>
    <tbody>
      <% _.each(chapters, function(chapter) { %>
23
        <tr class="chapter collapsed" data-location="<%- chapter.location %>" data-depth="1">
24
          <td class="unit">
25
            <button class="toggle-collapse ccx-button-link" aria-expanded="false">
26
              <span class="fa fa-caret-right" aria-hidden="true"></span>
27 28 29 30
              <span class="sr">
                <%- interpolate(gettext('toggle chapter %(displayName)s'),
                  {displayName: chapter.display_name}, true) %>
              </span>
31
            </button>
32
            <span class="sr">
33
              <%- gettext('Section') %>&nbsp;</span><%- chapter.display_name %>
34
          </td>
35 36
          <td class="date start-date">
            <button class="ccx-button-link">
37
              <%- chapter.start %>
38 39 40
              <span class="sr"><%- gettext('Click to change') %></span>
            </button>
          </td>
41 42
          <td class="date due-date no-link">
            <%- gettext('N/A') %>
43
          </td>
44 45
          <td><button class="remove-unit ccx-button-link" aria-label="<%- interpolate(
                gettext('Remove chapter %(chapterDisplayName)s'), {chapterDisplayName: chapter.display_name}, true) %>">
46
            <span class="fa fa-remove" aria-hidden="true"></span> <%- gettext('remove') %>
47
          </button></td>
48 49
        </tr>
        <% _.each(chapter.children, function(child) { %>
cewing committed
50
          <tr class="sequential collapsed" data-depth="2"
51
              data-location="<%- chapter.location %> <%- child.location %>">
52
            <td class="unit">
53
              <button class="toggle-collapse ccx-button-link" aria-expanded="false">
54
                 <span class="fa fa-caret-right" aria-hidden="true"></span>
55 56 57 58
                 <span class="sr">
                     <%- interpolate(gettext('toggle subsection %(displayName)s'),
                      {displayName: child.display_name}, true) %>
                 </span>
59
              </button>
60
              <span class="sr"><%- gettext('Subsection') %>&nbsp;</span><%- child.display_name %>
61 62 63
            </td>
            <td class="date start-date">
              <button class="ccx-button-link">
64
                <%- child.start %>
65 66 67 68 69
                <span class="sr"><%- gettext('Click to change') %></span>
              </button>
            </td>
            <td class="date due-date">
              <button class="ccx-button-link">
70
                <%- child.due %>
71 72
                <span class="sr"><%- gettext('Click to change') %></span>
              </button>
73
            </td>
74 75
            <td><button class="remove-unit ccx-button-link" aria-label="<%- interpolate(
                gettext('Remove subsection %(subsectionDisplayName)s'), {subsectionDisplayName: child.display_name}, true) %>">
76
              <span class="fa fa-remove" aria-hidden="true"></span> <%- gettext('remove') %>
77
            </button></td>
78 79
          </tr>
          <% _.each(child.children, function(subchild) { %>
80
            <tr class="vertical" data-depth="3"
81
                data-location="<%- chapter.location %> <%- child.location %> <%- subchild.location %>">
82 83
              <td class="unit">&nbsp;
                 <span class="sr"><%- gettext('Unit') %>&nbsp;</span>
84
                 <%- subchild.display_name %>
85
              </td>
86 87
              <td class="date start-date no-link">
                <% if (subchild.start) { %>
88
                  <%- subchild.start %>
89 90 91 92 93 94
                <% } else { %>
                  <%
                  // Translators: Unit's aka vertical start date is set to Unscheduled when user has not set start date on corresponding subsection aka sequential.
                  %>
                  <%- gettext('Unscheduled') %>
                <% } %>
95
              </td>
96 97
              <td class="date due-date no-link">
                <% if (subchild.due) { %>
98
                  <%- subchild.due %>
99 100 101 102 103 104 105 106 107 108
                <% } else { %>
                  <%
                  // Translators: Unit's aka vertical due date is set to Unscheduled when user has not set due date on corresponding subsection aka sequential.
                  %>
                  <%- gettext('Unscheduled') %>
                <% } %>
              </td>
              <td>
                <button class="remove-unit ccx-button-link" aria-label="<%- interpolate(
                    gettext('Remove unit %(unitName)s'), {unitName: subchild.display_name}, true) %>">
109
                  <span class="fa fa-remove" aria-hidden="true"></span> <%- gettext('remove') %>
110 111
                </button>
              </td>
112
          </tr>
113 114 115 116 117 118
          <% }); %>
        <% }); %>
      <% }); %>
    </tbody>
  </table>