[mod] simplify template

This commit is contained in:
Laurent Peuch 2016-11-01 12:21:49 +01:00
parent bed41e136f
commit 76afaf140d

View File

@ -1,12 +1,8 @@
{% if section.image.type == "video" %} {% if section.image.type == "video" %}
{% set video = Video(section.image) %} {% set video = Video(section.image) %}
{{ video.copy() }} {{ video.copy() }}
{% else %}
{% set image = Image(section.image) %} <section class="full-picture">
{{ image.copy() }}
{% endif %}
{% if video %}
<section class="full-picture">
<div class="video-container"> <div class="video-container">
{% if section.text %} {% if section.text %}
<div class="title-container"> <div class="title-container">
@ -22,14 +18,22 @@
</div> </div>
</div> </div>
{% endif %} {% endif %}
<video autoplay loop muted class="fillWidth"> <video autoplay loop muted class="fillWidth">
<source src="{{ video }}" type="video/webm" data-source="{{ video }}" data-format="vp8" data-extension="webm"> <source src="{{ video }}" type="video/webm" data-source="{{ video }}" data-format="vp8" data-extension="webm">
</video> </video>
<img class="lazy full-picture" src="{{ video.generate_thumbnail("2000") }}"> <img class="lazy full-picture" src="{{ video.generate_thumbnail("2000") }}">
</div> </div>
</section> </section>
{% else %} {% else %}
<section class="full-picture" style="background: transparent url('{{ image }}') no-repeat fixed center top / cover, transparent url('{{ image.generate_thumbnail("x450") }}') no-repeat fixed center top / cover;"> {% set image = Image(section.image) %}
{{ image.copy() }}
<section class="full-picture" style="background: transparent url('{{ image }}') no-repeat fixed center top / cover, transparent url('{{ image.generate_thumbnail("x450") }}') no-repeat fixed center top / cover;">
{% if section.text %} {% if section.text %}
<div class="picture-text"> <div class="picture-text">
<div class="picture-text-column"> <div class="picture-text-column">
@ -44,5 +48,6 @@
</div> </div>
</div> </div>
{% endif %} {% endif %}
</section>
</section>
{% endif %} {% endif %}