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