add-xblock-component-menu.underscore 1.29 KB
Newer Older
1
<% if (type === 'advanced' || templates.length > 1) { %>
2 3 4 5 6 7 8
    <div class="tab current" id="tab1" tabindex="-1" role="dialog" aria-label="<%-
        interpolate(
            gettext('%(type)s Component Template Menu'),
                {type: type},
                true
        )
    %>">
9 10 11 12
        <ul class="new-component-template">
            <% for (var i = 0; i < templates.length; i++) { %>
                <% if (!templates[i].boilerplate_name) { %>
                <li class="editor-md empty">
13
                    <button type="button" class="button-component" data-category="<%= templates[i].category %>">
14
                        <span class="name"><%= templates[i].display_name %></span>
15
                    </button>
16 17 18
                </li>
                <% } else { %>
                <li class="editor-md">
19
                    <button type="button" class="button-component" data-category="<%= templates[i].category %>"
20 21
                       data-boilerplate="<%= templates[i].boilerplate_name %>">
                        <span class="name"><%= templates[i].display_name %></span>
22
                    </button>
23 24 25 26
                </li>
                <% } %>
            <% } %>
        </ul>
27
        <button class="cancel-button" data-type="<%= type %>"><%= gettext("Cancel") %></button>
28 29
    </div>
<% } %>