Sphinx template needs precise "Log a doc bug" link created on-demand similar to current functionality

Bug #1421799 reported by Anne Gentle
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
openstack-manuals
Fix Released
High
Anne Gentle

Bug Description

The current implementation of the "log a bug" feature on each page of docs.openstack.org built from the clouddocs-maven-plugin is this snippet of javascript that activates when the "bug" icon is pushed.

https://github.com/stackforge/clouddocs-maven-plugin/blob/a3621dfb4b620f3993d826649f7b944dae4b2407/src/main/resources/common/jquery/main-openstack.js#L223

function logABug(bugTitle, fieldComment){
    var urlBase = "https://bugs.launchpad.net/openstack-manuals/+filebug?field.title="
    var bugLink = urlBase + encodeURIComponent(bugTitle) + "&field.comment=" + lineFeed + lineFeed + "-----------------------------------" + lineFeed + fieldComment;
   document.getElementById("logABugLink1").href=bugLink;
   document.getElementById("logABugLink2").href=bugLink;
}

This snippet should be incorporated into the Sphinx theme at http://git.openstack.org/cgit/openstack/openstackdocstheme in the docs.js file.

Revision history for this message
Anne Gentle (annegentle) wrote :

Also, the page template will need to be updated so that the bug icon is contained by:

 <a id="logABugLink1" href="" target="_blank" title="Found an error? Report a bug against this page"><i class="icon-bug">

Changed in openstack-manuals:
assignee: nobody → Bernd Bausch (berndbausch)
Revision history for this message
Tom Fifield (fifieldt) wrote :

These files:

https://github.com/stackforge/clouddocs-maven-plugin/blob/master/src/main/resources/common/jquery/main-openstack.js

https://github.com/stackforge/clouddocs-maven-plugin/blob/master/src/main/resources/common/main-openstack.js

contain the javascript magic (search for "launchpad")
that make the bug URLs.

So, somewhere in the template, I'd guess there would be a place where
javascript is included. Solving this bug is probably has two hard bits:

1) Including that javascript, making a button to call the logABug method
2) Working out how to pre-populate the variables (example below) needed
to lodge the bug.

var sourceFile = "source File:
file:/home/jenkins/workspace/openstack-manuals-tox-doc-publishdocs/doc/install-guide/bk-openstack-install-guide.xml"
   var xmlId = "xml:id: openstack-install-manual"
   var lineFeed = "%0A";
   var docUrl = "URL: " + window.location;
   var bugTitle = "OpenStack Installation Guide for Red Hat Enterprise
Linux 7, CentOS 7, and Fedora 20 in OpenStack Installation Guide for Red
Hat Enterprise Linux 7, CentOS 7, and Fedora 20 - kilo";
   var buildTime = "Built: 2015-02-19T08:19:31+00:00";
   var gitSha = "git SHA: 46962ea4e450b5cd6250e1aaccf83311fabb21c4";
   var fieldComment = encodeURI(buildTime) + lineFeed +
encodeURI(gitSha) + lineFeed + encodeURI(docUrl) + lineFeed +
encodeURI(sourceFile) + lineFeed + encodeURI(xmlId);
   logABug(bugTitle,fieldComment);

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to openstackdocstheme (master)

Fix proposed to branch: master
Review: https://review.openstack.org/160151

Changed in openstack-manuals:
status: Confirmed → In Progress
Revision history for this message
Bernd Bausch (berndbausch) wrote :

I decided to submit a partial fix, consisting of Javascript code that works but is probably in the wrong place (layout.html for now) and is still unable to pull information equivalent to the current DocBook solution. The commit message has details.

Changed in openstack-manuals:
assignee: Bernd Bausch (berndbausch) → Anne Gentle (annegentle)
Changed in openstack-manuals:
assignee: Anne Gentle (annegentle) → Bernd Bausch (berndbausch)
Changed in openstack-manuals:
assignee: Bernd Bausch (berndbausch) → Anne Gentle (annegentle)
Changed in openstack-manuals:
assignee: Anne Gentle (annegentle) → Andreas Jaeger (jaegerandi)
Changed in openstack-manuals:
assignee: Andreas Jaeger (jaegerandi) → Bernd Bausch (berndbausch)
Changed in openstack-manuals:
assignee: Bernd Bausch (berndbausch) → Andreas Jaeger (jaegerandi)
Changed in openstack-manuals:
assignee: Andreas Jaeger (jaegerandi) → Bernd Bausch (berndbausch)
Changed in openstack-manuals:
assignee: Bernd Bausch (berndbausch) → Anne Gentle (annegentle)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to openstackdocstheme (master)

Reviewed: https://review.openstack.org/160151
Committed: https://git.openstack.org/cgit/openstack/openstackdocstheme/commit/?id=606ec02d4a1b22cd5e4f05669eaa3756d5e4f8ed
Submitter: Jenkins
Branch: master

commit 606ec02d4a1b22cd5e4f05669eaa3756d5e4f8ed
Author: Bernd Bausch <email address hidden>
Date: Sun Mar 1 13:04:09 2015 +0900

    "log a bug" link added to Sphinx-based documentation

    Current documentation is Docbook-based. Each page features two
    "log a bug" links near the top and the bottom. This bug fix
    modifies the openstackdocstheme to do something
    similar for future Sphinx-based documentation pages.

    Regarding functionality:
    ------------------------
    In the current DocBook-based implementation, a click on
    "log a bug" opens a launchpad page with the bug summary and
    further information prepopulated. Summary is the name of the
    book, such as "Install Guide for Ubuntu - Icehouse"; an example for
    Further Information is:

        -----------------------------------
        Built: 2015-01-06T17:15:01 00:00
        git SHA: 233c8098bbdc5bc83bbd74403650feb6610f4b95
        URL:
        http://docs.openstack.org/icehouse/install-guide/install/apt/content/
        source File:
        file:/home/jenkins/workspace/openstack-manuals-tox-doc-publishdocs/doc/install-guide/bk_openstackinstallguide.xml
        xml:id: openstack-install-manual-icehouse

    With our Sphinx-based docs, the Release value, git SHA, and source file should be sufficient. Here is the new functionality:

    -------------------------------------
    Release: 1.0 on 2015-04-06 12:27
    SHA: c43d442c4d053891a22bde1232f9fbea18bad44e
    Source: http://git.openstack.org/cgit/openstack/openstack-manuals/tree/doc/source/index.rst

    Change-Id: Ib60146d993ff67fc3f8fd8703cdad1935f7ec6bb
    Partial-Bug: #1421799

Anne Gentle (annegentle)
Changed in openstack-manuals:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.