PHP Classes
elePHPant
Icontem

File: src/Cabin/Bridge/View/perms/test.twig

Recommend this page to a friend!
  Classes of Scott Arciszewski  >  CMS Airship  >  src/Cabin/Bridge/View/perms/test.twig  >  Download  
File: src/Cabin/Bridge/View/perms/test.twig
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: CMS Airship
Content management system with security features
Author: By
Last change:
Date: 1 year ago
Size: 5,054 bytes
 

Contents

Class file image Download
{% import "macros/permtable.twig" as ptable %}

<div id="perm_test_results" class="table full-width table-pad-1">
    <div class="table-row">
        <div class="table-cell">
            {{ __("Cabin") }}:
        </div>
        <div class="table-cell">
            <a href="{{ cabin_url() }}crew/permissions/{{ cabin|e('html_attr') }}">{{ cabin }}</a>
        </div>
    </div>
    {% if contexts %}
        <div class="table-row full-width">
            <div class="table-cell">
                {{ __("Contexts") }}:
            </div>
            <div class="table-cell">
                <ul class="test-cabin-list">{% for c in contexts %}{#
                    #}<li>
                        <a href="{{ cabin_url() }}crew/permissions/{{ cabin|e('html_attr') }}/context/{{ c.contextid|e('html_attr') }}">{#
                            #}{{ c.locator|default(__('(Blank)')) }}{#
                        #}</a>
                    </li>{#
                #}{% endfor %}</ul>
            </div>
        </div>
        <div class="table-row">
            <div class="table-cell">
                {{ __("Permissions") }}:
            </div>
            <div class="table-cell">
                <table id="perm_test_tree" class="full-width">
                    <thead>
                    <tr class="perm_header">
                        <th class="permtable_header_name" rowspan="2">
                            Group
                        </th>
                        <th colspan="{{ actions|length|e('html_attr') }}" class="text-center">
                            Permissions
                        </th>
                    </tr>
                    <tr class="perm_header">
                        {% for act in actions %}
                            <th class="permtable_header_action read_only">{{ act|capitalize }}</th>
                        {% endfor %}
                    </tr>
                    </thead>
                    <tbody>
                    {% for branch in permissions %}
                        {{ ptable.readOnlyTable(branch) }}
                    {% endfor %}
                    {% if userlist %}
                        <tr class="perm_header">
                            <th class="permtable_header_name" rowspan="2">
                                {{ __("User") }}
                            </th>
                            <th colspan="{{ actions|length }}" class="text-center">
                                {{ __("Permissions") }}
                            </th>
                        </tr>
                        <tr class="perm_header">
                            {% for act in actions %}
                                <th class="permtable_header_action read_only">{{ act|capitalize }}</th>
                            {% endfor %}
                        </tr>
                    {% for userid, perms in userlist %}
                        {% set username = user_name(userid) %}
                        <tr class="perm_row read_only"{#
                            #} id="user_{{ userid|e('html_attr') }}"{#
                        #}>
                            <td class="permtable_name depth_0">
                                <div class="perm_username">
                                    <a href="{{ cabin_url() }}crew/users/edit/{{ userid|e('html_attr') }}">{#
                                        #}{{ username }}{#
                                    #}</a>
                                </div>
                            </td>
                            {% for act in actions %}
                                {% if perms[act] %}
                                    <td
                                        class="permtable_perm"
                                        title="{{ username|e('html_attr') }} - {{ act|ucfirst|e('html_attr') }}: {{ __("Yes")|e('html_attr') }}"
                                    >{#
                                    #}<i class="fa fa-check perm-on"></i>{#
                                #}</td>
                                {% else %}
                                <td
                                    class="permtable_perm"
                                    title="{{ username|e('html_attr') }} - {{ act|ucfirst|e('html_attr') }}: {{ __("No")|e('html_attr') }}"
                                >{#
                                    #}<i class="fa fa-close perm-off"></i>{#
                                #}</td>
                                {% endif %}
                            {% endfor %}
                        </tr>
                    {% endfor %}
                    {% endif %}
                    </tbody>
                </table>
            </div>
        </div>
    {% else %}
        <div class="table-row">
            <div class="table-cell">
                {{ __("Contexts") }}:
            </div>
            <div class="table-cell">
                {{ __("No contexts found. By default, only administrators can access this feature.") }}
            </div>
        </div>
    {% endif %}
</div>