{% set pinned = _args.pinned|default(null) %}
{% set color = _args.color|default('dblue') %}
{% set department = _args.department|default(null) %}
{% set subdepartment = _args.subdepartment|default(null) %}
{% set timestamp = _args.timestamp|default(null) %}
{% set actions = _args.actions|default([]) %}
{% set scheduledAt = _args.scheduledAt|default(null) %}
<div class="feedbox__meta">
<span class="status status--{{ color }}"></span>
<span class="feedbox__meta--name">
{% if department %}
<a class="feedbox__meta--link" href="#">
{{ department }}
{% if subdepartment %}
<span>({{ subdepartment }})</span>
{% endif %}
</a>
{% endif %}
{% if draft %}
<span class="font-12 ml-2">
{% if scheduledAt %}
<span class="feedstatus text-bold mr-1">Scheduled -</span>
<span class="status-time text-scheduled text-medium">{{ scheduledAt }}</span>
{% else%}
<span class="feedstatus text-bold mr-1">Unpublished</span>
{% if timestamp %}
<span class="status-time text-slate text-medium">{{ timestamp }}</span>
{% endif %}
{% endif %}
</span>
{% else %}
{% if timestamp %}
<span class="feedbox__meta--time">{{ timestamp }}</span>
{% endif %}
{% endif %}
</span>
{% if actions %}
<span class="options">
{% if pinned is not empty %}
<span class="feedbox__pinned{% if pinned.active|default(false) %} pinned{% endif %}">
<i class="{{ pinned.icon|default('icon-pin') }}"></i>
{{ pinned.text|default('Pinned') -}}
</span>
{% endif %}
<a class="options-toggle" href="#">
<i class="icon-moredots"></i>
</a>
<div class="options-drawer">
{% for action in actions %}
{% if action.toggler is defined %}
<label class="options-pin">
<input
type="checkbox"
class="sr-only"
{% if action.toggled %}checked{% endif %}
data-trigger="toggler"
data-toggler-url="{{ action.toggler }}"
/>
<i class="{{ action.icon }} btn btn-gray"></i>
</label>
{% elseif action.items is defined %}
<span class="dropdown">
<a class="dropdown-toggle dropdown-toggle--noicon btn btn-gray" data-toggle="dropdown" href="#">
{{ action.title }}
<i class="icon-angledown"></i>
</a>
<span class="dropdown-menu dropdown-menu-right">
{% for item in action.items %}
<a
class="dropdown-item"
href="{{ item.link|default('#') }}"
{% if item.modal|default(null) %}data-toggle="modal" data-target="#{{ item.modal }}"{% endif %}
{% if item.sidepanel|default(null) %}data-toggle="sidepanel" data-target="#{{ item.sidepanel }}"{% endif %}
>{{ item.title }}</a>
{% endfor %}
</span>
</span>
{% else %}
<a
class="btn btn-gray"
href="{{ action.link|default('#') }}"
{% if action.modal|default(null) %}data-toggle="modal" data-target="#{{ action.modal }}"{% endif %}
{% if action.sidepanel|default(null) %}data-toggle="sidepanel" data-target="#{{ action.sidepanel }}"{% endif %}
>{{ action.title }}</a>
{% endif %}
{% endfor %}
</div>
</span>
{% endif %}
</div>