{% comment "rst" %} Build name ========== ``builds/includes/build_name.html`` A common include for showing the build name in a heading or title This is a more complex heading than other elements. It uses a breadcrumb to show the version the build was for, as well as the type of build in the case that build is for a pull request version. When used as a page title, on the build detail page, show some extra text and nested breadcrumbs that we don't need to show in the build listing. This gives some UI to link back to the build list or the version list. Normally, the whole breadcrumb is linked as single link. Template parameters ------------------- .. describe:: build The build instance to generate a name/header for. .. describe:: is_page_title **Boolean, default=False**. Add full build breadcrumbs and link each section separately. This is used in the build detail page, where we want the breadcrumbs to act more like breadcrumbs and want to link back to the list of version builds. On the build listing page, we only want to link to the build detail page for the build. {% endcomment %} {% load blocktrans trans from i18n %} {# djlint:off #} {# When not a page title, treat the entire breadcrumb as a link to the build #} {% if not is_page_title %}{% endif %} {# When used a a page title, link the sections independently #} {% if is_page_title %} {% endif %} {% if build.is_external %} {{ build.external_version_name | lower | capfirst }} {{ build.get_version_name }} {% else %} {# Translators: this renders with the version name, example "Version latest" #} {% blocktrans trimmed with version_name=build.get_version_name %} Version {{ version_name }} {% endblocktrans %} {% endif %} {% if is_page_title %} {% endif %} {% if is_page_title %} {# When used as a page title, show a section link for the filtered build list #} / {# Translators: this refers to a list of builds for a single project #} {% trans "Builds" %} {% endif %} / {% if is_page_title %} {% endif %} #{{ build.pk }} {% if is_page_title %} {% endif %} {% if not is_page_title %}{% endif %} {# djlint:on #}