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

{% set title = 'Information portal'|trans ~ ': ' ~ 'Phone book'|trans %}


{% 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 ~ "/Infoportal/phone_book/phone_book.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">
                {{ main_macro.get_filter_button_bar('service', 'id', 'title', app['allServices']) }}
                <a href="{{ app.request_context.baseUrl }}/{{ app.controller_alias }}/add-phone-book-item" class="btn btn-success pull-right no_context_menu" id="add_phone_book_item"><i class="fa fa-plus"></i>{{ 'Add'|trans }}</a>
            </div>
        </div>

        <div class="row">
            <div class="">
                <div class="box">
                    {% if attribute(app, 'dropdownAttribute') is defined %}
                        {{ main_macro.get_dropdown_attribute(app['dropdownAttribute']) }}
                    {% endif %}
                    <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>

    <div id="modalbox_ad">
        <div class="devoops-modal">
            <div class="devoops-modal-header">
                <div class="modal-header-name">
                    <span></span>
                </div>
                <div class="box-icons">
                    <a class="close-link">
                        <i class="fa fa-times"></i>
                    </a>
                </div>
            </div>
            <form class="form-horizontal" role="form" id="karaoke_form" action="{{ app.request_context.baseUrl }}/{{ app.controller_alias }}/save-phone-book-item">
            <div class="devoops-modal-inner">
                <div class="box">
                    <div class="box-content">
                            <!-- singer -->
                            <div class="form-group">
                                <label class="col-sm-3 control-label col-xs-offset-1">{{ 'Order'|trans }}<span class="icon-required">*</span></label>
                                <div class="col-xs-10 col-sm-8 no-padding">
                                    <div class=" col-xs-10 col-sm-10">
                                        <input type="number" required="required" name="num" data-validation="required" class='form-control own_fields with-error-space' min="1">
                                    </div>
                                    <span class="help-inline col-xs-12 col-sm-12">
                                        <span class="small txt-default">{{ 'Order of service in the directory. Must contain digits only'|trans }}</span>
                                    </span>
                                </div>
                            </div>
                            <!-- name -->
                            <div class="form-group">
                                <label class="col-sm-3 control-label col-xs-offset-1">{{ 'Title'|trans }}<span class="icon-required">*</span></label>
                                <div class="col-xs-10 col-sm-8 no-padding">
                                    <div class=" col-xs-10 col-sm-10 ">
                                        <input type="hidden" name="id" class="own_fields">
                                        <input type="text" required="required" name="title" data-validation="required" class='own_fields form-control'>
                                    </div>
                                </div>
                            </div>
                            <!-- URL -->
                            <div class="form-group">
                                <label class="col-sm-3 control-label col-xs-offset-1">{{ 'Phone number'|trans }}<span class="icon-required">*</span></label>
                                <div class="col-xs-10 col-sm-8 no-padding">
                                    <div class=" col-xs-10 col-sm-10">
                                        <input type="text" name="number" required="required" data-validation="required" class='form-control own_fields'>
                                    </div>
                                </div>
                            </div>
                       
                    </div>
                </div>
            </div>
            <div class="devoops-modal-bottom">
                <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>
            </div>
            </form>
        </div>
    </div>
    
{% endblock %}
