ui/twig/common/data/items/basic.html.twig line 1

Open in your IDE?
  1. {% set helper = _args.helper|default(null) %}
  2. {% set title = _args.title %}
  3. {% set text = _args.text|default(null) %}
  4. {% set subtext = _args.subtext|default(null) %}
  5. {% set statuses = _args.statuses|default([]) %}
  6. {% set actions = _args.actions|default([]) %}
  7. {% set bulk = _args.bulk|default(null) %}
  8. {% set lazyload = _args.lazyload|default(false) %}
  9. {% set htmlData = _args.htmlData|default({}) %}
  10. {% embed '@ui/common/data/item.html.twig' with {
  11.     helper: helper,
  12.     lazyload: lazyload,
  13.     htmlData: htmlData,
  14. } %}
  15.     {% block checkbox %}
  16.         {% if bulk is not empty %}
  17.             {% include '@ui/common/bulk/checkbox.html.twig' with {
  18.                 value: bulk
  19.             } %}
  20.         {% else %}
  21.             <div class="checkbox hidden-xs">&nbsp;</div>
  22.         {% endif %}
  23.     {% endblock %}
  24.     {% block details %}
  25.         <p class="module-li__title">{{ title|raw }}</p>
  26.         {% if text is not empty %}
  27.             <p class="module-li__url">{{ text|raw }}</p>
  28.         {% endif %}
  29.         {% if subtext is not empty %}
  30.             {% if subtext is iterable %}
  31.                 {% for st in subtext %}
  32.                     <p class="module-li__date">{{ st|raw }}</p>
  33.                 {% endfor %}
  34.             {% else %}
  35.                 <p class="module-li__date">{{ subtext|raw }}</p>
  36.             {% endif %}
  37.         {% endif %}
  38.     {% endblock %}
  39.     {% block statuses %}
  40.         {% if statuses is not empty %}
  41.             <div class="module-li__status">
  42.                 {% for status in statuses %}
  43.                     {% if status is not empty %}
  44.                         {% set tooltipText = null %}
  45.                         {% if status.text == 'Live' %}
  46.                             {% set tooltipText = 'This item is live to the public.' %}
  47.                         {% elseif status.text == 'Draft' %}
  48.                             {% set tooltipText = 'There is a draft of this item.' %}
  49.                         {% endif %}
  50.                         <span
  51.                             class="label label--{{ status.helper }}"
  52.                             {% if tooltipText is not empty %}
  53.                             data-toggle="tooltip"
  54.                             data-original-title="{{ tooltipText }}"
  55.                             data-placement="left"
  56.                             {% endif %}
  57.                         >
  58.                             {{ status.text }}
  59.                         </span>
  60.                     {% endif %}
  61.                 {% endfor %}
  62.             </div>
  63.         {% endif %}
  64.     {% endblock %}
  65.     {% block actions %}
  66.         {% if actions is not empty %}
  67.             <ul class="actions">
  68.                 {% for action in actions %}
  69.                     {% if action is not empty %}
  70.                         <li class="actions-li{% if action.disabled|default(false) is same as(true) %} disabled{% endif %}">
  71.                             {% if action.items|default([]) is not empty %}
  72.                                 <a class="actions-li__link" href="#" data-toggle="dropdown">
  73.                                     <em class="icon {{ action.icon }}"></em>
  74.                                 </a>
  75.                                 <ul class="dropdown-menu" role="menu" aria-labelledby="export">
  76.                                     {% for item in action.items %}
  77.                                         {% if item is not empty %}
  78.                                             <li role="presentation" class="text-{{ item.helper|default('default') }}">
  79.                                                 <a role="menuitem" tabindex="-1" href="{{ item.link|default('#') }}">{{ item.title }}</a>
  80.                                             </li>
  81.                                         {% endif %}
  82.                                     {% endfor %}
  83.                                 </ul>
  84.                             {% else %}
  85.                                 <a class="actions-li__link" href="{{ action.link|default('#') }}">
  86.                                     <em class="icon {{ action.icon }}"></em>
  87.                                 </a>
  88.                             {% endif %}
  89.                         </li>
  90.                     {% endif %}
  91.                 {% endfor %}
  92.             </ul>
  93.         {% endif %}
  94.     {% endblock %}
  95. {% endembed %}