src/Aqarmap/Bundle/NeighborhoodBundle/Resources/views/Default/index.html.twig line 1

Open in your IDE?
  1. {% extends "base.html.twig" %}
  2. {% form_theme quick_registration_form 'Form/form_div_layout.html.twig' %}
  3. {% set canonical_url = url(app.request.get('_route'), app.request.get('_route_params')) %}
  4. {% set SEND_MESSAGE_CONSTANT = constant('Aqarmap\\Bundle\\ListingBundle\\Constant\\LeadTypes::SEND_MESSAGE') %}
  5. {# Page title #}
  6. {% block title %} {{ "%s - %s | %s"|format(location.title, 'neighborhoods.prices_guide'|trans, 'layout.app_name'|trans) }}{% endblock %}
  7. {# Meta Description #}
  8. {% block meta_description %}{{ location.description }}{% endblock %}
  9. {% block htmlhead %}
  10.     <link rel="alternate" hreflang="ar" href="{{ url(app.request.get('_route'), app.request.get('_route_params')|merge({'_locale': 'ar'})) }}" />
  11.     <link rel="alternate" hreflang="en" href="{{ url(app.request.get('_route'), app.request.get('_route_params')|merge({'_locale': 'en'})) }}" />
  12.     <link rel="alternate" hreflang="x-default"
  13.         href="{{ url(app.request.get('_route'), app.request.get('_route_params')|merge({'_locale': 'ar'})) }}"/>
  14.     <meta name="twitter:card" content="summary_large_image" />
  15.     <meta name="twitter:site" content="{{ "%s%s"|format('@', 'layout.app_name'|trans) }}" />
  16.     <meta name="twitter:creator" content="{{ "%s%s"|format('@', 'layout.app_name'|trans) }}" />
  17.     <meta property="og:title" content="{{ "%s.%s.%s"|format('layout.app_name'|trans, 'neighborhoods.prices_guide'|trans, location.title) }}"/>
  18.     <meta property="og:description" content="{{ 'neighborhoods.sharing.description_location'|trans({'%location%': location.title}) }}" />
  19.     <meta property="og:image" content="{% if location.mainPhoto %}{{ custom_vich_uploader_asset(location.mainPhoto.file, 'file') | thumbnail('large')}}{% endif %}" />
  20.     <meta property="og:url" content="{{ url('neighborhood_main_page', {'location_slug': location.slug}) }}" />
  21.     <meta property="og:site_name" content="{{ 'layout.app_name'|trans }}" />
  22.     <meta property="fb:app_id" content="{{ facebook_app_id }}"/>
  23.     {% if location.disabled %}
  24.         <meta name="robots" content="noindex, nofollow">
  25.     {% endif %}
  26.     <link rel="canonical" href="{{ canonical_url }}"/>
  27. {% endblock %}
  28. {% block body %}
  29.     {% set sharingEvent = "neighborhood" %}
  30.     {% set topSellerTrigger = 'gtm-action-topsellers-lead-price-guide' %}
  31.     {% set topSellerEventAction = 'Top Sellers Price Guide' %}
  32.     <section id="{{ app.request.get('_route') }}">
  33.         <div class="container">
  34.             <div class="row">
  35.                 <div class="col-md-12 hidden-xs">
  36.                     <div class="pull-left flip">
  37.                         {% if location.compoundFilter %}
  38.                             {% set compound = 1  %}
  39.                         {% else %}
  40.                             {% set compound = null  %}
  41.                         {% endif %}
  42.                         {% set neighborhood_breadcrumb = knp_menu_get( 'aqarmap.neighborhood.breadcrumb' , [], {"location": location , "compound": compound}) %}
  43.                         {{ knp_menu_render(neighborhood_breadcrumb , {
  44.                             'allow_safe_labels': true,
  45.                             'template': 'knp_breadcrumbs.html.twig',
  46.                             'currentAsLink': true,
  47.                             'currentClass': 'active'
  48.                         }) }}
  49.                     </div>
  50.                     <div class="pull-right flip">
  51.                         {% if app.user %}
  52.                             {% if  subscribedUser %}
  53.                                 <a  id="un-subscribe-btn" class="btn" href="{{ path('neighbourhood_remove_subscriber', {'location': location.id}) }}"> {{ "neighborhoods.unsubscribe"|trans }}</a>
  54.                             {% else %}
  55.                                 <a id="subscribe-btn" class="btn" href="{{ path('neighbourhood_add_subscriber', {'location': location.id}) }}"> {{ "neighborhoods.subscribe"|trans }}</a>
  56.                             {% endif %}
  57.                         {% endif %}
  58.                     </div>
  59.                 </div>
  60.             </div>
  61.         </div><!-- end of .container (cover & breadcrumb) -->
  62.         {% if location_statistics and isStatisticsContainsAveragePrice %}
  63.             {% include '@AqarmapNeighborhoodBundle/neighborhoodAveragePrices.html.twig' %}
  64.         {% endif %}
  65.         {% if location.getChildren|length > 0 %}
  66.             {% include '@AqarmapNeighborhoodBundle/neighborhoodSubLocations.html.twig' %}
  67.         {% endif %}
  68.         {% if location_statistics %}
  69.             {% include '@AqarmapNeighborhoodBundle/neighborhoodStatistics.html.twig' %}
  70.         {% endif %}
  71.         {% if location.rating %}
  72.             {% include '@AqarmapNeighborhoodBundle/neighborhoodRatings.html.twig' %}
  73.         {% endif %}
  74.         {# Description & Photos #}
  75.         {% if location.description or location.photos.count > 0 %}
  76.             {% include "@AqarmapNeighborhoodBundle/neighborhoodDetails.html.twig" %}
  77.         {% endif %}
  78.         {% if isEnabledFeature('web.sharing.page') %}
  79.             <div class="container">
  80.                 <div class="listing-share-box" id="shareLiveListing">
  81.                     <label class="share-header-mob">
  82.                         {{ 'neighborhoods.share_neighborhoods'|trans({'%location%': location.title |trans})  }}
  83.                     </label>
  84.                     {% include '@AqarmapListingBundle/Listing/elementShareContent.html.twig' with {'url': app.request.uri} %}
  85.                 </div>
  86.                 <a class="listing-share-btn-container neighborhood-share-btn-container stickPermanent borderLight" data-toggle="modal" data-target="#neighborhoodShareModal">
  87.                     <span class="container btn-wrapper">
  88.                         <label>{{ location.title }}</label>
  89.                         <span class="btn btn-default btn-share">
  90.                             <i class="fa fa-share-alt"></i>
  91.                             {{ 'layout.share'|trans }}
  92.                         </span>
  93.                     </span>
  94.                 </a>
  95.             </div>
  96.         {% endif %}
  97.         {% if location and isEnabledFeature('web.topsellers.section') %}
  98.         <div class="container">
  99.             <div class="row">
  100.                 <div class="col">
  101.                     <div class="top-sellers-warp-cards w-100">
  102.                         {% include "@AqarmapListing/ListingSearch/topSellersResponsive.html.twig"  with {'trigger': topSellerTrigger, 'eventAction': topSellerEventAction, leadSourcePage: 'price_guide'} %}
  103.                     </div>
  104.                 </div>
  105.             </div>
  106.         </div>
  107.             <div ng-controller="listingLeadsWizardController" ng-init="initFormWizard()">
  108.                 {{ include('@AqarmapUserBundle/User/listingMultiStepLeadModal.html.twig') }}
  109.             </div>
  110.         {% endif %}
  111.         {# Neighborhood  Discussions #}
  112.         {% if get_setting('features', 'discussions')  %}
  113.             {% include "@AqarmapNeighborhoodBundle/neighborhoodDiscussions.html.twig" %}
  114.         {% endif %}
  115.         {# Neighborhood Compund #}
  116.         {% if location.compoundFilter %}
  117.             {% if location.locationCompound %}
  118.                 <div class="container">
  119.                     <div class="page-header">
  120.                         <h1>
  121.                             {{ 'neighborhoods.information'|trans({'%location%': location.title |trans})  }}
  122.                         </h1>
  123.                     </div>
  124.                     <div class="row">
  125.                         <div class="col-xs-12">
  126.                             <table class="table table-responsive table-bordered compound_info">
  127.                                 <tbody>
  128.                                 <tr>
  129.                                     <td class="compound_info_title" ><p class="block-label">{{ 'neighborhoods.compound.developer_name'|trans }}</p></td>
  130.                                     <td><p class="block-label">{% if location.locationCompound.developerName  %}{{ location.locationCompound.developerName }}{% else %} -- {% endif %}</p></td>
  131.                                     <td class="compound_info_title"><p class="block-label">{{ 'neighborhoods.compound.project_size'|trans }}</p></td>
  132.                                     <td><p class="block-label">{% if location.locationCompound.projectSize  %}{{ location.locationCompound.getProjectSize() }}{% else %} -- {% endif %}</p></td>
  133.                                 </tr>
  134.                                 <tr>
  135.                                     <td class="compound_info_title" ><p class="block-label">{{ 'neighborhoods.compound.units_count'|trans }}</p></td>
  136.                                     <td><p class="block-label">{% if location.locationCompound.unitsCount  %}{{ location.locationCompound.unitsCount|fixArabicNumbers|raw }}{% else %} -- {% endif %}</p></td>
  137.                                     <td class="compound_info_title" ><p class="block-label">{{ 'neighborhoods.compound.state'|trans }}</p></td>
  138.                                     <td><p class="block-label">{% if location.locationCompound.state  %}{{ getCompoundStatusLabel(location.locationCompound.state)|trans }}{% else %} -- {% endif %}</p></td>
  139.                                 </tr>
  140.                                 </tbody>
  141.                             </table>
  142.                         </div>
  143.                     </div>
  144.                 </div>
  145.             {% endif %}
  146.             {% if location.listing %}
  147.                 {% if location.listing.liveChildren is defined and location.listing.liveChildren is not empty %}
  148.                     <div class="container">
  149.                         <div class="page-header">
  150.                             <h1>
  151.                                 {{ 'neighborhoods.units'|trans({'%location%': location.title |trans})  }}
  152.                             </h1>
  153.                         </div>
  154.                         <div class="row">
  155.                             <div class="col-xs-12">
  156.                                 {% include '@AqarmapListingBundle/Listing/units-table.html.twig' with {'units': location.listing.liveChildren} %}
  157.                             </div>
  158.                         </div>
  159.                     </div>
  160.                 {% endif %}
  161.             {% endif %}
  162.         {% endif %}
  163.         {# Compound send contact form #}
  164.         {% if location.compoundFilter %}
  165.             {% if location.listing %}
  166.                 <div class="neighborhood-contact-seller listingSideForm" ng-controller="listingDetailsController" >
  167.                     <div  class="container">
  168.                         <div class="page-header">
  169.                             <h1>{{ 'neighborhoods.compound.contact_developer'|trans }}</h1>
  170.                         </div>
  171.                         {{ form_start(contact_seller_form) }}
  172.                         {{ form_row(contact_seller_form.subject, {value : 'Re: '~ location.listing.title|title|striptags}) }}
  173.                         {{ form_widget(contact_seller_form.message, {attr: {class: 'form-control','placeholder': "neighborhoods.compound.contact_seller_message_placeholder"|trans, 'ng-model': 'sellerMessageContent'}}) }}
  174.                         <button type="submit"  class="btn btn-primary btn-sm  pull-right flip mb-2" data-gtm-listing-id="{{ location.listing.id }}" ng-click="sendEmailtoSeller($event, '{{ location.listing.id }}', '{{ SEND_MESSAGE_CONSTANT }}' )" ng-disabled="contact_seller.$invalid" onclick="gtmPushAction('gtm-btn-listing-message', 'Email')">
  175.                             <span class="fa fa-paper-plane"></span>&nbsp;&nbsp;{{ 'listing.send_message'|trans }}
  176.                         </button>
  177.                         {{ form_end(contact_seller_form) }}
  178.                     </div>
  179.                 </div>
  180.             {% endif %}
  181.         {% endif %}
  182.         {# Nearest Neighbourhoods #}
  183.         {% if nearestNeighbourhoods|length > 0 %}
  184.             {% include "@AqarmapNeighborhoodBundle/neighbourhoodsFeaturedSection.html.twig" %}
  185.         {% endif %}
  186.         <div class="container">
  187.             <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 mobile-breadcrumb visible-sm visible-xs">
  188.                 {% set NEIGHBORHOOD_BREADCRUMB = knp_menu_get('aqarmap.neighborhood.breadcrumb', [], {
  189.                     location: location,
  190.                     compound: compound
  191.                 }) %}
  192.                 {{
  193.                 knp_menu_render(NEIGHBORHOOD_BREADCRUMB , {
  194.                     'allow_safe_labels': true,
  195.                     'template': 'knp_breadcrumbs.html.twig',
  196.                     'currentAsLink': true,
  197.                     'currentClass': 'active',
  198.                 })
  199.                 }}
  200.             </div>
  201.         </div>
  202.         <div class="container">
  203.             <div class="discussions col-md-12">
  204.                 <div class="tab-content searchResultsContainer interested-listings subsLinks more-locations-container">
  205.                     {% include "@AqarmapMainBundle/Default/locationsSubLinks.html.twig" %}
  206.                 </div>
  207.             </div>
  208.         </div>
  209.     </section>
  210.     {% if isEnabledFeature('web.sharing.page') %}
  211.         {% include "@AqarmapNeighborhoodBundle/neighborhoodSharing.html.twig" %}
  212.     {% endif %}
  213. {% endblock %}
  214. {% block footer %}
  215.     {% include "footer.v2.html.twig" %}
  216. {% endblock %}
  217. {% block javascripts %}
  218.     {{ parent() }}
  219.     <script>
  220.         {# Graph Data #}
  221.         var months = [];
  222.         var dataSets = [];
  223.         var avg_price_data = [];
  224.         var propety_type_title ;
  225.         var property_type_color ;
  226.         {% for history in historyData %}
  227.             propety_type_title = "{{ history['title'] }}";
  228.                 {% for data in history['data']['average_price'] %}
  229.                     {% if data['value'] %}
  230.                         avg_price_data.push({{ data['value']  }});
  231.                         months.push("{{ data['date']|localizeddate('none', 'none', app.request.locale, null, "MMMM") ~ "-" ~ data['date']|date("Y") }}");
  232.                     {% endif %}
  233.                 {% endfor %}
  234.             {% if loop.index == 2  %}
  235.                 property_type_color = '#f38b00';
  236.             {% else %}
  237.                 property_type_color = '#0080bb';
  238.             {% endif %}
  239.             dataSets.push({
  240.                 label: propety_type_title,
  241.                 fill: false,
  242.                 lineTension: 0.1,
  243.                 backgroundColor: property_type_color,
  244.                 borderColor: property_type_color,
  245.                 borderCapStyle: 'round',
  246.                 borderDash: [],
  247.                 borderDashOffset: 0.0,
  248.                 borderJoinStyle: 'miter',
  249.                 pointBorderColor: property_type_color,
  250.                 pointBackgroundColor: "#fff",
  251.                 pointBorderWidth: 1,
  252.                 pointHoverRadius: 5,
  253.                 pointHoverBackgroundColor: property_type_color,
  254.                 pointHoverBorderColor: property_type_color,
  255.                 pointHoverBorderWidth: 2,
  256.                 pointRadius: 1,
  257.                 pointHitRadius: 10,
  258.                 data: avg_price_data,
  259.                 spanGaps: false,
  260.             });
  261.             avg_price_data = [];
  262.         {% endfor %}
  263.         var data = {
  264.             labels: Array.from(new Set(months)),
  265.             datasets: dataSets
  266.         };
  267.         {% if isEnabledFeature('web.pricegraph.resize') %}
  268.         var ctx = $(".statistics");
  269.         ctx.each(function(index) {
  270.             var statistics = new Chart(this, {
  271.                 type: 'line',
  272.                 data: data,
  273.                 options: {
  274.                     tooltips: {
  275.                         callbacks: {
  276.                             label: function(tooltipItem, data) {
  277.                                 return tooltipItem.yLabel.toLocaleString();
  278.                             }
  279.                         }
  280.                     },
  281.                     scales: {
  282.                         yAxes: [{
  283.                             ticks: {
  284.                                 beginAtZero:true,
  285.                                 callback: function(label, index, labels) {
  286.                                     return label.toLocaleString();
  287.                                 }
  288.                             }
  289.                         }],
  290.                         xAxes: [{
  291.                             ticks: {
  292.                                 autoSkip: false
  293.                             }
  294.                         }]
  295.                     }
  296.                 }
  297.             });
  298.         });
  299.         {% else %}
  300.         var ctx = $("#statistics");
  301.         var statistics = new Chart(ctx, {
  302.             type: 'line',
  303.             data: data,
  304.             options: {
  305.                 tooltips: {
  306.                     callbacks: {
  307.                         label: function(tooltipItem, data) {
  308.                             return tooltipItem.yLabel.toLocaleString();
  309.                         }
  310.                     }
  311.                 },
  312.                 scales: {
  313.                     yAxes: [{
  314.                         ticks: {
  315.                             beginAtZero:true,
  316.                             callback: function(label, index, labels) {
  317.                                 return label.toLocaleString();
  318.                             }
  319.                         }
  320.                     }],
  321.                     xAxes: [{
  322.                         ticks: {
  323.                             autoSkip: false
  324.                         }
  325.                     }]
  326.                 }
  327.             }
  328.         });
  329.         {% endif %}
  330.     </script>
  331.     <script type="application/ld+json">
  332.     {
  333.           "@context": "https://schema.org",
  334.           "@type": "Place",
  335.           "url":"{{ url(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) }}" ,
  336.           "description":"{{ location.description }}" ,
  337.           "geo": {
  338.           "@type": "GeoCoordinates",
  339.           "latitude": "{{ location.centerLat }}",
  340.           "longitude": "{{ location.centerLng }}"
  341.           },
  342.           "name": "{{ location.title }}"
  343.     }
  344.     </script>
  345.     <script>
  346.     $(document).ready(function() {
  347.         var neighborhoodDescription = $('#neighborhoodDescription');
  348.         neighborhoodDescription.addClass('hidden-neighborhood-description')
  349.         var moreTrans = Translator.trans('more_link');
  350.         var lessTrans = Translator.trans('less_link');
  351.         $('.see-more').html(moreTrans);
  352.         $('.see-more').on('click', function() {
  353.             var seeMoreText = $(this).html();
  354.             if (seeMoreText == moreTrans) {
  355.                 $(this).html(lessTrans);
  356.             } else if (seeMoreText == lessTrans) {
  357.                 $(this).html(moreTrans);
  358.             }
  359.             if (neighborhoodDescription.hasClass('hidden-neighborhood-description')) {
  360.                 neighborhoodDescription.removeClass('hidden-neighborhood-description')
  361.                 neighborhoodDescription.addClass('visible-neighborhood-description')
  362.             } else if (neighborhoodDescription.hasClass('visible-neighborhood-description')) {
  363.                 neighborhoodDescription.removeClass('visible-neighborhood-description')
  364.                 neighborhoodDescription.addClass('hidden-neighborhood-description')
  365.                 $("#neighborhoodDescription")[0].scrollIntoView();
  366.             }
  367.         })
  368.     })
  369.     </script>
  370. {% endblock %}