xblock-outline.underscore 4.24 KB
Newer Older
1
<% if (parentInfo) { %>
2
<li class="outline-item outline-item-<%= xblockType %> <%= includesChildren ? 'is-collapsible' : '' %> is-draggable <%= isCollapsed ? 'is-collapsed' : '' %>"
3
    data-parent="<%= parentInfo.get('id') %>" data-locator="<%= xblockInfo.get('id') %>">
4
    <span class="draggable-drop-indicator draggable-drop-indicator-before"><span class="icon fa fa-caret-right" aria-hidden="true"></span></span>
5 6 7 8

    <div class="wrapper-xblock-header">
        <div class="wrapper-xblock-header-primary">
            <% if (includesChildren) { %>
9
                <h3 class="xblock-title expand-collapse <%= isCollapsed ? 'expand' : 'collapse' %>"
10 11 12 13
                    title="<%= interpolate(
                          gettext('Collapse/Expand this %(xblock_type)s'), { xblock_type: xblockTypeDisplayName }, true
                    ) %>"
                >
14
                    <span class="icon fa fa-caret-down ui-toggle-expansion" aria-hidden="true"></span>
15 16 17 18 19
            <% } else { %>
                <h3 class="xblock-title">
            <% } %>

                <% if (xblockInfo.get('studio_url') && xblockInfo.get('category') !== 'chapter') { %>
Andrew Gaylard committed
20
                    <a href="<%= xblockInfo.get('studio_url') %>"><%- xblockInfo.get('display_name') %></a>
21
                <% } else { %>
22
                    <span class="wrapper-xblock-field is-editable" data-field="display_name">
Andrew Gaylard committed
23
                        <span class="xblock-field-value"><%- xblockInfo.get('display_name') %></span>
24 25 26 27 28 29 30 31
                    </span>
                <% } %>
            </h3>

            <div class="item-actions">
                <ul class="actions-list">
                    <li class="action-item action-delete">
                        <a href="#" data-tooltip="<%= gettext('Delete') %>" class="delete-button action-button">
32
                            <span class="icon fa fa-remove" aria-hidden="true"></span>
33 34 35 36 37 38 39 40 41
                            <span class="sr"><%= gettext('Delete') %></span>
                        </a>
                    </li>
                </ul>
            </div>
        </div>
        <div class="wrapper-xblock-header-secondary">
            <% if (xblockInfo.get('release_date')) { %>
                <div class="meta-info">
42
                    <span class="icon fa fa-clock-o" aria-hidden="true"></span>
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
                    <%= gettext('Released:') %> <%= xblockInfo.get('release_date') %>
                </div>
            <% } %>


            <div class="item-actions">
                <ul class="actions-list">
                </ul>
            </div>
        </div>
    </div>
<% } %>
    <% if (!parentInfo && xblockInfo.get('child_info') && xblockInfo.get('child_info').children.length === 0) { %>
        <div class="no-content add-xblock-component">
            <p><%= gettext("You haven't added any content to this course yet.") %>
58
                <a href="#" class="button button-new" data-category="<%= childCategory %>"
59
                   data-parent="<%= xblockInfo.get('id') %>" data-default-name="<%= defaultNewChildName %>"
60 61 62 63
                   title="<%= interpolate(
                         gettext('Click to add a new %(xblock_type)s'), { xblock_type: defaultNewChildName }, true
                   ) %>"
                >
64
                    <span class="icon fa fa-plus" aria-hidden="true"></span><%= addChildLabel %>
65 66 67 68 69 70 71 72 73
                </a>
            </p>
        </div>
    <% } else { %>
        <ol class="sortable-list sortable-<%= xblockType %>-list">
        </ol>

        <% if (childType) { %>
            <div class="add-xblock-component">
74
                <a href="#" class="button button-new" data-category="<%= childCategory %>"
75
                   data-parent="<%= xblockInfo.get('id') %>" data-default-name="<%= defaultNewChildName %>"
76 77 78 79
                   title="<%= interpolate(
                         gettext('Click to add a new %(xblock_type)s'), { xblock_type: defaultNewChildName }, true
                   ) %>"
                >
80
                    <span class="icon fa fa-plus" aria-hidden="true"></span><%= addChildLabel %>
81 82 83 84 85 86
                </a>
            </div>
        <% } %>
    <% } %>

<% if (parentInfo) { %>
87
    <span class="draggable-drop-indicator draggable-drop-indicator-after"><span class="icon fa fa-caret-right" aria-hidden="true"></span></span>
88 89
</li>
<% } %>