<commit_before>{% extends "PumWoodworkBundle:User:layout.html.twig" %}

{% set sidebar_active = "usergroup_list" %}

{% block content %}
    {% if app.request.xmlHttpRequest %}
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
            <div class="pum-row-head">
                {{ pum_macros.section_title(group.name ~ ' - ' ~ 'ww.users.groups.permissions.title'|trans({}, 'pum'), null, null, [
                    {
                        href: path('ww_homepage'),
                        text: 'common.woodwork.breadcrumb'|trans({}, 'pum')
                    },
                    {
                        href: path('ww_usergroup_list'),
                        text: 'ww.users.usergroups.description'|trans({}, 'pum')
                    },
                    {
                        text: 'ww.users.groups.permissions.manage.breadcrumb'|trans({}, 'pum')
                    }
                ]) }}
            </div>
        </div>
        <div class="modal-body">
            {{ pum_macros.alertMessages() }}

            <div class="row">
                <div class="col-lg-12 col-offset-auto">
                    <form action="{{ path(app.request.attributes.get('_route'),
                           app.request.attributes.get('_route_params')) }}" name="pum_permissions_tableviews" method="post" {{ (app.request.xmlHttpRequest ? ' class="form-horizontal yaah-js" data-ya-trigger="submit" data-ya-target="#pumAjaxModal .modal-content" data-ya-location="inner" data-remote="false"' : 'class="form-horizontal"') }}>
                        {# The global form #}
                        {% for error in errors %}
                            {{ error }}
                        {% endfor %}

                        {% set tableViewsCount = schema|length %}
                        {% if tableViewsCount == 0 %}
                            <span class="val-empty">{{ 'pa.customview.object.no.tableview'|trans({}, 'pum') }}</span>
                        {% endif %}

                        <div class="panel-heading" id="tableview">
                            <div class="row">
                                <h4 class="panel-title col-xs-6">
                                     <span class="object-title">{{ object|pum_humanize_object_name }}</span>
                                </h4>

                                <span class="project-global-permissions col-xs-5 level">
                                    <div class="row">
                                        <div class="col-xs-2 text-center">
                                            <input type="checkbox" class="flat-custom pomegranate no-label large" id="tableview_view" data-type="see" name="tableviews[attribute][view]" value="1" />
                                            <label class="container" for="tableview_view"><span class="sr-only">View</span></label>
                                            <div class="custom-label">View</div>
                                        </div>
                                         <div class="col-xs-2 text-center">
                                            <input type="radio" class="flat-custom pomegranate no-label large" id="tableview_default" data-type="see" name="tableviews[attribute][default]" value="0" {% if schema.attributes.default == true %}checked="checked"{% endif %} />
                                            <label class="container" for="tableview_default"><span class="sr-only">Original view</span></label>
                                            <div class="custom-label">Original view</div>
                                        </div>
                                    </div>
                                </span>
                            </div>
                        </div>

                        {% for _tableview in schema.tableviews %}
                            <div id="tableview_{{ _tableview.id }}" class="container beam-object">
                                <span class="object-name col-xs-6">{{ _tableview.name|pum_humanize }}</span>
                                <span class="project-global-permissions col-xs-5 level">
                                    <div class="row">
                                        <div class="col-xs-2 text-center">
                                            <input type="checkbox" class="flat-custom no-label small" id="tableview_{{ _tableview.id }}_view" data-type="see" name="tableviews[tableview][{{ _tableview.id }}][attribute][view]" value="1" {% if _tableview.attribute.view == true %}checked="checked"{% endif %} />
                                            <label class="control-label" for="tableview_{{ _tableview.id }}_view"><span class="sr-only">{{ 'ww.permission.tableview.view'|trans({}, 'pum') }}</span></label>
                                        </div>
                                        <div class="col-xs-2 text-center">
                                            <input type="radio" class="flat-custom no-label small" id="tableview_{{ _tableview.id }}_default" data-type="see" name="tableviews[attribute][default]" value="{{ _tableview.id }}" {% if _tableview.attribute.default == true %}checked="checked"{% endif %} />
                                            <label class="control-label" for="tableview_{{ _tableview.id }}_default"><span class="sr-only">{{ 'ww.permission.tableview.default'|trans({}, 'pum') }}</span></label>
                                        </div>
                                    </div>
                                </span>
                            </div>
                        {% endfor %}

                        <div class="text-center">
                            <button type="submit" id="pum_usergroup_permission_tableview" name="pum_usergroup_permission_tableview[save]" class="btn pum-scheme-btn-darkgrass">Enregistrer</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    {% endif %}
{% endblock %}<commit_msg>Tableviews permissions layout<commit_after>{% extends "PumWoodworkBundle:User:layout.html.twig" %}

{% set sidebar_active = "usergroup_list" %}

{% block content %}
    {% if app.request.xmlHttpRequest %}
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
            <div class="pum-row-head">
                {{ pum_macros.section_title(group.name ~ ' - ' ~ 'ww.users.groups.permissions.title'|trans({}, 'pum'), null, null, [
                    {
                        href: path('ww_homepage'),
                        text: 'common.woodwork.breadcrumb'|trans({}, 'pum')
                    },
                    {
                        href: path('ww_usergroup_list'),
                        text: 'ww.users.usergroups.description'|trans({}, 'pum')
                    },
                    {
                        text: 'ww.users.groups.permissions.manage.breadcrumb'|trans({}, 'pum')
                    }
                ]) }}
            </div>
        </div>
        <div class="modal-body">
            {{ pum_macros.alertMessages() }}

            <div class="row">
                <div class="col-lg-10 col-lg-offset-1 col-offset-auto">
                    <form action="{{ path(app.request.attributes.get('_route'),
                           app.request.attributes.get('_route_params')) }}" name="pum_permissions_tableviews" method="post" {{ (app.request.xmlHttpRequest ? ' class="form-horizontal yaah-js" data-ya-trigger="submit" data-ya-target="#pumAjaxModal .modal-content" data-ya-location="inner" data-remote="false"' : 'class="form-horizontal"') }}>
                        {# The global form #}
                        {% for error in errors %}
                            {{ error }}
                        {% endfor %}

                        {% set tableViewsCount = schema|length %}
                        {% if tableViewsCount == 0 %}
                            <span class="val-empty">{{ 'pa.customview.object.no.tableview'|trans({}, 'pum') }}</span>
                        {% endif %}

                        <div class="panel-group" id="tableviews-accordion" role="tablist" aria-multiselectable="true">
                            <div class="panel panel-default" id="tableview">
                                <div class="panel-heading" id="tableviews-heading">
                                    <div class="row">
                                        <h4 id="tableviews-header" class="panel-title col-xs-4">
                                             <span class="object-title">{{ object|pum_humanize_object_name }}</span>
                                        </h4>

                                        <span class="col-xs-6 level" data-level="1">
                                            <div class="row">
                                                <div class="col-xs-5">
                                                    <input type="checkbox" class="flat-custom small" id="tableview_view" name="tableviews[attribute][view]" data-type="view" value="1" />
                                                    <label for="tableview_view"><span>All</span></label>
                                                </div>
                                                 <div class="col-xs-5 col-xs-offset-1">
                                                    <input type="radio" class="flat-custom small" id="tableview_default" name="tableviews[attribute][default]" value="0" data-type="origin" {% if schema.attributes.default == true %}checked="checked"{% endif %} />
                                                    <label for="tableview_default"><span>Original view</span></label>
                                                </div>
                                            </div>
                                        </span>
                                    </div>
                                </div>

                                <div id="tableviews_collapse" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="#tableviews-header">
                                    <div class="panel-body">
                                    {% for _tableview in schema.tableviews %}
                                        {% if loop.first == false %}
                                            <hr />
                                        {% endif %}
                                        <div class="row">
                                            <span class="col-xs-4">{{ _tableview.name|pum_humanize }}</span>
                                            <span class="col-xs-6 level" data-level="2">
                                                <div class="row">
                                                    <div class="col-xs-5">
                                                        <input type="checkbox" class="flat-custom" id="tableview_{{ _tableview.id }}_view" name="tableviews[tableview][{{ _tableview.id }}][attribute][view]" data-type="view" value="1" {% if _tableview.attribute.view == true %}checked="checked"{% endif %} />
                                                        <label for="tableview_{{ _tableview.id }}_view">View</label>
                                                    </div>
                                                    <div class="col-xs-5 col-xs-offset-1">
                                                        <input type="radio" class="flat-custom" id="tableview_{{ _tableview.id }}_default" name="tableviews[attribute][default]" data-type="master" value="{{ _tableview.id }}" {% if _tableview.attribute.default == true %}checked="checked"{% endif %} />
                                                        <label for="tableview_{{ _tableview.id }}_default">Default</label>
                                                    </div>
                                                </div>
                                            </span>
                                        </div>
                                    {% endfor %}
                                    </div>
                                </div>
                            </div>
                        </div>

                        <div class="text-center">
                            <button type="submit" id="pum_usergroup_permission_tableview" name="pum_usergroup_permission_tableview[save]" class="btn pum-scheme-btn-darkgrass">Enregistrer</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    {% endif %}
{% endblock %}
{'fraction_non_alphanumeric': 0.1373938780278838, 'fraction_numerical': 0.002881844380403458, 'mean_word_length': 1.1755337173839377, 'pattern_counts': {'":': 0, '<': 156, '<?xml version=': 0, '>': 156, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 110, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1695991', 'n_tokens_mistral': 3088, 'n_tokens_neox': 2872, 'n_words': 506}