Skip to content

Commit

Permalink
Rename note title slot
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksip committed Dec 12, 2023
1 parent 185779a commit b7093ca
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// Then render the same template using the encapsulated record.
$this->curatedRecord = $this->driver;
$this->driver = $record;
$this->slot('listNoteTitleEsc')->set($this->transEsc('Aipa::More Information'));
$this->slot('listNoteTitle')->set($this->translate('Aipa::More Information'));
?>
<?= $this->record($this->driver)->getSearchResult('condensed', $this->results) ?>
<?php endif; ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// Then render the same template using the encapsulated record.
$this->curatedRecord = $this->driver;
$this->driver = $record;
$this->slot('listNoteTitleEsc')->set($this->transEsc('Aipa::More Information'));
$this->slot('listNoteTitle')->set($this->translate('Aipa::More Information'));
?>
<?= $this->record($this->driver)->getSearchResult('grid', $this->results) ?>
<?php endif; ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// Then render the same template using the encapsulated record.
$this->curatedRecord = $this->driver;
$this->driver = $record;
$this->slot('listNoteTitleEsc')->set($this->transEsc('Aipa::More Information'));
$this->slot('listNoteTitle')->set($this->translate('Aipa::More Information'));
?>
<?= $this->record($this->driver)->getSearchResult('list', $this->results) ?>
<?php endif; ?>
Expand Down
10 changes: 5 additions & 5 deletions themes/finna2/templates/list/list-notes.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
$note = $this->markdown()->toHtml($note);
$view = $this->params->getView();

$this->slot('listNoteTitleEsc', $this->transEsc('Note'));
$noteTitleEsc = $this->slot('listNoteTitleEsc')->get();
$this->slot('listNoteTitle', $this->translate('Note'));
$noteTitle = $this->escapeHtml($this->slot('listNoteTitle')->get());
?>
<?php if ($view === 'condensed'): ?>
<button class="note-button condensed" aria-hidden="true" title="<?=$noteTitleEsc?>"><?=$this->icon('list-note') ?><?=$noteTitleEsc?><span class="caret"></span></button>
<button class="note-button condensed" aria-hidden="true" title="<?=$noteTitle?>"><?=$this->icon('list-note') ?><?=$noteTitle?><span class="caret"></span></button>
<?php endif; ?>
<div class="<?= in_array($view, ['grid', 'condensed']) ? "note-overlay-$view note-hide" : 'note-overlay-list' ?>">
<div class="notes">
Expand All @@ -30,13 +30,13 @@
<?php endif; ?>
<div class="note-rows">
<?php if ($view === 'list' || $view === 'compact'): ?>
<?=$this->icon('list-note') ?><span><?=$noteTitleEsc?>:</span>
<?=$this->icon('list-note') ?><span><?=$noteTitle?>:</span>
<?php endif; ?>
<?=$note;?>
</div>
</div>
</div>
<?php if ($view === 'grid'): ?>
<button class="note-button" aria-hidden="true" title="<?=$noteTitleEsc?>"><?=$this->icon('list-note') ?><?=$noteTitleEsc?><span class="caret"></span></button>
<button class="note-button" aria-hidden="true" title="<?=$noteTitle?>"><?=$this->icon('list-note') ?><?=$noteTitle?><span class="caret"></span></button>
<?php endif; ?>
<!-- END of: finna - list/list-notes.phtml -->

0 comments on commit b7093ca

Please sign in to comment.