templates/Default/odpage/_summary.html.twig line 1

Open in your IDE?
  1. {% if seoOd.stat is not null %}
  2.     {% set stat = seoOd.stat %}
  3.     <section class="panel">
  4.         {# @var \App\Entity\model\StatPriceDuration stat #}
  5.         <h2 class="panel-heading">
  6.             {% if transport == 'bus' %}
  7.                 {{ 'bus.odpage.summary.h2' | trans(seoOd.transParams) }}
  8.             {% elseif transport == 'train' %}
  9.                 {{ 'train.odpage.summary.h2' | trans(seoOd.transParams) }}
  10.             {% elseif transport == 'flight' %}
  11.                 {{ 'flight.odpage.summary.h2' | trans(seoOd.transParams) }}
  12.             {% elseif transport == 'carpooling' %}
  13.                 {{ 'carpooling.odpage.summary.h2' | trans(seoOd.transParams) }}
  14.             {% endif %}
  15.         </h2>
  16.         <div class="panel-body">
  17.             <div class="row">
  18.                 <div class="col-md-7">
  19.                     <table class="table1 info-route">
  20.                         {% if transport == 'bus' %}
  21.                             <tr>
  22.                                 <td><strong>{{ 'bus.odpage.summary.minprice'| trans }}</strong></td>
  23.                                 <td>{{ stat.priceMin | cb_niceprice(seoOd.currency, 'round') }}</td>
  24.                             </tr>
  25.                             <tr>
  26.                                 <td><strong>{{ 'bus.odpage.summary.maxprice'| trans }}</strong></td>
  27.                                 <td>{{ stat.priceMax | cb_niceprice(seoOd.currency, 'round') }}</td>
  28.                             </tr>
  29.                             <tr>
  30.                                 <td><strong>{{ 'bus.odpage.summary.duration'| trans }}</strong></td>
  31.                                 <td>{{ stat.durationMin | cb_niceduration }}</td>
  32.                             </tr>
  33.                             <tr>
  34.                                 <td><strong>{{ 'bus.odpage.summary.operated'| trans }}</strong></td>
  35.                                 <td>{{ seoOd.companiesName | join(', ') }}</td>
  36.                             </tr>
  37.                             <tr>
  38.                                 <td><strong>{{ 'bus.odpage.summary.distance' | trans }}</strong></td>
  39.                                 <td>{{ seoOd.distanceNice }}</td>
  40.                             </tr>
  41.                         {% elseif transport == 'train' %}
  42.                             <tr>
  43.                                 <td><strong>{{ 'train.odpage.summary.minprice'| trans(seoOd.transParams) }}</strong></td>
  44.                                 <td>{{ stat.priceMin | cb_niceprice(seoOd.currency, 'round') }}</td>
  45.                             </tr>
  46.                             <tr>
  47.                                 <td><strong>{{ 'train.odpage.summary.maxprice'| trans(seoOd.transParams) }}</strong></td>
  48.                                 <td>{{ stat.priceMax | cb_niceprice(seoOd.currency, 'round') }}</td>
  49.                             </tr>
  50.                             <tr>
  51.                                 <td><strong>{{ 'train.odpage.summary.duration'| trans(seoOd.transParams) }}</strong></td>
  52.                                 <td>{{ stat.durationMin | cb_niceduration }}</td>
  53.                             </tr>
  54.                             <tr>
  55.                                 <td><strong>{{ 'train.odpage.summary.operated'| trans(seoOd.transParams) }}</strong></td>
  56.                                 <td>{{ seoOd.companiesName | default('') |join(', ') }}</td>
  57.                             </tr>
  58.                             <tr>
  59.                                 <td><strong>{{ 'train.odpage.summary.distance' | trans(seoOd.transParams) }}</strong></td>
  60.                                 <td>{{ seoOd.distanceNice }}</td>
  61.                             </tr>
  62.                         {% elseif transport == 'flight' %}
  63.                             <tr>
  64.                                 <td><strong>{{ 'flight.odpage.summary.minprice'| trans(seoOd.transParams) }}</strong></td>
  65.                                 <td>{{ stat.priceMin | cb_niceprice(seoOd.currency, 'round') }}</td>
  66.                             </tr>
  67.                             <tr>
  68.                                 <td><strong>{{ 'flight.odpage.summary.maxprice'| trans(seoOd.transParams) }}</strong></td>
  69.                                 <td>{{ stat.priceMax | cb_niceprice(seoOd.currency, 'round') }}</td>
  70.                             </tr>
  71.                             <tr>
  72.                                 <td><strong>{{ 'flight.odpage.summary.duration'| trans(seoOd.transParams) }}</strong></td>
  73.                                 <td>{{ stat.durationMin | cb_niceduration }}</td>
  74.                             </tr>
  75.                             <tr>
  76.                                 <td><strong>{{ 'flight.odpage.summary.operated'| trans(seoOd.transParams) }}</strong></td>
  77.                                 <td>{{ seoOd.companiesName | default('') |join(', ') }}</td>
  78.                             </tr>
  79.                             <tr>
  80.                                 <td><strong>{{ 'flight.odpage.summary.distance' | trans(seoOd.transParams) }}</strong></td>
  81.                                 <td>{{ seoOd.distanceNice }}</td>
  82.                             </tr>
  83.                         {% elseif transport == 'carpooling' %}
  84.                             <tr>
  85.                                 <td><strong>{{ 'carpooling.odpage.summary.minprice'| trans(seoOd.transParams) }}</strong></td>
  86.                                 <td>{{ stat.priceMin | cb_niceprice(seoOd.currency, 'round') }}</td>
  87.                             </tr>
  88.                             <tr>
  89.                                 <td><strong>{{ 'carpooling.odpage.summary.maxprice'| trans(seoOd.transParams) }}</strong></td>
  90.                                 <td>{{ stat.priceMax | cb_niceprice(seoOd.currency, 'round') }}</td>
  91.                             </tr>
  92.                             <tr>
  93.                                 <td><strong>{{ 'carpooling.odpage.summary.duration'| trans(seoOd.transParams) }}</strong></td>
  94.                                 <td>{{ stat.durationMin | cb_niceduration }}</td>
  95.                             </tr>
  96.                             <tr>
  97.                                 <td><strong>{{ 'carpooling.odpage.summary.operated'| trans(seoOd.transParams) }}</strong></td>
  98.                                 <td>{{ seoOd.companiesName | default('') |join(', ') }}</td>
  99.                             </tr>
  100.                             <tr>
  101.                                 <td><strong>{{ 'carpooling.odpage.summary.distance' | trans(seoOd.transParams) }}</strong></td>
  102.                                 <td>{{ seoOd.distanceNice }}</td>
  103.                             </tr>
  104.                         {% endif %}
  105.                     </table>
  106.                 </div>
  107.                 <div class="col-md-5">
  108.                     {% if seoOd.img is not null %}
  109.                         <img src="{{ seoOd.img.src }}" alt="{{ seoOd.img.alt }}" />
  110.                     {% endif %}
  111.                 </div>
  112.                 <div itemscope itemtype="http://schema.org/Product">
  113.                     <meta itemprop="name"
  114.                           content="{{ transport~'.odpage.microdata.product' | trans(seoOd.transParams) }}"/>
  115.                     <div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
  116.                         <meta itemprop="price" content="{{ (stat.priceMin/100) |number_format(2) }}"/>
  117.                         <meta itemprop="priceCurrency" content="{{ seoOd.currency }}"/>
  118.                         <meta itemprop="availability" content="http://schema.org/InStock"/>
  119.                     </div>
  120.                     <div itemprop="offers" itemscope itemtype="http://schema.org/AggregateOffer">
  121.                         <meta itemprop="lowPrice" content="{{ (stat.priceMin/100) |number_format(2) }}"/>
  122.                         <meta itemprop="highPrice" content="{{ (stat.priceMax/100) |number_format(2) }}"/>
  123.                         <meta itemprop="priceCurrency" content="{{ seoOd.currency }}"/>
  124.                         <meta itemprop="availability" content="http://schema.org/InStock"/>
  125.                     </div>
  126.                 </div>
  127.             </div>
  128.         </div>
  129.     </section>
  130. {% endif %}