templates/content/weather.html.twig line 1

Open in your IDE?
  1. <div>
  2.     {% set locationStore = [ ['garmisch', 'Garmisch Partenkirchen'],['hohenpeissenberg','Hohenpeißenberg'], ['altenstadt', 'Schongau'], ['holzkirchen', 'Bad Tölz'] ] %}
  3.     {% set locationSelect = pimcore_select('location', {
  4.         store: locationStore,
  5.         width: 300,
  6.         class: "align-middle",
  7.         defaultValue: "garmisch"
  8.     }) %}
  9.     {% set location = locationSelect.getData() %}
  10.     {% if location == 'garmisch' %}
  11.         {% set locationName = 'Garmisch Partenkirchen' %}
  12.     {% elseif location == 'hohenpeissenberg' %}
  13.         {% set locationName = 'Hohenpeißenberg' %}
  14.     {% elseif location == 'altenstadt' %}
  15.         {% set locationName = 'Altenstadt' %}
  16.     {% elseif location == 'holzkirchen' %}
  17.         {% set locationName = 'Bad Tölz' %}
  18.     {% endif %}
  19.     {% if editmode %}
  20.         {% block scripts %}
  21.             {{ encore_entry_script_tags('app') }}
  22.         {% endblock %}
  23.         {% block stylesheets %}
  24.             {{ encore_entry_link_tags('style') }}
  25.         {% endblock %}
  26.         {% block head_links %}
  27.             {{ pimcore_head_link() }}
  28.         {% endblock %}
  29.         <div style="display: inline-block; margin-left: 100px;" class="editmode-label">
  30.             <span>Snippet Content</span>
  31.             <div class="editmode-label">
  32.                 <span>Für welchen Ort soll das Wetter vorhergesagt werden:</span>
  33.                 <div>{{ locationSelect|raw }}</div>
  34.             </div>
  35.             <br>
  36.             <div class="bg-white shadow-card p-5 transition">
  37.                 <div class="h-[50px]">
  38.                     <h4 class="uppercase text-dark-blue text-sm">
  39.                         {{ pimcore_input('title', {
  40.                             width: 400,
  41.                             placeholder: 'Wetter',
  42.                             class: 'h-[50px] font-mont-heavy text-dark-blue uppercase'
  43.                         }) }}
  44.                     </h4>
  45.                 </div>
  46.             </div>
  47.             <div class="bg-white p-5">
  48.                 <h4 class="uppercase text-blue-light text-sm">
  49.                     {{ pimcore_link('forecast-link') }}
  50.                 </h4>
  51.             </div>
  52.         </div>
  53.     {% else %}
  54.         {% if pimcore_input('title') %}
  55.             <div class="fade-in delay-300">
  56.                 <div class="group relative bg-white dark:bg-neutral-900 dark:text-white rounded shadow-card p-5 md:hover:shadow-md transition">
  57.                     <div class="h-[200px]">
  58.                         <div class="flex h-full flex-col justify-between">
  59.                             <div class="col">
  60.                                 <a href="/radio/service#wetter"><h4 class="uppercase text-dark-blue dark:text-blue-light text-sm md:group-hover:translate-x-2 transition duration-300 ease-out">{{ pimcore_input('title') }}</h4></a>
  61.                                 <p class="uppercase text-gray-400 md:group-hover:translate-x-2 transition duration-300 ease-out">In {{ locationName }}</p>
  62.                             </div>
  63.                             <div class="col-auto">
  64.                                 <div class="vue-app">
  65.                                     <weather source="/api/get-dwd-weather?station={{ location }}"></weather>
  66.                                 </div>
  67.                             </div>
  68.                             <div class="col">
  69.                                 <h4 class="text-right uppercase text-blue-light text-sm md:group-hover:-translate-x-2 transition duration-300 ease-out">
  70.                                     {{ pimcore_link('forecast-link') }}
  71.                                 </h4>
  72.                             </div>
  73.                         </div>
  74.                     </div>
  75.                 </div>
  76.             </div>
  77.             {% endif %}
  78.     {% endif %}
  79. </div>