Skip to content

Commit

Permalink
Allow deleting of uploaded file from template element
Browse files Browse the repository at this point in the history
  • Loading branch information
yurabakhtin committed Oct 20, 2023
1 parent d8dc773 commit 5c1eb46
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Changelog
- Fix #291: Fix broken URL in email footer
- Fix #293: Initialize module content class
- Enh #301: Tests for `next` version
- Enh #318: Allow deleting of uploaded file from template element

1.9.3 (June 13, 2023)
---------------------
Expand Down
5 changes: 5 additions & 0 deletions modules/template/models/FileContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,9 @@ public function renderForm($form)
]);
}

public function canEdit($user = null): bool
{
return PagePermission::canEdit();
}

}
1 change: 1 addition & 0 deletions modules/template/widgets/views/fileContentFormFields.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
'id' => $id . '-preview',
'popoverPosition' => 'top',
'items' => [$model->getFile()],
'edit' => true,
'options' => ['style' => 'display:block;margin-left:150px']]) ?>

<?= humhub\modules\file\widgets\UploadProgress::widget(['id' => $id . '-progress', 'options' => ['style' => 'display:block;margin-left:150px;width:500px']]) ?>
Expand Down

0 comments on commit 5c1eb46

Please sign in to comment.