<commit_before>{#
/**
 * Copyright (C) 2019 Xibo Signage Ltd
 *
 * Xibo - Digital Signage - http://www.xibo.org.uk
 *
 * This file is part of Xibo.
 *
 * Xibo is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * Xibo is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with Xibo.  If not, see <http://www.gnu.org/licenses/>.
 */
#}
{% extends "form-base.twig" %}
{% import "forms.twig" as forms %}
{% import "inline.twig" as inline %}

{% set randomId = random() %}

{% block formTitle %}
    {% trans %}Permissions for {{ entity }}{% endtrans %}
{% endblock %}

{% block formButtons %}
    {% trans "Help" %}, XiboHelpRender("{{ help.permissions }}")
    {% trans "Cancel" %}, XiboDialogClose()
    {% trans "Save" %}, permissionsFormSubmit("{{ randomId }}")
{% endblock %}

{% block callBack %}permissionsFormOpen{% endblock %}

{% block formHtml %}
    <div class="permissions-form">
        <div class="row">
            <div class="col-md-12">
                <div class="XiboGrid permissionsGrid" id="{{ randomId }}"
                     data-url="{{ urlFor("user.permissions", {entity: entity, id: objectId}) }}"
                     data-permissions="{{ permissions|json_encode }}">
                    <div class="permissionsTableFilter">
                        <form onsubmit="false">
                            {% set title %}{% trans "Name" %}{% endset %}
                            {{ inline.input("name", title) }}
                        </form>
                    </div>
                    <div class="XiboData">
                        <table id="permissionsTable" class="table table-striped">
                            <thead>
                            <tr>
                                <th>{% trans "Name" %}</th>
                                <th>{% trans "View" %}</th>
                                <th>{% trans "Edit" %}</th>
                                <th>{% trans "Delete" %}</th>
                            </tr>
                            </thead>
                            <tbody>

                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        {% if entity == "Campaign" or entity == "Playlist" %}
        <div class="row">
            <div class="col-md-12">
                {% set title %}{% trans %}Cascade permissions to all items underneath this one.{% endtrans %}{% endset %}
                {% set helpText %}{% trans %}For example, if this is a Layout then update the permissions on all Regions, Playlists and Widgets.{% endtrans %}{% endset %}
                {{ forms.checkbox("cascade", title, 0, helpText) }}
            </div>
        </div>
        {% endif %}
        {% if canSetOwner %}
        <div class="row">
            <div class="col-md-12">
                {% set title %}{% trans %}Owner{% endtrans %}{% endset %}
                {% set helpText %}{% trans %}Change the Owner of this item. Leave empty to keep the current owner.{% endtrans %}{% endset %}
                {{ forms.dropdown("ownerId", "single", title, "", [{"userId": null, "userName": ""}]|merge(owners), "userId", "userName", helpText) }}
            </div>
        </div>
        {% endif %}
    </div>
{% endblock %}<commit_msg>OSX-577 Fixes search by name on permissions form xibosignage/xibo#1812<commit_after>{#
/**
 * Copyright (C) 2019 Xibo Signage Ltd
 *
 * Xibo - Digital Signage - http://www.xibo.org.uk
 *
 * This file is part of Xibo.
 *
 * Xibo is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * any later version.
 *
 * Xibo is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with Xibo.  If not, see <http://www.gnu.org/licenses/>.
 */
#}
{% extends "form-base.twig" %}
{% import "forms.twig" as forms %}
{% import "inline.twig" as inline %}

{% set randomId = random() %}

{% block formTitle %}
    {% trans %}Permissions for {{ entity }}{% endtrans %}
{% endblock %}

{% block formButtons %}
    {% trans "Help" %}, XiboHelpRender("{{ help.permissions }}")
    {% trans "Cancel" %}, XiboDialogClose()
    {% trans "Save" %}, permissionsFormSubmit("{{ randomId }}")
{% endblock %}

{% block callBack %}permissionsFormOpen{% endblock %}

{% block formHtml %}
    <div class="permissions-form">
        <div class="row">
            <div class="col-md-12">
                <div class="XiboGrid permissionsGrid" id="{{ randomId }}"
                     data-url="{{ urlFor("user.permissions", {entity: entity, id: objectId}) }}"
                     data-permissions="{{ permissions|json_encode }}">
                    <div class="permissionsTableFilter">
                        <div class="XiboFilter well">
                            <div class="FilterDiv" id="Filter">
                                <form class="form-inline">
                                    {% set title %}{% trans "Name" %}{% endset %}
                                    {{ inline.input("name", title) }}
                                </form>
                            </div>
                        </div>
                    </div>
                    <div class="XiboData">
                        <table id="permissionsTable" class="table table-striped">
                            <thead>
                            <tr>
                                <th>{% trans "Name" %}</th>
                                <th>{% trans "View" %}</th>
                                <th>{% trans "Edit" %}</th>
                                <th>{% trans "Delete" %}</th>
                            </tr>
                            </thead>
                            <tbody>

                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        {% if entity == "Campaign" or entity == "Playlist" %}
        <div class="row">
            <div class="col-md-12">
                {% set title %}{% trans %}Cascade permissions to all items underneath this one.{% endtrans %}{% endset %}
                {% set helpText %}{% trans %}For example, if this is a Layout then update the permissions on all Regions, Playlists and Widgets.{% endtrans %}{% endset %}
                {{ forms.checkbox("cascade", title, 0, helpText) }}
            </div>
        </div>
        {% endif %}
        {% if canSetOwner %}
        <div class="row">
            <div class="col-md-12">
                {% set title %}{% trans %}Owner{% endtrans %}{% endset %}
                {% set helpText %}{% trans %}Change the Owner of this item. Leave empty to keep the current owner.{% endtrans %}{% endset %}
                {{ forms.dropdown("ownerId", "single", title, "", [{"userId": null, "userName": ""}]|merge(owners), "userId", "userName", helpText) }}
            </div>
        </div>
        {% endif %}
    </div>
{% endblock %}
{'fraction_non_alphanumeric': 0.1442058975685463, 'fraction_numerical': 0.004009311950336265, 'mean_word_length': 1.6537405628002746, 'pattern_counts': {'":': 4, '<': 85, '<?xml version=': 0, '>': 85, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1986762', 'n_tokens_mistral': 2218, 'n_tokens_neox': 2009, 'n_words': 648}