templates/bestellung/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block body %}
  3. {% set summe = 0 %}
  4. <br>
  5. <div class="container">
  6.     <h2>Ihre Bestellung</h2>
  7.     <br>
  8.     
  9.     <table class="table table-striped">
  10.         <thead>
  11.             <tr>
  12.                 <td>Bestell Nr.</td>
  13.                 <td>Name</td>
  14.                 <td>Preis</td>
  15.                 <td>Status</td>
  16.                 <td></td>
  17.             </tr>
  18.         </thead>
  19.         
  20.         <tbody>
  21.             {% for bestellung in bestellungen %}
  22.             {% set summe = summe + bestellung.preis %}
  23.             <tr>
  24.                 <td>{{bestellung.bnummer}}</td>
  25.                 <td>{{bestellung.name}}</td>
  26.                 <td>{{bestellung.preis}}</td>
  27.                 
  28.                 {% if not is_granted('ROLE_USER') %}
  29.                 <td>{{bestellung.status}}</td>
  30.                 {% endif %}
  31.                 
  32.                 {% if is_granted('ROLE_USER') %}
  33.                 <td>
  34.                     <div class="dropdown show">
  35.                         <a class="btn btn-secondary dropdown-toggle" href="#" role="button" id="dropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  36.                             {{bestellung.status}}
  37.                         </a>
  38.                         <div class="dropdown-menu" aria-labelledby="dropdownMenuLink">
  39.                             <a class="dropdown-item" href="{{path('app_status',{id: bestellung.id, status: 'offen'})}}">offen</a>
  40.                             <a class="dropdown-item" href="{{path('app_status',{id: bestellung.id, status: 'fertig'})}}">fertig</a>
  41.                             <a class="dropdown-item" href="{{path('app_status',{id: bestellung.id, status: 'archiv'})}}">archiv</a>
  42.                         </div>
  43.                     </div>
  44.                 </td>
  45.                 {% endif %}
  46.                 
  47.                 {% if bestellung.status == 'offen' %} <!-- Die Möglichkeit zur Löschung besteht nur, wenn die Bestellung noch offen ist -->
  48.                 <td><a class="btn btn-outline-danger btn-sm" href="{{path('app_loeschen',{id: bestellung.id})}}" role="button">Entfernen</a></td>
  49.                 {% else %}
  50.                 <td> </td>
  51.                 {% endif %}
  52.                 
  53.             </tr>
  54.             {% endfor %}
  55.             <tr>
  56.                 <td> </td>
  57.                 <td> </td>
  58.                 <td>{{summe}} CHF</td>
  59.                 
  60.                 {% if not is_granted('ROLE_USER') %}
  61.                 <td> </td>
  62.                 {% endif %}
  63.                 
  64.                 {% if is_granted('ROLE_USER') %}
  65.                 <td> </td>
  66.                 {% endif %}
  67.                 
  68.                 <td> </td>
  69.             </tr>
  70.         </tbody>
  71.     </table>
  72. </div>
  73. {% endblock %}