templates/marketplaceDepartment.html.twig line 1

Open in your IDE?
  1. {% extends 'layout.html.twig' %}
  2. {% block title %}{{ 'service.marketplace'|trans }}{% endblock %}
  3. {% block page_contents %}
  4. <div class="marketplaceWrapper">
  5. <!-- department path -->
  6.     <div class="departmentPath">
  7.         {% set depCount = 0 %}
  8.         {% for dep in departmentPath %}
  9.             {% if depCount == 0 %}
  10.                 <a href="{{ path('root') }}marketplace" class="pathLink">{{ 'eshop.home'|trans }}</a>
  11.             {% endif %}
  12.             {% set depCount = depCount + 1 %}
  13.             {% if depCount == departmentPath|length %}
  14.                 <span class="pathSeparator">|</span> <a href="{{ path('root') }}marketplace/department/{{ dep.departmentId }}" class="pathLinkCurrent">{{ dep.departmentName }}</a>
  15.             {% else %}
  16.                 <span class="pathSeparator">|</span> <a href="{{ path('root') }}marketplace/department/{{ dep.departmentId }}" class="pathLink">{{ dep.departmentName }}</a>
  17.             {% endif %}
  18.         {% endfor %}
  19.     </div>
  20.     <table width="100%">
  21.       <tr>
  22.         <td><h1>{{ department.departmentName }}</h1></td>
  23.         <td>&nbsp;&nbsp;&nbsp;</td>
  24.         <td>
  25.             <a href="{{ path('root') }}addproducts" class="newButtonLink">{{ 'module.eshopLink_add'|trans }}</a>
  26.         </td>
  27.         <td>
  28.             <!-- Search form -->
  29.             {% set smallPanel = true %}
  30.             {{ include('searchForm.html.twig') }}
  31.         </td>
  32.       </tr>
  33.     </table>
  34.     <div class="departmentsContainer">
  35.         {% for dep in childDepartments %}
  36.             {% set departmentId = dep.departmentId %}
  37.             <a href="{{ path('root') }}marketplace/department/{{ dep.departmentId }}" class="departmentLink">
  38.                 <div class="departmentBox2">
  39.                     {% if dep.image1 is defined and dep.image1 != "" %}
  40.                     <div class="departmentImage">
  41.                         {% set imagePath = 'images/' ~ dep.image1 %}
  42.                         <!-- we display department image -->
  43.                         <img src="{{ asset(imagePath) }}" alt="Department Image" border="0">
  44.                     </div>
  45.                     {% endif %}
  46.                     <div class="departmentTitle">{{ dep.departmentName }}</div>
  47.                     <div class="subDepartments">
  48.                         {% set subDepCount = 0 %}
  49.                         {% set subDeps = subDepartments[departmentId] %}
  50.                             {% for subDep in subDeps %}
  51.                                 {% set subDepId = subDep.departmentId %}
  52.                                 {% if subDepCount < 3 %}
  53.                                     <div class="subDepartmentBox">
  54.                                         <a href="{{ path('root') }}marketplace/department/{{ subDepId }}" class="subDepartmentLink">{{ subDep.departmentName }}</a>
  55.                                     </div>
  56.                                 {% endif %}
  57.                                 {% set subDepCount = subDepCount + 1 %}
  58.                             {% endfor %}
  59.                     </div>
  60.                 </div>
  61.             </a>
  62.         {% endfor %}
  63.     </div>
  64.     <!-- product list -->
  65.     <div class="productContainer">
  66.         <div class="products"><h3>{{ 'eshop.products'|trans }}</h3></div>
  67.             <!-- navigator -->
  68.             <div class="navigator">
  69.                 <div class="paginator">
  70.                     {% set countPerPage = 20 %}
  71.                     {% set pageCount = productCount / countPerPage %}
  72.                     {% set pageTotal = pageCount|round(0, 'ceil') %}
  73.                     {% if pageTotal == 0 %}
  74.                         {% set pageTotal = pageTotal + 1 %}
  75.                     {% endif %}
  76.                     {% if app.request.get('page') is defined and app.request.get('page') > 0 %}
  77.                         {% set currentPage = app.request.get('page') %}
  78.                     {% else %}
  79.                         {% set currentPage = 1 %}
  80.                     {% endif %}
  81.                   <span class="smallDescription">{{ 'system.pages'|trans }}: {{ currentPage }}/{{ pageTotal }}</span>
  82.                     {% set scheme = app.request.scheme %}
  83.                     {% set host = app.request.host %}
  84.                     {% set port = app.request.port %}
  85.                     {% set startPage = 1 %}
  86.                     {% if pageTotal > 12 %}
  87.                         {% set pagesDisplayed = 12 %}
  88.                         {% set endPage = startPage + 11 %}
  89.                     {% else %}
  90.                         {% set pagesDisplayed = pageTotal %}
  91.                         {% set endPage = pageTotal %}
  92.                     {% endif %}
  93.                     {% if app.request.get('page') is defined and app.request.get('page') != '' and app.request.get('page') > endPage %}
  94.     {#                <br>---- is request page#}
  95.                         {% set startPage = app.request.get('page') - 5 %}
  96.                         {% set endPage = startPage + 11 %}
  97.                     {% endif %}
  98.                     {% if startPage > 1 %}
  99.                         <span class="smallMenu">
  100.                         {# prev page link #}
  101.                         <a href="{{ scheme }}://{{ host }}{{ app.request.pathinfo }}?page={{ (startPage - 5) }}" class="pageLink">&lt;</a>
  102.                       </span>
  103.                     {% endif %}
  104.     {#                <br>qqw page: {{ dump(app.request.get('page')) }}#}
  105.                     {% for i in startPage..endPage %}
  106.                         {% if app.request.get('page') is defined and app.request.get('page') == i %}
  107.                             {% set cssClass = 'pageLinkCurrent' %}
  108.                         {% elseif app.request.get('page') == null and i == 1 %}
  109.                             {% set cssClass = 'pageLinkCurrent' %}
  110.                         {% else %}
  111.                             {% set cssClass = 'pageLink' %}
  112.                         {% endif %}
  113.                         <a href="{{ scheme }}://{{ host }}{{ app.request.pathinfo }}?page={{ i }}" class="{{ cssClass }}">{{ i }}</a>
  114.                     {% endfor %}
  115.                         {% if pageTotal > 12 %}
  116.                           <span class="smallMenu">
  117.                             {# next page link #}
  118.                             <a href="{{ scheme }}://{{ host }}{{ app.request.pathinfo }}?page={{ (endPage + 1) }}" class="pageLink">&gt;</a>
  119.                           </span>
  120.                             <span class="smallMenu">
  121.                             {# first page link #}
  122.                             <a href="{{ scheme }}://{{ host }}{{ app.request.pathinfo }}?page=1" class="pageLink">&lt;&lt;</a>
  123.                             {# last page link #}
  124.                             <a href="{{ scheme }}://{{ host }}{{ app.request.pathinfo }}?page={{ pageTotal }}" class="pageLink">&gt;&gt;</a>
  125.                           </span>
  126.                         {% endif %}
  127.                 </div>
  128.                 <div class="clearPaginator">
  129.                 </div>
  130.             </div>
  131.         {% for product in productList %}
  132.     {#        {% for price in product.prices %}#}
  133.     {#            {% set displayPrice = price.nettoValue|round(2, 'ceil') %}#}
  134.     {#        {% endfor %}#}
  135.             {#    we get price(s) to display #}
  136.             {% set displayPrice = null %}
  137.             {% set displayPriceVAT = null %}
  138.             {% for price in productPriceList %}
  139.                 {% if price.productId == product.productId %}
  140.                     {#    we get default price level  #}
  141.                     {% if price.priceLevelId == 1 %}
  142.                         {% set displayPrice = price.nettoValue|round(2, 'ceil') %}
  143. {#                        {% set displayPrice = price.bruttoValue|round(2, 'ceil') %}#}
  144.                     {% endif %}
  145.                 {% endif %}
  146.             {% endfor %}
  147.             <div class="productPanel">
  148.                 <div class="productImage">
  149.                     {% if product.image1 is defined %}
  150.                         <a href="{{ path('root') }}marketplace/product/{{ product.productId }}">
  151.                             <img src="{{ product.image1 }}" class="marketplaceProductImage" alt="Product Image" border="0">
  152.                         </a>
  153.                     {% endif %}
  154.                 </div>
  155.                 <div class="productDetail">
  156.                     <a href="{{ path('root') }}marketplace/product/{{ product.productId }}" class="productLink">{{ product.productName }}</a>
  157.                     <div class="productDescription">
  158.                         {% if product.productDescription|length > 200 %}
  159.                             {% set productDescription = product.productDescription|slice(0, 200) ~ "..." %}
  160.                         {% else %}
  161.                             {% set productDescription = product.productDescription %}
  162.                         {% endif %}
  163.                         {{ productDescription|striptags }}
  164.                     </div>
  165.                 </div>
  166.                 <div class="productBasket">
  167.                     <div class="productPrice">{{ displayPrice }} CZK</div>
  168.                     <div class="productToBasket">
  169.                         <a href="{{ path('root') }}marketplace/product/{{ product.productId }}" class="viewProductLink">{{ 'system.view'|trans }}</a>
  170.                     </div>
  171.                     <div class="productToBasket">
  172.                         <a href="{{ path('root') }}marketplace/product/{{ product.productId }}?redirect_to_eshop={{ product.productLink }}" target="_blank" class="viewProductLink">{{ 'service.eshop'|trans }}</a>
  173.                     </div>
  174.                 </div>
  175.             </div>
  176.         {% endfor %}
  177.         <!-- navigator -->
  178.         <div class="navigator">
  179.             <div class="paginator">
  180.               <span class="smallDescription">pages {{ currentPage }}/{{ pageTotal }}</span>
  181.                 {% for i in startPage..endPage %}
  182.                     {% if app.request.get('page') is defined and app.request.get('page') == i %}
  183.                         {% set cssClass = 'pageLinkCurrent' %}
  184.                     {% elseif app.request.get('page') == null and i == 1 %}
  185.                         {% set cssClass = 'pageLinkCurrent' %}
  186.                     {% else %}
  187.                         {% set cssClass = 'pageLink' %}
  188.                     {% endif %}
  189.                     <a href="{{ scheme }}://{{ host }}{{ app.request.pathinfo }}?page={{ i }}" class="{{ cssClass }}">{{ i }}</a>
  190.                 {% endfor %}
  191.             </div>
  192.             <div class="clearPaginator">
  193.             </div>
  194.         </div>
  195.         {% if productCount == 0 %}
  196.             <br><br>
  197.             {% set actionBannerPath = 'images/banners/VirtualRealityCommerceCZ-ActionBanner001.jpg' %}
  198.     {#        we display Action banner image#}
  199.             <div class="banner">
  200.                 <a href="{{ path('root') }}addproducts">
  201.                     <img src="{{ asset(actionBannerPath) }}" alt="Action banner" border="0" class="bannerImage">
  202.                 </a>
  203.             </div>
  204.         {% endif %}
  205.     </div>
  206.     <div class="eshopLinkList">
  207.         <div class="eshopLinks"><h3>{{ 'module.eshopLinks'|trans }}</h3></div>
  208.         {% for eshopLink in eshopLinkList %}
  209.             <div class="eshopLinkPanel">
  210.                 {% if eshopLink.logoUrl is defined and eshopLink.logoUrl != '' %}
  211.                     <div class="eshopLinkLogo">
  212.                         <a href="{{ path('root') }}marketplace/eshop/{{ eshopLink.eshopLinkId }}?redirect_to_eshop={{ eshopLink.eshopLinkUrl }}" target="_blank">
  213.                             <img src="{{ eshopLink.logoUrl }}" width="150" alt="E-shop Logo">
  214.                         </a>
  215.                     </div>
  216.                 {% endif %}
  217.                 <div class="eshopLinkDetail">
  218.                     <a href="{{ path('root') }}marketplace/eshop/{{ eshopLink.eshopLinkId }}?redirect_to_eshop={{ eshopLink.eshopLinkUrl }}" target="_blank" class="eshopLink">{{ eshopLink.eshopLinkName }}</a>
  219.                     <div class="eshopLinkDescription">{{ eshopLink.eshopLinkDescription }}</div>
  220.                 </div>
  221.             </div>
  222.         {% endfor %}
  223.     </div>
  224.     <br>
  225. </div>
  226. {% endblock %}