Skip to content
Snippets Groups Projects
Commit d301344a authored by Lukas Ruge's avatar Lukas Ruge
Browse files

infrainfo

parent 39c27ffd
No related branches found
No related tags found
No related merge requests found
Pipeline #32744 passed
{% assign display_info = 0 -%}
{% if component.out_of_service -%}
{% assign display_info = 1 -%}
{% endif -%}
{% capture nowunix %}{{'now' | date: '%s'}}{% endcapture %}
{%- capture next_week %}{{'now' | date: '%s' | plus: 604800 }}{%- endcapture -%}
{% for maintenance in site.maintenance -%}
{% capture eventdate %}{{maintenance.eventdate | date: '%s'}}{% endcapture %}
{% capture eventend %}{{maintenance.eventend | date: '%s'}}{% endcapture %}
{% if maintenance.components -%}
{% if maintenance.components contains component.uid -%}
{% if eventdate < nowunix -%}
{% if nowunix < eventend -%}
{% assign display_info = 2 -%}
{% endif -%}
{% endif -%}
{% if eventdate < next_week -%}
{% assign display_info = 3 -%}
{% endif -%}
{% endif -%}
{% endif -%}
{% endfor -%}
{% if display_info == 1 -%}
<div style="line-height: 18pt; margin:10px 0; width: 100%; background-color: #FFB390; border-width: thick; border-color: #e67206; border-radius: 10px; min-height: 40pt; ">
<span style="float: left; color: #e67206; font-size: 40pt; display:block; width: 50pt; height: 40pt; text-align:center; line-height: 40pt;"></span><p style="vertical-align: middle;">Ist aktuell außer Betrieb.</p>
</div>
{% endif -%}
{% if display_info == 2 -%}
<div style="line-height: 18pt; margin:10px 0; width: 100%; background-color: #FFB390; border-width: thick; border-color: #e67206; border-radius: 10px; min-height: 40pt; ">
<span style="float: left; color: #e67206; font-size: 40pt; display:block; width: 50pt; height: 40pt; text-align:center; line-height: 40pt;"></span><p style="vertical-align: middle;">Laufende Wartung.</p>
</div>
{% endif -%}
{% if display_info == 3 -%}
<div style="line-height: 18pt; margin:10px 0; width: 100%; background-color: #FFF8DC; border-width: thick; border-color: #e67206; border-radius: 10px; min-height: 40pt; ">
<span style="float: left; color: #e67206; font-size: 40pt; display:block; width: 50pt; height: 40pt; text-align:center; line-height: 40pt;"></span><p style="vertical-align: middle;">Innerhalb der nächsten 7 Tage ist eine Wartung geplant.</p>
</div>
{% endif -%}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment