{% extends app['twig_theme'] ~ '/' ~ 'layout.twig' %}
{% import  app['twig_theme'] ~ '/macro/iptw_macro.twig' as main_macro %}

{% set title = ('Users'|trans ~ ': ' ~ 'list of STB in group '|trans ~ '"' ~ app.consoleGroup.name ~ '"') %}
{% set active_alias = 'users-consoles-groups' %}


{% block footer_js %}
    
        {{ parent() }}
        {% include app.twig_theme ~ "/basic_templates/scripts-datatables.twig" %}

        <script src="{{app.request_context.baseUrl}}/plugins/datatables/extensions/FixedHeader/js/dataTables.fixedHeader.js"></script>
        <link  href="{{app.request_context.baseUrl}}/plugins/datatables/extensions/FixedHeader/css/fixedHeader.dataTables.css" rel="stylesheet">

{% endblock %}
{% block footer %}
        
        {{ parent() }}
        <script type="text/javascript" defer>
            {% include app.twig_theme ~ "/Users/users_groups_consoles_list/users_groups_consoles_list.js.twig" %}
        </script>

{% endblock %}


{% block content %}
    <div id="iptv_list">
        <div class="row filters-actions-pannel">
            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                <a href="{{app.request_context.baseUrl}}/{{app.controller_alias}}/add-console-item" class="btn btn-action pull-right no_context_menu" id="add_console_item"><i class="fa fa-plus"></i>{{ 'Add STB'|trans }}</a>
            </div>
        </div>

        <div class="row">
            <div class="">
                <div class="box">
                    <div class="box-content">
                        <div class="box-content no-padding">
                            <div class="dataTables_processing"></div>
                            <table class="table  table-hover table-datatable" id="datatable-1">
                                {% if attribute(app, 'dropdownAttribute') is defined %}
                                    {{ main_macro.get_datatable_head(app['dropdownAttribute']) }}
                                {% endif %}
                                <tbody>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>


    <script type="text/template" id="add_console_template">
        <div class="box-content">
            <form class="form-horizontal" role="form" action="{{ app.request_context.baseUrl }}/{{ app.controller_alias }}/add-console-item">
                <div class="form-group">
                    <label class="col-sm-3 control-label col-sm-offset-1">{{ 'MAC'|trans }}<span class="icon-required">*</span></label>
                    <div class="col-xs-10 col-sm-8">
                        <span class="col-xs-8 col-sm-8">
                            <input type="hidden" name="groupid">
                            <input type="hidden" name="id">
                            <input id="item_mac" class="own_fields form-control" type="text" name="mac" 
                                data-validation="required, custom, server"
                                data-validation-postpone = "200"
                                data-validation-url = "{{ app.request_context.baseUrl }}/{{ app.controller_alias }}/check-console-item" 
                                data-validation-regexp = "^([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}$"
                                data-validation-error-msg-custom = "{{ 'Enter MAC-address according to the format'|trans }}" >
                            <div class=""></div>
                        </span>
                    </div>
                </div>
            </form>
        </div>
    </script>

    <script type="text/template" id="modal_form_buttons">
        <div class="col-xs-12">
            <button type="submit" class="btn btn-success col-sm-2 pull-right">{{ 'Save'|trans }}</button>
            <button type="reset"  class="btn btn-default col-sm-2 pull-right">{{ 'Cancel'|trans }}</button>
        </div>
    </script>

{% endblock %}