Skip to content

Commit

Permalink
first pass at multiple collections
Browse files Browse the repository at this point in the history
  • Loading branch information
respinos committed Oct 4, 2023
1 parent baa757d commit 495d227
Show file tree
Hide file tree
Showing 7 changed files with 194 additions and 3 deletions.
4 changes: 4 additions & 0 deletions styles/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,10 @@ sl-dropdown::part(panel) {
margin-top: 0;
}

.mt-0_5 {
margin-top: 0.5rem;
}

.mt-1 {
margin-top: 1rem;
}
Expand Down
21 changes: 21 additions & 0 deletions styles/text/reslist.css
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,25 @@ ul.list--striped li {

ul.list--striped li:nth-child(odd) {
background: var(--color-teal-100);
}

a.bedazzled-link {
text-decoration: none;
}

a.bedazzled-link span:not(.material-icons) {
text-decoration: underline;
}

a.bedazzled-link[data-selected="true"] .material-icons {
color: var(--color-neutral-500);
}

a.bedazzled-link[data-selected="true"] span:not(.material-icons) {
text-decoration: none;
color: var(--color-neutral-500);
}

.filters__count {
white-space: nowrap;
}
2 changes: 1 addition & 1 deletion templates/text/qbat/qbat.base.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
<xsl:variable name="root-href">
<xsl:choose>
<xsl:when test="$docroot = '/'">/samples/</xsl:when>
<xsl:when test="starts-width($api_url, 'https://quod.lib')">/lib/colllist/?byFormat=Text%20Collections</xsl:when>
<xsl:when test="starts-with($api_url, 'https://quod.lib')">/lib/colllist/?byFormat=Text%20Collections</xsl:when>
<xsl:otherwise>/cgi/c/collsize/coll-idx?byFormat=Text%20Collections</xsl:otherwise>
</xsl:choose>
</xsl:variable>
Expand Down
17 changes: 17 additions & 0 deletions templates/text/qbat/qbat.bookbag.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -258,4 +258,21 @@
</button>
</xsl:template>

<xsl:template match="*[qui:values]" mode="title">
<xsl:for-each select="qui:values/qui:value">
<xsl:value-of select="." />
<xsl:if test="position() &lt; last()">
<xsl:text>; </xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:template>

<xsl:template match="qui:field[@key='title']" priority="99">
<xsl:choose>
<xsl:when test="//qui:block[@slot='item']">
<xsl:apply-templates select="." mode="build" />
</xsl:when>
</xsl:choose>
</xsl:template>

</xsl:stylesheet>
79 changes: 79 additions & 0 deletions templates/text/qbat/qbat.reslist.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
</button>
<h2 class="visually-hidden">Options</h2>
<xsl:call-template name="build-filters-panel" />
<xsl:apply-templates select="//qui:panel[@slot='guide-frame']" />
</xsl:if>
</div>
<div class="main-panel">
Expand All @@ -61,6 +62,7 @@
<xsl:when test="//qui:filter">true</xsl:when>
<xsl:when test="$search-form/@data-has-query='true'">true</xsl:when>
<xsl:when test="//qui:nav[@role='index']">true</xsl:when>
<xsl:when test="//qui:panel[@slot='guide-frame']">true</xsl:when>
<xsl:otherwise>false</xsl:otherwise>
</xsl:choose>
</xsl:template>
Expand Down Expand Up @@ -713,4 +715,81 @@
</div>
</xsl:template>

<xsl:template match="qui:panel[@slot='guide-frame']">
<details class="panel mt-2" open="open">
<summary>Collection</summary>
</details>
<div class="filter-item--list">
<xsl:apply-templates select="qui:section" />
</div>
</xsl:template>

<xsl:template match="qui:panel[@slot='guide-frame']/qui:section">
<xsl:variable name="href" select="qui:link[@rel='results']/@href" />
<a class="[ flex filter-item bedazzled-link ][ gap-0_5 mt-0_5 ]" href="{$href}">
<xsl:if test="@selected = 'selected'">
<xsl:attribute name="data-selected">true</xsl:attribute>
</xsl:if>
<span class="material-icons text-black no-underline" aria-hidden="true" href="{$href}">
<xsl:choose>
<xsl:when test="@selected = 'selected'">radio_button_checked</xsl:when>
<xsl:otherwise>radio_button_unchecked</xsl:otherwise>
</xsl:choose>
</span>
<span>
<xsl:if test="@selected = 'selected'">
<xsl:attribute name="style">text-decoration: none !important;</xsl:attribute>
</xsl:if>
<span>
<xsl:value-of select="qui:header" />
</span>
<span class="filters__count">
<xsl:text> (</xsl:text>
<xsl:value-of select="@data-hit-count" />
<xsl:text>)</xsl:text>
</span>
</span>
</a>
</xsl:template>

<xsl:template match="qui:panel[@slot='guide-frame']/qui:section" mode="v1">
<xsl:param name="classes" />
<div class="[ mt-1 ]">
<p>
<a class="[ flex flex-start ][ gap-0_25 bedazzled-link ]" href="{qui:link[@rel='home']/@href}">
<xsl:if test="@selected = 'selected'">
<xsl:attribute name="style">color: black;</xsl:attribute>
</xsl:if>
<xsl:choose>
<xsl:when test="@icon">
<span class="material-icons flex-shrink-0" aria-hidden="true"><xsl:value-of select="@icon" /></span>
</xsl:when>
<xsl:otherwise>
<span class="material-icons flex-shrink-0" aria-hidden="true" style="opacity: 0.5">check_box_outline_blank</span>
</xsl:otherwise>
</xsl:choose>
<span><xsl:value-of select="qui:header" /></span>
</a>
</p>
<p class="text--small text--muted" style="margin-top: 0; margin-left: 1.5rem">
<xsl:apply-templates select="qui:block[@slot='summary']" mode="copy-guts" />
</p>
</div>
<xsl:if test="false()">
<div class="[ link-box ][ flex flex-center ][ mt-2 {$classes} ]">
<a class="[ flex flex-start ][ gap-0_25 bedazzled-link ]" href="{qui:link[@rel='home']/@href}">
<xsl:choose>
<xsl:when test="@icon">
<span class="material-icons flex-shrink-0" aria-hidden="true"><xsl:value-of select="@icon" /></span>
</xsl:when>
<xsl:otherwise>
<span class="material-icons flex-shrink-0" aria-hidden="true" style="opacity: 0.5">check_box_outline_blank</span>
</xsl:otherwise>
</xsl:choose>
<span><xsl:value-of select="qui:header" /></span>
</a>
</div>
</xsl:if>
</xsl:template>

</xsl:stylesheet>
16 changes: 14 additions & 2 deletions templates/text/qui/components/qui.collection.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,25 @@
</qui:link>
</xsl:when>
<xsl:when test="$context-type = 'group' or $context-type = 'multiple'">
<qui:link href="/cgi/i/image/image-idx?page=groups">
<xsl:text>Image Collections</xsl:text>
<xsl:variable name="root-href">
<xsl:choose>
<xsl:when test="$docroot = '/'">/samples/</xsl:when>
<xsl:when test="starts-with($api_url, 'https://quod.lib')">/lib/colllist/?byFormat=Text%20Collections</xsl:when>
<xsl:otherwise>/cgi/c/collsize/coll-idx?byFormat=Text%20Collections</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<qui:link href="{$root-href}">
<xsl:text>Text Collections</xsl:text>
</qui:link>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="//Param[@name='bookbag'] = '1'">
<qui:link href="{//MainNav/NavItem[Name='bookbag']/Link}">
<xsl:text>Bookbag</xsl:text>
</qui:link>
</xsl:if>
<xsl:if test="normalize-space(/Top/BackLink)">
<qui:link href="{normalize-space(/Top/BackLink)}">
<xsl:choose>
Expand Down
58 changes: 58 additions & 0 deletions templates/text/qui/qui.reslist.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@
<xsl:call-template name="build-search-form" />
<xsl:call-template name="build-portfolio-actions" />
<xsl:apply-templates select="//Facets" />
<xsl:apply-templates select="//GuideFrameResults" />
<xsl:apply-templates select="//SearchDescription" />
<xsl:choose>
<xsl:when test="$subview = 'detail'"></xsl:when>
Expand Down Expand Up @@ -965,5 +966,62 @@
<xsl:apply-templates select="child::node()" mode="KwicContent"/>
<xsl:text> </xsl:text>
</xsl:template>

<xsl:template match="GuideFrameResults">
<xsl:if test="Coll">
<qui:panel slot="guide-frame">
<xsl:apply-templates select="Coll" />
</qui:panel>
</xsl:if>
</xsl:template>

<xsl:template match="GuideFrameResults/Coll">
<qui:section>
<xsl:if test="FocusColl = 'true'">
<xsl:attribute name="selected">selected</xsl:attribute>
</xsl:if>
<xsl:attribute name="icon">
<xsl:choose>
<xsl:when test="CollName = 'results.allselectedcolls'">
<xsl:text>topic</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>filter_frames</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="data-hit-count">
<xsl:value-of select="CollTotals/HitCount" />
</xsl:attribute>
<qui:header>
<xsl:choose>
<xsl:when test="CollName = 'results.allselectedcolls'">
<xsl:value-of select="key('get-lookup', CollName)" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="CollName" />
</xsl:otherwise>
</xsl:choose>
</qui:header>
<qui:link rel="results">
<xsl:attribute name="href">
<xsl:choose>
<xsl:when test="FocusColl = 'true'">
<xsl:value-of select="//CurrentUrl" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="CollResultsHref" />
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</qui:link>
<xsl:if test="normalize-space(CollHomeHref)">
<qui:link rel="home" href="{CollHomeHref}" />
</xsl:if>
<qui:block slot="summary">
<xsl:apply-templates select="CollTotals" />
</qui:block>
</qui:section>
</xsl:template>

</xsl:stylesheet>

0 comments on commit 495d227

Please sign in to comment.