123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249 |
- {% extends base_template %}
- {% if params.page is empty %}
- {% set page = 1 %}
- {% else %}
- {% set page = params.page %}
- {% endif %}
- {% set page_ini = 1 %}
- {% set page_end = params.pages %}
- {% if params.pages > 1 %}
- {% if page == 1 %}
- {% set page_prev = page_end %}
- {% set page_next = page + 1 %}
- {% elseif page == page_end %}
- {% set page_prev = page - 1 %}
- {% set page_next = 1 %}
- {% else %}
- {% set page_prev = page - 1 %}
- {% set page_next = page + 1 %}
- {% endif %}
- {% else %}
- {% set page_prev = 1 %}
- {% set page_next = 1 %}
- {% endif %}
- {% block title %}
- - {{ params.label }}
- {% endblock %}
- {% block breadcrumb %}
- {% set links = [{label: params.label, class: 'active', link: ''}] %}
- {% include "BaseAdminBundle:Utils:breadcrumb.html.twig" with links %}
- {% endblock %}
- {% block list_filters %}
- <style type="text/css">
- .filter {
- margin: 5px;
- display: block;
- }
- .filter-title {
- width: 200px;
- }
- .filter-value {
- width: 400px;
- }
- input[type='text']:focus {
- border-color: #66afe9 !important;
- box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset, 0 0 8px rgba(102, 175, 233, 0.6);
- outline: 0 none;
- transition: border-color 0.15s ease-in-out 0s, box-shadow 0.15s ease-in-out 0s;
- }
- input[type='text'] {
- width: inherit;
- padding: 4px;
- -webkit-border-radius: 0px;
- -moz-border-radius: 0px;
- border-radius: 0px;
- direction: ltr;
- border: 1px solid #cccccc;
- color: #555;
- font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
- background: #fff none repeat scroll 0 0;
- }
- .inactive {
- display: none;
- }
- .active {
- display: block;
- }
- .glyphicon-chevron-down, .glyphicon-chevron-up {
- cursor: pointer;
- }
- </style>
- <div class="col-xs-12 col-md-12">
- <div class="box">
- <form id="filter_form" action="{{ url('entity_audit') }}" method="POST">
- <fieldset class="filter_legend">
- <legend class="filter_legend"> <i id="filter-icon" class="glyphicon glyphicon-chevron-{% if data|length == 0 and not form.vars.submitted %}down{% else %}up{% endif %} btn-xs" title="{{ 'audit.filter.show_hide'|trans({}, 'AuditBundle') }}"></i> {{ 'FILTROS'|trans({}, 'AuditBundle') }}</legend>
- <div class="filter_container {% if data|length == 0 and not form.vars.submitted %}inactive{% endif %}" style="padding: 0 15px 15px 15px;">
- <table class="bordered-table">
- <tbody>
- <tr class="filter">
- <td class="filter-title" width="200">{{ 'Entidad'|trans({}, 'AuditBundle') }}:</td>
- <td class="filter-value form-inline">
- {{ form_widget(form.entity) }}
- </td>
- </tr>
- <tr class="filter">
- <td class="filter-title" width="200">{{ 'Tipo de Revisión'|trans({}, 'AuditBundle') }}:</td>
- <td class="filter-value form-inline">
- {{ form_widget(form.types) }}
- </td>
- </tr>
- <tr class="filter">
- <td class="filter-title" width="200">{{ 'ID del Elemento'|trans({}, 'AuditBundle') }}:</td>
- <td class="filter-value form-inline">
- {{ form_widget(form.idx) }}
- </td>
- </tr>
- <tr class="filter">
- <td class="filter-title" width="200">{{ 'Usuario'|trans({}, 'AuditBundle') }}:</td>
- <td class="filter-value form-inline">
- {{ form_widget(form.users) }}
- </td>
- </tr>
- <tr class="filter">
- <td class="filter-title">{{ 'Fecha Desde'|trans({}, 'AuditBundle') }}:</td> <td class="filter-value form-inline">
- {{ form_widget(form.dateFrom) }}
- </td>
- </tr>
- <tr class="filter">
- <td class="filter-title">{{ 'Fecha Hasta'|trans({}, 'AuditBundle') }}:</td>
- <td class="filter-value">
- {{ form_widget(form.dateTo) }}
- </td>
- </tr>
- <tr class="filter">
- <td class="filter-title" width="200">{{ 'Datos'|trans({}, 'AuditBundle') }}:</td>
- <td class="filter-value form-inline">
- {{ form_widget(form.searchValue) }}
- </td>
- </tr>
- <tr class="filter">
- <td class="filter-title" width="200">{{ 'Resultados por Página'|trans({}, 'AuditBundle') }}:</td>
- <td class="filter-value form-inline">
- {{ form_widget(form.resxpage) }}
- </td>
- </tr>
- </tbody>
- </table>
- {{ form_widget(form.page) }}
- {{ form_widget(form.sort_by) }}
- {{ form_widget(form.sort_order) }}
- {{ form_row(form._token) }}
- <input class="btn btn-small btn-primary" type="submit" value="{{ 'Buscar'|trans({}, 'AuditBundle') }}">
- <a class="btn btn-small btn-default" href="{{ url('entity_audit') }}">{{ 'Limpiar'|trans({}, 'AuditBundle') }}</a>
- </div>
- </fieldset>
- </form>
- </div>
- </div>
- {% endblock %}
- {% block list_table %}
- <div class="col-xs-12 col-md-12">
- <div class="box box-primary" style="margin-bottom: 100px; min-height: ">
- {% if data and is_post %}
- <div class="box-body no-padding table-responsive">
- <p style="float: right">{{ total }} {{ 'resultado(s)'|trans({}, 'AuditBundle') }}</p>
- <table class="table table-bordered table-striped sonata-ba-list">
- <thead>
- <tr>
- <th>{{ 'Entidad'|trans({}, 'AuditBundle') }}</th>
- <th>{{ 'ID del Elemento'|trans({}, 'AuditBundle') }}</th>
- <th>{{ 'Tipo de Revisión'|trans({}, 'AuditBundle') }}</th>
- <th>{{ 'Usuario'|trans({}, 'AuditBundle') }}</th>
- <th>{{ 'Fecha'|trans({}, 'AuditBundle') }}</th>
- <th>{{ 'Datos'|trans({}, 'AuditBundle') }}</th>
- </tr>
- </thead>
- <tbody>
- {% for item in data %}
- <tr>
- <td><a href="{{ path('entity_audit_view_details', { 'classValue': entities[entity], 'id':item['id'], 'rev':item['rev'] }) }}">{{ item['rev'] }}</a></td>
- <td>{{ item['id'] }}</td>
- <td>{{ item['revtype'] }}</td>
- <td>{{ item['username'] }}</td>
- <td>{{ item['timestamp'] }}</td>
- <td style="font-size: 14px">
- <ul>
- {% for column in columns[entity] %}
- <li style="float: left; width: 23%; margin-right: 2%; line-height: 1 !important"><strong>{{ column }}:</strong> {{ item[column] }}</li>
- {% endfor %}
- </ul>
- </td>
- </tr>
- {% endfor %}
- </tbody>
- <tfoot>
- <tr>
- <td colspan="6" class="pager">
- <div class="pagination">
- <ul style="float: right; text-align: center">
- <p>{{ 'Página'|trans({}, 'AuditBundle') }} {{ page }} {{ 'de'|trans({}, 'AuditBundle') }} {{ params.pages }}</p>
- {% if params.pages > 1 %}
- <li>
- <a href="javascript:void(0)" onclick="SetPage('{{ page_ini }}');">«</a>
- </li>
- <li>
- <a href="javascript:void(0)" onclick="SetPage('{{ page_prev }}');">‹</a>
- </li>
- <li>
- <a href="javascript:void(0)" onclick="SetPage('{{ page_next }}');">›</a>
- </li>
- <li>
- <a href="javascript:void(0)" onclick="SetPage('{{ page_end }}');">»</a>
- </li>
- {% endif %}
- </ul>
- </div>
- </td>
- </tr>
- </tfoot>
- </table>
- </div>
- {% else %}
- <div style="padding: 15px;">
- {% if is_post %}
- {{ 'nothingfound' |trans({}, 'AuditBundle') }}
- {% else %}
- {{ 'readysearch' |trans({}, 'AuditBundle') }}
- {% endif %}
- </div>
- {% endif %}
- </div>
- </div>
- <script type="text/javascript" src="{{ asset('bundles/sonataadmin/vendor/jqueryui/ui/i18n/jquery.ui.datepicker-es.js') }}"></script>
- <script type="text/javascript">
- $(document).ready(function () {
- $('.datepicker').datepicker({
- dateFormat: 'dd/mm/yy'
- });
- $('#filter-icon').on('click', function() {
- var filter_container = $('.filter_container');
- if (filter_container.hasClass('inactive')) {
- filter_container.removeClass('inactive');
- filter_container.addClass('active');
- $(this).removeClass('glyphicon-chevron-down');
- $(this).addClass('glyphicon-chevron-up');
- } else {
- filter_container.removeClass('active');
- filter_container.addClass('inactive');
- $(this).removeClass('glyphicon-chevron-up');
- $(this).addClass('glyphicon-chevron-down');
- }
- });
- });
- function SetPage(page) {
- $('[name$="[page]"]').val(page);
- $('#filter_form').submit();
- }
- </script>
- {% endblock %}
|