123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- {% extends 'admin/base.html.twig' %}
- {% block content %}
- <div class="content">
- <div class="container-fluid">
- <div class="row">
- <div class="col-md-12">
- <div class="card">
- <div class="card-header">
- <div class="float-left">
- <h4 class="card-title">Список статей</h4>
- </div>
- <div class="float-right">
- <a class="btn btn-primary btn-fill btn-icon" href="{{ path('admin.article_add') }}" role="button" title="Добавить">
- <i class="fa fa-plus"></i>
- </a>
- </div>
- </div>
- <div class="card-body">
- {% for label, messages in app.flashes(['success', 'warning', 'danger', 'info', 'primary']) %}
- {% for message in messages %}
- <div class="alert alert-{{ label }}">
- <span>{{ message }}</span>
- </div>
- {% endfor %}
- {% endfor %}
- <table class="table table-hover table-bordered">
- <thead>
- <th>ID</th>
- <th>Название</th>
- <th>Активная</th>
- <th></th>
- </thead>
- <tbody>
- {% for article in articles %}
- <tr>
- <td>{{ article.id }}</td>
- <td>{{ article.title }}</td>
- {% if article.isActive %}
- <td class="text-success">Да</td>
- {% else %}
- <td class="text-danger">Нет</td>
- {% endif %}
- <td style="width: 110px">
- <a class="btn btn-primary btn-fill btn-icon" href="{{ path('admin.article_edit', {id: article.id}) }}" role="button" title="Редактировать">
- <i class="fa fa-pencil"></i>
- </a>
- <a class="btn btn-danger btn-fill btn-icon" href="{{ path('admin.article_delete', {id: article.id}) }}" role="button" title="Удалить">
- <i class="fa fa-trash-o"></i>
- </a>
- </td>
- </tr>
- {% endfor %}
- </tbody>
- </table>
- <br>
- <ul class="pagination justify-content-center">
- {% if prev_page %}
- <li class="page-item">
- <a class="page-link" href="{{ path('admin.article_list', {
- page: prev_page
- }) }}">Предыдущая страница</a>
- </li>
- {% endif %}
- {% if next_page %}
- <li class="page-item">
- <a class="page-link" href="{{ path('admin.article_list', {
- page: next_page
- }) }}">Следующая страница</a>
- </li>
- {% endif %}
- </ul>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- {% endblock %}
|