{% extends "includes/crud/table_list.html" %} {% load trans blocktrans from i18n %} {% block top_left_menu_items %} {% endblock top_left_menu_items %} {% block create_button %} {% url "projects_temporary_access_create" project.slug as create_url %} {% trans "Add share" as create_text %} {% include "includes/crud/create_button.html" with url=create_url text=create_text %} {% endblock create_button %} {% block list_placeholder_icon_class %} fa-duotone fa-share-nodes {% endblock list_placeholder_icon_class %} {% block list_placeholder_header %} {% blocktrans trimmed %} No active shares are configured yet {% endblocktrans %}
{% blocktrans trimmed %} Sharing tokens can be used to share private documentation projects to users outside your organization. {% endblocktrans %}
{% endblock list_placeholder_header %} {% block list_placeholder_text %} {% trans "Learn more" %} {% endblock list_placeholder_text %} {% block list_item_right_buttons %} {% if object.access_type != "http_header_token" %} {# TODO make this a dropdown menu so we can provide a bit more context #} {# TODO maybe also make this button disabled if there is not sharing URL? #} {% endif %} {% url "projects_temporary_access_delete" object.project.slug object.pk as form_url %} {% trans "Remove share" as action_text %} {% blocktrans trimmed asvar content_text with share=object.description %} Remove share {{ share }}? {% endblocktrans %} {% include "includes/crud/remove_button.html" with id=object.pk form_url=form_url action_text=action_text content_text=content_text %} {% endblock list_item_right_buttons %} {% block list_item_icon %} {% if object.access_type == "password" %} {% elif object.access_type == "token" %} {% elif object.access_type == "http_header_token" %} {% endif %} {% endblock list_item_icon %} {% block list_item_header %} {{ object.description|truncatechars:24 }}
{% if object.allow_all %} {% blocktrans trimmed %} All versions {% endblocktrans %} {% else %} {% with versions=object.versions.all %} {% blocktrans trimmed count version_count=versions|length with version_name=versions.0.verbose_name %} Version {{ version_name }} {% plural %} {{ version_count }} versions {% endblocktrans %} {% endwith %} {% endif %}
{% endblock list_item_header %} {% block list_item_meta_items %}
{% if object.access_type == "password" %} {# Nothing useful to display, but take up the same space #} {% elif object.access_type == "token" %} {{ object.token|slice:"0:4" }}**** {% elif object.access_type == "http_header_token" %} {{ object.token|slice:"0:4" }}**** {% endif %}
{% endblock list_item_meta_items %} {% block list_item_extra_items %} {# There is no reason to show expired status here as these shares just disappear #}
{% trans "Expires" %}
{{ object.expires }}
{% trans "Last used" %}
{% if object.last_used_at %} {{ object.last_used_at|timesince }} {% else %} {% trans "Never" %} {% endif %}
{% endblock list_item_extra_items %}