From d175b7686437b616e113e34f4dabc86ffb8d10e4 Mon Sep 17 00:00:00 2001 From: Adam Spiers Date: Thu, 21 Feb 2019 10:47:40 +0000 Subject: [PATCH] Fix per-project deprecation badges I2498f00a6c863d078a70289a655b0aa3958325ed changed the badge shown at the top of documentation pages which describes the state of the release of the documentation currently being viewed. However the unfortunately release-switcher dropdown it introduced into deprecated_badge.tmpl had the side-effect of affecting the badge.html which is dynamically included in project documentation by some Javascript in theme/openstackdocs/layout.html within the openstackdocstheme repository, and the new release switcher was only designed to work with openstack-manuals, not with any other projects. This broke the badge for all releases (www/$RELEASE/badge.html), excluding www/latest/ which has a hard-coded badge.html. This was missed during testing because the dynamic inclusion mechanism is hardcoded to retrieve the badge from https://docs.openstack.org rather than any local repository. For a quick fix, reintroduce the old badge template as www/templates/project_deprecated_badge.tmpl and change all the per-project badges to use this. Later we can investigate the possibility of enhancing this per-project badge so that it provides release-switching functionality like the badge currently in openstack-manuals. Change-Id: I53c4b35e31bcdda16ffd50f9a8a26c773c8d3574 --- www/austin/badge.html | 2 +- www/bexar/badge.html | 2 +- www/cactus/badge.html | 2 +- www/diablo/badge.html | 2 +- www/essex/badge.html | 2 +- www/folsom/badge.html | 2 +- www/grizzly/badge.html | 2 +- www/havana/badge.html | 2 +- www/juno/badge.html | 2 +- www/kilo/badge.html | 2 +- www/liberty/badge.html | 2 +- www/mitaka/badge.html | 2 +- www/newton/badge.html | 2 +- www/ocata/badge.html | 2 +- www/pike/badge.html | 2 +- www/queens/badge.html | 2 +- www/rocky/badge.html | 2 +- www/templates/project_deprecated_badge.tmpl | 44 +++++++++++++++++++++ 18 files changed, 61 insertions(+), 17 deletions(-) create mode 100644 www/templates/project_deprecated_badge.tmpl diff --git a/www/austin/badge.html b/www/austin/badge.html index 8db46c5c3a..d0ad4745d3 100644 --- a/www/austin/badge.html +++ b/www/austin/badge.html @@ -1 +1 @@ -{% include 'templates/deprecated_badge.tmpl' %} \ No newline at end of file +{% include 'templates/project_deprecated_badge.tmpl' %} \ No newline at end of file diff --git a/www/bexar/badge.html b/www/bexar/badge.html index 8db46c5c3a..d0ad4745d3 100644 --- a/www/bexar/badge.html +++ b/www/bexar/badge.html @@ -1 +1 @@ -{% include 'templates/deprecated_badge.tmpl' %} \ No newline at end of file +{% include 'templates/project_deprecated_badge.tmpl' %} \ No newline at end of file diff --git a/www/cactus/badge.html b/www/cactus/badge.html index 8db46c5c3a..d0ad4745d3 100644 --- a/www/cactus/badge.html +++ b/www/cactus/badge.html @@ -1 +1 @@ -{% include 'templates/deprecated_badge.tmpl' %} \ No newline at end of file +{% include 'templates/project_deprecated_badge.tmpl' %} \ No newline at end of file diff --git a/www/diablo/badge.html b/www/diablo/badge.html index 8db46c5c3a..d0ad4745d3 100644 --- a/www/diablo/badge.html +++ b/www/diablo/badge.html @@ -1 +1 @@ -{% include 'templates/deprecated_badge.tmpl' %} \ No newline at end of file +{% include 'templates/project_deprecated_badge.tmpl' %} \ No newline at end of file diff --git a/www/essex/badge.html b/www/essex/badge.html index 8db46c5c3a..d0ad4745d3 100644 --- a/www/essex/badge.html +++ b/www/essex/badge.html @@ -1 +1 @@ -{% include 'templates/deprecated_badge.tmpl' %} \ No newline at end of file +{% include 'templates/project_deprecated_badge.tmpl' %} \ No newline at end of file diff --git a/www/folsom/badge.html b/www/folsom/badge.html index 8db46c5c3a..d0ad4745d3 100644 --- a/www/folsom/badge.html +++ b/www/folsom/badge.html @@ -1 +1 @@ -{% include 'templates/deprecated_badge.tmpl' %} \ No newline at end of file +{% include 'templates/project_deprecated_badge.tmpl' %} \ No newline at end of file diff --git a/www/grizzly/badge.html b/www/grizzly/badge.html index 8db46c5c3a..d0ad4745d3 100644 --- a/www/grizzly/badge.html +++ b/www/grizzly/badge.html @@ -1 +1 @@ -{% include 'templates/deprecated_badge.tmpl' %} \ No newline at end of file +{% include 'templates/project_deprecated_badge.tmpl' %} \ No newline at end of file diff --git a/www/havana/badge.html b/www/havana/badge.html index 8db46c5c3a..d0ad4745d3 100644 --- a/www/havana/badge.html +++ b/www/havana/badge.html @@ -1 +1 @@ -{% include 'templates/deprecated_badge.tmpl' %} \ No newline at end of file +{% include 'templates/project_deprecated_badge.tmpl' %} \ No newline at end of file diff --git a/www/juno/badge.html b/www/juno/badge.html index 8db46c5c3a..d0ad4745d3 100644 --- a/www/juno/badge.html +++ b/www/juno/badge.html @@ -1 +1 @@ -{% include 'templates/deprecated_badge.tmpl' %} \ No newline at end of file +{% include 'templates/project_deprecated_badge.tmpl' %} \ No newline at end of file diff --git a/www/kilo/badge.html b/www/kilo/badge.html index 8db46c5c3a..d0ad4745d3 100644 --- a/www/kilo/badge.html +++ b/www/kilo/badge.html @@ -1 +1 @@ -{% include 'templates/deprecated_badge.tmpl' %} \ No newline at end of file +{% include 'templates/project_deprecated_badge.tmpl' %} \ No newline at end of file diff --git a/www/liberty/badge.html b/www/liberty/badge.html index 8db46c5c3a..d0ad4745d3 100644 --- a/www/liberty/badge.html +++ b/www/liberty/badge.html @@ -1 +1 @@ -{% include 'templates/deprecated_badge.tmpl' %} \ No newline at end of file +{% include 'templates/project_deprecated_badge.tmpl' %} \ No newline at end of file diff --git a/www/mitaka/badge.html b/www/mitaka/badge.html index 8db46c5c3a..d0ad4745d3 100644 --- a/www/mitaka/badge.html +++ b/www/mitaka/badge.html @@ -1 +1 @@ -{% include 'templates/deprecated_badge.tmpl' %} \ No newline at end of file +{% include 'templates/project_deprecated_badge.tmpl' %} \ No newline at end of file diff --git a/www/newton/badge.html b/www/newton/badge.html index 8db46c5c3a..d0ad4745d3 100644 --- a/www/newton/badge.html +++ b/www/newton/badge.html @@ -1 +1 @@ -{% include 'templates/deprecated_badge.tmpl' %} \ No newline at end of file +{% include 'templates/project_deprecated_badge.tmpl' %} \ No newline at end of file diff --git a/www/ocata/badge.html b/www/ocata/badge.html index 8db46c5c3a..d0ad4745d3 100644 --- a/www/ocata/badge.html +++ b/www/ocata/badge.html @@ -1 +1 @@ -{% include 'templates/deprecated_badge.tmpl' %} \ No newline at end of file +{% include 'templates/project_deprecated_badge.tmpl' %} \ No newline at end of file diff --git a/www/pike/badge.html b/www/pike/badge.html index 8db46c5c3a..d0ad4745d3 100644 --- a/www/pike/badge.html +++ b/www/pike/badge.html @@ -1 +1 @@ -{% include 'templates/deprecated_badge.tmpl' %} \ No newline at end of file +{% include 'templates/project_deprecated_badge.tmpl' %} \ No newline at end of file diff --git a/www/queens/badge.html b/www/queens/badge.html index 8db46c5c3a..d0ad4745d3 100644 --- a/www/queens/badge.html +++ b/www/queens/badge.html @@ -1 +1 @@ -{% include 'templates/deprecated_badge.tmpl' %} \ No newline at end of file +{% include 'templates/project_deprecated_badge.tmpl' %} \ No newline at end of file diff --git a/www/rocky/badge.html b/www/rocky/badge.html index 8db46c5c3a..d0ad4745d3 100644 --- a/www/rocky/badge.html +++ b/www/rocky/badge.html @@ -1 +1 @@ -{% include 'templates/deprecated_badge.tmpl' %} \ No newline at end of file +{% include 'templates/project_deprecated_badge.tmpl' %} \ No newline at end of file diff --git a/www/templates/project_deprecated_badge.tmpl b/www/templates/project_deprecated_badge.tmpl new file mode 100644 index 0000000000..1ad79e08aa --- /dev/null +++ b/www/templates/project_deprecated_badge.tmpl @@ -0,0 +1,44 @@ +{# -*- mode: html -*- #} + + +{# reason to not use the CSSDIR its because introduces a relative path #} +{# not an absolute, so when its included on docthemes, its tried to include the css #} +{# from a wrong path instead of the right one #} + + + + +
+ x +
+ {% if SERIES_INFO.status == 'obsolete' %} +

+ This release is no longer supported by the community. The current supported release is {{RELEASED_SERIES.capitalize()}}. +

+ {% elif SERIES_INFO.status == 'EOL' %} +

+ This release is no longer supported by the community. The current supported release is {{RELEASED_SERIES.capitalize()}}. +

+ {% elif SERIES == RELEASED_SERIES %} +

+ This is the current supported release. +

+ {% elif SERIES_INFO.status == 'maintained' %} +

+ This is maintained, but not the current release. The current supported + release is {{RELEASED_SERIES.capitalize()}}. +

+ {% elif SERIES_INFO.status == 'development' %} +

+ This release is under development. The current supported release is {{RELEASED_SERIES.capitalize()}}. +

+ {% endif %} +  Back to Top +
+
\ No newline at end of file