Advertisement
raul_mash

Untitled

Jan 24th, 2020
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 6.63 KB | None | 0 0
  1. {% extends 'base.html.twig' %}
  2.  
  3. {% block title %}Lista Utenti{% endblock %}
  4.  
  5. {% block content %}
  6.  
  7.     <table class="table table-bordered">
  8.         <thead>
  9.         <tr>
  10.             <form class="pull-right hidden" role="search" id="nav-search-form" method="get"
  11.                  action="{{ path(app.request.attributes.get('_route'))}}">
  12.                 <div class="input-group">
  13.                     <label>
  14.                         <input type="text" class="form-control" placeholder="Ricerca per Username" name="search" value={{ search }}>
  15.                     </label>
  16.                 </div>
  17.             </form>
  18.             {% spaceless %}
  19.                 {% if nbPages > 1 %}
  20.  
  21.                     {# Number of page around current page+1 #}
  22.                     {% set nearbyPagesLimit = 3 %}
  23.                     <div>
  24.                         <ul class="pagination">
  25.                             {% if currentPage != 1 %}
  26.                                 <li>
  27.                                     <a href="{{ path(app.request.attributes.get('_route'),
  28.                                        app.request.query.all|merge({ 'currentPage': 1, 'pageSize': pageSize })) }}">First</a>
  29.                                 </li>
  30.                             {% endif %}
  31.                             {% for i in 1..nbPages %}
  32.                                 {% if 0 == (currentPage - nearbyPagesLimit) - loop.index %} {# dot before #}
  33.                                     <li class="disabled"><a href="#">...</a></li>
  34.                                 {% elseif 0 == (currentPage + nearbyPagesLimit) - loop.index %} {# dot after #}
  35.                                     <li class="disabled"><a href="#">...</a></li>
  36.                                 {% elseif 0 < (currentPage - nearbyPagesLimit) - loop.index %} {# hide all before #}
  37.                                {% elseif 0 > (currentPage + nearbyPagesLimit) - loop.index %} {# hide all after #}
  38.                                 {% else %}
  39.                                     <li {% if currentPage == loop.index %} class="active" style="font-weight: bold;" {% endif %}>
  40.                                         <a href="{{ path('inaner_user_list',
  41.                                            app.request.query.all|merge({ 'currentPage': loop.index, 'pageSize': pageSize  })) }}">{{ loop.index }}</a>
  42.                                     </li>
  43.                                 {% endif %}
  44.                             {% endfor %}
  45.                             {% if currentPage != nbPages %}
  46.                                 <li>
  47.                                     <a href="{{ path('inaner_user_list',
  48.                                        app.request.query.all|merge( { 'currentPage': nbPages, 'pageSize': pageSize  } )) }}">Last</a>
  49.                                 </li>
  50.                             {% endif %}
  51.                         </ul>
  52.                     </div>
  53.                 {% endif %}
  54.             {% endspaceless %}
  55.         </tr>
  56.         <tr>
  57.             <th>#</th>
  58.             <th><a href="{{ path(app.request.attributes.get('_route'),
  59.                    app.request.query.all|merge({ 'sort': 'name', 'direction':direction })) }}">Nome</a></th>
  60.             <th><a href="{{ path(app.request.attributes.get('_route'),
  61.                    app.request.query.all|merge({ 'sort': 'surname', 'direction':direction })) }}">Cognome</a></th>
  62.             <th><a href="{{ path(app.request.attributes.get('_route'),
  63.                    app.request.query.all|merge({ 'sort': 'username', 'direction':direction })) }}">Username</a></th>
  64.             <th><a href="{{ path(app.request.attributes.get('_route'),
  65.                    app.request.query.all|merge({ 'sort': 'email', 'direction':direction })) }}">Email</a></th>
  66.             <th><a href="{{ path(app.request.attributes.get('_route'),
  67.                    app.request.query.all|merge({ 'sort': 'externalId', 'direction':direction })) }}">SAP Username</a>
  68.             </th>
  69.             <th>Rda</th>
  70.             <th>A. Rotante</th>
  71.             <th>A. Fissa</th>
  72.             <th>Spagna</th>
  73.             <th>B.I.</th>
  74.             <th>HTL</th>
  75.             <th>Manodopera</th>
  76.             <th>Azioni</th>
  77.         </tr>
  78.         </thead>
  79.         <tbody>
  80.         {% for user in users %}
  81.             <tr>
  82.                 <td scope=row>{{ user.id }}</td>
  83.                 <td>{{ user.name }}</td>
  84.                 <td>{{ user.surname }}</td>
  85.                 <td>{{ user.username }}</td>
  86.                 <td>{{ user.email }}</td>
  87.                 <td>{{ user.externalId }}</td>
  88.                 {% if user.userType == 'P' %}
  89.                     <td>Pilota</td>
  90.                 {% elseif user.userType == 'T' %}
  91.                     <td>Tecnico</td>
  92.                 {% endif %}
  93.                 <td>
  94.                     {% if user.hasRdaGrant %}
  95.                         Si
  96.                     {% else %}
  97.                         No
  98.                     {% endif %}
  99.                 </td>
  100.                 <td>
  101.                     {% if user.hasReportGrant %}
  102.                         Si
  103.                     {% else %}
  104.                         No
  105.                     {% endif %}
  106.                 </td>
  107.                 <td>
  108.                     {% if user.hasFixedGrant %}
  109.                         Si
  110.                     {% else %}
  111.                         No
  112.                     {% endif %}
  113.                 </td>
  114.                 <td>
  115.                     {% if user.hasSpainGrant %}
  116.                         Si
  117.                     {% else %}
  118.                         No
  119.                     {% endif %}
  120.                 </td>
  121.                 <td>
  122.                     {% if user.hasBusinessGrant %}
  123.                         Si
  124.                     {% else %}
  125.                         No
  126.                     {% endif %}
  127.                 </td>
  128.                 <td>
  129.                     {% if user.hasHtlGrant %}
  130.                         Si
  131.                     {% else %}
  132.                         No
  133.                     {% endif %}
  134.                 </td>
  135.                 <td>
  136.                     {% if user.hasManodoperaGrant %}
  137.                         Si
  138.                     {% else %}
  139.                         No
  140.                     {% endif %}
  141.                 </td>
  142.                 <td style="width: 175px">
  143.                     <a href="/users/edit/{{ user.id }}" class="btn btn-success">Modifica</a>
  144.                     {% if is_granted('ROLE_USER_ADMIN') %}
  145.                         <a href="/users/delete/{{ user.id }}" class="btn btn-danger">Elimina</a>
  146.                     {% endif %}
  147.                 </td>
  148.             </tr>
  149.         {% endfor %}
  150.  
  151.         </tbody>
  152.     </table>
  153. {% endblock content %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement