content-group-editor.underscore 2.47 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 5 6
          <%= gettext(error.message) %>
        </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 11 12 13 14 15 16 17
                <label for="group-cohort-name-<%= uniqueId %>"><%= gettext("Content Group Name") %></label><%
                if (!_.isUndefined(id) && !_.isEmpty(id)) {
                    %><span class="group-configuration-id">
                        <span class="group-configuration-label"><%= gettext('Content Group ID') %></span>
                        <span class="group-configuration-value"><%= id %></span>
                    </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 23 24 25 26 27 28
        <% if (!_.isEmpty(usage)) { %>
            <div class="wrapper-group-configuration-validation usage-validation">
                <i class="icon fa fa-warning"></i>
                <p class="group-configuration-validation-text">
                    <%= gettext('This content group is used in one or more units.') %>
                </p>
            </div>
        <% } %>
29 30 31 32
    </div>
    <div class="actions">
        <button class="action action-primary" type="submit"><% if (isNew) { print(gettext("Create")) } else { print(gettext("Save")) } %></button>
        <button class="action action-secondary action-cancel"><%= gettext("Cancel") %></button>
33 34 35 36 37 38 39 40 41 42 43 44

         <% if (!isNew) { %>
            <% if (_.isEmpty(usage)) { %>
                <span class="wrapper-delete-button" data-tooltip="<%= gettext("Delete") %>">
                    <a class="button action-delete delete" href="#"><%= gettext("Delete") %></a>
                </span>
            <% } else { %>
                <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>
                </span>
            <% } %>
        <% } %>
45 46
    </div>
</form>