Files
vision/templates/_cells/documentActions.html.twig
Xbird 9f22f5b1ee V-Beta-1.0.0
Vision is out of alpha !
2022-02-02 17:46:29 +01:00

27 lines
2.7 KiB
Twig

{% if is_granted('view', document) %}
{% if currentPath != path('document_view', {'id': document.id}) and noview is not defined %}
<a href="{{ path('document_view', {'id': document.id}) }}" class="btn btn-primary btn-sm" data-bs-toggle="tooltip" data-placement="top" title="{% trans %}tooltip_view{% endtrans %}"><i class="far fa-eye"></i></a>
{% endif %}
{% if is_granted('edit', document) and noedit is not defined %}
<a href="{{ path('document_edit', {'id': document.id}) }}" class="btn btn-success btn-sm" data-bs-toggle="tooltip" data-placement="top" title="{% trans %}tooltip_edit{% endtrans %}"><i class="far fa-edit"></i></a>
{% endif %}
{% if is_granted('delete', document) and nodelete is not defined %}
<a href="{{ path('document_delete', {'id': document.id}) }}" class="btn btn-danger btn-sm" data-bs-toggle="tooltip" data-placement="top" title="{% trans %}tooltip_delete{% endtrans %}" onclick="return confirm('{% trans %}confirm_ok_delete{% endtrans %}')"><i class="fa fa-trash"></i></a>
{% endif %}
{% if document.allowShare and noshare is not defined %}
<a href="{{ path('share', {'share': document.share}) }}" class="btn btn-info btn-sm" data-bs-toggle="tooltip" data-placement="top" title="{% trans %}tooltip_share_link{% endtrans %}" target="_blank"><i class="fa fa-link"></i></a>
{% endif %}
{% if is_granted('archive', document) and noarchive is not defined %}
<a href="{{ path('document_archive', {'id': document.id}) }}" class="btn btn-{% if document.archive %}danger{% else %}info{% endif %} btn-sm" data-bs-toggle="tooltip" data-placement="top" title="{% if document.archive %}{% trans %}tooltip_unarchive{% endtrans %}{% else %}{% trans %}tooltip_archive{% endtrans %}{% endif %}" onclick="return confirm('Are you ok to {% if document.archive %}un{% endif %}archive this ?')"><i class="fas fa-archive"></i></a>
{% endif %}
{% if addtofolder is defined %}
<a href="{{ path('folder_document_add', {'id': addtofolder, 'Document': document.id}) }}" class="btn btn-success btn-sm" data-bs-toggle="tooltip" data-placement="top" title="{% trans %}tooltip_add_to_folder{% endtrans %}"><i class="fas fa-folder-plus"></i></a>
{% endif %}
{% if removefromfolder is defined %}
<a href="{{ path('folder_document_remove', {'id': removefromfolder, 'Document': document.id}) }}" class="btn btn-danger btn-sm" data-bs-toggle="tooltip" data-placement="top" title="{% trans %}tooltip_remove_from_folder{% endtrans %}" onclick="return confirm('{% trans %}confirm_ok_remove_from_folder{% endtrans %}')"><i class="fas fa-folder-minus"></i></a>
{% endif %}
{% else %}
<span class="text-danger"><i class="fas fa-eye-slash"></i></span>
{% endif %}