view.html.twig 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. {% extends base_template %}
  2. {% block title %}
  3. - {{ data.label }}
  4. {% endblock %}
  5. {% block breadcrumb %}
  6. {% set links = [
  7. {label: 'Auditoría de Entidades'|trans({}, 'AuditBundle'), class: '', link: url('entity_audit')},
  8. {label: data.label, class: 'active', link: ''}
  9. ] %}
  10. {% include "BaseAdminBundle:Utils:breadcrumb.html.twig" with links %}
  11. {% endblock %}
  12. {% block list_filters %}
  13. <fieldset class="filter_legend">
  14. <div class="col-xs-12 col-md-12">
  15. <div class="box box-primary">
  16. <div class="box-header">
  17. <h4 class="box-title"> {{ 'Resumen'|trans({}, 'AuditBundle') }}: </h4>
  18. </div>
  19. <table class="table table-bordered table-striped sonata-ba-list">
  20. <tbody>
  21. <tr class="filter inactive">
  22. <td class="filter-title" width="180"><b>{{ 'Revisión'|trans({}, 'AuditBundle') }}</b>:</td>
  23. <td class="filter-value">{{ data.rev }}</td>
  24. </tr>
  25. <tr class="filter inactive">
  26. <td class="filter-title"><b>{{ 'Entidad'|trans({}, 'AuditBundle') }}</b>:</td>
  27. <td class="filter-value">{{ data.className }}</td>
  28. </tr>
  29. <tr class="filter inactive">
  30. <td class="filter-title"><b>{{ 'Id'|trans({}, 'AuditBundle') }}</b>:</td>
  31. <td class="filter-value">{{ data.id }}</td>
  32. </tr>
  33. <tr class="filter inactive">
  34. <td class="filter-title"><b>{{ 'Usuario'|trans({}, 'AuditBundle') }}</b>:</td>
  35. <td class="filter-value">{{ data.revdata.username | default('(anonymous)')}}</td>
  36. </tr>
  37. <tr class="filter inactive">
  38. <td class="filter-title"><b>{{ 'Fecha'|trans({}, 'AuditBundle') }}</b>:</td>
  39. <td class="filter-value">{{ data.revdata.timestamp | date("d/m/Y \\a \\l\\a\\s h:m:s") }} hs</td>
  40. </tr>
  41. </tbody>
  42. </table>
  43. </div>
  44. </div>
  45. <hr>
  46. <div class="col-xs-12 col-md-12">
  47. <div class="box box-primary">
  48. <div class="box-header">
  49. <h4 class="box-title"> {{ 'Datos actuales de la entidad'|trans({}, 'AuditBundle') }}: </h4>
  50. </div>
  51. <table class="table table-bordered table-striped sonata-ba-list">
  52. <tbody>
  53. <tr class="filter inactive">
  54. <td class="filter-title" width="180"><b>{{ 'Campo'|trans({}, 'AuditBundle') }}</b></td>
  55. <td class="filter-title"><b>{{ 'Valor'|trans({}, 'AuditBundle') }}</b></td>
  56. </tr>
  57. </tbody>
  58. <tbody>
  59. {% for field, value in data.details %}
  60. <tr class="filter inactive">
  61. <td class="filter-value">{{ field }}</td>
  62. <td class="filter-value">
  63. {% if value.timestamp is defined %}
  64. {{ value | date("d/m/Y \\a \\l\\a\\s h:m:s") }}
  65. {% elseif value is iterable %}
  66. {{ dump(value) }}
  67. {% else %}
  68. {{ value }}
  69. {% endif %}
  70. </td>
  71. </tr>
  72. {% endfor %}
  73. </tbody>
  74. </table>
  75. </div>
  76. </div>
  77. <hr>
  78. <div class="col-xs-12 col-md-12">
  79. <div class="box box-primary">
  80. <div class="box-header">
  81. <h4 class="box-title"> {{ 'Revisiones efectuadas'|trans({}, 'AuditBundle') }} ({{ data.revisions|length }}): </h4>
  82. </div>
  83. <form action="{{ path('entity_audit_compare_revs', { 'className': data.className, 'id': data.id }) }}" method="get">
  84. <div style="display:block; height:200px; overflow:auto; margin-bottom:10px">
  85. <table class="table table-bordered table-striped sonata-ba-list" style="width:100%;margin-top:0px;margin-bottom:0px">
  86. <tbody>
  87. <tr class="filter inactive">
  88. <td class="filter-title" style="width:90px;"><b>{{ 'Revisión'|trans({}, 'AuditBundle') }}</b></td>
  89. <td class="filter-title" style="width:250px;"><b>{{ 'Fecha'|trans({}, 'AuditBundle') }}</b></td>
  90. <td class="filter-title" style="width:150px;"><b>{{ 'Usuario'|trans({}, 'AuditBundle') }}</b></td>
  91. <td class="filter-title" style="width:50px;"><b>{{ 'Anterior'|trans({}, 'AuditBundle') }}</b></td>
  92. <td class="filter-title" style="width:50px;"><b>{{ 'Actual'|trans({}, 'AuditBundle') }}</b></td>
  93. </tr>
  94. </tbody>
  95. <tbody>
  96. {% for revision in data.revisions %}
  97. <tr class="filter inactive">
  98. <td class="filter-value" style="text-align:center;"><a href="{{ path('entity_audit_view_details', { 'className': data.className, 'id': data.id, 'rev': revision.rev }) }}">{{ revision.rev }}</a></td>
  99. <td class="filter-value">{{ revision.timestamp | date("d/m/Y \\a \\l\\a\\s h:m:s") }}</td>
  100. <td class="filter-value">{{ revision.username|default('(anonymous)') }}</td>
  101. <td class="filter-value" style="text-align:center"><input type="radio" name="oldRev" value="{{ revision.rev }}"{% if loop.index == 2 %} checked="checked"{% endif %} /></td>
  102. <td class="filter-value" style="text-align:center"><input type="radio" name="newRev" value="{{ revision.rev }}"{% if loop.index == 1 %} checked="checked"{% endif %} /></td>
  103. </tr>
  104. {% endfor %}
  105. </tbody>
  106. </table>
  107. </div>
  108. <input class="btn btn-small btn-primary" type="submit" value="{{ 'Comparar'|trans({}, 'AuditBundle') }}" />
  109. <a class="btn btn-small btn-default" href="{{ path('entity_audit') }}">{{ 'Regresar'|trans({}, 'AuditBundle') }}</a>
  110. </div>
  111. </div>
  112. </form>
  113. </fieldset>
  114. {% endblock %}
  115. {% block content %}{% endblock %}