install plugin
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
{% extends "forms/field.html.twig" %}
|
||||
|
||||
{% block input %}
|
||||
<div class="form-input-wrapper {{ field.size }}">
|
||||
<button
|
||||
name="{{ (scope ~ field.name)|fieldName }}"
|
||||
type="submit"
|
||||
{% block input_attributes %}
|
||||
{% if field.classes is defined %}class="{{ field.classes }} button" {% endif %}
|
||||
{% if field.id is defined %}id="{{ field.id|e }}" {% endif %}
|
||||
{% if field.style is defined %}style="{{ field.style|e }}" {% endif %}
|
||||
{% if field.disabled or isDisabledToggleable %}disabled="disabled"{% endif %}
|
||||
{% if field.placeholder %}placeholder="{{ field.placeholder }}"{% endif %}
|
||||
{% if field.autofocus in ['on', 'true', 1] %}autofocus="autofocus"{% endif %}
|
||||
{% if field.novalidate in ['on', 'true', 1] %}novalidate="novalidate"{% endif %}
|
||||
{% if field.readonly in ['on', 'true', 1] %}readonly="readonly"{% endif %}
|
||||
{% if field.autocomplete in ['on', 'off'] %}autocomplete="{{ field.autocomplete }}"{% endif %}
|
||||
{% if field.validate.required in ['on', 'true', 1] %}required="required"{% endif %}
|
||||
{% if field.validate.pattern %}pattern="{{ field.validate.pattern }}"{% endif %}
|
||||
{% if field.validate.message %}title="{{ field.validate.message|e|t }}"
|
||||
{% elseif field.title is defined %}title="{{ field.title|e|t }}" {% endif %}
|
||||
{% endblock %}
|
||||
>{{ field.text|t }}</button>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,170 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
{% import 'user-manager-macros.html.twig' as macros %}
|
||||
|
||||
{% set title = "PLUGIN_ADMIN_ADDON_USER_MANAGER.GROUP_MANAGER"|tu %}
|
||||
|
||||
{% if group %}
|
||||
{% set group_name = group.readableName ?: group.groupname %}
|
||||
{% set title = "PLUGIN_ADMIN_ADDON_USER_MANAGER.GROUP"|tu ~ ": " ~ group_name|e %}
|
||||
{% endif %}
|
||||
|
||||
{% set ps = config.system.param_sep %}
|
||||
|
||||
{% block titlebar %}
|
||||
{% if not group %}
|
||||
<div class="button-bar">
|
||||
<a class="button" href="#modal-admin-addon-user-manager-new" data-remodal-target="modal-admin-addon-user-manager-new"><i class="fa fa-plus"></i> {{ "PLUGIN_ADMIN.ADD"|tu }}</a>
|
||||
</div>
|
||||
|
||||
<h1><i class="fa fa-fw fa-user-o"></i> {{ "PLUGIN_ADMIN_ADDON_USER_MANAGER.GROUP_MANAGER"|tu }}</h1>
|
||||
{% else %}
|
||||
<div class="button-bar">
|
||||
<a class="button" href="{{ base_url }}/group-manager"><i class="fa fa-reply"></i> {{ "PLUGIN_ADMIN.BACK"|tu }}</a>
|
||||
{% if exists %}
|
||||
<a class="button disable-after-click" href="{{ uri.addNonce(uri.route(true) ~ '/name' ~ ps ~ group.groupname ~ '/task' ~ ps ~ 'groupDelete', 'admin-form', 'admin-nonce') }}" class="page-delete" ><i class="fa fa-close"></i> {{ "PLUGIN_ADMIN.DELETE"|tu }}</a>
|
||||
{% endif %}
|
||||
<button class="button" type="submit" name="task" value="save" form="blueprints"><i class="fa fa-check"></i> {{ "PLUGIN_ADMIN.SAVE"|tu }}</button>
|
||||
</div>
|
||||
<h1><i class="fa fa-fw fa-user"></i> {{ "PLUGIN_ADMIN_ADDON_USER_MANAGER.GROUP"|tu }}: {{ group.groupname|e }}</h1>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% set appendUrl = '?filter=' ~ filter|url_encode %}
|
||||
|
||||
{% block content %}
|
||||
{% if not group %}
|
||||
<h1>{{ "PLUGIN_ADMIN_ADDON_USER_MANAGER.GROUPS"|tu }}</h1>
|
||||
|
||||
{% if filterException %}
|
||||
<div class="notices red"><h2>{{ "PLUGIN_ADMIN_ADDON_USER_MANAGER.FILTER_ERROR"|tu }}</h2><p>{{ filterException.message }}</p></div>
|
||||
{% endif %}
|
||||
|
||||
<div class="admin-addon-user-manager-filter">
|
||||
<div class="admin-addon-user-manager-filter__input">
|
||||
<form method="get">
|
||||
<div class="block block-text">
|
||||
<div class="form-field vertical">
|
||||
<div class="form-data" data-grav-default="{{ filter }}">
|
||||
<div class="form-input-wrapper">
|
||||
<input name="filter" value="{{ filter }}" type="text" placeholder="{{ "PLUGIN_ADMIN_ADDON_USER_MANAGER.FILTER_GROUPS"|tu }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="admin-addon-user-manager-filter__help">
|
||||
<a href="https://github.com/david-szabo97/grav-plugin-admin-addon-user-manager/blob/master/docs/filter.md#groups" class="button" target="_new"><i class="fa fa-question"></i> {{ "PLUGIN_ADMIN_ADDON_USER_MANAGER.HELP"|tu }}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form method="post">
|
||||
<div class="admin-addon-user-manager admin-addon-user-manager--list admin-addon-user-manager--group">
|
||||
{% if groups is empty %}
|
||||
<h2>{{ "PLUGIN_ADMIN_ADDON_USER_MANAGER.NO_RESULTS"|tu }}</h2>
|
||||
{% else %}
|
||||
<div class="cell cell--header">
|
||||
<div class="user">
|
||||
<div class="user__checkbox"><input type="checkbox" id="selectAll" /></div>
|
||||
<div class="user__username">{{ "PLUGIN_ADMIN.NAME"|tu }}</div>
|
||||
<div class="user__actions">{{ "PLUGIN_ADMIN_ADDON_USER_MANAGER.ACTIONS"|tu }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% for groupName, group in groups %}
|
||||
<div class="cell">
|
||||
<div class="user">
|
||||
<div class="user__checkbox"><input type="checkbox" name="selected[]" value="{{ groupName }}" /></div>
|
||||
<div class="user__username"><a href="{{ uri.route(true) ~ '/name' ~ ps ~ group.groupname }}">({{ group.users }}) <i class="fa fa-{{ group.icon}}"></i> {{ group.readableName ?: groupName }}</a></div>
|
||||
<div class="user__actions">
|
||||
<a href="{{ uri.addNonce(uri.route(true) ~ '/name' ~ ps ~ group.groupname ~ '/task' ~ ps ~ 'groupDelete', 'admin-form', 'admin-nonce') }}" class="delete">{{ "PLUGIN_ADMIN.DELETE"|tu }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="admin-addon-user-manager-bulk-action">
|
||||
<a data-remodal-target="modal-admin-addon-user-manager-bulk" class="button">{{ "PLUGIN_ADMIN_ADDON_USER_MANAGER.BULK_ACTION"|tu }}</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{{ macros.pagination(pagination, uri.route(true), ps, appendUrl) }}
|
||||
|
||||
<div class="remodal" data-remodal-id="modal-admin-addon-user-manager-new" data-remodal-options="hashTracking: false">
|
||||
<form onsubmit='handleAdminAddonUserManagerSubmit(this); return false;'>
|
||||
{% for field in fields %}
|
||||
{% if field.type %}
|
||||
{% set value = data.value(field.name) %}
|
||||
<div class="block block-{{field.type}}">
|
||||
{% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
<div class="button-bar">
|
||||
<button class="button primary" >{{ "PLUGIN_ADMIN.CONTINUE"|tu }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="remodal" data-remodal-id="modal-admin-addon-user-manager-bulk" data-remodal-options="hashTracking: false">
|
||||
<form method="post" onsubmit='handleAdminAddonUserManagerBulkSubmit(this);'>
|
||||
{% for field in bulkFields %}
|
||||
{% if field.type %}
|
||||
<div class="block block-{{field.type}}">
|
||||
{% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
<div class="button-bar">
|
||||
<button class="button primary" >{{ "PLUGIN_ADMIN.CONTINUE"|tu }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function handleAdminAddonUserManagerSubmit(form) {
|
||||
var name = form.querySelector('[name=name]').value;
|
||||
window.location = '{{ base_url }}/group-manager/name{{ ps }}' + name;
|
||||
}
|
||||
|
||||
var selectAllEle = document.getElementById('selectAll');
|
||||
var selectEles = document.querySelectorAll('input[name="selected[]"]');
|
||||
if (selectAllEle) {
|
||||
selectAllEle.addEventListener('change', function(e) {
|
||||
for (var i = 0; i < selectEles.length; i++) {
|
||||
selectEles[i].checked = this.checked;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function handleAdminAddonUserManagerBulkSubmit(form) {
|
||||
for (var i = 0; i < selectEles.length; i++) {
|
||||
form.appendChild(selectEles[i]);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{% else %}
|
||||
<h1>{{ group.readableName ?: group.groupname }}</h1>
|
||||
|
||||
{% include 'partials/blueprints.html.twig' with { data: group, blueprints: group.blueprints } %}
|
||||
|
||||
<div class="remodal" data-remodal-id="changes">
|
||||
<form>
|
||||
<h1>{{ "PLUGIN_ADMIN.MODAL_CHANGED_DETECTED_TITLE"|tu }}</h1>
|
||||
<p class="bigger">
|
||||
{{ "PLUGIN_ADMIN.MODAL_CHANGED_DETECTED_DESC"|tu }}
|
||||
</p>
|
||||
<br>
|
||||
<div class="button-bar">
|
||||
<a class="button secondary" data-leave-action="cancel" href="#"><i class="fa fa-fw fa-close"></i> {{ "PLUGIN_ADMIN.CANCEL"|tu }}</a>
|
||||
<a class="button" data-leave-action="continue" href="#"><i class="fa fa-fw fa-check"></i> {{ "PLUGIN_ADMIN.CONTINUE"|tu }}</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,28 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% set title = "PLUGIN_ADMIN.USER"|tu ~ ": " ~ admin.route|e %}
|
||||
|
||||
{% block titlebar %}
|
||||
<div class="button-bar">
|
||||
<a class="button" href="{{ base_url }}/user-manager"><i class="fa fa-reply"></i> {{ "PLUGIN_ADMIN.BACK"|tu }}</a>
|
||||
<button class="button" type="submit" name="task" value="save" form="blueprints" onclick="document.getElementById('user_expert_form').submit()"><i class="fa fa-check"></i> {{ "PLUGIN_ADMIN.SAVE"|tu }}</button>
|
||||
</div>
|
||||
|
||||
<h1><i class="fa fa-fw fa-user"></i> {{ "PLUGIN_ADMIN.USER"|tu }}: {{ user.username|e }}</h1>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1>{{ title }}</h1>
|
||||
|
||||
<form method="post" id="user_expert_form">
|
||||
{% for field in blueprint.fields %}
|
||||
{% if field.type %}
|
||||
{% set value = attribute(_context, field.name) %}
|
||||
<div class="block block-{{field.type}}">
|
||||
{% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{{ nonce_field('form', 'form-nonce')|raw }}
|
||||
</form>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,31 @@
|
||||
{% macro pagination(pagination, url, ps, appendUrl) %}
|
||||
{% if pagination.count > 1 %}
|
||||
<div class="admin-addon-user-manager-pagination">
|
||||
<ul class="admin-addon-user-manager-pagination__pages">
|
||||
{% if pagination.current > 1 %}
|
||||
<li><a href="{{ url ~ '/page' ~ ps ~ '1' ~ appendUrl }}"><<</a></li>
|
||||
{% endif %}
|
||||
{% if pagination.current > 2 %}
|
||||
<li><a href="{{ url ~ '/page' ~ ps ~ (pagination.current - 1) ~ appendUrl }}"><</a></li>
|
||||
{% endif %}
|
||||
{% set fromPage = (pagination.current - 2 < 1) ? 1 : pagination.current - 2 %}
|
||||
{% set toPage = (pagination.current + 2 > pagination.count) ? pagination.count : pagination.current + 2 %}
|
||||
{% for i in fromPage..toPage %}
|
||||
{% if pagination.current == i %}
|
||||
<li class="current">{{ i }}</li>
|
||||
{% else %}
|
||||
<li><a href="{{ url ~ '/page' ~ ps ~ i ~ appendUrl }}">{{ i }}</a></li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if pagination.current < pagination.count - 1 %}
|
||||
<li><a href="{{ url ~ '/page' ~ ps ~ (pagination.current + 1) ~ appendUrl }}">></a></li>
|
||||
{% endif %}
|
||||
{% if pagination.current < pagination.count %}
|
||||
<li><a href="{{ url ~ '/page' ~ ps ~ pagination.count ~ appendUrl }}">>></a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
||||
<div class="admin-addon-user-manager-pagination__text">{{ "PLUGIN_ADMIN_ADDON_USER_MANAGER.PAGINATION_SUMMARY"|t(pagination.startOffset + 1, pagination.endOffset, pagination.total) }}</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
@@ -0,0 +1,199 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
{% import 'user-manager-macros.html.twig' as macros %}
|
||||
|
||||
{% set title = "PLUGIN_ADMIN_ADDON_USER_MANAGER.USER_MANAGER"|tu %}
|
||||
|
||||
{% block titlebar %}
|
||||
{% if not user %}
|
||||
<div class="button-bar">
|
||||
<a class="button" href="#modal-admin-addon-user-manager-new" data-remodal-target="modal-admin-addon-user-manager-new"><i class="fa fa-plus"></i> {{ "PLUGIN_ADMIN.ADD"|tu }}</a>
|
||||
</div>
|
||||
|
||||
<h1><i class="fa fa-fw fa-user-o"></i> {{ "PLUGIN_ADMIN_ADDON_USER_MANAGER.USER_MANAGER"|tu }}</h1>
|
||||
{% else %}
|
||||
<div class="button-bar">
|
||||
<a class="button" href="{{ base_url }}/user-manager"><i class="fa fa-reply"></i> {{ "PLUGIN_ADMIN.BACK"|tu }}</a>
|
||||
{% if exists %}
|
||||
<a class="button disable-after-click" href="{{ uri.addNonce(uri.route(true) ~ '/task' ~ ps ~ 'userDelete', 'admin-form', 'admin-nonce') }}" class="page-delete" ><i class="fa fa-close"></i> {{ "PLUGIN_ADMIN.DELETE"|tu }}</a>
|
||||
<a class="button disable-after-click" href="{{ uri.addNonce(uri.route(true) ~ '/task' ~ ps ~ 'userLoginAs', 'admin-form', 'admin-nonce') }}"><i class="fa fa-sign-in"></i> {{ "PLUGIN_ADMIN_ADDON_USER_MANAGER.LOGIN_AS"|tu }}</a>
|
||||
{% endif %}
|
||||
<button class="button" type="submit" name="task" value="admin-addon-user-manager-save" form="blueprints"><i class="fa fa-check"></i> {{ "PLUGIN_ADMIN.SAVE"|tu }}</button>
|
||||
</div>
|
||||
<h1><i class="fa fa-fw fa-user"></i> {{ "PLUGIN_ADMIN.USER"|tu }}: {{ user.username|e }}</h1>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% set ps = config.system.param_sep %}
|
||||
{% set appendUrl = '?filter=' ~ filter|url_encode %}
|
||||
|
||||
{% block content %}
|
||||
{% if not user %}
|
||||
{% set style = listStyle|default('grid') %}
|
||||
|
||||
<h1>{{ "PLUGIN_ADMIN_ADDON_USER_MANAGER.USERS"|tu }}</h1>
|
||||
|
||||
{% if filterException %}
|
||||
<div class="notices red"><h2>{{ "PLUGIN_ADMIN_ADDON_USER_MANAGER.FILTER_ERROR"|tu }}</h2><p>{{ filterException.message }}</p></div>
|
||||
{% endif %}
|
||||
|
||||
<div class="admin-addon-user-manager-filter">
|
||||
<div class="admin-addon-user-manager-filter__input">
|
||||
<form method="get">
|
||||
<div class="block block-text">
|
||||
<div class="form-field vertical">
|
||||
<div class="form-data" data-grav-default="{{ filter }}">
|
||||
<div class="form-input-wrapper">
|
||||
<input name="filter" value="{{ filter }}" type="text" placeholder="{{ "PLUGIN_ADMIN_ADDON_USER_MANAGER.FILTER_USERS"|tu }}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="admin-addon-user-manager-filter__help">
|
||||
<a href="https://github.com/david-szabo97/grav-plugin-admin-addon-user-manager/blob/master/docs/filter.md#users" class="button" target="_new"><i class="fa fa-question"></i> {{ "PLUGIN_ADMIN_ADDON_USER_MANAGER.HELP"|tu }}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="admin-addon-user-manager-style">
|
||||
{% if style != 'grid' %}<a href="{{ uri.route(true) ~ '/listStyle' ~ ps ~ 'grid' ~ '/page' ~ ps ~ pagination.current ~ appendUrl }}"><i class="fa fa-th"></i></a>{% else %}<i class="fa fa-th"></i>{% endif %}
|
||||
{% if style != 'list' %}<a href="{{ uri.route(true) ~ '/listStyle' ~ ps ~ 'list' ~ '/page' ~ ps ~ pagination.current ~ appendUrl }}"><i class="fa fa-list"></i></a>{% else %}<i class="fa fa-list"></i>{% endif %}
|
||||
</div>
|
||||
|
||||
<form method="post">
|
||||
<div class="admin-addon-user-manager admin-addon-user-manager--{{ style }}">
|
||||
{% if users is empty %}
|
||||
<h2>{{ "PLUGIN_ADMIN_ADDON_USER_MANAGER.NO_RESULTS"|tu }}</h2>
|
||||
{% else %}
|
||||
{% if style == 'list' %}
|
||||
<div class="cell cell--header">
|
||||
<div class="user">
|
||||
<div class="user__checkbox"><input type="checkbox" id="selectAll" /></div>
|
||||
<div class="user__username">{{ "PLUGIN_ADMIN.USERNAME"|tu }}</div>
|
||||
<div class="user__email">{{ "PLUGIN_ADMIN.EMAIL"|tu }}</div>
|
||||
<div class="user__actions">{{ "PLUGIN_ADMIN_ADDON_USER_MANAGER.ACTIONS"|tu }}</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% for user in users %}
|
||||
<div class="cell">
|
||||
<div class="user">
|
||||
{% if style == 'grid' %}
|
||||
<div class="user__avatar"><a href="{{ base_url }}/user-manager/{{ user.username }}"><img src="{{ user.avatarUrl }}" /></a></div>
|
||||
{% else %}
|
||||
<div class="user__checkbox"><input type="checkbox" name="selected[]" value="{{ user.username }}" /></div>
|
||||
{% endif %}
|
||||
<div class="user__username"><a href="{{ base_url }}/user-manager/{{ user.username }}">{{ user.username }}</a></div>
|
||||
<div class="user__email">{{ user.email }}</div>
|
||||
<div class="user__actions">
|
||||
<a href="{{ base_url ~ '/user-expert/' ~ user.username }}" class="expert">{{ "PLUGIN_ADMIN_ADDON_USER_MANAGER.EXPERT"|tu }}</a>
|
||||
<a href="{{ uri.addNonce(base_url ~ '/user-manager/' ~ user.username ~ '/task' ~ ps ~ 'userDelete', 'admin-form', 'admin-nonce') }}" class="delete" onclick="return confirm('{{ "PLUGIN_ADMIN_ADDON_USER_MANAGER.USER_CONFIRM_DELETE"|tu }}');">{{ "PLUGIN_ADMIN.DELETE"|tu }}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="admin-addon-user-manager-bulk-action">
|
||||
<a data-remodal-target="modal-admin-addon-user-manager-bulk" class="button">{{ "PLUGIN_ADMIN_ADDON_USER_MANAGER.BULK_ACTION"|tu }}</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{{ macros.pagination(pagination, uri.route(true) ~ '/listStyle' ~ ps ~ listStyle, ps, appendUrl) }}
|
||||
|
||||
<div class="remodal" data-remodal-id="modal-admin-addon-user-manager-new" data-remodal-options="hashTracking: false">
|
||||
<form method="post" onsubmit='handleAdminAddonUserManagerSubmit(this); return false;'>
|
||||
{% for field in fields %}
|
||||
{% if field.type %}
|
||||
{% if field.name == 'username' %}
|
||||
{% set field = field|merge({ validate: field.validate|merge({ pattern: grav.config.system.username_regex })}) %}
|
||||
{% endif %}
|
||||
<div class="block block-{{field.type}}">
|
||||
{% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
<div class="button-bar">
|
||||
<button class="button primary" >{{ "PLUGIN_ADMIN.CONTINUE"|tu }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="remodal" data-remodal-id="modal-admin-addon-user-manager-bulk" data-remodal-options="hashTracking: false">
|
||||
<form method="post" onsubmit='handleAdminAddonUserManagerBulkSubmit(this);'>
|
||||
{% for field in bulkFields %}
|
||||
{% if field.type %}
|
||||
{% if field.name == 'groups' %}
|
||||
{% set field = field|merge({options: groupnames}) %}
|
||||
{% endif %}
|
||||
{% if field.name == 'permissions' %}
|
||||
{% set field = field|merge({selectize: { options: permissions }}) %}
|
||||
{% endif %}
|
||||
<div class="block block-{{field.type}}">
|
||||
{% include ["forms/fields/#{field.type}/#{field.type}.html.twig", 'forms/fields/text/text.html.twig'] %}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
<div class="button-bar">
|
||||
<button class="button primary" >{{ "PLUGIN_ADMIN.CONTINUE"|tu }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function handleAdminAddonUserManagerSubmit(form) {
|
||||
var username = form.querySelector('[name=username]').value;
|
||||
window.location = '{{ base_url }}/user-manager/' + username;
|
||||
}
|
||||
|
||||
var selectAllEle = document.getElementById('selectAll');
|
||||
var selectEles = document.querySelectorAll('input[name="selected[]"]');
|
||||
selectAllEle.addEventListener('change', function(e) {
|
||||
for (var i = 0; i < selectEles.length; i++) {
|
||||
selectEles[i].checked = this.checked;
|
||||
}
|
||||
});
|
||||
|
||||
function handleAdminAddonUserManagerBulkSubmit(form) {
|
||||
for (var i = 0; i < selectEles.length; i++) {
|
||||
form.appendChild(selectEles[i]);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{% else %}
|
||||
<h1>{{ user.username }}</h1>
|
||||
|
||||
{% include 'partials/blueprints.html.twig' with { data: user, blueprints: blueprints } %}
|
||||
|
||||
<div class="remodal" data-remodal-id="changes">
|
||||
<form>
|
||||
<h1>{{ "PLUGIN_ADMIN.MODAL_CHANGED_DETECTED_TITLE"|tu }}</h1>
|
||||
<p class="bigger">
|
||||
{{ "PLUGIN_ADMIN.MODAL_CHANGED_DETECTED_DESC"|tu }}
|
||||
</p>
|
||||
<br>
|
||||
<div class="button-bar">
|
||||
<a class="button secondary" data-leave-action="cancel" href="#"><i class="fa fa-fw fa-close"></i> {{ "PLUGIN_ADMIN.CANCEL"|tu }}</a>
|
||||
<a class="button" data-leave-action="continue" href="#"><i class="fa fa-fw fa-check"></i> {{ "PLUGIN_ADMIN.CONTINUE"|tu }}</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$('[name="task"][value$="save"]').on('click._grav', function(event) {
|
||||
$(global).off('beforeunload');
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- Temporary fix: https://github.com/getgrav/grav-plugin-admin/pull/1379 -->
|
||||
<style>
|
||||
.permission-container {
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user