{% extends "projects/base.html" %} {% load crispy from crispy_forms_tags %} {% load trans blocktrans from i18n %} {% load alter_field from ext_theme_tags %} {% block title %} {% if version %} {{ version.verbose_name }} - {{ version.project.name }} {% else %} {% trans "Activate a new version" %} {% endif %} {% endblock title %} {% block content-header %} {% with versions_active="active" %} {% include "projects/partials/header.html" %} {% endwith %} {% endblock content-header %} {% block content %}
{# Common header #}

{% if version %} {% trans "Edit version" %} {% else %} {% trans "Activate a new version" %} {% trans "Select a version to activate" %} {% endif %}

{% if version %} {# Left card display when there is a version to edit #}
{{ version.verbose_name }}
{{ version.identifier_friendly }}
{% if version.active %}
{% url "projects_redirects_create" project_slug=project.slug as url_redirects %} {% blocktrans trimmed with url=url_redirects %} Deactivating a version or changing its slug will result in the deletion of its documentation. Make sure to create a redirect for these URLs to ensure old links continue working. {% endblocktrans %}
{% endif %}
{% csrf_token %} {% alter_field form.active classes="ui toggle checkbox" %} {% alter_field form.hidden classes="ui toggle checkbox" %} {{ form | crispy }}
{% if version.built %} {% blocktrans count build_count=version.builds.count %} {{ build_count }} build {% plural %} {{ build_count }} builds {% endblocktrans %} {% else %} No builds yet {% endif %}
{% else %} {# Search for new version to activate #} {% block project_version_form_search %}
{# Pass information from Django into site JS, avoid CSP as inline JS #} {# Placeholder until a version is selected #} {% block version_create_placeholder %}
{% trans "Configure a new branch or tag" %}

{% blocktrans trimmed %} New documentation versions can be added from existing tags or branches. {% endblocktrans %}

{% trans "Learn more" %}
{% trans "Are your versions out of date?" %} {% trans "Resync versions" %}
{% endblock version_create_placeholder %}
{% endblock project_version_form_search %} {% endif %}
{# Help display? #}

{% trans "Help topics" %}

{% include "includes/elements/link.html" with url="https://docs.readthedocs.io/page/versions.html" text=_("Versions") is_external=True class="item" %} {% include "includes/elements/link.html" with url="https://docs.readthedocs.io/page/versions.html#version-states" text=_("Version states") is_external=True class="item" %} {% include "includes/elements/link.html" with url="https://docs.readthedocs.io/page/versions.html#privacy-levels" text=_("Privacy levels") is_external=True class="item" %} {% include "includes/elements/link.html" with url="https://docs.readthedocs.io/page/guides/automation-rules.html" text=_("Version automation rules") is_external=True class="item" %} {% include "includes/elements/link.html" with url="https://docs.readthedocs.io/" text=_("Documentation index") is_external=True class="item" %}
{% endblock content %}