add-xblock-component-menu-problem.underscore 2.28 KB
Newer Older
1 2 3 4 5 6 7 8
<div class="tab-group tabs" tabindex="-1" role="dialog" aria-label="<%-
    interpolate(
        gettext('%(type)s Component Template Menu'),
            {type: type},
            true
    )
%>">
    <ul class="problem-type-tabs nav-tabs" tabindex='-1'>
9 10 11 12
        <li class="current">
            <a class="link-tab" href="#tab1"><%= gettext("Common Problem Types") %></a>
        </li>
        <li>
13
            <a class="link-tab" href="#tab2"><%= gettext("Advanced") %></a>
14 15 16 17 18
        </li>
    </ul>
    <div class="tab current" id="tab1">
        <ul class="new-component-template">
            <% for (var i = 0; i < templates.length; i++) { %>
19
                <% if (templates[i].tab == "common") { %>
20 21
                    <% if (!templates[i].boilerplate_name) { %>
                    <li class="editor-md empty">
22
                        <button type="button" class="button-component" data-category="<%= templates[i].category %>">
23
                            <span class="name"><%= templates[i].display_name %></span>
24
                        </button>
25 26 27
                    </li>
                    <% } else { %>
                    <li class="editor-md">
28
                        <button type="button" class="button-component" data-category="<%= templates[i].category %>"
29 30
                           data-boilerplate="<%= templates[i].boilerplate_name %>">
                            <span class="name"><%= templates[i].display_name %></span>
31
                        </button>
32 33 34 35 36 37 38 39 40
                    </li>
                    <% } %>
                <% } %>
            <% } %>
        </ul>
    </div>
    <div class="tab" id="tab2">
        <ul class="new-component-template">
            <% for (var i = 0; i < templates.length; i++) { %>
41
                <% if (templates[i].tab == "advanced") { %>
42
                <li class="editor-manual">
43
                    <button type="button" class="button-component" data-category="<%= templates[i].category %>"
44 45
                       data-boilerplate="<%= templates[i].boilerplate_name %>">
                        <span class="name"><%= templates[i].display_name %></span>
46
                    </button>
47 48 49 50 51
                </li>
                <% } %>
            <% } %>
        </ul>
    </div>
52
    <button class="cancel-button" data-type="<%= type %>"><%= gettext("Cancel") %></button>
53
</div>