<commit_before>{% extends 'MainBundle::base.html.twig' %}
{% set readOnly = (is_granted('ROLE_ADMIN') == false and is_granted('ROLE_BOARD') == false) %}
{% block body %}
    <script type="text/ng-template" id="nodes_renderer.html">
        <div ui-tree-handle class="tree-node tree-node-content angular-ui-tree-handle">
            <a class="btn btn-success btn-xs" ng-if="node.nodes && node.nodes.length > 0" data-nodrag ng-click="ctrl.toggle(this)">
                <span class="glyphicon" ng-class="{'glyphicon-chevron-right': collapsed, 'glyphicon-chevron-down': !collapsed}"></span>
            </a>
            {[{node.title}]}
            <a class="pull-right btn btn-danger btn-xs {% if (readOnly) %}hidden{% endif %}" data-nodrag ng-click="ctrl.remove(this)"><span
                        class="glyphicon glyphicon-remove"></span></a>
            <a class="pull-right btn btn-primary btn-xs
               {% if (readOnly) %}hidden{% endif %}"
               data-nodrag ng-click="ctrl.edit(this)"
               style="margin-right: 8px;">
                <span class="glyphicon glyphicon-edit"></span>
            </a>
            <a class="pull-right btn btn-primary btn-xs {% if (readOnly) %}hidden{% endif %}" ng-hide="ctrl.depth()>2" data-nodrag ng-click="ctrl.newSubItem(this)" style="margin-right: 8px;"><span
                        class="glyphicon glyphicon-plus"></span></a>
            {% if (readOnly) %}
                <a class="pull-right btn btn-primary btn-xs" ng-hide="ctrl.depth()>2" data-nodrag ng-click="ctrl.edit(this)" style="margin-right: 8px;">
                    <span class="glyphicon glyphicon-eye-open"></span>
                </a>
            {% endif %}
        </div>
        <ol class="ng-pristine ng-untouched ng-valid ng-scope angular-ui-tree-nodes" ui-tree-nodes="" ng-model="node.nodes" ng-class="{hidden: collapsed}">
            <li ng-repeat="node in node.nodes" ui-tree-node ng-include="'nodes_renderer.html'">
            </li>
        </ol>
    </script>
    <div class="main-inner" ng-controller="guideController as ctrl" ng-init="ctrl.init()">
        <div class="container">
            <div class="span5">
                <div class="widget">
                    <div class="widget-header">
                        <i class="icon-book"></i>
                        <h3>Categories</h3>
                            <span>
                                <button class="btn btn-default {% if (readOnly) %}hidden{% endif %}"
                                        type="button"
                                        ng-click="ctrl.addToRoot()">
                                    Add Category
                                </button>
                            </span>
                            <span>
                                <div class="onoffswitch">
                                    <input name="onoffswitch"
                                           class="onoffswitch-checkbox ng-pristine ng-untouched ng-valid"
                                           id="myonoffswitch" ng-model="ctrl.activated"
                                           ng-change="ctrl.changeGuideStatus()"
                                           type="checkbox"
                                           {% if (readOnly) %}disabled="true"{% endif %}">
                                    <label class="onoffswitch-label" for="myonoffswitch">
                                        <span class="onoffswitch-inner"></span>
                                        <span class="onoffswitch-switch"></span>
                                    </label>
                                </div>

                            </span>
                    </div>

                    <div class="widget-content">
                        <div class="ng-scope angular-ui-tree" ui-tree="treeOptions" id="tree-root" data-max-depth="3">
                            <ol ui-tree-nodes class="ng-pristine ng-untouched ng-valid ng-scope angular-ui-tree-nodes" ng-model="ctrl.data">
                                <li ng-repeat="node in ctrl.data" class="ng-scope angular-ui-tree-node" ui-tree-node ng-include="'nodes_renderer.html'"></li>
                            </ol>
                        </div>
                    </div>
                </div>
            </div>
            <div class="span5">
                <div class="widget">
                    <div class="widget-header">
                        <i class="icon-book"></i>
                        <h3>Content</h3>
                        <input class="{% if (readOnly) %}hidden{% endif %}" ng-if="ctrl.categorieSelected.title" class="btn btn-default" value="Save" type="submit" ng-click="ctrl.save()">
                    </div>
                    <div class="widget-content">
                        <div ng-if="ctrl.categorieSelected.title" class="ng-scope">
                            <label for="title">Title :</label>
                            <input type="text" name="title" required="" id="name" ng-model="ctrl.categorieSelected.title" {% if (readOnly) %}disabled="true"{% endif %}><br>
                            <label for="content">Content :</label>
                            <textarea ckeditor="editorOptions" ng-model="ctrl.categorieSelected.content" {% if (readOnly) %}disabled="true"{% endif %}></textarea>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}<commit_msg>Improve save button display for guide categories.<commit_after>{% extends 'MainBundle::base.html.twig' %}
{% set readOnly = (is_granted('ROLE_ADMIN') == false and is_granted('ROLE_BOARD') == false) %}
{% block body %}
    <script type="text/ng-template" id="nodes_renderer.html">
        <div ui-tree-handle class="tree-node tree-node-content angular-ui-tree-handle">
            <a class="btn btn-success btn-xs" ng-if="node.nodes && node.nodes.length > 0" data-nodrag ng-click="ctrl.toggle(this)">
                <span class="glyphicon" ng-class="{'glyphicon-chevron-right': collapsed, 'glyphicon-chevron-down': !collapsed}"></span>
            </a>
            {[{node.title}]}
            <a class="pull-right btn btn-danger btn-xs {% if (readOnly) %}hidden{% endif %}" data-nodrag ng-click="ctrl.remove(this)"><span
                        class="glyphicon glyphicon-remove"></span></a>
            <a class="pull-right btn btn-primary btn-xs
               {% if (readOnly) %}hidden{% endif %}"
               data-nodrag ng-click="ctrl.edit(this)"
               style="margin-right: 8px;">
                <span class="glyphicon glyphicon-edit"></span>
            </a>
            <a class="pull-right btn btn-primary btn-xs {% if (readOnly) %}hidden{% endif %}" ng-hide="ctrl.depth()>2" data-nodrag ng-click="ctrl.newSubItem(this)" style="margin-right: 8px;"><span
                        class="glyphicon glyphicon-plus"></span></a>
            {% if (readOnly) %}
                <a class="pull-right btn btn-primary btn-xs" ng-hide="ctrl.depth()>2" data-nodrag ng-click="ctrl.edit(this)" style="margin-right: 8px;">
                    <span class="glyphicon glyphicon-eye-open"></span>
                </a>
            {% endif %}
        </div>
        <ol class="ng-pristine ng-untouched ng-valid ng-scope angular-ui-tree-nodes" ui-tree-nodes="" ng-model="node.nodes" ng-class="{hidden: collapsed}">
            <li ng-repeat="node in node.nodes" ui-tree-node ng-include="'nodes_renderer.html'">
            </li>
        </ol>
    </script>
    <div class="main-inner" ng-controller="guideController as ctrl" ng-init="ctrl.init()">
        <div class="container">
            <div class="span5">
                <div class="widget">
                    <div class="widget-header">
                        <i class="icon-book"></i>
                        <h3>Categories</h3>
                            <span>
                                <button class="btn btn-default {% if (readOnly) %}hidden{% endif %}"
                                        type="button"
                                        ng-click="ctrl.addToRoot()">
                                    Add Category
                                </button>
                            </span>
                            <span>
                                <div class="onoffswitch">
                                    <input name="onoffswitch"
                                           class="onoffswitch-checkbox ng-pristine ng-untouched ng-valid"
                                           id="myonoffswitch" ng-model="ctrl.activated"
                                           ng-change="ctrl.changeGuideStatus()"
                                           type="checkbox"
                                           {% if (readOnly) %}disabled="true"{% endif %}">
                                    <label class="onoffswitch-label" for="myonoffswitch">
                                        <span class="onoffswitch-inner"></span>
                                        <span class="onoffswitch-switch"></span>
                                    </label>
                                </div>

                            </span>
                    </div>

                    <div class="widget-content">
                        <div class="ng-scope angular-ui-tree" ui-tree="treeOptions" id="tree-root" data-max-depth="3">
                            <ol ui-tree-nodes class="ng-pristine ng-untouched ng-valid ng-scope angular-ui-tree-nodes" ng-model="ctrl.data">
                                <li ng-repeat="node in ctrl.data" class="ng-scope angular-ui-tree-node" ui-tree-node ng-include="'nodes_renderer.html'"></li>
                            </ol>
                        </div>
                    </div>
                </div>
            </div>
            <div class="span5">
                <div class="widget">
                    <div class="widget-header">
                        <i class="icon-book"></i>
                        <h3>Content</h3>
                        <input class="{% if (readOnly) %}hidden{% endif %} btn btn-default" ng-if="ctrl.categorieSelected.title" value="Save" type="submit" ng-click="ctrl.save()">
                    </div>
                    <div class="widget-content">
                        <div ng-if="ctrl.categorieSelected.title" class="ng-scope">
                            <label for="title">Title :</label>
                            <input type="text" name="title" required="" id="name" ng-model="ctrl.categorieSelected.title" {% if (readOnly) %}disabled="true"{% endif %}><br>
                            <label for="content">Content :</label>
                            <textarea ckeditor="editorOptions" ng-model="ctrl.categorieSelected.content" {% if (readOnly) %}disabled="true"{% endif %}></textarea>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}


{'fraction_non_alphanumeric': 0.14872727272727274, 'fraction_numerical': 0.0023636363636363638, 'mean_word_length': 1.3770527225583404, 'pattern_counts': {'":': 0, '<': 179, '<?xml version=': 0, '>': 185, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 38, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7244495', 'n_tokens_mistral': 3027, 'n_tokens_neox': 2769, 'n_words': 540}