content-group-editor.underscore 2.49 KB
Newer Older
1
<form class="collection-edit-form">
2
    <% if (error && error.message) { %>
3
        <div class="content-group-edit-error message message-status message-status error is-shown">
4
          <%- gettext(error.message) %>
5 6
        </div>
    <% } %>
7 8 9
    <div class="wrapper-form">
        <fieldset class="collection-fields">
            <div class="input-wrap field text required add-collection-name <% if(error && error.attributes && error.attributes.name) { print('error'); } %>">
10
                <label for="group-cohort-name-<%- uniqueId %>"><%- gettext("Content Group Name") %></label><%
11 12
                if (!_.isUndefined(id) && !_.isEmpty(id)) {
                    %><span class="group-configuration-id">
13 14
                        <span class="group-configuration-label"><%- gettext('Content Group ID') %></span>
                        <span class="group-configuration-value"><%- id %></span>
15 16 17
                    </span><%
                }
                %>
18
                <input name="group-cohort-name" id="group-cohort-name-<%- uniqueId %>" class="collection-name-input input-text" value="<%- name %>" type="text" placeholder="<%- gettext("This is the name of the group") %>">
19 20
            </div>
        </fieldset>
21 22
        <% if (!_.isEmpty(usage)) { %>
            <div class="wrapper-group-configuration-validation usage-validation">
23
                <span class="icon fa fa-warning" aria-hidden="true"></span>
24
                <p class="group-configuration-validation-text">
25
                    <%- gettext('This content group is used in one or more units.') %>
26 27 28
                </p>
            </div>
        <% } %>
29 30 31
    </div>
    <div class="actions">
        <button class="action action-primary" type="submit"><% if (isNew) { print(gettext("Create")) } else { print(gettext("Save")) } %></button>
32
        <button class="action action-secondary action-cancel"><%- gettext("Cancel") %></button>
33 34 35

         <% if (!isNew) { %>
            <% if (_.isEmpty(usage)) { %>
36 37
                <span class="wrapper-delete-button" data-tooltip="<%- gettext("Delete") %>">
                    <a class="button action-delete delete" href="#"><%- gettext("Delete") %></a>
38 39
                </span>
            <% } else { %>
40 41
                <span class="wrapper-delete-button" data-tooltip="<%- gettext('Cannot delete when in use by a unit') %>">
                    <a class="button action-delete delete is-disabled" href="#" aria-disabled="true" ><%- gettext("Delete") %></a>
42 43 44
                </span>
            <% } %>
        <% } %>
45 46
    </div>
</form>