nineskeletor/templates/Pagewidget/viewbookmark.html.twig

91 lines
4.8 KiB
Twig
Raw Permalink Normal View History

2023-02-01 09:03:27 +01:00
{% set widgetname="bookmark" %}
2023-01-23 09:46:34 +01:00
{% extends 'Pagewidget/widget.twig' %}
{% block widgetaction %}
{% if canadd %}
<i class="fas fa-text-height" title="Changer taille des items" onClick="changeWidget({{ entity.id }},'modedesktop',{{modedesktop}})"></i>
{% endif %}
{% endblock %}
{% block widgetbody %}
<div class="items-list">
{% for bookmark in bookmarks %}
{% set havebookmark=true %}
{% if bookmark.item %}
{% set bookmarktitle = bookmark.item.title %}
{% set bookmarksubtitle = bookmark.item.subtitle %}
{% set bookmarkbackgroundcolor = bookmark.item.color ? bookmark.item.color : app.session.get('colorbgbodydark')|raw %}
{% set bookmarktarget = bookmark.item.target %}
{% set bookmarkurl = ( bookmark.item.protected and not app.user ? path("app_login") : bookmark.item.url|replace({'#login#': username}) ) %}
{% set bookmarkcontent = bookmark.item.content %}
{% set bookmarkicon = (bookmark.item.icon ? bookmark.item.icon.label : "icon/icon_pin.png") %}
2023-01-12 16:14:31 +01:00
{% else %}
2023-01-23 09:46:34 +01:00
{% set bookmarktitle = bookmark.title %}
{% set bookmarksubtitle = bookmark.subtitle %}
{% set bookmarkbackgroundcolor = bookmark.color ? bookmark.color : app.session.get('colorbgbodydark')|raw %}
{% set bookmarktarget = bookmark.target %}
{% set bookmarkurl = bookmark.url|replace({'#login#': username}) %}
{% set bookmarkcontent = null %}
{% set bookmarkicon = bookmark.icon ? bookmark.icon.label : "icon/icon_pin.png" %}
2023-01-12 16:14:31 +01:00
{% endif %}
2023-01-23 09:46:34 +01:00
<div class="item {{itemsize}}" style="background-color: {{ bookmarkbackgroundcolor }};" data-idcategory="bookmark" data-title="{{bookmarktitle|lower}}">
<div class="item-container">
<div class="item-content">
{% if bookmarktarget == 'frame' %}
<a class="item-link" onClick="showItemframe('bookmark{{ bookmark.id }}','{{ bookmarkurl }}')">
{% else %}
<a class="item-link" href="{{ bookmarkurl }}" target="{{bookmarktarget }}">
{% endif %}
<img height="35" src="{{ path('app_minio_image',{file:bookmarkicon}) }}">
<div class="item-title">
<h3 >{{ bookmarktitle }}</h3>
<div class="item-subtitle">{{ bookmarksubtitle|nl2br }}</div>
</div>
</a>
2023-01-12 16:14:31 +01:00
2023-01-23 09:46:34 +01:00
<div class="item-action">
{% if canadd %}
{% if bookmark.item %}
<a style="display:none" onClick="delBookmark({{ bookmark.id }},{{ entity.id }},false)"><i class="item-heart fas fa-heart-crack"></i></a>
2023-01-12 16:14:31 +01:00
{% else %}
2023-01-23 09:46:34 +01:00
<a style="display:none" onClick="modBookmark({{ bookmark.id }},{{ entity.id }},false)"><i class="item-mod fas fa-file"></i></a>
<a style="display:none" onClick="delBookmark({{ bookmark.id }},{{ entity.id }},false)"><i class="item-trash fas fa-trash"></i></a>
2023-01-12 16:14:31 +01:00
{% endif %}
2023-01-23 09:46:34 +01:00
{% endif %}
2023-01-12 16:14:31 +01:00
2023-01-23 09:46:34 +01:00
{% if bookmarkcontent %}
<a style="display:none"><i class="item-info fas fa-circle-info"></i></a>
{% endif %}
</div>
</div>
2023-01-12 16:14:31 +01:00
2023-01-23 09:46:34 +01:00
<div class="item-description hide">{{ bookmarkcontent|raw }}</div>
</div>
</div>
{% endfor %}
{% if canadd %}
<div class="item {{ itemsize }}" style="background-color: var(--colorbgbodydark);" data-idcategory="bookmark">
<div class="item-container">
<div class="item-content">
<a class="item-link" onClick="addBookmark({{ entity.id }},false)">
<img height="35" src="{{ path('app_minio_image',{file:"icon/icon_add.png"}) }}">
<div class="item-title">
<h3 >Ajouter</h3>
<div class="item-subtitle">Ajouter un Lien</div>
</div>
</a>
<div class="item-action">
2023-01-12 16:14:31 +01:00
</div>
</div>
</div>
2023-01-23 09:46:34 +01:00
</div>
2023-01-12 16:14:31 +01:00
{% endif %}
</div>
2023-01-23 09:46:34 +01:00
{% endblock %}
2023-01-12 16:14:31 +01:00