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

Open in your IDE?
  1. {% set EXPIRED_LISTING_STATUS = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingStatus::EXPIRED') %}
  2. {% set USER_DELETED_LISTING_STATUS = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\ListingStatus::USER_DELETED') %}
  3. {% set isValidListing = not listing.status in ([EXPIRED_LISTING_STATUS, USER_DELETED_LISTING_STATUS]) %}
  4. {% set isListingOwner = is_granted("ROLE_OWNER", listing) %}
  5. {% set listingMetaTitle = listing.metaTitle ? listing.metaTitle : ""  %}
  6. {% set listingTitle = listing.title ? listing.title : listingMetaTitle %}
  7. {% set hasLastUpdatedDate = listing.isProjectOrUnit %}
  8. {% set hasPublishedDate = listing.publishedAt is not null %}
  9. {% set isCompoundHasLastUpdatedDate = listing.compoundField and listing.compoundField.updatedAt %}
  10. <div class="listing-details-page__project-title-section">
  11.     <span hidden itemprop="url">{{ url(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) }}</span>
  12.     {# Publish date #}
  13.     <div class="listing-details-page__title-section__sub">
  14.         <span>
  15.             {{ listing.propertyType.title }}
  16.         </span>
  17.         {% if hasLastUpdatedDate %}
  18.             {% set lastUpdate = listing.isProject ? isCompoundHasLastUpdatedDate ? listing.compoundField.updatedAt : listing.updatedAt : listing.parent.updatedAt %}
  19.             <i class="mx-1">.</i>
  20.             <span class="m-0">
  21.                 {{ lastUpdate|date("d-m-Y")|localizeddate('long', 'none') }}
  22.             </span>
  23.         {% elseif hasPublishedDate %}
  24.             <i class="mx-1">.</i>
  25.             <span class="m-0">
  26.                 {{ listing.publishedAt|date("d-m-Y")|localizeddate('long', 'none') }}
  27.             </span>
  28.         {% endif %}
  29.     </div>
  30.     {# Title container #}
  31.     <h1 class="listing-details-page__project-title-section__title __default_font_family" itemprop="name">
  32.         {{ listingTitle|striptags|fixArabicNumbers|raw }}
  33.         {% if isValidListing %}
  34.             {% if isListingOwner %} 
  35.                 <a class="_link" href="{{ path('listing_edit', {'id': listing.id}) }}">
  36.                     {{ 'layout.edit_Listing'|trans }}
  37.                 </a>
  38.             {% endif %}
  39.         {% endif %}
  40.     </h1>
  41.     {# Location container #}
  42.     <p itemprop="address" class="listing-details-page__project-title-section__address">
  43.         <img
  44.             src="/images/BrandsIcons/listing/ic_location.svg"
  45.             class="listing-details-page__project-title-section__address-icon"
  46.             width="24" height="24"
  47.         />
  48.         {% if not listing.isProject %}
  49.             <a class="text-inherit"
  50.                 href="{{ generate_search_url(
  51.                     {
  52.                         'section': listing.section.id,
  53.                         'propertyType': listing.propertyType.id,
  54.                         'location': listing.location.id
  55.                     }
  56.                 ) }}">
  57.                 {{ listing.address }}
  58.             </a>
  59.         {% else %}
  60.             {{ listing.address }}
  61.         {% endif %}
  62.     </p>
  63.     {# Price container #}
  64.     {% set hasMinimumUnitPrice = listing.compoundField and listing.compoundField.minPrice %}
  65.     <div class="listing-details-page__project-title-section__starting-price">
  66.         {% if hasMinimumUnitPrice %}
  67.             {{ 'listing.starting_from'|trans }}
  68.             <span class="integer">
  69.                 {{ listing.compoundField.minPrice|number_format }}
  70.             </span>
  71.             <span class="mx-2">
  72.                 {{ get_setting('general', 'currency')|trans }}
  73.             </span>
  74.         {% else %}
  75.             {{ 'listing.call_for_price'|trans }}
  76.         {% endif %}
  77.     </div>
  78. </div>