Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept all file formats for documents #322

Closed
sebdeleze opened this issue Sep 23, 2020 · 0 comments · Fixed by #323
Closed

Accept all file formats for documents #322

sebdeleze opened this issue Sep 23, 2020 · 0 comments · Fixed by #323

Comments

@sebdeleze
Copy link
Contributor

No description provided.

sebdeleze pushed a commit that referenced this issue Nov 12, 2020
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant