Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Possible to override admin template?

Started by Muut Archive 10 years ago · 2 replies · 356 views
10 years ago

In the dashboard, I'd like to give a permission to clear cache, without access to maintenance;

TWIG

{% block titlebar %}
    <div class="button-bar">
        {% if authorize(['admin.maintenance', 'admin.super']) %}
            <div class="button-group">
                <button data-clear-cache-type="" data-clear-cache="{{ uri.addNonce(clear_cache_url, 'admin-form', 'admin-nonce') }}" class="button"><i class="fa fa-trash"></i> {{ "PLUGIN_ADMIN.CLEAR_CACHE"|tu }}</button>
                <button type="button" class="button dropdown-toggle" data-toggle="dropdown">
                    <i class="fa fa-caret-down"></i>
                </button>
                <ul class="dropdown-menu">

                </ul>
            </div>

            <button data-gpm-checkupdates="" class="button"><i class="fa fa-refresh"></i> {{ "PLUGIN_ADMIN.CHECK_FOR_UPDATES"|tu }}</button>
        {% endif %}
    </div>
    <h1><i class="fa fa-fw fa-th"></i> {{ "PLUGIN_ADMIN.DASHBOARD"|tu }}</h1>
{% endblock %}
---
10 years ago

change it to:

TWIG
{% if authorize(['admin.cache', 'admin.super','admin.maintenance']) %}
            <div class="button-group">
                <button data-clear-cache-type="" data-clear-cache="{{ uri.addNonce(clear_cache_url, 'admin-form', 'admin-nonce') }}" class="button"><i class="fa fa-trash"></i> {{ "PLUGIN_ADMIN.CLEAR_CACHE"|tu }}</button>
                <button type="button" class="button dropdown-toggle" data-toggle="dropdown">
                    <i class="fa fa-caret-down"></i>
                </button>
                <ul class="dropdown-menu">
                   ...
                </ul>
            </div>
{% endif %}
{% if authorize(['admin.super','admin.maintenance']) %}
            <button data-gpm-checkupdates="" class="button"><i class="fa fa-refresh"></i> {{ "PLUGIN_ADMIN.CHECK_FOR_UPDATES"|tu }}</button>
{% endif %}

etc...


10 years ago

You can't currently change the theme. You could fork the Admin plugin and apply your changes, then keep your fork up to date with the default Admin.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1357 9 years ago
Archive · by Muut Archive, 9 years ago
2 936 9 years ago
Archive · by Muut Archive, 9 years ago
2 4066 9 years ago
Archive · by Muut Archive, 9 years ago
1 2955 9 years ago
Archive · by Muut Archive, 9 years ago
3 1121 9 years ago