{% extends 'shatailadmin/pages/side_panels/includes/action_list_item.html' %} {% load shatailadmin_tags i18n %} {% comment %} This template is used to show Live, Draft, Live and Draft, In Moderation or Live and In Moderation. Sometimes {{ block.super }} will be called two times in the instances where the page is in multiple states eg. Live + Draft {% endcomment %} {% block content %}
{% trans 'Page status: ' as screen_reader_title_prefix %} {% with workflow_state=page.current_workflow_state draft_revision=page.get_latest_revision live_revision=page.live_revision %} {# Live section #} {% if page.live %} {% trans 'Live' as title %} {% if live_revision %} {% timesince_last_update live_revision.created_at user_display_name=live_revision.user|user_display_name use_shorthand=True as help_text %} {% endif %} {% with icon_name='doc-full-inverse' %} {% if page.has_unpublished_changes or workflow_state %} {% with hide_action=True %} {{ block.super }} {% endwith %} {% else %} {{ block.super }} {% endif %} {% endwith %} {% endif %} {# Draft and In moderation settings #} {% if workflow_state %} {# In Moderation Settings #} {% trans 'In Moderation' as title %} {% if workflow_state.created_at %} {% timesince_last_update workflow_state.created_at user_display_name=workflow_state.requested_by|user_display_name use_shorthand=True as help_text %} {% endif %} {% url 'shatailadmin_pages:workflow_status' page.id as action_url %} {% trans 'View details' as action_text %} {# Icon #} {% with icon_name='draft' hide_action=False %} {{ block.super }} {% endwith %} {# Draft Settings #} {% elif page.has_unpublished_changes %} {% trans 'Draft' as title %} {% if draft_revision.created_at %} {% timesince_last_update draft_revision.created_at user_display_name=draft_revision.user|user_display_name use_shorthand=True as help_text %} {% endif %} {# Icon #} {% with icon_name='draft' %} {{ block.super }} {% endwith %} {% endif %} {% endwith %}
{% endblock %} {% block action %} {% if workflow_state %} {% include 'shatailadmin/pages/side_panels/includes/side_panel_button.html' with attr='data-action-workflow-status' data_url=action_url text=action_text %} {% else %} {% url 'shatailadmin_pages:history' page.id as action_url %} {% trans 'View history' as action_text %} {{ block.super }} {% endif %} {% endblock %} {% block bottom %} {# Workflow Status #} {% with workflow_state=page.current_workflow_state draft_revision=page.get_latest_revision %} {% if workflow_state %}
{% icon name='warning' class_name='w-w-4 w-h-4 w-text-info-100 w-shrink-0' %}
{% if workflow_state.status == 'needs_changes' %} {% trans " Changes requested" %} {{ workflow_state.current_task_state.finished_at|naturaltime }} {% else %} {% if workflow_state.status == "in_progress" %} {% trans "Awaiting" %} {% trans "since" as since_text %} {% else %} {{ workflow_state.get_status_display }} {% endif %} {{ workflow_state.current_task_state.task.name }} {{ workflow_state.current_task_state.started_at|naturaltime }} {% endif %}
{% endif %} {# Scheduled publishing #} {% if draft_revision and draft_revision.approved_go_live_at %}
{% icon name='info-circle' class_name='w-w-4 w-h-4 w-text-info-100 w-shrink-0' %}
{% trans 'This will publish at ' %}{{ draft_revision.approved_go_live_at }}
{% endif %} {% endwith %} {% endblock %}