Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {% extends 'base.html.twig' %}
- {% block title %}Lista Utenti{% endblock %}
- {% block content %}
- <table class="table table-bordered">
- <thead>
- <tr>
- <form class="pull-right hidden" role="search" id="nav-search-form" method="get"
- action="{{ path(app.request.attributes.get('_route'))}}">
- <div class="input-group">
- <label>
- <input type="text" class="form-control" placeholder="Ricerca per Username" name="search" value={{ search }}>
- </label>
- </div>
- </form>
- {% spaceless %}
- {% if nbPages > 1 %}
- {# Number of page around current page+1 #}
- {% set nearbyPagesLimit = 3 %}
- <div>
- <ul class="pagination">
- {% if currentPage != 1 %}
- <li>
- <a href="{{ path(app.request.attributes.get('_route'),
- app.request.query.all|merge({ 'currentPage': 1, 'pageSize': pageSize })) }}">First</a>
- </li>
- {% endif %}
- {% for i in 1..nbPages %}
- {% if 0 == (currentPage - nearbyPagesLimit) - loop.index %} {# dot before #}
- <li class="disabled"><a href="#">...</a></li>
- {% elseif 0 == (currentPage + nearbyPagesLimit) - loop.index %} {# dot after #}
- <li class="disabled"><a href="#">...</a></li>
- {% elseif 0 < (currentPage - nearbyPagesLimit) - loop.index %} {# hide all before #}
- {% elseif 0 > (currentPage + nearbyPagesLimit) - loop.index %} {# hide all after #}
- {% else %}
- <li {% if currentPage == loop.index %} class="active" style="font-weight: bold;" {% endif %}>
- <a href="{{ path('inaner_user_list',
- app.request.query.all|merge({ 'currentPage': loop.index, 'pageSize': pageSize })) }}">{{ loop.index }}</a>
- </li>
- {% endif %}
- {% endfor %}
- {% if currentPage != nbPages %}
- <li>
- <a href="{{ path('inaner_user_list',
- app.request.query.all|merge( { 'currentPage': nbPages, 'pageSize': pageSize } )) }}">Last</a>
- </li>
- {% endif %}
- </ul>
- </div>
- {% endif %}
- {% endspaceless %}
- </tr>
- <tr>
- <th>#</th>
- <th><a href="{{ path(app.request.attributes.get('_route'),
- app.request.query.all|merge({ 'sort': 'name', 'direction':direction })) }}">Nome</a></th>
- <th><a href="{{ path(app.request.attributes.get('_route'),
- app.request.query.all|merge({ 'sort': 'surname', 'direction':direction })) }}">Cognome</a></th>
- <th><a href="{{ path(app.request.attributes.get('_route'),
- app.request.query.all|merge({ 'sort': 'username', 'direction':direction })) }}">Username</a></th>
- <th><a href="{{ path(app.request.attributes.get('_route'),
- app.request.query.all|merge({ 'sort': 'email', 'direction':direction })) }}">Email</a></th>
- <th><a href="{{ path(app.request.attributes.get('_route'),
- app.request.query.all|merge({ 'sort': 'externalId', 'direction':direction })) }}">SAP Username</a>
- </th>
- <th>Rda</th>
- <th>A. Rotante</th>
- <th>A. Fissa</th>
- <th>Spagna</th>
- <th>B.I.</th>
- <th>HTL</th>
- <th>Manodopera</th>
- <th>Azioni</th>
- </tr>
- </thead>
- <tbody>
- {% for user in users %}
- <tr>
- <td scope=row>{{ user.id }}</td>
- <td>{{ user.name }}</td>
- <td>{{ user.surname }}</td>
- <td>{{ user.username }}</td>
- <td>{{ user.email }}</td>
- <td>{{ user.externalId }}</td>
- {% if user.userType == 'P' %}
- <td>Pilota</td>
- {% elseif user.userType == 'T' %}
- <td>Tecnico</td>
- {% endif %}
- <td>
- {% if user.hasRdaGrant %}
- Si
- {% else %}
- No
- {% endif %}
- </td>
- <td>
- {% if user.hasReportGrant %}
- Si
- {% else %}
- No
- {% endif %}
- </td>
- <td>
- {% if user.hasFixedGrant %}
- Si
- {% else %}
- No
- {% endif %}
- </td>
- <td>
- {% if user.hasSpainGrant %}
- Si
- {% else %}
- No
- {% endif %}
- </td>
- <td>
- {% if user.hasBusinessGrant %}
- Si
- {% else %}
- No
- {% endif %}
- </td>
- <td>
- {% if user.hasHtlGrant %}
- Si
- {% else %}
- No
- {% endif %}
- </td>
- <td>
- {% if user.hasManodoperaGrant %}
- Si
- {% else %}
- No
- {% endif %}
- </td>
- <td style="width: 175px">
- <a href="/users/edit/{{ user.id }}" class="btn btn-success">Modifica</a>
- {% if is_granted('ROLE_USER_ADMIN') %}
- <a href="/users/delete/{{ user.id }}" class="btn btn-danger">Elimina</a>
- {% endif %}
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- {% endblock content %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement