{% requirePackage 'Users' %} {% extends "_layouts/cp" %} {% import "_includes/forms" as forms %} {% set crumbs = [ { label: "Settings"|t, url: url('settings') }, { label: "Users"|t, url: url('settings/users') }, { label: "User Groups"|t, url: url('settings/users') } ] %} {% if group is not defined and groupId is defined %} {% set group = blx.userGroups.getGroupById(groupId) %} {% if not group %}{% exit 404 %}{% endif %} {% endif %} {% set isNewGroup = (group is not defined or groupId is not defined) %} {% if isNewGroup %} {% set title = "Create a new user group"|t %} {% else %} {% set title = group.name|t %} {% endif %} {% set content %}
{% if not isNewGroup %}{% endif %} {{ forms.textField({ first: true, label: "Name"|t, id: 'name', name: 'name', value: (group is defined ? group.name : null), errors: (group is defined ? group.getErrors('name') : null), autofocus: true, required: true, translatable: true }) }} {{ forms.textField({ label: "Handle"|t, id: 'handle', name: 'handle', value: (group is defined ? group.handle : null), errors: (group is defined ? group.getErrors('handle') : null), required: true }) }}

{{ "Permissions"|t }}

{% include "_includes/permissions" with { userOrGroup: (group is defined ? group : null) } only %}
{% endset %} {% if group is not defined or not group.handle %} {% includeJs "new Blocks.HandleGenerator('#name', '#handle');" %} {% endif %}