From c7f1ed00282b6cbfe9e06993b6abf9e54709b2b3 Mon Sep 17 00:00:00 2001 From: chenxing Date: Thu, 13 Sep 2018 00:21:53 +0800 Subject: [PATCH] Fix the incorrect storyboard url Using "repository_name" instead of "bug_project" to combine with the "urlBase" string, if set use_storyboard to "True". storyboard URLs are in this format: "https://storyboard.openstack.org/#!/project/"+"openstack/whereto" not: "https://storyboard.openstack.org/#!/project/"+"whereto" Change-Id: Ib553d95f22c7848a5bd537b8929a2d6e6625451b --- doc/source/index.rst | 25 ++++++++----------- .../theme/openstackdocs/script_footer.html | 5 +++- .../theme/openstackdocs/static/js/docs.js | 4 +-- .../storyboard-url-cee60d9449ec2980.yaml | 6 +++++ 4 files changed, 23 insertions(+), 17 deletions(-) create mode 100644 releasenotes/notes/storyboard-url-cee60d9449ec2980.yaml diff --git a/doc/source/index.rst b/doc/source/index.rst index 0988327..5e153c2 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -49,23 +49,22 @@ Using the theme The prefix and repo name. For example, ``'openstack/python-glanceclient'``. + ``use_storyboard`` + Set to ``True`` if using StoryBoard. + + .. note:: + + If using StoryBoard, do not set ``bug_project`` and ``bug_tag`` + options. + ``bug_project`` The project name or ID. For launchpad, it's a string like ``python-glanceclient``. If unspecified, the "Report a bug" - links are not shown. - - If your project uses ``storyboard.openstack.org``, it's a - string like ``openstack-ci`` for the project group. - - ..note:: Previously StoryBoard showed numbers, and thus you set - this to a project number instead like ``901``. Set this to a - string instead and also use the ``use_storyboard`` variable. + links are not shown. This option can be removed if using StoryBoard. ``bug_tag`` - Launchpad bug tag. If unspecified, no tag is set. The default is empty. - - ``use_storyboard`` - Set to ``True`` if using StoryBoard. + Launchpad bug tag. If unspecified, no tag is set. The default is empty. + This option can be removed if using StoryBoard. One example for a project using launchpad:: @@ -79,8 +78,6 @@ Using the theme # openstackdocstheme options repository_name = 'openstack-infra/infra-manual' use_storyboard = True - bug_project = 'openstack-ci' - bug_tag = '' #. Remove the options that will be automatically configured by the theme. diff --git a/openstackdocstheme/theme/openstackdocs/script_footer.html b/openstackdocstheme/theme/openstackdocs/script_footer.html index aab205e..e8033af 100644 --- a/openstackdocstheme/theme/openstackdocs/script_footer.html +++ b/openstackdocstheme/theme/openstackdocs/script_footer.html @@ -53,6 +53,9 @@ /* gitsha, project and bug_tag rely on variables in conf.py */ var gitSha = "SHA: {{ gitsha }}"; + {%- if repository_name %} + var repositoryName = "{{ repository_name }}"; + {%- endif %} {%- if bug_project %} var bugProject = "{{ bug_project }}"; {%- endif %} @@ -78,5 +81,5 @@ lineFeed + encodeURI(gitSha) + lineFeed + encodeURI(gitURL) ; - logABug(bugTitle, bugProject, fieldComment, fieldTags); + logABug(bugTitle, bugProject, fieldComment, fieldTags, repositoryName); diff --git a/openstackdocstheme/theme/openstackdocs/static/js/docs.js b/openstackdocstheme/theme/openstackdocs/static/js/docs.js index b0a74ec..6de6369 100644 --- a/openstackdocstheme/theme/openstackdocs/static/js/docs.js +++ b/openstackdocstheme/theme/openstackdocs/static/js/docs.js @@ -104,7 +104,7 @@ $('div.deprecated > p').prepend('