templates/Frontend/company.html.twig line 1

  1. {% set manual = company.getManual %}
  2. {% set adsense = 'no' %}
  3. {% if is_granted('IS_AUTHENTICATED_FULLY') %}
  4.     {% if app.request.query.get("preview") == 'true' %}
  5.         {% set manual = true %}
  6.     {% endif %}
  7. {% endif %}
  8. {% extends "Frontend/base.html.twig" %}
  9. {% block metatitle %}
  10.     {% if manual %}
  11.         {{ company.getManualMetatitle |replace({'%county%': activecounty.getName}) |replace({'%city%': city.getName|mb_capitalize}) |replace({'%company%': company.getName}) |striptags |raw}}
  12.     {% else %}
  13.         {{ company.getMetatitle.getTitle |replace({'%county%': activecounty.getName}) |replace({'%city%': city.getName|mb_capitalize}) |replace({'%company%': company.getName}) |striptags |raw}}
  14.     {% endif %}
  15. {% endblock %}
  16. {% block metadescription %}
  17.     {% if manual %}
  18.         {{ company.getManualMetadescription |replace({'%county%': activecounty.getName}) |replace({'%city%': city.getName|mb_capitalize}) |replace({'%company%': company.getName}) |striptags |raw}}
  19.     {% else %}
  20.         {{ company.getMetadescription.getDescription |replace({'%county%': activecounty.getName}) |replace({'%city%': city.getName|mb_capitalize}) |replace({'%company%': company.getName}) |striptags |raw}}
  21.     {% endif %}
  22. {% endblock %}
  23. {% block maincontent %}
  24. <ul class="breadcrumbs">
  25.     <li>
  26.         <a href="/" title="Home">Hem</a>
  27.     </li>
  28.     <li>
  29.         <a href="{{ path('spinner_front_county', {'countypermalink': activecounty.getPermalinkP|mb_capitalize}) }}" title="{{activecounty.getName}}">{{activecounty.getName |mb_capitalize}}</a>
  30.     </li>
  31.     <li>
  32.         <a href="{{ path('spinner_front_city', {'countypermalink': activecounty.getPermalinkP|mb_capitalize, 'citypermalink': city.getPermalinkP|mb_capitalize}) }}">{{ city.getName|mb_capitalize |mb_capitalize}}</a>
  33.     </li>
  34.     <li>
  35.         <a href="{{ path('spinner_front_company', { 'citypermalink': company.getCityobj.getPermalinkP|mb_capitalize, 'companypermalink': company.getPermalinkP|mb_capitalize}) }}">{{ company.getName |mb_capitalize |raw}}</a>
  36.     </li>
  37. </ul>
  38.             {% if adsense == 'yes' %}
  39.                 <div class="hidden-sm hidden-xs">
  40.             <!-- Text block -->
  41.             <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  42.             <!-- catering_text_468x15 -->
  43.             <ins class="adsbygoogle ads-breadcrumbs"
  44.                  style="display:inline-block;width:468px;height:15px"
  45.                  data-ad-client="ca-pub-7945349731684325"
  46.                  data-ad-slot="3406595274">
  47.              </ins>
  48.             <script>
  49.                 (adsbygoogle = window.adsbygoogle || []).push({});
  50.             </script>
  51.             </div>
  52.             <div class="hidden-lg">
  53.             <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  54.             <!-- catering_responsive -->
  55.             <ins class="adsbygoogle ads-breadcrumbs"
  56.                  style="display:block"
  57.                  data-ad-client="ca-pub-7945349731684325"
  58.                  data-ad-slot="3374412476"
  59.                  data-ad-format="auto"></ins>
  60.             <script>
  61.             (adsbygoogle = window.adsbygoogle || []).push({});
  62.             </script>
  63.             </div>
  64.             {% endif %}
  65.             <div class="provider clearfix">
  66.             {# H1 block #}
  67.             {% if manual %}
  68.                 <h1 class="provider-header">{{ company.getManualH1 |replace({'%company%': company.getName}) |replace({'%city%': city.getName|mb_capitalize}) |striptags |raw}}</h1>
  69.             {% else %}
  70.                 <h1 class="provider-header">{{ company.getH1.getH1 |replace({'%company%': company.getName}) |replace({'%city%': city.getName|mb_capitalize}) |striptags |raw}}</h1>
  71.             {% endif %}
  72.           {% if adsense == 'yes' %}
  73.             <div style="float:right;" class="hidden-sm hidden-xs">
  74.                 <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  75.                 <!-- catering_336x280 -->
  76.                 <ins class="adsbygoogle"
  77.                      style="display:inline-block;width:336px;height:280px"
  78.                      data-ad-client="ca-pub-7945349731684325"
  79.                      data-ad-slot="7976395676">
  80.                 </ins>
  81.                 <script>
  82.                     (adsbygoogle = window.adsbygoogle || []).push({});
  83.                 </script>
  84.             </div>  
  85.           {% endif %}
  86.           {# Content 1 Block #}
  87.           {% if manual %}
  88.               {% set content = company.getManualContent | replace({'%company%': company.getName}) |replace({'%county%': activecounty.getName}) |replace({'%city%': city.getName|mb_capitalize}) |raw %}
  89.               {% if '[thumbnail]' in content %}
  90.                   {% set scontent = content|split('[thumbnail]') %}
  91.                   {{scontent.0 |raw }}
  92.                   {% if adsense == 'yes' %}
  93.                     <div class="hidden-lg">
  94.                     <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  95.                     <!-- catering_responsive -->
  96.                     <ins class="adsbygoogle"
  97.                          style="display:block"
  98.                          data-ad-client="ca-pub-7945349731684325"
  99.                          data-ad-slot="3374412476"
  100.                          data-ad-format="auto"></ins>
  101.                     <script>
  102.                     (adsbygoogle = window.adsbygoogle || []).push({});
  103.                     </script>
  104.                     </div>
  105.                   {% endif %}
  106.                   {% if company.getThumbnail.getName is defined %}
  107.                   <img src="{{ path('spinner_front_company_thumbnail', {'citypermalink': company.getCityobj.getPermalinkP|mb_capitalize, 'companypermalink': company.getPermalinkP|mb_capitalize, 'imagename': company.getManualThumbnailname | replace({'%company%': company.getName}) }) }}{% if is_granted('IS_AUTHENTICATED_FULLY') %}{% if app.request.query.get("preview") == 'true' %}?preview=true{% endif %}{% endif %}" alt="{{ company.getThumbnail.getAlt.getAlt | replace({'%company%': company.getName}) }}" class="img-responsive cityimg alignright" />
  108.                   {% endif %}
  109.                   {{scontent.1 |raw}}
  110.               {% else %}
  111.                        {{ content |raw}}
  112.               {% endif %}
  113.           {% else %}
  114.               {% set content = company.getContent.getContent | replace({'%company%': company.getName}) |replace({'%county%': activecounty.getName}) |replace({'%city%': city.getName|mb_capitalize}) |raw %}
  115.               {% if '[thumbnail]' in content %}
  116.                   {% set scontent = content|split('[thumbnail]') %}
  117.                   {{scontent.0 |raw }}
  118.                   {% if adsense == 'yes' %}
  119.                     <div class="hidden-lg">
  120.                     <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
  121.                     <!-- catering_responsive -->
  122.                     <ins class="adsbygoogle"
  123.                          style="display:block"
  124.                          data-ad-client="ca-pub-7945349731684325"
  125.                          data-ad-slot="3374412476"
  126.                          data-ad-format="auto"></ins>
  127.                     <script>
  128.                     (adsbygoogle = window.adsbygoogle || []).push({});
  129.                     </script>
  130.                     </div>
  131.                   {% endif %}
  132.                   {% if company.getThumbnail.getName is defined %}
  133.                   <img src="{{ path('spinner_front_company_thumbnail', {'citypermalink': company.getCityobj.getPermalinkP|mb_capitalize, 'companypermalink': company.getPermalinkP|mb_capitalize, 'imagename': company.getThumbnail.getName.getName | replace({'%company%': company.getName}) }) }}" alt="{{ company.getThumbnail.getAlt.getAlt | replace({'%company%': company.getName}) }}" class="img-responsive cityimg alignright" />
  134.                   {% endif %}
  135.                   {{scontent.1 |raw}}
  136.               {% else %}
  137.                        {{ content |raw}}
  138.               {% endif %}
  139.             {% endif %}
  140.       </div>
  141.       {% include 'Frontend/form.html.twig' %}<br>
  142.       <div class="provider clearfix">
  143.           <h2 class="provider-header">{{ company.getH2interesting.getH2 }}</h2>
  144.           {% for article in company.getInterestingarticles %}
  145.           <article class="blog-post">
  146.               <h3>{{ article.getTitle | raw}}</h3>
  147.               <p>{{article.getExcerpt |replace({'[ReadMoreText]': defaults.ReadMoreText |striptags}) |replace({ '[ReadMoreURL]': path('spinner_front_articles_single', {'articlepermalink':article.getRelated.getPermalinkP}) }) |raw}}
  148.           </article>
  149.           {% endfor %}
  150.       </div>
  151.       <div class="provider clearfix">
  152.           {% if manual %}
  153.           <h2 class="provider-header">{{ company.getManualH2 |replace({'%company%': company.getName}) |striptags |raw}}</h2>
  154.           {% else %}
  155.           <h2 class="provider-header">{{ company.getH2.getH2 |replace({'%company%': company.getName}) |striptags |raw}}</h2>
  156.           {% endif %}
  157.           <p class="provider-descr">{{ company.getDescription |striptags |raw}}</p>
  158.           <p>
  159.           <b>Adress:</b><br>
  160.           {% if company.getStreet is not empty %}{{ company.getStreet }}<br>{% endif %}
  161.           {% if company.getZip is not empty %}{{ company.getZip }}{% endif %}    {% if company.getCity is not empty %}{{ company.getCity }}{% endif %}<br>
  162.           </p>
  163.           <p>
  164.           {% if company.getHomepage is not empty %}<b>Hemsida:</b>    {{ company.getHomepage |striptags |raw}}<br>{% endif %}
  165.           {% if company.getEmail is not empty %}<b>E-post:</b> <span id="eaddr" h="{{ company.getEmail |striptags |raw |base64Encode}}"></span> <br>{% endif %}
  166.           </p>
  167.           {% if company.getOpeninghours is not empty or company.getWeekends is not empty %}
  168.             <p>
  169.             <b>Öppettider:</b><br>
  170.             {% if company.getOpeninghours is not empty %}<b>Vardagar:</b> {{ company.getOpeninghours |striptags |raw}}<br>{% endif %}
  171.             {% if company.getWeekends is not empty %}<b>Helger:</b> {{ company.getWeekends |striptags |raw}}{% endif %}
  172.             </p>
  173.           {% endif %}
  174.           {% if company.getPhone is not empty %}<b>Telefonnummer:</b> <span id="phoneNumber" style="display:none;">{{ company.getPhone }}</span><a href="" id="showPhone">Visa</a><br>{% endif %}
  175.           {#<iframe width="100%" frameborder="0" style="border:0; min-height: 300px" src="https://www.google.com/maps/embed/v1/place?q={{company.getLatitude}}%2C{{ company.getLongitude }}&key=AIzaSyCREQXquXKUF3-eDE9z6xOjBAd4BTODz3k"></iframe>#}
  176.           <iframe width="100%" frameborder="0" style="border:0; min-height: 300px" src="https://www.google.com/maps/embed/v1/place?q={{company.getMapsString}}&zoom=18&key=AIzaSyCREQXquXKUF3-eDE9z6xOjBAd4BTODz3k"></iframe>
  177.           {#<iframe width="100%" frameborder="0" style="border:0; min-height: 300px"  src="http://maps.google.com/maps?q={{company.getMapsString}}&loc:{{company.getLatitude}}+{{ company.getLongitude }}&mrt=yp&z=12&output=embed"></iframe>#}
  178.       </div>
  179.     <div class="row">
  180.         <div class="col-md-6">
  181.             <div class="panel panel-flyt">
  182.                 <div class="panel-heading">
  183.                         <h3 class="panel-title">Flyttstädning nära {{ city.getName|mb_capitalize }}</h3>
  184.                 </div>
  185.                 <div class="panel-body">
  186.                     <ul>
  187.                     {% for closest in closestcities %}
  188.                         <li><a href="{{ path('spinner_front_city', {'countypermalink': closest.getCounty.getPermalinkP|mb_capitalize, 'citypermalink': closest.getPermalinkP|mb_capitalize}) }}">Flyttstädning {{ closest.getName |mb_capitalize}}</a></li>
  189.                     {% endfor %}
  190.                     </ul>
  191.                 </div>
  192.             </div>
  193.         </div>
  194.         <div class="col-md-6">
  195.             <div class="panel panel-flyt">
  196.                 <div class="panel-heading">
  197.                     <h3 class="panel-title">Rekommenderade orter</h3>
  198.                 </div>
  199.                 <div class="panel-body">
  200.                     <ul>
  201.                     {% for recommended in company.getRecommended %}
  202.                         <li><a href="{{ path('spinner_front_city', {'countypermalink': recommended.getCounty.getPermalinkP|mb_capitalize, 'citypermalink': recommended.getPermalinkP|mb_capitalize}) }}">Flyttstädning {{ recommended.getName |mb_capitalize}}</a></li>
  203.                     {% endfor %}
  204.                     </ul>
  205.                 </div>
  206.             </div>
  207.         </div>
  208.     </div>
  209. {% endblock %}
  210. {% block javascripts %}
  211.     {{ parent() }}
  212.     {{ encore_entry_script_tags('company') }}
  213. {% endblock %}