Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 43 additions & 45 deletions interface/themes/firebird/Record/view.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@
{assign var=ld value=$ht_vals_from_json}

<main class="main-container" id="main">
{* {include file="search_form.tpl"} *}

{* <div class="container container-medium flex-container flex-container-expanded container-boxed"> *}

<div class="twocol mt-1">

<section class="twocol-main" id="section">
Expand All @@ -36,7 +34,6 @@
<div class="cover d-none d-md-block">
{if $ld.handle}
<img class="border p-1" aria-hidden="true" alt="" src="{$unicorn_root}/cgi/imgsrv/cover?id={$ld.handle};width=250" />
{* <img aria-hidden="true" alt="" src="https://preview.babel.hathitrust.org/cgi/imgsrv/cover?id=mdp.35112104694155" /> *}
{else}
<img class="bookCover" aria-hidden="true" alt="" src="https://catalog.hathitrust.org/images/nocover-thumbnail.png" />
{/if}
Expand Down Expand Up @@ -71,14 +68,6 @@
</a>
</div>
</div>
{* <div class="article-actions" style="display: flex; align-items: center">
<h3 class="xx-offscreen" style="font-size: 1rem; margin-right: 1rem;">Tools</h3>
<ul>
<li><a href="/Record/{$id|escape:"url"}/Cite" class="cite"><i class="icomoon icomoon-bookmark" aria-hidden="true"></i> {translate text="Cite this"}</a></li>
<li><a download class="endnotelink" href="/Search/SearchExport?handpicked={$id|escape:"url"}&amp;method=ris" data-toggle="tracking" data-tracking-category="recordActions" data-tracking-action="Catalog Export" data-tracking-label="Endnote"><i class="icomoon icomoon-upload" aria-hidden="true"></i> Export citation file</a></li>
</ul>
</div> *}

{include file="$module/view.summary.tpl"}

<h2 id="viewability" class="mt-3">Viewability</h2>
Expand All @@ -94,28 +83,48 @@
{assign var=ld value=$ru->ht_link_data_from_json($e)}
{if (isset($record_is_tombstone) and $record_is_tombstone) || !($ld.is_tombstone)}
<tr>
<td>
{if (isset($record_is_tombstone) and $record_is_tombstone) }
This item is no longer available (<a href="//babel.hathitrust.org/cgi/pt?id={$ld.handle}">why not?</a>)
{elseif ( $ld.is_resource_sharing )}
<a data-activated-role="true" href="{$handle_prefix}{$ld.handle}" referrerpolicy="unsafe-url"><i aria-hidden="true" class="fa-solid fa-lock-open"></i> <span>Registered Access</span> &nbsp; <span class="IndItem">{$ld.enumchron}</span></a>
{elseif ( ! $ld.is_fullview && ( $ld.has_activated_role && $ld.role_name !== 'resourceSharing' ) ) }
<a data-activated-role="true" href="{$handle_prefix}{$ld.handle}" referrerpolicy="unsafe-url"><i aria-hidden="true" class="fa-solid fa-unlock"></i> <span>Limited (Access Permitted)</span> &nbsp; <span class="IndItem">{$ld.enumchron}</span></a>
{elseif ($ld.is_fullview )}
<a href="{$handle_prefix}{$ld.handle}" referrerpolicy="unsafe-url"><i class="fa-regular fa-file-lines" aria-hidden="true"></i> <span>Full view</span> &nbsp; <span class="IndItem">{$ld.enumchron}</span></a>
{elseif $ld.is_emergency_access}
<a href="{$handle_prefix}{$ld.handle}" referrerpolicy="unsafe-url"><i aria-hidden="true" class="fa-solid fa-unlock"></i> <span>Temporary access</span> &nbsp; <span class="IndItem">{$ld.enumchron}</span></a>
{else}
<a href="{$handle_prefix}{$ld.handle}" referrerpolicy="unsafe-url"><i aria-hidden="true" class="fa-solid fa-lock"></i> <span>Limited (search only)</span> &nbsp; <span class="IndItem">{$ld.enumchron}</span></a>
{/if}

</td>
<td>
{$ld.original_from}
</td>
</tr>
{/if}
{/foreach}
<td>
{if (isset($record_is_tombstone) and $record_is_tombstone) }
This item is no longer available (<a href="//babel.hathitrust.org/cgi/pt?id={$ld.handle}">why not?</a>)
{elseif ( $ld.is_resource_sharing )}
<a data-activated-role="true" href="{$handle_prefix}{$ld.handle}" referrerpolicy="unsafe-url">
<i aria-hidden="true" class="fa-solid fa-lock-open"></i>
<span class="text-decoration-underline">Registered Access</span>
{if (isset($ld.enumchron) and $ld.enumchron)}<span class="IndItem">{$ld.enumchron}</span>{/if}
</a>
{elseif ( ! $ld.is_fullview && ( $ld.has_activated_role && $ld.role_name !== 'resourceSharing' ) ) }
<a data-activated-role="true" href="{$handle_prefix}{$ld.handle}" referrerpolicy="unsafe-url">
<i aria-hidden="true" class="fa-solid fa-unlock"></i>
<span class="text-decoration-underline">Limited (Access Permitted)</span>
{if (isset($ld.enumchron) and $ld.enumchron)}<span class="IndItem">{$ld.enumchron}</span>{/if}

@eumalin eumalin Sep 9, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check treats the text "0" as if it were empty.

{if (isset($ld.enumchron) and $ld.enumchron)} will hide the value when $ld.enumchron is the string "0", because PHP and Smarty treat "0" as false in a boolean check. Before this PR, the value was always shown, even if it was "0".

If a volume or issue is ever labeled just "0", it will now disappear from the link instead of showing up.

Suggested fix: check for an empty string directly instead of relying on truthiness, for example:

{if isset($ld.enumchron) and $ld.enumchron !== ''}

This same check is repeated on other lines, so the fix should be made in all five places (or pulled out into one shared check before the if/elseif chain).

@carylwyatt carylwyatt Sep 10, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eumalin Thanks for the feedback! I googled a bit and found this {capture} function in smarty that holds template pieces as variables, so I used that to compute the enumchron template piece one time if it exists for that record and then insert where needed.
Edit to add: re-staged on dev-3

</a>
{elseif ($ld.is_fullview )}
<a href="{$handle_prefix}{$ld.handle}" referrerpolicy="unsafe-url">
<i class="fa-regular fa-file-lines" aria-hidden="true"></i>
<span class="text-decoration-underline">Full view</span>
{if (isset($ld.enumchron) and $ld.enumchron)}<span class="IndItem">{$ld.enumchron}</span>{/if}
</a>
{elseif $ld.is_emergency_access}
<a href="{$handle_prefix}{$ld.handle}" referrerpolicy="unsafe-url">
<i aria-hidden="true" class="fa-solid fa-unlock"></i>
<span class="text-decoration-underline">Temporary access</span>
{if (isset($ld.enumchron) and $ld.enumchron)}<span class="IndItem">{$ld.enumchron}</span>{/if}
</a>
{else}
<a href="{$handle_prefix}{$ld.handle}" referrerpolicy="unsafe-url">
<i aria-hidden="true" class="fa-solid fa-lock"></i>
<span class="text-decoration-underline">Limited (search only)</span>
{if (isset($ld.enumchron) and $ld.enumchron)}<span class="IndItem">{$ld.enumchron}</span>{/if}
</a>
{/if}

</td>
<td>
{$ld.original_from}
</td>
</tr>
{/if}
{/foreach}

</tbody>
</table>
Expand All @@ -126,18 +135,7 @@

</article>





</section>








{if is_array($similarRecords) or $lastsearch}
<div class="twocol-side" id="sidebar">
Expand Down