vendor/elcoag/symfony-process-bundle/src/Resources/views/crud/index.html.twig line 1

  1. {% extends 'base.html.twig' %}
  2. {% block title %}{{ title|trans }} - {{ subtitle|trans }}{% endblock %}
  3. {% block page_title %}{{ title|trans }}{% endblock %}
  4. {% block page_subtitle %}{{ subtitle|trans }}{% endblock %}
  5. {% block page_content %}
  6.     <div class="row">
  7.         {% if app.session.flashbag.peekAll|length > 0 %}
  8.             <div class="col-md-12">
  9.                 {% for type, messages in app.session.flashbag.all %}
  10.                     {% for message in messages %}
  11.                         <div class="alert alert-{{ type ? type : 'info' }}">
  12.                             {{ message|trans({}, domain|default('messages')) }}
  13.                         </div>
  14.                     {% endfor %}
  15.                 {% endfor %}
  16.             </div>
  17.         {% endif %}
  18.         <div class="col-md-12">
  19.             <div class="card card-info">
  20.                 <div class="card-body">
  21.                     <div class="row">
  22.                         <div class="col-md-12">
  23.                             <a href="{{ path(app_new) }}" class="btn btn-primary">Create new</a>
  24.                         </div>
  25.                     </div>
  26.                 </div>
  27.             </div>
  28.         </div>
  29.         <div class="col-md-12">
  30.             <div class="card card-info">
  31.                 <div class="card-header">
  32.                     <h3 class="card-title">{{ object_title }} List</h3>
  33.                 </div>
  34.                 <div class="card-body p-1">
  35.                     <div class="row">
  36.                         <div class="col-md-12">
  37.                             <table class="table table-bordered table-hover dataTable m-0">
  38.                                 <thead>
  39.                                     {% set temp = items|first %}
  40.                                     <tr>
  41.                                     {% for property_title in temp.attributes %}
  42.                                         <th>{{ property_title }}</th>
  43.                                     {% endfor %}
  44.                                     </tr>
  45.                                 </thead>
  46.                                 <tbody>
  47.                                 {% for item in items %}
  48.                                     <tr>
  49.                                         {% for field in temp.attributes %}
  50.                                             <td class="p-1">
  51.                                             {% if field is same as('actions') %}
  52.                                                 <a class="btn btn-xs btn-default float-right ml-1" href="{{ path(app_show, {'id': item.id}) }}">Show</a>
  53.                                                 <a class="btn btn-xs btn-primary float-right" href="{{ path(app_edit, {'id': item.id}) }}">Edit</a>
  54.                                             {% elseif attribute(item, field).timestamp is defined %}
  55.                                                 <a class="" href="{{ path(app_show, {'id': item.id}) }}">{{ attribute(item, field)|date('m/d/Y') }}</a>
  56.                                             {% else %}
  57.                                                 <a class="" href="{{ path(app_show, {'id': item.id}) }}">{{ attribute(item, field) }}</a>
  58.                                             {% endif %}
  59.                                             </td>
  60.                                         {% endfor %}
  61.                                     </tr>
  62.                                 {% endfor %}
  63.                                 </tbody>
  64.                             </table>
  65.                         </div>
  66.                     </div>
  67.                 </div>
  68.             </div>
  69.         </div>
  70.     </div>
  71. {% endblock %}