app/Plugin/TabaCMS2/Resource/template/admin/snippet/nav.twig line 1

Open in your IDE?
  1. {#
  2. Copyright (C) SPREAD WORKS Inc. All Rights Reserved.
  3. For the full copyright and license information, please view the LICENSE
  4. file that was distributed with this source code.
  5. #}
  6. {% set const = TabaCMS2Constants %}
  7. {% set bind_prefix = constant('ADMIN_BIND_PREFIX',const) %}
  8. {% set trans_prefix = constant('PLUGIN_CODE_LC',const) %}
  9. {% set tag_id_prefix = constant('PLUGIN_CODE_LC',const)%}
  10. <script>
  11.     $(function() {
  12.         var appendNav = $('#nav-{{ constant('PLUGIN_CODE_LC',const) }}-subnav');
  13.         $('#nav-{{ constant('PLUGIN_CATEGORY_ID',const) }}').append(appendNav.html());
  14.     });
  15. </script>
  16. <style>
  17. .{{ tag_id_prefix }}_nav_parent {
  18.     border-bottom: 1px solid #f7f7f9;
  19.     padding: 10px !important;
  20. }
  21. .{{ tag_id_prefix }}_nav_parent.active {
  22.     background-color: #f3f3f3;
  23. }
  24. .{{ tag_id_prefix }}_nav_child {
  25.     width: 50%;
  26.     padding: 10px !important;
  27.     border-bottom: 1px solid #f7f7f9;
  28.     text-align: center !important;
  29.     font-size: 0.9rem !important;
  30. }
  31. .{{ tag_id_prefix }}_nav_child:nth-child(odd) {
  32.     border-right: 1px solid #f7f7f9;
  33. }
  34. </style>
  35. <ul id="nav-{{ constant('PLUGIN_CODE_LC',const) }}-subnav" style="display:none;">
  36.     <a
  37.         class="c-mainNavArea__navItemSubTitle{{ active_menus(menus)[1] != constant('PLUGIN_CODE_LC',const) ? ' collapsed' }}"
  38.         data-bs-toggle="collapse"
  39.         href="#nav-{{ constant('PLUGIN_CODE_LC',const) }}"
  40.         aria-expanded="{{ active_menus(menus)[1] != constant('PLUGIN_CODE_LC',const) ? 'true' : 'false' }}"
  41.         aria-controls="nav-{{ constant('PLUGIN_CATEGORY_ID',const) }}">
  42.         <span>CMS</span></a>
  43.     <ul class="collapse{{ active_menus(menus)[1] == constant('PLUGIN_CODE_LC',const) ? ' show' }}" id="nav-{{ constant('PLUGIN_CODE_LC',const) }}">
  44.         {% for type in type_list %}
  45.             <li><a href="{{ url(bind_prefix~'_post_list',{type_id:type.typeId}) }}" class="{{ tag_id_prefix }}_nav_parent {{ ( (type.typeId ==  app.request.get('type_id') and active_menus(menus)[2] != constant('PLUGIN_CODE_LC',const)~'_type') or (active_menus(menus)[2] == constant('PLUGIN_CODE_LC',const)~'_post_'~type.typeId)) ? 'active' : '' }}"><span class="fw-bold">{{ type.typeName }}</span></a></li>
  46.             <li class="d-flex">
  47.                 <a href="{{ url(bind_prefix~'_post_list',{type_id:type.typeId}) }}" class="{{ tag_id_prefix }}_nav_child {{ active_menus(menus)[2] == constant('PLUGIN_CODE_LC',const)~'_post_list_'~type.typeId ? 'is-active' }}"><span>投稿一覧</span></a>
  48.                 <a href="{{ url(bind_prefix~'_post_new',{type_id:type.typeId}) }}" class="{{ tag_id_prefix }}_nav_child {{ (type.typeId ==  app.request.get('type_id') and (active_menus(menus)[2] == constant('PLUGIN_CODE_LC',const)~'_post_'~type.typeId and app.request.get('post_id') is empty)) ? 'is-active' }}"><span>新規投稿</span></a>
  49.             </li>
  50.             <li class="d-flex">
  51.                 <a href="{{ url(bind_prefix~'_category_list',{type_id:type.typeId}) }}" class="{{ tag_id_prefix }}_nav_child {{ active_menus(menus)[2] == constant('PLUGIN_CODE_LC',const)~'_category_'~type.typeId ? 'is-active' }}"><span>カテゴリー</span></a>
  52.                 <a href="{{ url(bind_prefix~'_tag_list',{type_id:type.typeId}) }}" class="{{ tag_id_prefix }}_nav_child {{ active_menus(menus)[2] == constant('PLUGIN_CODE_LC',const)~'_tag_'~type.typeId ? 'is-active' }}"><span>タグ</span></a>
  53.             </li>
  54.         {% endfor %}
  55.         <li><a href="{{ url(bind_prefix~'_type_list') }}" class="{{ tag_id_prefix }}_nav_parent {{ active_menus(menus)[2] == constant('PLUGIN_CODE_LC',const)~'_type' ? 'is-active' }}"><span class="fw-bold">投稿タイプ設定</span></a></li>
  56.     </ul>
  57. </ul>