Skip to content

Commit

Permalink
display counter if too many linkto in home table close #494
Browse files Browse the repository at this point in the history
The limit is calculated depending on the number of hidden column.
  • Loading branch information
vincent-peugnet committed Dec 3, 2024
1 parent c5c438a commit 46c95bd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/class/Controllerhome.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public function desktop()
$vars['searchopt'] = $deepsearch['searchopt'];
$vars['display'] = $display;
$vars['urlchecker'] = Config::urlchecker();
$vars['hiddencolumncount'] = count(User::HOME_COLUMNS) - count($this->user->columns());

if ($display === 'graph') {
$vars['layout'] = $_GET['layout'] ?? 'cose-bilkent';
Expand Down
10 changes: 9 additions & 1 deletion app/view/templates/home.php
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,15 @@ class="redirection"
<td class="description" title="<?= $item->description() ?>"><?= $item->description('short') ?></td>
<?php endif ?>
<?php if ($columns['linkto']) : ?>
<td class="linkto"><?= $opt->linktolink($item->linkto('array')) ?></td>
<td class="linkto">
<?php if (($linktocount = count($item->linkto())) > ($hiddencolumncount - 5 )) : ?>
<span class="counter" title="<?= implode("\n", $item->linkto()) ?>">
<?= $linktocount ?>
</span>
<?php else : ?>
<?= $opt->linktolink($item->linkto('array')) ?>
<?php endif ?>
</td>
<?php endif ?>
<?php if ($columns['externallinks']) : ?>
<td class="externallinks" title="<?= $item->externallinkstitle() ?>">
Expand Down

0 comments on commit 46c95bd

Please sign in to comment.