src/Aqarmap/Bundle/DiscussionBundle/Resources/views/Discussion/discussions.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. {% block stylesheets %}
  4.     {{ parent() }}
  5.     <link rel="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  6. {% endblock %}
  7. {# Page title #}
  8. {% set pageTitle = selectedCategory ? 'neighborhoods.discussion.explore_category_title_in'|trans({'%category%': selectedCategory.title}) : 'neighborhoods.discussion.main_title'|trans %}
  9. {% set pageTitle = location ? 'neighborhoods.discussion.explore_title_in'|trans({'%location%': location.title}) : pageTitle %}
  10. {% block title %}
  11.     {{ pageTitle }}
  12.     &bull;
  13.     {{ parent() }}
  14. {% endblock %}
  15. {% block meta_description %}
  16.     {{ metaDescriptionContent }}
  17. {% endblock %}
  18. {% block metatags %}
  19.     {% if discussions|length == 0 %}
  20.         <meta name="robots" content="noindex">
  21.     {% endif %}
  22. {% endblock %}
  23. {% block htmlhead %}
  24.     <link rel="canonical" href="{{ url(app.request.get('_route'), app.request.query.all|merge({'_locale': app.request.get('_locale')})) }}"/>
  25.     <link rel="alternate" hreflang="ar" href="{{ url(app.request.get('_route'), app.request.query.all|merge({'_locale': 'ar'})) }}"/>
  26.     <link rel="alternate" hreflang="en" href="{{ url(app.request.get('_route'), app.request.query.all|merge({'_locale': 'en'})) }}"/>
  27.     <link rel="alternate" hreflang="x-default" href="{{ url(app.request.get('_route'), app.request.query.all|merge({'_locale': 'ar'})) }}"/>
  28.     {{ _self.pagination_meta(discussions) }}
  29. {% endblock %}
  30. {% block body %}
  31.     <section id="{{ app.request.get('_route') }}" ng-controller="neighborhoodDiscussionController">
  32.         {% set topSellerTrigger = 'gtm-action-topsellers-lead-ask-neighbors' %}
  33.         {% set topSellerEventAction = 'Top Sellers Ask Neighbors'%}
  34.         <div class="resposive-add-discussion-conatiner hidden-md hidden-lg hidden-sm">
  35.             <div class="container">
  36.                 <div class="page-header">
  37.                     <h2 class="custom-header">{{ "neighborhoods.discussion.main_title"|trans }}</h2>
  38.                     <p class="discussion-form-sub-title responsive_style hidden-xs">{{ "neighborhoods.discussion.sub_title"|trans }}</p>
  39.                 </div>
  40.                 <div class="row">
  41.                     <div class="col-xs-12" ng-init="showFormData = false;discussionContent='';">
  42.                         {{ form_start(responsiveDiscussionForm, {attr: {'ng-submit': 'submitDiscussion($event, data)'}}) }}
  43.                         <div class="discussion-form-textarea">
  44.                             {{ form_widget(responsiveDiscussionForm.content, {'attr': {'placeholder': "neighborhoods.discussion.sub_title_placeholder"|trans({'%location%': ''}, 'messages'), 'ng-click' : 'showFormData = true;', 'ng-model' : 'discussionContent'  } }) }}
  45.                         </div>
  46.                         <div id="discussion-form-content" class="discussion-form-containers" ng-show="showFormData">
  47.                             <div id="location_search">
  48.                                 {{ form_widget(responsiveDiscussionForm.location, { 'attr' : { 'class' : 'chosen'}}) }}
  49.                             </div>
  50.                             {{ form_widget(responsiveDiscussionForm.category) }}
  51.                         </div>
  52.                         <button type="submit" id="discussion-submit-btn" class="darken btn btn-lg  btn-primary btn-block">{{ "neighborhoods.discussion.share"|trans }}
  53.                         </button>
  54.                         {{ form_end(responsiveDiscussionForm) }}
  55.                         <div class="cancel-button">
  56.                             <a href="" class="text-center" ng-click="showFormData = false;discussionContent='';" ng-show="showFormData">{{ "terms_conditions.cancel"|trans }}</a>
  57.                         </div>
  58.                     </div>
  59.                 </div>
  60.             </div>
  61.         </div>
  62.         <div class="discussions">
  63.             <div class="container">
  64.                 <div class="row">
  65.                     <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 hidden-sm hidden-xs">
  66.                         {% set discussions_breadcrumb = knp_menu_get( 'aqarmap.askNeighbors.breadcrumb' , [],{'location': app.request.get('location'), 'category': app.request.get('category')}) %}
  67.                         {{ knp_menu_render(discussions_breadcrumb, {
  68.                             'allow_safe_labels': true,
  69.                             'template': 'knp_breadcrumbs.html.twig',
  70.                             'currentAsLink': true,
  71.                             'currentClass': 'active'
  72.                         }) }}
  73.                     </div>
  74.                     <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
  75.                         <div class="row">
  76.                             <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
  77.                                 <div class="page-header">
  78.                                     {% set discussionLocationTitle = location ? location.title : '' %}
  79.                                     {% if location %}
  80.                                         <h1 class="custom-header">{{
  81.                                             getDiscussionSearchTabsTitle(app.request.get('tab', 1))|trans ~
  82.                                             'layout.in'|trans ~ discussionLocationTitle }}
  83.                                             {% if discussions.currentPageNumber != 1 %}
  84.                                                 {{ ' - ' ~ 'layout.description.page'|trans({'%page_number%' : discussions.currentPageNumber}) }}
  85.                                             {% endif %}
  86.                                         </h1>
  87.                                     {% elseif selectedCategory %}
  88.                                         <h1 class="custom-header">{{
  89.                                             getDiscussionSearchTabsTitle(app.request.get('tab', 1))|trans ~
  90.                                             'layout.in'|trans ~ selectedCategory.title }}
  91.                                             {% if discussions.currentPageNumber != 1 %}
  92.                                                 {{ ' - ' ~ 'layout.description.page'|trans({'%page_number%' : discussions.currentPageNumber}) }}
  93.                                             {% endif %}
  94.                                         </h1>
  95.                                     {% else %}
  96.                                         <h1 class="custom-header">{{
  97.                                             getDiscussionSearchTabsTitle(app.request.get('tab', 1))|trans }}
  98.                                             {% if discussions.currentPageNumber != 1 %}
  99.                                                 {{ ' - ' ~ 'layout.description.page'|trans({'%page_number%' : discussions.currentPageNumber}) }}
  100.                                             {% endif %}
  101.                                         </h1>
  102.                                     {% endif %}
  103.                                 </div>
  104.                                 <div class="discussion-form-containers">
  105.                                     {{ form_start(discussionSearchForm, {'attr' : {'class' : 'discussion-search-form'}}) }}
  106.                                     <div class="discussion-search-location">
  107.                                         {% if  app.request.get('location') %}
  108.                                             {{ form_widget(discussionSearchForm.location, { value : app.request.get('location'), 'attr' : { 'class' : 'chosen', 'ng-init' : 'locationSelect=' ~ app.request.get('location') , 'ng-model' : 'locationSelect' }}) }}
  109.                                         {% else %}
  110.                                             {{ form_widget(discussionSearchForm.location, { value : app.request.get('location'), 'attr' : { 'class' : 'chosen', 'ng-model' : 'locationSelect' }}) }}
  111.                                         {% endif %}
  112.                                     </div>
  113.                                     <div class="discussion-search-category">
  114.                                         {% if  app.request.get('category') %}
  115.                                             {{ form_widget(discussionSearchForm.category, {value : app.request.get('category', ''), 'attr' : { 'ng-init' : 'categorySelect=' ~ app.request.get('category'), 'ng-model' : 'categorySelect'}}) }}
  116.                                         {% else %}
  117.                                             {{ form_widget(discussionSearchForm.category, {value : app.request.get('category', ''), 'attr' : { 'ng-model' : 'categorySelect'}}) }}
  118.                                         {% endif %}
  119.                                     </div>
  120.                                     {{ form_end(discussionSearchForm) }}
  121.                                 </div>
  122.                                 <div class="discussions-table-container">
  123.                                     {% if discussions|length == 0 %}
  124.                                         <div class="discussions-no-result">
  125.                                             <div class="alert alert-warning no-result-container">
  126.                                                 {% if location is defined and location is not empty and location.parent %}
  127.                                                     <p class="no_result_text">{{ "neighborhoods.discussion.no_results_try_parent"|trans({'%location%': location, '%parent%': location.parent, '%url%': path(app.request.attributes.get('_route'),app.request.query.all|merge({'location': location.parent.id}))})|raw }}</p>
  128.                                                 {% else %}
  129.                                                     <p class="no_result_text">{{ "neighborhoods.discussion.no_results_try_trending"|trans({'%url%': path('neighborhood_discussion_list', {'category': app.request.get('category')})})|raw }}</p>
  130.                                                 {% endif %}
  131.                                             </div>
  132.                                         </div>
  133.                                     {% endif %}
  134.                                     <div class="tabbable-panel">
  135.                                         <div class="tabbable-line">
  136.                                             <ul class="nav nav-tabs ">
  137.                                                 {% for status, label in getDiscussionSearchTabs() %}
  138.                                                     <li
  139.                                                         {% if app.request.get('tab', 1) == status %} class="active" {% endif %}>
  140.                                                         {#data-toggle="tab"#}
  141.                                                         <a ng-init="currentTab={{ app.request.get('tab', 1) }};" href="{{ path('neighborhood_discussion_list', { 'tab' : status, 'location' : app.request.get('location'), 'category' : app.request.get('category')}) }}">{{ label|trans }}</a>
  142.                                                     </li>
  143.                                                 {% endfor %}
  144.                                             </ul>
  145.                                             <div class="tab-content">
  146.                                                 {% if discussions|length == 0 %}
  147.                                                     <div class="discussions-tabs-no-result">
  148.                                                         <div class="discussions-tabs-no-result-holder">
  149.                                                             <i class="fa fa-question-circle" aria-hidden="true"></i>
  150.                                                             <p>{{ "neighborhoods.discussion.no_results_tabs_found"|trans }}</p>
  151.                                                         </div>
  152.                                                     </div>
  153.                                                 {% else %}
  154.                                                     <div class="tab-pane active" id="tab_1">
  155.                                                         {% for discussion in discussions %}
  156.                                                             <div class="media">
  157.                                                                 <div class="media-body">
  158.                                                                     <h4 class="media-heading">
  159.                                                                         <a id="title-link" target="_blank" href="{{ path('neighborhood_discussion_comments', {'discussion': discussion.id, 'utm_source': 'system', 'utm_medium': 'search', 'utm_campaign': 'view_question'}) }}" class="">
  160.                                                                             {{ discussion.content|slice(0, 87)|raw }}
  161.                                                                         </a>
  162.                                                                     </h4>
  163.                                                                     <div class="row">
  164.                                                                         <div class="col-xs-8 pull-left flip">
  165.                                                                             <p id="discussion-p">
  166.                                                                                 {% if discussion.category %}
  167.                                                                                     <a id="content-link" target="_blank" href="{{ path('neighborhood_discussion_list' , {'category': discussion.category.id }) }}" class="">
  168.                                                                                         {{ discussion.category.title }}
  169.                                                                                     </a>
  170.                                                                                 {% endif %}
  171.                                                                                 {% if discussion.location %}
  172.                                                                                     <span id="discussion-location-category-parser">{{ 'layout.in'|trans }}</span>
  173.                                                                                     <a id="content-link" target="_blank" href="{{ path('neighborhood_discussion_list' , {'location':discussion.location.id }) }}" class="">
  174.                                                                                         {{ discussion.location.title }}
  175.                                                                                     </a>
  176.                                                                                 {% endif %}
  177.                                                                             </p>
  178.                                                                         </div>
  179.                                                                         <div class="col-xs-4 pull-right flip">
  180.                                                                             <small id="discussions_comment_label" class="">
  181.                                                                                 <label>
  182.                                                                                     <a target="_blank" href="{{ path('neighborhood_discussion_comments' , {'discussion': discussion.id }) }}" class="">
  183.                                                                                         <i class="fa fa-comment-o" aria-hidden="true"></i>
  184.                                                                                         {{ discussion.commentsCounter }}
  185.                                                                                         {{ "neighborhoods.discussion.comments"|trans }}
  186.                                                                                     </a>
  187.                                                                                 </label>
  188.                                                                             </small>
  189.                                                                         </div>
  190.                                                                     </div>
  191.                                                                 </div>
  192.                                                             </div>
  193.                                                             <hr/>
  194.                                                         {% endfor %}
  195.                                                         {{ knp_pagination_render(discussions) }}
  196.                                                     </div>
  197.                                                 {% endif %}
  198.                                             </div>
  199.                                         </div>
  200.                                     </div>
  201.                                 </div>
  202.                             </div>
  203.                         </div>
  204.                         <!-- end col-md-12 (page-header) -->
  205.                     </div>
  206.                     <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12 panel-white padding-md-zero">
  207.                         <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 hidden-xs">
  208.                             <div class="page-header">
  209.                                 <h2 class="custom-header">{{ "neighborhoods.discussion.main_title"|trans }}</h2>
  210.                                 <p class="discussion-form-sub-title">{{ "neighborhoods.discussion.sub_title"|trans }}</p>
  211.                             </div>
  212.                             <div class="row">
  213.                                 <div class="col-xs-12" ng-init="showFormData = true;">
  214.                                     {{ form_start(discussionForm, {attr: {'ng-submit': 'submitDiscussion($event, data)'}}) }}
  215.                                     <div id="discussion-form-content" class="discussion-form-containers" ng-show="showFormData">
  216.                                         <div id="location_search">
  217.                                             {{ form_widget(discussionForm.location, { 'attr' : { 'class' : 'chosen'}}) }}
  218.                                         </div>
  219.                                         {{ form_widget(discussionForm.category) }}
  220.                                     </div>
  221.                                     <div class="discussion-form-textarea">
  222.                                         {{ form_widget(discussionForm.content,
  223.                                             {'attr': {'placeholder': "neighborhoods.discussion.sub_title_placeholder"|trans({'%location%': ''}, 'messages'), 'ng-click' : 'showFormData = true;'} })
  224.                                         }}
  225.                                     </div>
  226.                                     <button type="submit" id="discussion-submit-btn" class="btn btn-primary btn-block">{{ "neighborhoods.discussion.share"|trans }}
  227.                                     </button>
  228.                                     {{ form_end(discussionForm) }}
  229.                                 </div>
  230.                             </div>
  231.                         </div>
  232.                         <!-- end col-md-12 (page-header) -->
  233.                         <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
  234.                             {% if interestsListings|length > 0 %}
  235.                                 <div class="page-header">
  236.                                     <h2 class="custom-small-header">{{ 'advice.Properties_intersted_in'|trans }}
  237.                                     </h2>
  238.                                 </div>
  239.                             {% endif %}
  240.                             <div class="interested-listings ">
  241.                                 {% include "@AqarmapDiscussionBundle/Discussion/ListingsYouMaybeInterestedIn.html.twig" %}
  242.                             </div>
  243.                         </div>
  244.                         <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 mobile-breadcrumb visible-sm visible-xs">
  245.                             {% set discussions_breadcrumb = knp_menu_get( 'aqarmap.askNeighbors.breadcrumb' , [],{'location': app.request.get('location'), 'category': app.request.get('category')}) %}
  246.                             {{ knp_menu_render(discussions_breadcrumb, {
  247.                                 'allow_safe_labels': true,
  248.                                 'template': 'knp_breadcrumbs.html.twig',
  249.                                 'currentAsLink': true,
  250.                                 'currentClass': 'active'
  251.                             }) }}
  252.                         </div>
  253.                         {% if not isLastPage(discussions) and location and isEnabledFeature('web.topsellers.section') %}
  254.                             <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 discussions-top-sellers-container">
  255.                                 <div>
  256.                                     {% include "@AqarmapListing/ListingSearch/topSellersResponsive.html.twig"  with {'trigger': topSellerTrigger, 'eventAction': topSellerEventAction, leadSourcePage: 'ask_neighbors'}%}
  257.                                 </div>
  258.                             </div>
  259.                             <div ng-controller="listingLeadsWizardController" ng-init="initFormWizard()">
  260.                                 {{ include('@AqarmapUserBundle/User/listingMultiStepLeadModal.html.twig') }}
  261.                             </div>
  262.                         {% endif %}
  263.                         {% if popularArticles|length > 0 %}
  264.                             {% include '@AqarmapDiscussion/Discussion/popularArticles.html.twig' %}
  265.                         {% endif %}
  266.                     </div>
  267.                 </div>
  268.                 {% if isLastPage(discussions) and location and isEnabledFeature('web.topsellers.section') %}
  269.                     <div class="row">
  270.                         <div class="col visible-sm visible-lg">
  271.                             <div class="top-sellers-warp-cards w-100">
  272.                                 {% include "@AqarmapListing/ListingSearch/topSellersResponsive.html.twig"  with {'trigger': topSellerTrigger, 'eventAction': topSellerEventAction , 'position':'bottom', leadSourcePage: 'ask_neighbors'} %}
  273.                             </div>
  274.                         </div>
  275.                     </div>
  276.                     {{ include('@AqarmapUserBundle/User/listingQuickLeadModal.html.twig') }}
  277.                 {% endif %}
  278.                 <div class="tab-content searchResultsContainer interested-listings subsLinks more-locations-container">
  279.                     {% include "@AqarmapMainBundle/Default/locationsSubLinks.html.twig" %}
  280.                 </div>
  281.             </div>
  282.         </div>
  283.         {{ include('@AqarmapUserBundle/User/loginModal.html.twig') }}
  284.     </section>
  285. {% endblock %}
  286. {% block footer %}
  287.     {% include "footer.v2.html.twig" %}
  288. {% endblock %}
  289. {% block javascripts %}
  290.     {{ parent() }}
  291.     <script>
  292.         jQuery(document).ready(function ($) {
  293. loadMoreInit('.sectionLoadMore');
  294. });
  295.     </script>
  296. {% endblock %}
  297. {% macro pagination_meta(pagination) %}
  298.     {% set total = pagination.totalItemCount %}
  299.     {% set items_per_age = pagination.itemNumberPerPage %}
  300.     {% set current = pagination.currentPageNumber %}
  301.     {% set last = (total / items_per_age) | round(0, 'ceil') %}
  302.     {% set page_parameter = pagination.paginatorOption('pageParameterName') %}
  303.     {% if current != 1 and total %}
  304.         <link rel="prev" href="{{ url(app.request.attributes.get('_route'), app.request.query.all|merge({ (page_parameter): (current - 1) })) }}"/>
  305.     {% endif %}
  306.     {% if current != last and total %}
  307.         <link rel="next" href="{{ url(app.request.attributes.get('_route'), app.request.query.all|merge({ (page_parameter): (current + 1) })) }}"/>
  308.     {% endif %}
  309. {% endmacro %}