Skip to content

Commit

Permalink
bbaglist
Browse files Browse the repository at this point in the history
  • Loading branch information
respinos committed Oct 3, 2023
1 parent 79fb3e0 commit 0a49394
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 19 deletions.
37 changes: 23 additions & 14 deletions templates/text/bookbag.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,29 @@
<?CHUNK filename="entitiesdoctype.chnk" optional="1"?>

<Top xmlns:dlxs="http://www.umdl.umich.edu/dlxs">
<!-- XSL fallback files -->
<XslFallbackFileList>
<Filename>bookbagitemsstring.xsl</Filename>
<Filename>bookbag.xsl</Filename>
<Filename>bookbagheader.xsl</Filename>
<Filename>htmlhead.xsl</Filename>
<Filename>globalvariables.xsl</Filename>
<Filename>navheader.xsl</Filename>
<Filename>footer.import.xsl</Filename>
<Filename>searchforms.xsl</Filename>
<Filename>misc.xsl</Filename>
<Filename>xsl2htmlutils.xsl</Filename>
</XslFallbackFileList>

<!-- XSL fallback files -->
<XslFallbackFileList pipeline="qui">
<Filename>qui/qui.base.xsl</Filename>
<Filename>../vendor/str.split.function.xsl</Filename>
<Filename>../vendor/xslfunctions.xsl</Filename>
<Filename>qui/components/*.xsl</Filename>
<Filename>qui/includes/qui.results-item.xsl</Filename>
<Filename>qui/includes/qui.search-common.xsl</Filename>
<Filename>qui/includes/qui.search-simple.xsl</Filename>
<Filename>qui/includes/qui.search-boolean.xsl</Filename>
<Filename>qui/includes/qui.search-proximity.xsl</Filename>
<Filename>qui/includes/qui.bookbag-items.xsl</Filename>
<Filename>qui/qui.bookbag.xsl</Filename>
</XslFallbackFileList>

<XslFallbackFileList pipeline="qbat">
<Filename>qbat/qbat.base.xsl</Filename>
<Filename>../vendor/xslfunctions.xsl</Filename>
<Filename>qbat/components/*.xsl</Filename>
<Filename>qbat/includes/qbat.bookbag-items.xsl</Filename>
<Filename>qbat/qbat.bookbag.xsl</Filename>
</XslFallbackFileList>

<!-- Custom OPTIONAL XML for top-level file bookbag.xml -->
<CustomXml><?CHUNK filename="bookbagextra.xml" optional="1"?></CustomXml>

Expand Down
15 changes: 10 additions & 5 deletions templates/text/qui/includes/qui.search-common.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
<xsl:attribute name="value">
<xsl:choose>
<xsl:when test="contains($searchtype, 'bbag')">
<xsl:value-of select="substring-before($searchtype, 'bbag')" />
<xsl:value-of select="substring-after($searchtype, 'bbag')" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$searchtype" />
Expand All @@ -53,17 +53,22 @@
</xsl:attribute>
</qui:hidden-input>

<xsl:if test="contains($searchtype, 'bbag')">
<qui:hidden-input name="rgn" value="full text" />
<qui:hidden-input name="bookbag" value="1" />
</xsl:if>

<xsl:choose>
<xsl:when test="$page = 'simple'">
<xsl:when test="contains($searchtype, 'simple')">
<xsl:call-template name="build-simple-form" />
</xsl:when>
<xsl:when test="$page = 'boolean'">
<xsl:when test="contains($searchtype, 'boolean')">
<xsl:call-template name="build-boolean-form" />
</xsl:when>
<xsl:when test="$page = 'proximity'">
<xsl:when test="contains($searchtype, 'proximity')">
<xsl:call-template name="build-proxmity-form" />
</xsl:when>
<xsl:when test="$page = 'bib'">
<xsl:when test="contains($searchtype, 'bib')">
<xsl:call-template name="build-bib-form" />
</xsl:when>
<xsl:when test="$page = 'wwstart' or $page = 'wwfull'">
Expand Down
120 changes: 120 additions & 0 deletions templates/text/qui/qui.bookbag.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dlxs="http://dlxs.org" xmlns:qbat="http://dlxs.org/quombat" xmlns:exsl="http://exslt.org/common" extension-element-prefixes="exsl" xmlns:qui="http://dlxs.org/quombat/ui">

<xsl:variable name="BbagItemsCount" select="/Top/NavHeader/BookbagItems"/>
<xsl:variable name="search-form" select="//SearchForm" />

<xsl:template name="build-body-main">
<xsl:call-template name="build-breadcrumbs" />
<qui:header role="main" data-badge="view_list">
<xsl:value-of select="key('get-lookup', 'bookbag.str.holdings')" />
</qui:header>

<xsl:choose>
<xsl:when test="/Top/Bookbag/BookbagItems = 0">
<qui:callout slot="empty">
<xhtml:p>
<xsl:value-of select="key('get-lookup','bookbag.str.no.items')"/>
</xhtml:p>
</qui:callout>
</xsl:when>
<xsl:when test="$page = 'bbagemail'">
<xsl:call-template name="build-bookbag-email-form" />
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="build-bookbag-search-form" />
<xsl:call-template name="build-action-panel-bookbag" />
<xsl:call-template name="build-bookbag-items" />
</xsl:otherwise>
</xsl:choose>

<qui:block slot="overview">
<p>
<xsl:value-of select="key('get-lookup','bookbagitemsstring.str.yourlisthas')"/>
<xsl:value-of select="$BbagItemsCount"/>
<xsl:choose>
<xsl:when test="$BbagItemsCount=1">
<xsl:value-of select="key('get-lookup','bookbagitemsstring.str.itemsingular')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="key('get-lookup','bookbagitemsstring.str.itemplural')"/>
</xsl:otherwise>
</xsl:choose>
</p>
</qui:block>
<qui:block slot="items">
<xsl:apply-templates select="/Top//BookbagResults/Item" />
</qui:block>
</xsl:template>

<xsl:template name="get-title">
<xsl:value-of select="key('get-lookup', 'bookbag.str.holdings')" />
</xsl:template>

<xsl:template name="get-current-page-breadcrumb-label">
Bookbag
</xsl:template>

<xsl:template name="build-bookbag-search-form">
<xsl:call-template name="build-advanced-search-form" />
</xsl:template>

<xsl:template name="build-bookbag-email-form">
<qui:form name="email" href="{/Top/DlxsGlobals/ScriptName[@application='text']}">
<xsl:apply-templates select="/Top/Bookbag/BookbagActionForm/HiddenVars"/>
<qui:form-control>
<qui:label><xsl:value-of select="key('get-lookup','bookbag.str.sendto')" /></qui:label>
<qui:input name="email" type="text" />
</qui:form-control>
<qui:input type="submit" name="submit" value="Email Records" />
</qui:form>
</xsl:template>

<xsl:template name="build-action-panel-bookbag">
<qui:block slot="actions">
<xsl:call-template name="build-bookbag-action-form">
<xsl:with-param name="bbaction">email</xsl:with-param>
</xsl:call-template>
<xsl:call-template name="build-bookbag-action-form">
<xsl:with-param name="bbaction">download</xsl:with-param>
</xsl:call-template>
</qui:block>
</xsl:template>

<xsl:template name="build-bookbag-items">
<qui:block slot="items">
<xsl:apply-templates select="/Top//BookbagResults/Item" />
</qui:block>
</xsl:template>

<xsl:template name="build-bookbag-action-form">
<xsl:param name="bbaction" />
<xsl:variable name="label">
<xsl:choose>
<xsl:when test="$bbaction = 'email'">
<xsl:value-of select="key('get-lookup','bookbag.str.emailcontents')"/>
</xsl:when>
<xsl:when test="$bbaction = 'download'">
<xsl:value-of select="key('get-lookup','bookbag.str.downloadcontents')"/>
</xsl:when>
<xsl:when test="$bbaction = 'empty'">
<xsl:value-of select="key('get-lookup','bookbag.str.emptycontents')"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<qui:form href="{/Top/DlxsGlobals/ScriptName[@application='text']}">
<xsl:apply-templates select="/Top/Bookbag/BookbagActionForm/HiddenVars"/>
<xsl:choose>
<xsl:when test="$bbaction = 'email' or $bbaction = 'list'">
<qui:hidden-input name="page" value="bbag{$bbaction}" />
</xsl:when>
<xsl:otherwise>
<qui:hidden-input name="bbaction" value="{$bbaction}" />
</xsl:otherwise>
</xsl:choose>
<qui:input type="submit" name="submit" value="{normalize-space($label)}" />
</qui:form>
</xsl:template>


</xsl:stylesheet>

0 comments on commit 0a49394

Please sign in to comment.