src/views/admin/banner.twig line 1

Open in your IDE?
  1. {% import 'utility/_macros.twig' as macros %}
  2. {% extends 'layout/_base.twig' %}
  3. {% block head %}
  4.   {% include 'layout/_head.twig' %}
  5.   {{ macros.styleNscript('admin/info') }}
  6. {% endblock %}
  7. {% block main %}
  8. <section class="grid grid--main">
  9.   {% include 'admin/layout/_aside.twig' %}
  10.   <main class="main">
  11.     <ul class="breadcrumb breadcrumb--dashboard">
  12.       <li class="breadcrumb--li">
  13.         <a class="breadcrumb--li-a" href="{{ path('admin_dashboard') }}">Dashboard</a>
  14.       </li>
  15.       <li class="breadcrumb--li">
  16.         <a class="breadcrumb--li-a current">Home Page Banner</a>
  17.       </li>
  18.     </ul>
  19.     <div class="workarea workarea--1x2">
  20.       <div class="formholder">
  21.       {% for message in app.flashes('success') %}
  22.     <div class="alert alert-success">
  23.         {{ message }}
  24.     </div>
  25. {% endfor %}
  26. {% for message in app.flashes('error') %}
  27.     <div class="alert alert-danger">
  28.         {{ message }}
  29.     </div>
  30. {% endfor %}
  31.         <div class="formholder--heading">Create Banner</div>
  32.         <form class="form" id="createIssueTheme" method="POST" enctype="multipart/form-data">
  33.           <div class="input--group" style="margin: 0;">
  34.             <input class="input" type="file" name="cover" accept=".jpg,.jpeg,.png" required />
  35.             <div class="progress">Upload Cover</div>
  36.           </div>
  37.           <div class="image--preview"></div>
  38.           <div class="input--group">
  39.             <input class="input" type="text" name="title" placeholder="Enter Title" required />
  40.           </div>
  41.           <div class="input--group">
  42.             <textarea name="description" placeholder="Enter Description" ></textarea>
  43.           </div>
  44.           <input type="hidden" name="locale" value="{{ app.request.locale }}" />
  45.           <button class="btn--primary-solid btn--100" type="submit">Create</button>
  46.         </form>
  47.       </div>
  48.       <table class="table">
  49.   <thead>
  50.     <tr>
  51.     <th>Cover</th>
  52.       <th>Title</th>
  53.       <th>Description</th>
  54.       
  55.       <th>Actions</th> 
  56.     </tr>
  57.   </thead>
  58.   <tbody>
  59.     {% for banner in banners %}
  60.       <tr>
  61.       <td>
  62.           {% if banner.cover %}
  63.             <img src="{{ asset('uploads/banners/' ~ banner.cover) }}" alt="{{ banner.title }}" style="width: 100px;" />
  64.           {% else %}
  65.             No Cover Image
  66.           {% endif %}
  67.         </td>
  68.         <td>{{ banner.title }}</td>
  69.         <td>{{ banner.description }}</td>
  70.         
  71.         <td class="btn--group">
  72.                 <a href="{{ path('admin_banner_edit', { 'id': banner.id }) }}" class="btn--icon btn--edit"><i class="btn--icon-i ri-quill-pen-fill"></i></a>
  73.                 <form method="POST" action="{{ path('admin_banner_delete', { 'id': banner.id }) }}" style="display:inline;" onsubmit="return confirm('Are you sure you want to delete this banner?');">
  74.                   <button type="submit" class="btn--icon btn--delete"><i class="btn--icon-i ri-delete-bin-2-fill"></i></button>
  75.                 </form>
  76.               </td>
  77.       </tr>
  78.     {% else %}
  79.       <tr>
  80.         <td colspan="4">No banners found.</td>
  81.       </tr>
  82.     {% endfor %}
  83.   </tbody>
  84. </table>
  85.     </div>
  86.   </main>
  87. </section>
  88. {% endblock %}