move-xblock-list.underscore 2.17 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<div class="xblock-items-category">
    <span class="sr">
        <%
        // Translators: message will be like `Units in Homework - Question Styles`, `Subsections in Example 1 - Getting started` etc.
        %>
        <%- StringUtils.interpolate(
                gettext("{categoryText} in {parentDisplayname}"),
                {categoryText: categoryText, parentDisplayname: parentDisplayname}
            )
        %>
    </span>
    <span class="category-text" aria-hidden="true">
        <%- categoryText %>:
    </span>
</div>
16
<ul class="xblock-items-container" data-items-category="<%- XBlocksCategory %>">
17 18 19 20
    <% for (var i = 0; i < xblocks.length; i++) {
        var xblock = xblocks[i];
    %>
        <li class="xblock-item" data-item-index="<%- i %>">
Mushtaq Ali committed
21
            <% if (sourceXBlockId !== xblock.id && (xblock.get('child_info') || XBlocksCategory !== 'component')) { %>
22 23 24 25 26 27 28 29 30 31
                <button class="button-forward" >
                    <span class="xblock-displayname truncate">
                        <%- xblock.get('display_name') %>
                    </span>
                    <% if(currentLocationIndex === i) { %>
                        <span class="current-location">
                            (<%- gettext('Current location') %>)
                        </span>
                    <% } %>
                    <span class="icon fa fa-arrow-right forward-sr-icon" aria-hidden="true"></span>
Mushtaq Ali committed
32
                    <span class="sr forward-sr-text"><%- gettext("View child items") %></span>
33
                </button>
Mushtaq Ali committed
34 35 36 37 38 39 40 41 42 43 44
            <% } else { %>
                <span class="component">
                    <span class="xblock-displayname truncate">
                        <%- xblock.get('display_name') %>
                    </span>
                    <% if(currentLocationIndex === i) { %>
                        <span class="current-location">
                            (<%- gettext('Currently selected') %>)
                        </span>
                    <% } %>
                </span>
45 46 47 48 49 50 51 52 53
            <% } %>
        </li>
    <% } %>
    <% if(xblocks.length === 0) { %>
        <span class="xblock-no-child-message">
            <%- noChildText %>
        </span>
    <% } %>
</ul>