Skip to content

Commit

Permalink
download column display is optionable close #427
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-peugnet committed Sep 30, 2024
1 parent 8b46f5a commit 444e35b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/class/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ abstract class Model
public const METADATAS_NAMES = [
'favicon' => 'favicon',
'id' => 'id',
'download' => 'download',
'tag' => 'tag',
'title' => 'title',
'description' => 'description',
Expand Down
1 change: 1 addition & 0 deletions app/class/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class User extends Item

public const COLUMNS = [
'favicon',
'download',
'tag',
'title',
'description',
Expand Down
8 changes: 5 additions & 3 deletions app/view/templates/home.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,9 @@
<th class="edit"></th>
<th class="read"></th>
<th class="delete" title="delete page"></th>
<th class="download" title="download page as json"></th>
<?php if ($columns['tag']) { ?>
<?php if ($columns['download']) { ?>
<th class="download" title="download page as json"></th>
<?php } if ($columns['tag']) { ?>
<th class="tag">
<a href="<?= $opt->sortbyorder('tag') ?>">tag</a>
<?= $this->insert('macro_tablesort', ['opt' => $opt, 'th' => 'tag']) ?>
Expand Down Expand Up @@ -296,14 +297,15 @@ class="redirection"
</a>
<?php } ?>
</td>
<?php if ($columns['download']) { ?>
<td class="download">
<?php if ($this->caneditpage($item)) { ?>
<a href="<?= $this->upage('pagedownload', $item->id()) ?>" class="button" download>
<i class="fa fa-download"></i>
</a>
<?php } ?>
</td>
<?php if ($columns['tag']) { ?>
<?php } if ($columns['tag']) { ?>
<td class="tag"><?= $opt->taglinks($item->tag('array')) ?></td>
<?php }
if ($columns['title']) { ?>
Expand Down

0 comments on commit 444e35b

Please sign in to comment.