Skip to content

Commit

Permalink
fix serialissue reslist metadata + card fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
respinos committed Dec 8, 2023
1 parent f52a9cf commit 15b6a9a
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/js/text/handlers/item-page-navigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ window.addEventListener('DOMContentLoaded', (event) => {
headingObjectCallback: function(object, el) {
if ( el.classList.contains('card') ) {
object.headingLevel = 3;
object.textContent = el.querySelector('.card__heading').textContent;
}
return object;
}
Expand Down
4 changes: 4 additions & 0 deletions src/scss/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ a.bedazzled-link[data-selected="true"] span:not(.material-icons) {
border-radius: 2px !important;
}

img {
width: auto;
}

address {
font-style: normal;
}
Expand Down
33 changes: 32 additions & 1 deletion src/scss/_cards.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
display: flex;
flex-flow: row wrap;
justify-content: center;
gap: 0.5rem;
margin-bottom: 1rem;
}

.gallery-view .card {
Expand All @@ -26,7 +28,30 @@

.card {
width: calc(25% - 16px);
margin: 0 0.5em;
margin: 0;
// margin: 0 0.5em;

p:last-child {
margin-bottom: 0;
}
}

a.card {
text-decoration: none;
color: var(--base-text-color);

h3 {
box-shadow: inset 0 -1px #1d7491;
margin-top: 0;
padding-top: 0;
display: inline;
}

&:hover h3 {
box-shadow: inset 0 -2px #1d7491;
background: var(--color-maize-300);
transition: background 0.5s;
}
}

@media (min-width: 950px) and (max-width: 1100px) {
Expand All @@ -44,11 +69,17 @@
@media screen and (max-width: 600px) {
.card {
width: 100%;

// img.card__image {
// width: 100%;
// }
}
}

.card__image {
padding: 0;
display: block;
margin: 0 auto 0.5rem;
}

.card__heading {
Expand Down
2 changes: 1 addition & 1 deletion src/scss/_typography.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}

.text-block img {
width: auto;
// width: auto;
max-width: 100%;
}

Expand Down
2 changes: 1 addition & 1 deletion templates/text/qbat/qbat.base.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,7 @@
</svg> -->
</xsl:template>

<xsl:template match="xhtml:img[substring(@src, 1, 1) != '/']/@src" mode="copy">
<xsl:template match="xhtml:img[substring(@src, 1, 1) != '/' and not(starts-with(@src, 'http'))]/@src" mode="copy">
<xsl:attribute name="src">
<xsl:choose>
<xsl:when test="$collid = '*' or $collid = ''">
Expand Down
4 changes: 3 additions & 1 deletion templates/text/qbat/qbat.home.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@
<xsl:template match="qui:block[@slot='contents']" />

<xsl:template match="qui:img|xhtml:img" mode="card-image">
<img class="[ card__image ]" src="{@src}" alt="" />
<img class="[ card__image ]" src="{@src}" alt="@alt">
<xsl:apply-templates select="@width|@height" mode="copy" />
</img>
</xsl:template>

<xsl:template match="qui:header|xhtml:h3" mode="card-title">
Expand Down
5 changes: 5 additions & 0 deletions templates/text/qui/includes/qui.header-reslist.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
<xsl:with-param name="item" select="$item" />
</xsl:call-template>
</xsl:when>
<xsl:when test="$item/ItemHeader/node()[@NODE]">
<xsl:call-template name="build-metadata-fields-for-serialissue-node">
<xsl:with-param name="item" select="$item" />
</xsl:call-template>
</xsl:when>
<xsl:when test="$item[@NODE]">
<xsl:call-template name="build-metadata-fields-for-serialissue-node">
<xsl:with-param name="item" select="$item" />
Expand Down
2 changes: 1 addition & 1 deletion templates/text/qui/qui.base.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
<xsl:if test="//NavItem[Name='browse']/Tab='false' and //CollectionIdno">
<qui:link rel="browse" icon="list">
<xsl:attribute name="href">
<xsl:value-of select="//ScriptName[@application='pageviewer']" />
<xsl:value-of select="//ScriptName[@application='text']" />
<xsl:text>?cc=</xsl:text>
<xsl:value-of select="$collid" />
<xsl:text>;idno=</xsl:text>
Expand Down
15 changes: 15 additions & 0 deletions templates/text/qui/qui.home.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
<xsl:apply-templates select="/Top/Panels/div[@data-slot='browse']" mode="links" />
</qui:nav>
</qui:panel>
<xsl:apply-templates select="/Top/Panels/div[@data-slot='custom']" mode="links" />
</xsl:template>

<xsl:template name="get-current-page-breadcrumb-label">
Expand Down Expand Up @@ -159,6 +160,20 @@
</xsl:for-each>
</xsl:template>

<xsl:template match="div[@data-slot='custom']" mode="links">
<qui:panel slot="custom">
<qui:header><xsl:value-of select="h3" /></qui:header>
<qui:nav>
<xsl:for-each select="nav/a">
<qui:link href="{@href}">
<xsl:apply-templates select="@rel" mode="build-icon" />
<xsl:apply-templates mode="copy" />
</qui:link>
</xsl:for-each>
</qui:nav>
</qui:panel>
</xsl:template>

<xsl:template match="div[@data-slot='useguidelines']" mode="copy" priority="101">
<xsl:copy>
<xsl:apply-templates select="@*" mode="copy" />
Expand Down

0 comments on commit 15b6a9a

Please sign in to comment.