templates/index/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% set page_title = 'Paper doll' %}
  3. {% block body %}
  4.     {% if is_granted('ROLE_USER') %}
  5.         <div class="alert alert-info userStatusInfo">
  6.             Hallo {{ app.user.email }}<br>
  7.             <a href="{{ path('app_logout') }}">Logout!</a>
  8.         </div>
  9.     {%  else %}
  10.         <div class="alert alert-warning userStatusInfo">
  11.             Hallo, du bist nicht eingeloggt und wirst daher deine Kreation nicht speichern können. <a href="{{ path('app_login') }}">Logge dich hier ein!</a>
  12.         </div>
  13.     {% endif %}
  14.     <section id="chooseRace">
  15.         {% for r in races %}
  16.             <div class="card">
  17.                 <img src="/uploads/{{ r.image }}" class="card-img-top" alt="...">
  18.                 <div class="card-body">
  19.                     <h5 class="card-title"> {{ r.name }}</h5>
  20.                     <p>{{ r.description }}</p>
  21.                     {% for l in r.layers %}
  22.                             {% if l.category.name == 'Körper' and l.mainLayer == true %}
  23.                                 <a href="#" class="btn btn-primary selectRaceAndBody" data-race="{{ r.id }}" data-layer="{{ l.id }}" data-image="{{ l.image }}">Auswählen</a>
  24.                             {% endif %}
  25.                     {% endfor %}
  26.                 </div>
  27.             </div>
  28.         {% endfor %}
  29.     </section>
  30.     <section id="canvas">
  31.     </section>
  32.     <section id="categories">
  33.         <section id="categoryMenu">
  34.             {% if is_granted('ROLE_USER') %}
  35.                 <div id="creationManagementLink">
  36.                     <img src="/imag/icon_objekt_nach_vorn.png" class="d-block">
  37.                 </div>
  38.             {% endif %}
  39.             <div id="existingElementsLink">
  40.                 <img src="/img/icon_objekt_entfernen.png" class="d-block">
  41.             </div>
  42.             {% for c in categories %}
  43.                     <div class="outfitCategoryLink" data-id="{{ c.id }}" id="outfitCategoryLink{{ c.id }}">
  44.                         <img src="/uploads/{{ c.iconFile }}" class="d-block">
  45.                     </div>
  46.             {% endfor %}
  47.         </section>
  48.         {% if is_granted('ROLE_USER') %}
  49.         <div id="creationManagementWrapper">
  50.             <h2>Kreation speichern/laden</h2>
  51.             <ul id="creations">
  52.             {%for c in creations %}
  53.                 <li><a href="#" class="loadCreation" data-creation="{{ c.id }}"><i>{{ c.race.name }}</i> - {{ c.name }}</a></li>
  54.             {% endfor %}
  55.             </ul>
  56.             <br>
  57.             <a href="#" class="btn btn-success" id="saveCreation">Kreation speichern</a>
  58.         </div>
  59.         {% endif %}
  60.         <div id="existingElementsWrapper" style="min-height: 50px;">
  61.             <h2>Vorhandene Elemente</h2>
  62.             <div id="canvasLayers">
  63.                 <div id="carouselExampleCaptionsCanvasLayers" class="carousel slide">
  64.                     <div class="carousel-inner">
  65.                     </div>
  66.                     <button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleCaptionsCanvasLayers" data-bs-slide="prev">
  67.                         <span class="carousel-control-prev-icon" aria-hidden="true"></span>
  68.                         <span class="visually-hidden">Previous</span>
  69.                     </button>
  70.                     <button class="carousel-control-next" type="button" data-bs-target="#carouselExampleCaptionsCanvasLayers" data-bs-slide="next">
  71.                         <span class="carousel-control-next-icon" aria-hidden="true"></span>
  72.                         <span class="visually-hidden">Next</span>
  73.                     </button>
  74.                 </div>
  75.             </div>
  76.         </div>
  77.     {% for c in categories %}
  78.             <div class="outfitCategoryWrapper" id="outfitCategoryWrapper{{ c.id }}">
  79.                 <h2>{{ c.name }}</h2>
  80.                 <div id="carouselExampleCaptions{{ c.id }}" class="carousel slide" data-bs-ride="carousel" data-bs-interval="false">
  81.                     <div class="carousel-inner">
  82.                             {% for l in layers %}
  83.                                 {% if l.category.name == c.name %}
  84.                                     {% for r in l.race %}
  85.                                         <div class="carousel-item" data-bs-interval="false" data-race="{{ r.id }}" data-layer="{{ l.id }}">
  86.                                             <img loading="lazy" src="/uploads/{{ l.thumbnail }}" class="d-block" alt="...">
  87.                                             <br><br>
  88.                                             <div class="carousel-caption d-md-block">
  89.                                                <!-- <h5>{{ l.name }}</h5> -->
  90.                                                 <a href="#" class="btn btn-sm btn-primary selectElement" data-race="{{ r.id }}" data-category="{{ c.id }}"  data-layer="{{ l.id }}" data-offset="{{ l.offset }}" data-image="{{ l.image }}" data-zindex="{{ l.defaultLayerZindex ? l.defaultLayerZindex : c.defaultLayerZindex }}">Auswählen</a>
  91.                                             </div>
  92.                                         </div>
  93.                                     {% endfor %}
  94.                                 {% endif %}
  95.                             {% endfor %}
  96.                     </div>
  97.                     <button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleCaptions{{ c.id }}" data-bs-slide="prev">
  98.                         <span class="carousel-control-prev-icon" aria-hidden="true"></span>
  99.                         <span class="visually-hidden">Previous</span>
  100.                     </button>
  101.                     <button class="carousel-control-next" type="button" data-bs-target="#carouselExampleCaptions{{ c.id }}" data-bs-slide="next">
  102.                         <span class="carousel-control-next-icon" aria-hidden="true"></span>
  103.                         <span class="visually-hidden">Next</span>
  104.                     </button>
  105.                 </div>
  106.             </div>
  107.     {% endfor %}
  108.         <br><br><br>
  109.         <a href="/" class="btn btn-danger">Zurück zum Start</a>
  110.     </section>
  111.     <script type="text/javascript">
  112.         canvasTextsJson = '{{ canvasTexts | json_encode | raw }}';
  113.     </script>
  114. {% endblock %}