-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
documents: handle several file formats
This commit allows to add all kind of files to documents. Depending on the type of the file, a preview can be available or not. Additionally, the way to show the files has been completely refactored, to make consistency with frontend views. * Configures preview max size for images and JSON/XML files. * Configures extensions which allow to show a preview. * Adds a border to generated file thumbnail. * Keeps the ratio when generating file thumbnail. * Appends orginal extension to filename when generating system files, to avoid conflict with files having the same name. * Adds defaults metadata values for file, only if file is not deleted. * Moves some functions related to documents from `views.py` to `utils.py`, to use them in JSON serialization. * Adds `restriction`, 'thumbnail` and `link` properties to file, in document detail view and serialization. * Avoids to remove the `restriction` property during pre-loading data, because this property is flagged as `dump_only`. * Removes call to `replace_refs()` in document detail view, as no `$ref` properties is used in template. * Changes `restricted` image for a better one. * Adds a default image if no thumbnail is available. * Refactore the macro for displaying thumbnails, as more information is now present in file metadata. * Closes #322. * Closes #339. Co-Authored-by: Sébastien Délèze <[email protected]>
- Loading branch information
Sébastien Délèze
committed
Nov 12, 2020
1 parent
cf240e0
commit 4c2f105
Showing
18 changed files
with
504 additions
and
422 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.