Bug 839975
Summary: | RFE: scripts directory in brand | ||
---|---|---|---|
Product: | [Community] Publican | Reporter: | Joshua Wulf <jwulf> |
Component: | publican | Assignee: | Jeff Fearn 🐞 <jfearn> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | tools-bugs <tools-bugs> |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | 2.3 | CC: | kpalko, lcarlon, rglasz, rlandman+disabled, xma |
Target Milestone: | 3.1 | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | 3.1.0 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2013-02-06 03:40:53 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Joshua Wulf
2012-07-13 10:46:47 UTC
.woff web fonts are another resource that I'm bundling in my brand This will also need support for the relative pathing for desktop and web output - in my Brand xsl customization i'm injecting the <script> tag. The relative path for the scripts will be different depending on whether the book is being built for the centralised web version of the brand, or the decentralised desktop version of the brand. This worked in Publican 2, but stopped working in Publican 3. I need this to get the Portal issue https://bugzilla.redhat.com/show_bug.cgi?id=845806 addressed, and I also need it for the MRG 2.3 release in February 2013. ^ "This" means bundling the javascript in the css directory. The css directory contents are no longer installed in the web version of the brand in Publican 3, so my brand's javascript files are not showing up on the server. This fix has been committed to the devel branch for inclusion in Publican 3.1. Sample output assuming JS files are moved to en-US/scripts $ rpm -qilp tmp/rpm/noarch/publican-redha* | grep -E 'scripts|css' /usr/share/publican/Common_Content/redhat-video/en-US/css /usr/share/publican/Common_Content/redhat-video/en-US/css/lang.css /usr/share/publican/Common_Content/redhat-video/en-US/css/menu.css /usr/share/publican/Common_Content/redhat-video/en-US/css/overrides.css /usr/share/publican/Common_Content/redhat-video/en-US/scripts /usr/share/publican/Common_Content/redhat-video/en-US/scripts/code-lang-switcher.js /usr/share/publican/Common_Content/redhat-video/en-US/scripts/jquery-1.4.2.min.js /usr/share/publican/Common_Content/redhat-video/en-US/scripts/modernizr.js /usr/share/publican/Common_Content/redhat-video/en-US/scripts/skynet-book.js /var/www/html/docs/redhat-video/en-US/css /var/www/html/docs/redhat-video/en-US/css/lang.css /var/www/html/docs/redhat-video/en-US/css/menu.css /var/www/html/docs/redhat-video/en-US/css/overrides.css /var/www/html/docs/redhat-video/en-US/scripts /var/www/html/docs/redhat-video/en-US/scripts/code-lang-switcher.js /var/www/html/docs/redhat-video/en-US/scripts/jquery-1.4.2.min.js /var/www/html/docs/redhat-video/en-US/scripts/modernizr.js /var/www/html/docs/redhat-video/en-US/scripts/skynet-book.js FYI the regression of non CSS files being dropped is also fixed, so if the JS files are left in the CSS directory they will be installed in to /var/www/html/docs/redhat-video/en-US/css/ What about the pathing in the xsl to include the JavaScript? The path is different for the web and desktop builds. Currently I have the following, for example, in html-single.xsl: <xsl:template name="user.footer.content"> <div class="skynetBookID"><xsl:value-of select="//productname[1]"/>/<xsl:value-of select="//title[1]"/></div> <script src="Common_Content/css/modernizr.js"></script> <script src="Common_Content/css/jquery-1.4.2.min.js"></script> <script src="Common_Content/css/code-lang-switcher.js"></script> <script src="Common_Content/css/skynet-book.js"></script> </xsl:template> The script src value should be different for the web package (where the .js files are in the consolidated location path) and the desktop package (where the .js files are in the book directory). So it seems like it needs a variable there to inject the correct path when it is being built. (In reply to comment #10) > What about the pathing in the xsl to include the JavaScript? The path is > different for the web and desktop builds. You should already be able to do this. Checkout the logic in the 'template name="head.content"' in xhtml-common.xsl. You should have access to all the variables referenced in there. So web path: <xsl:choose> <xsl:when test="$embedtoc != 0"> <!-- web path --> <script type="text/javascript"><xsl:attribute name="src"><xsl:value-of select="$tocpath"/>/../<xsl:value-of select="$brand"/>/scripts/$js_file</xsl:attribute></script> </xsl:when> <xsl:otherwise> <!-- desktop path --> <script type="text/javascript"><xsl:attribute name="src">/usr/share/publican/Common_Content/<xsl:value-of select="$brand"/>/scripts/$js_file</xsl:attribute></script> Untested but you get the idea. Verify version: publican-3.1.0-0.el6eng.noarch ->PASS Verify steps: 1. $publican create_brand --name=test --lang=en-US 2. $ cd publican-test/en-US 3. $ mkdir scripts, then copy test1.js and test1.css to this directory. 4. copy test2.js and test2.css to en-US/css/ directory. 5. $publican package --binary --lang=en-US 6. rpm -qilp tmp/rpm/noarch/publican-test* | grep -E 'scripts|css' Actual results: 1. js files and css files in css directory still in that directory. 2. js files and css files in scripts directory still in that directory. |