add-xblock-component-menu-problem.underscore 2.72 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
        <li class="current">
10
            <a class="link-tab" href="#tab1"><%- gettext("Common Problem Types") %></a>
11 12
        </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 23 24
                        <button type="button" class="button-component" data-category="<%- templates[i].category %>">
                            <%= HtmlUtils.HTML(support_indicator_template({support_level: templates[i].support_level})) %>
                            <span class="name"><%- templates[i].display_name %></span>
25
                        </button>
26 27 28
                    </li>
                    <% } else { %>
                    <li class="editor-md">
29 30 31 32
                        <button type="button" class="button-component" data-category="<%- templates[i].category %>"
                           data-boilerplate="<%- templates[i].boilerplate_name %>">
                            <%= HtmlUtils.HTML(support_indicator_template({support_level: templates[i].support_level})) %>
                            <span class="name"><%- templates[i].display_name %></span>
33
                        </button>
34 35 36 37 38 39 40 41 42
                    </li>
                    <% } %>
                <% } %>
            <% } %>
        </ul>
    </div>
    <div class="tab" id="tab2">
        <ul class="new-component-template">
            <% for (var i = 0; i < templates.length; i++) { %>
43
                <% if (templates[i].tab == "advanced") { %>
44
                <li class="editor-manual">
45 46 47 48
                    <button type="button" class="button-component" data-category="<%- templates[i].category %>"
                       data-boilerplate="<%- templates[i].boilerplate_name %>">
                        <%= HtmlUtils.HTML(support_indicator_template({support_level: templates[i].support_level})) %>
                        <span class="name"><%- templates[i].display_name %></span>
49
                    </button>
50 51 52 53 54
                </li>
                <% } %>
            <% } %>
        </ul>
    </div>
55 56
    <button class="cancel-button" data-type="<%- type %>"><%- gettext("Cancel") %></button>
    <%= HtmlUtils.HTML(support_legend_template({support_legend: support_legend})) %>
57
</div>