templates/block/timer.html.twig line 1

Open in your IDE?
  1. {% if timer.id %}
  2.     {% set days = ((timer.end - "now"|date('U'))/60/60/24)|round(0, 'floor') %}
  3.     {% if (days % 10) in [2, 3, 4] and not((days % 100 in [11, 12, 13, 14])) %}
  4.         {% set days = days ~ ' ' ~ labels.get('plural-day-2')|raw ~ ' ' %}
  5.     {% elseif (days % 10) == 1 and days != 11 %}
  6.         {% set days = days ~ ' ' ~ labels.get('plural-day-1')|raw ~ ' ' %}
  7.     {% else %}
  8.         {% set days = days ~ ' ' ~ labels.get('plural-day-5')|raw ~ ' ' %}
  9.     {% endif %}
  10.     <div class="top-action" style="background: url('/pic/timerbg/{{ app.request.locale }}/{{ timer.id }}.jpg')"{% if timer.href %} data-href="{{ timer.href }}"{% endif %}>
  11.         <div class="container">
  12.             <div class="row">
  13.                 <div class="col-md-8 col-xs-8 ta-1">
  14.                     <div class="hidden-xs"><a href="{{ timer.href }}"><img src="/pic/timer/{{ app.request.locale }}/{{ timer.id }}.jpg" alt=""></a></div>
  15.                     <div class="visible-xs"><a href="{{ timer.href }}">{{ timer.name }}</a></div>
  16.                 </div>
  17.                 <div class="col-md-4 col-xs-4 ta-2"><div class="timer"{{ timer.color ? (' style="color:#' ~ timer.color ~ '"')|raw : '' }} data-days="{{ days }}" data-data="{{ timer.end|date('Y/m/d H:i:s') }}"></div></div>
  18.             </div>
  19.         </div>
  20.     </div>
  21. {% endif %}