<commit_before>{% extends 'admin.twig' %}

{#
title
stylesheets
navi
body
javascript
#}


{% block title %}Skeleton-PHP || Dashboard{% endblock %}

{% block body %}
    <div class="row">
        <div class="col-lg-12">
            <h1 class="page-header">Edit Role</h1>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-12">
            <div class="panel panel-primary">
                <div class="panel-heading">
                    Edit {{ user.first_name}} {{ user.last_name}} 
                </div>

                
                <div class="panel-body">
                    <form action="{{ currentRoute }}" method="POST" role="form">
                        <div class="col-md-6">
                            <div class="form-group{% if has_error('role_name') %} has-error{% endif %}">
                                <label for="role_name">Role Name</label>
                                <input type="text" name="role_name" class="form-control" id="role_name" placeholder="Role Name" value="{{role.name}}" required="required">
                                <span class="help-block">{{ error('role_name') }}</span>
                            </div>

                            <div class="form-group{% if has_error('role_slug') %} has-error{% endif %}">
                                <label for="role_slug">Role Slug</label>
                                <input type="text" name="role_slug" class="form-control" id="role_slug" placeholder="Role Slug" value="{{role.slug}}" required="required">
                                <span class="help-block">{{ error('role_slug') }}</span>
                            </div>

                        </div>
                        
                        <div class="col-md-6">
                            <label>Role Permissions</label>
                            <div id="permissionsRow">
                                {% for key,perm in role.permissions|json_decode %} 
                                    <div>
                                        <div class="col-xs-6">
                                            <div class="form-group{% if has_error(name) %} has-error{% endif %}">
                                                <input type="text" name="perm_name[]" class="form-control" placeholder="Permission Name" value="{{key}}" required="required">
                                            </div>
                                        </div>

                                        <div class="col-xs-5">
                                            <div class="form-group{% if has_error(name) %} has-error{% endif %}">
                                                <select name="perm_value[]" class="form-control" required="required">
                                                    <option value="true" {% if perm == 1 %}selected{% endif %}>True</option>
                                                    <option value="false" {% if perm == 0 %}selected{% endif %}>False</option>
                                                </select>
                                            </div>
                                        </div>

                                        <div class="col-xs-1">
                                            <a class="btn btn-primary btn-danger removePerm"><span class="fa fa-fw fa-close"></span> </a>
                                        </div>
                                    </div>
                                {% endfor %}
                            </div>

                            <div class="form-group" style="text-align: center;">
                                <a class="btn btn-warning" id="addPermButton" style="margin-top: 15px;">
                                    <span class="fa fa-fw fa-gears"></span> Add New Permission
                                </a>
                            </div>
                        </div>
                    
                        
                        <div class="col-md-4 col-md-offset-4">
                            <div class="form-group">
                                <button type="submit" class="btn btn-primary form-control">Edit Role</button><commit_msg>delete roles<commit_after>{% extends 'admin.twig' %}

{#
title
stylesheets
navi
body
javascript
#}


{% block title %}Skeleton-PHP || Dashboard{% endblock %}

{% block body %}
    <div class="row">
        <div class="col-lg-12">
            <h1 class="page-header">Edit Role</h1>
        </div>
    </div>

    <div class="row">
        <div class="col-lg-12">
            <div class="panel panel-primary">
                <div class="panel-heading">
                    Edit {{ user.first_name}} {{ user.last_name}} 
                </div>

                
                <div class="panel-body">
                    <form action="{{ currentRoute }}" method="POST" role="form">
                        <div class="col-md-6">
                            <div class="form-group{% if has_error('role_name') %} has-error{% endif %}">
                                <label for="role_name">Role Name</label>
                                <input type="text" name="role_name" class="form-control" id="role_name" placeholder="Role Name" value="{{role.name}}" required="required">
                                <span class="help-block">{{ error('role_name') }}</span>
                            </div>

                            <div class="form-group{% if has_error('role_slug') %} has-error{% endif %}">
                                <label for="role_slug">Role Slug</label>
                                <input type="text" name="role_slug" class="form-control" id="role_slug" placeholder="Role Slug" value="{{role.slug}}" required="required">
                                <span class="help-block">{{ error('role_slug') }}</span>
                            </div>

                        </div>
                        
                        <div class="col-md-6">
                            <label>Role Permissions</label>
                            <div id="permissionsRow">
                                {% for key,perm in role.permissions|json_decode %} 
                                    <div>
                                        <div class="col-xs-6">
                                            <div class="form-group{% if has_error(name) %} has-error{% endif %}">
                                                <input type="text" name="perm_name[]" class="form-control" placeholder="Permission Name" value="{{key}}" required="required">
                                            </div>
                                        </div>

                                        <div class="col-xs-5">
                                            <div class="form-group{% if has_error(name) %} has-error{% endif %}">
                                                <select name="perm_value[]" class="form-control" required="required">
                                                    <option value="true" {% if perm == 1 %}selected{% endif %}>True</option>
                                                    <option value="false" {% if perm == 0 %}selected{% endif %}>False</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="col-xs-1">
                                            <a class="btn btn-primary btn-danger removePerm"><span class="fa fa-fw fa-close"></span> </a>
                                        </div>
                                    </div>
                                {% endfor %}
                            </div>

                            <div class="form-group" style="text-align: center;">
                                <a class="btn btn-warning" id="addPermButton" style="margin-top: 15px;">
                                    <span class="fa fa-fw fa-gears"></span> Add New Permission
                                </a>
                            </div>
                        </div>
                    
                        
                        <div class="col-md-4 col-md-offset-4">
                            <div class="form-group">
                                <button type="submit" class="btn btn-primary form-control">Edit Role</button>
{'fraction_non_alphanumeric': 0.1325874791716258, 'fraction_numerical': 0.004046655558200428, 'mean_word_length': 0.9739252995066948, 'pattern_counts': {'":': 0, '<': 139, '<?xml version=': 0, '>': 139, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 70, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4540272', 'n_tokens_mistral': 1984, 'n_tokens_neox': 1820, 'n_words': 398}