app/template/default/Message/index.twig line 1

Open in your IDE?
  1. {#
  2. This file is part of EC-CUBE
  3. Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  4. http://www.ec-cube.co.jp/
  5. For the full copyright and license information, please view the LICENSE
  6. file that was distributed with this source code.
  7. #}
  8. {% extends 'default_frame.twig' %}
  9. {% set body_class = 'message_page' %}
  10. {% block stylesheet %}
  11.     <link rel="stylesheet" href="/stylesheets/message.css?20220924">
  12.     <style>
  13.         nav {
  14.             min-height: auto;
  15.         }
  16.     </style>
  17.     {% if g_page > 1 %}
  18.     <meta name="robots" content="noindex" />
  19.     {% endif %}
  20. {% endblock %}
  21. {% block javascript %}
  22.     <script src="/javascripts/message.js"></script>
  23.     <script>
  24.         $(function() {
  25.             $('#category-select').on('change', function(event) {
  26.                 location.href = '/message?category=' + $(this).val();
  27.             });
  28.         });
  29.     </script>
  30. {% endblock %}
  31. {% block main %}
  32.     {#{% if g_pager.prev is not defined and g_category is empty and g_goods_id is empty and g_basic_id is empty %}#}
  33.     {% if g_pager.prev is empty and g_category is empty and g_goods_id is empty %}
  34.     <div id="ttl_koe">
  35.         <div id="koe_img">
  36.             <div id="txt">
  37.                 <p>お客様の声<span>{{ g_total_count }}件</span>を掲載!</p>
  38.                 <p>商品購入のご検討等にお役立てください!</p>
  39.             </div>
  40.         </div>
  41.     </div>
  42.     {% endif %}
  43.     <div class="left-menu">
  44.         <h3>カテゴリ一覧</h3>
  45.         <ul class="menu message-category-menu">
  46.             {% for category in g_category_list %}
  47.                 <li class="module-header message-category-{{ category.cmc_id }}">
  48.                     <a href="{{ url('message/index', {'category': category.cmc_id}) }}" {{ g_category_id == category.cmc_id ? 'class="active"' : "" }}>
  49.                         {{ category.category_name }}<span class="message-count">({{ category.cmc_count }}件)</span><span class="arw">&rtrif;</span>
  50.                     </a>
  51.                 </li>
  52.             {% endfor %}
  53.         </ul>
  54.     </div>
  55.     <div class="left-menu-sp contents-wrapper">
  56.         <span>カテゴリ一覧</span>
  57.         <select id="category-select">
  58.             <option value="">選択してください</option>
  59.             {% for category in g_category_list %}
  60.                 <option value="{{ category.cmc_id }}" {{ g_category_id == category.cmc_id ? 'selected' : "" }}>{{ category.category_name }}({{ category.cmc_count }}件)</option>
  61.             {% endfor %}
  62.         </select>
  63.     </div>
  64.     <div id="right-content">
  65.         {% if  g_category_id is not empty %}
  66.         <div class="content-title">
  67.             「<span class="content-target">{{ g_category['category_name'] }}</span>」のお客様の声一覧
  68.         </div>
  69.         {%  elseif g_goods_id is not empty %}
  70.         <div class="content-title">
  71.             {% for key, kataban in g_kataban %}
  72.                 {% if loop.first %}
  73.                     「<span class="content-target"> {{ kataban[0]['kataban']}} {{ g_goods['goods_name']}}</span>」のお客様の声一覧
  74.                 {% endif %}
  75.             {% endfor %}
  76.         </div>
  77.         {% endif %}
  78.         {% set week = "-2 week" | date("Y/m/d") %}
  79.         {% for key, row in g_msg_list %}
  80.             {% set images = row.img_paths %}
  81.             <div class="article no-img clearfix">
  82.                 <div class="date-box">
  83.                     <div id="{{ row.cm_id }}" name="{{ row.cm_id }}">
  84.                         {% if row.display_datetime | date("Y/m/d") > week %}
  85.                             <p class="new">New</p>
  86.                         {%  endif %}
  87.                         <p class="date">{{ row.display_datetime | date("Y/m/d") }}</p>
  88.                     </div>
  89.                 </div>
  90.                 <div class="ttl">
  91.                     <h3>{{ row.title }}</h3>
  92.                 </div>
  93.                 <div class="content-box">
  94.                     <div class="left">
  95.                         <div class="voice">
  96.                             {% if row.customer_name is not empty and row.customer_name !="#VALUE!" %}
  97.                                 <h4 class="voice-icon">
  98.                                     「{{ row.customer_name }}様」からの声
  99.                                 </h4>
  100.                             {% endif %}
  101.                             {% if row.comment is not empty %}
  102.                                 <p class="comment customer_comment">
  103.                                     {% if images|length >= 0  %}
  104.                                         {% for idx, image in images %}
  105.                                             {% set alt = row.customer_name %}
  106.                                             {% set image_src = image.path|replace({"https:": ""} ) %}
  107.                                             <img class="mt-image-none" src='{{ image_src }}' alt="{{ image.alt }}" style="">
  108.                                             <br><br>
  109.                                         {% endfor %}
  110.                                     {% endif %}
  111.                                     {{ row.comment | raw }}
  112.                                 </p>
  113.                             {% endif %}
  114.                         </div>
  115.                         {% if row.staff_comment is not empty %}
  116.                             <div class="shop">
  117.                                 <h4 class="shop-icon">ショップ担当者より</h4>
  118.                                 <p class="comment staff_comment">{{ row.staff_comment | raw }}</p>
  119.                             </div>
  120.                         {% endif %}
  121.                         {% if g_kataban[row.cm_id] is defined %}
  122.                             <div class="buy">
  123.                                 <h4 class="buy-icon">ご購入いただいた商品</h4>
  124.                                 {% for key, data in g_kataban[row.cm_id] %}
  125.                                     <a href="/item/{{ data.goods_id }}.html" target="_blank" class="item-btn">
  126.                                         <p>{{ data.kataban }} {{ data.name }} <span class="arw">&rtrif;</span></p>
  127.                                     </a>
  128.                                 {% endfor %}
  129.                             </div>
  130.                         {% endif %}
  131.                     </div>
  132.                 </div>
  133.             </div>
  134.         {% endfor %}
  135.     </div>
  136.     <!-- ページネーション -->
  137.     {% if g_pages > 1 %}
  138.         <nav data-pagination>
  139.             <ul>
  140.                 <li>
  141.                     {% if g_pager.prev is not empty %}
  142.                     <a href="/message?{{ PageWithGetParams(g_pager.next) | raw }}">
  143.                         <i class="ion-chevron-left"><</i>
  144.                     </a>
  145.                     {% else %}
  146.                     <a disabled>
  147.                         <i class="ion-chevron-left"></i>
  148.                     </a>
  149.                     {% endif %}
  150.                 </li>
  151.                 {% for key, page in g_pager.page_list %}
  152.                     {% if page == g_page %}
  153.                         <li class="current">{{ page }}</li>
  154.                     {% elseif page==null %}
  155.                         <li class="page-point">...</li>
  156.                     {% else %}
  157.                          <li><a href="/message?{{ PageWithGetParams(page) | raw }}">{{ page }}</a></li>
  158.                     {% endif %}
  159.                 {% endfor %}
  160.                 <li>
  161.                     {% if g_pager.next is defined %}
  162.                     <a href="/message?{{ PageWithGetParams(g_pager.next) | raw }}">
  163.                         <i class="ion-chevron-right">></i>
  164.                     </a>
  165.                     {% else %}
  166.                     <a disabled>
  167.                         <i class="ion-chevron-right"></i>
  168.                     </a>
  169.                     {% endif %}
  170.                 </li>
  171.             </ul>
  172.         </nav>
  173.     {% endif %}
  174. {% endblock %}