src/Aqarmap/Bundle/ListingBundle/Resources/views/Listing/compoundUnits.html.twig line 1

Open in your IDE?
  1. {% set isRTL = app.request.get('_locale') == 'ar'  %}
  2. {% set primaryActiveClass = hasPrimaryUnits ? 'active': '' %}
  3. {% set allowActiveResale = not hasPrimaryUnits and hasResaleUnits %}
  4. {% set resaleActiveClass = allowActiveResale ? 'active': '' %}
  5. {% set allowActiveRent = not hasPrimaryUnits and not allowActiveResale and hasRentUnits %}
  6. {% set rentActiveClass = allowActiveRent ? 'active': '' %}
  7. {% set resaleEvent = [{'isFired':true , 'trigger': 'gtm-btn-resale-tab-click' }] %}
  8. {% set primaryEvent = [{'isFired':true , 'trigger': 'gtm-btn-primary-tab-click' }] %}
  9. {% set rentEvent = [{'isFired':true , 'trigger': 'gtm-btn-rent-tab-click' }] %}
  10. {% set tableHeight = 188 %}
  11. {% set unitsLimit = 5 %}
  12. {% set listingSlug = listing.slug %}
  13. {% if not isPrimaryUnitsOnly %}
  14.     <ul class="nav nav-justified units-tabs" id="pills-tab" role="tablist">
  15.         <li class="nav-item units-tabs__item">
  16.             <span class="{{primaryActiveClass}} units-tabs__link large-element-tab mb-0" id="pills-primary-tab" data-toggle="pill" href="#pills-primary" role="tab" aria-controls="pills-primary" aria-selected="true"
  17.                 onclick="elementEvents.fireGTM('', '', {{ primaryEvent|json_encode() }})">
  18.                 {{'compound_units.primary'|trans}}
  19.             </span>
  20.         </li>
  21.         {% if hasResaleUnits %}
  22.             <li class="nav-item units-tabs__item">
  23.                 <span class="{{resaleActiveClass}} units-tabs__link large-element-tab mb-0" id="pills-resale-tab" data-toggle="pill" href="#pills-resale" role="tab" aria-controls="pills-resale" aria-selected="false"
  24.                     onclick="elementEvents.fireGTM('', '', {{ resaleEvent|json_encode() }})">
  25.                     {{'compound_units.resale'|trans}}
  26.                 </span>
  27.             </li>
  28.         {% endif %}    
  29.         {% if hasRentUnits %}
  30.             <li class="nav-item units-tabs__item">
  31.                 <span class="{{rentActiveClass}} units-tabs__link large-element-tab mb-0" id="pills-rent-tab" data-toggle="pill" href="#pills-rent" role="tab" aria-controls="pills-rent" aria-selected="false"
  32.                     onclick="elementEvents.fireGTM('', '', {{ rentEvent|json_encode() }})">
  33.                     {{'compound_units.rent'|trans}}
  34.                 </span>
  35.             </li>
  36.         {% endif %}   
  37.     </ul>
  38. {% endif %}   
  39. <div class="tab-content" id="pills-tabContent">
  40.     <div class="tab-pane {{primaryActiveClass}}" id="pills-primary" role="tabpanel" aria-labelledby="pills-primary-tab">
  41.         {% if isPrimarySoldOutCta %}
  42.             {% include "@AqarmapListing/Listing/soldOutCta.html.twig" %}
  43.         {% else %}
  44.             <div class="properties-container">
  45.                 {% for properties in liveUnitsPaginated %}
  46.                     {% set units = properties.propertyTypeChildren %}
  47.                     {% set isShowMoreEnabled = units|length > unitsLimit %}
  48.                     {% set largeElementParent = isShowMoreEnabled ?  'large-element-parent' : ''%}
  49.                     {% set largeElement = isShowMoreEnabled ?  'large-element' : ''%}
  50.                     <div class="units-container  {{largeElementParent}}">
  51.                         <div class="units-list-container mb-0">
  52.                             <p class="units-container__title">{{ properties.title }}</p>
  53.                             <div class="units-list {{largeElement}}" data-height="{{tableHeight}}">
  54.                                 {% for unit in  units %}
  55.                                     {% set unitUrl = listingSlug ? path('listing_slug', {'id': unit.id, 'slug':listingSlug})  :  path('listing_view', {'id': unit.id}) %}
  56.                                     <a class=' units-list__item unit' href='{{ unitUrl }}' target="_blank">
  57.                                         <p class="unit__area border-0 px-0">{{ unit.area }} {{ get_setting('general', 'measurement_unit')|trans }}</p>
  58.                                         <p class="d-flex justify-content-end align-items-center">
  59.                                             <span class="unit__price">
  60.                                                 {{ unit.price|number_format }} {{ get_setting('general', 'currency')|trans }}
  61.                                             </span>
  62.                                             {% if isRTL %}
  63.                                                 <i class="fa fa-chevron-left unit__redirect-arrow"></i>
  64.                                             {% else %}    
  65.                                                 <i class="fa fa-chevron-right unit__redirect-arrow"></i>
  66.                                             {% endif %}   
  67.                                         </p>
  68.                                     </a>
  69.                                 {% endfor %}
  70.                             </div>
  71.                         </div>
  72.                         {% if isShowMoreEnabled %}
  73.                             <a href="javascript:void(0)" class="see-more see-more-paragraph-button"
  74.                             data-seeMore="
  75.                             {{ 'listing.show_more'|trans }}
  76.                             <i class='fa fa-chevron-down see-more__arrow'></i>" 
  77.                             data-seeLess="{{ 'listing.show_less'|trans }}
  78.                             <i class='fa fa-chevron-up see-more__arrow'></i>">
  79.                             </a>
  80.                         {% endif %}   
  81.                     </div>
  82.                 {% endfor %}
  83.             </div>
  84.         {% endif %}
  85.     </div>
  86.     {% if hasResaleUnits %}
  87.         <div class="tab-pane {{resaleActiveClass}}" id="pills-resale" role="tabpanel" aria-labelledby="pills-resale-tab">
  88.             <div class="properties-container">
  89.                 {% for properties in resaleUnitsPaginated %}
  90.                     {% set units = properties.propertyTypeChildren %}
  91.                     {% set isShowMoreEnabled = units|length > unitsLimit %}
  92.                     {% set largeElementParent = isShowMoreEnabled ?  'large-element-parent' : ''%}
  93.                     {% set largeElement = isShowMoreEnabled ?  'large-element' : ''%}
  94.                     <div class="units-container  {{largeElementParent}}">
  95.                         <div class="units-list-container mb-0">
  96.                             <p class="units-container__title">{{ properties.title }}</p>
  97.                             <div class="units-list {{largeElement}}" data-height="{{tableHeight}}">
  98.                                 {% for unit in  units %}
  99.                                     {% set unitUrl = listingSlug ? path('listing_slug', {'id': unit.id, 'slug':listingSlug})  :  path('listing_view', {'id': unit.id}) %}
  100.                                     <a class='units-list__item unit' href='{{ unitUrl }}' target="_blank">
  101.                                         <p class="unit__area border-0 px-0">{{ unit.area }} {{ get_setting('general', 'measurement_unit')|trans }}</p>
  102.                                         <p class="d-flex justify-content-end align-items-center">
  103.                                             <span class="unit__price">
  104.                                                 {{ unit.price|number_format }} {{ get_setting('general', 'currency')|trans }}
  105.                                             </span>
  106.                                             {% if isRTL %}
  107.                                                 <i class="fa fa-chevron-left unit__redirect-arrow"></i>
  108.                                             {% else %}    
  109.                                                 <i class="fa fa-chevron-right unit__redirect-arrow"></i>
  110.                                             {% endif %}   
  111.                                         </p>
  112.                                     </a>
  113.                                 {% endfor %}
  114.                             </div>
  115.                         </div>
  116.                         {% if isShowMoreEnabled %}
  117.                             <a href="javascript:void(0)" class="see-more see-more-paragraph-button"
  118.                             data-seeMore="
  119.                             {{ 'listing.show_more'|trans }}
  120.                             <i class='fa fa-chevron-down see-more__arrow'></i>" 
  121.                             data-seeLess="{{ 'listing.show_less'|trans }}
  122.                             <i class='fa fa-chevron-up see-more__arrow'></i>">
  123.                             </a>
  124.                         {% endif %}   
  125.                     </div>
  126.                 {% endfor %}
  127.             </div>
  128.         </div>
  129.     {% endif %}
  130.     {% if hasRentUnits %}
  131.         <div class="tab-pane  {{rentActiveClass}} " id="pills-rent" role="tabpanel" aria-labelledby="pills-rent-tab">
  132.             <div class="properties-container">
  133.                 {% for properties in rentUnitsPaginated %}
  134.                     {% set units = properties.propertyTypeChildren %}
  135.                     {% set isShowMoreEnabled = units|length > unitsLimit %}
  136.                     {% set largeElementParent = isShowMoreEnabled ?  'large-element-parent' : ''%}
  137.                     {% set largeElement = isShowMoreEnabled ?  'large-element' : ''%}
  138.                     <div class="units-container  {{largeElementParent}}">
  139.                         <div class="units-list-container mb-0">
  140.                             <p class="units-container__title">{{ properties.title }}</p>
  141.                             <div class="units-list {{largeElement}}" data-height="{{tableHeight}}">
  142.                                 {% for unit in  units %}
  143.                                     {% set unitUrl = listingSlug ? path('listing_slug', {'id': unit.id, 'slug':listingSlug})  :  path('listing_view', {'id': unit.id})%}
  144.                                     <a class='units-list__item unit' href='{{ unitUrl }}' target="_blank">
  145.                                         <p class="unit__area border-0 px-0">{{ unit.area }} {{ get_setting('general', 'measurement_unit')|trans }}</p>
  146.                                         <p class="d-flex justify-content-end align-items-center">
  147.                                             <span class="unit__price">
  148.                                             {{ unit.price != 0 ? unit.price|number_format ~ ' ' ~ get_setting('general', 'currency')|trans : 'listing.call_for_price'|trans }}
  149.                                             </span>
  150.                                             {% if isRTL %}
  151.                                                 <i class="fa fa-chevron-left unit__redirect-arrow"></i>
  152.                                             {% else %}    
  153.                                                 <i class="fa fa-chevron-right unit__redirect-arrow"></i>
  154.                                             {% endif %}    
  155.                                         </p>
  156.                                     </a>
  157.                                 {% endfor %}
  158.                             </div>
  159.                         </div>
  160.                         {% if isShowMoreEnabled %}
  161.                             <a href="javascript:void(0)" class="see-more see-more-paragraph-button"
  162.                             data-seeMore="
  163.                             {{ 'listing.show_more'|trans }}
  164.                             <i class='fa fa-chevron-down see-more__arrow'></i>" 
  165.                             data-seeLess="{{ 'listing.show_less'|trans }}
  166.                             <i class='fa fa-chevron-up see-more__arrow'></i>">
  167.                             </a>
  168.                         {% endif %}    
  169.                     </div>
  170.                 {% endfor %}
  171.             </div>
  172.         </div>
  173.     {% endif %}    
  174. </div>