Files
odoo_source/addons
Soukéina Bojabza fdfd5042f8 [IMP] website: manage better the files uploaded in a form
Before this commit, now that multiple files can be uploaded in a form,
we could observe that the file input is not convenient to manage this
situation:

- Clicking again on the input to choose other files replaces the
previously uploaded ones, we can therefore not upload files one by one.
- A file cannot be deleted in an obvious way: we need to cancel a new
upload, as it will replace the file by nothing and therefore delete it.
- When multiple files are uploaded, only the number of files is
displayed and not their name (they are only displayed on hover).

This commit improves these behaviors:

- Clicking again on the input adds additional files instead of replacing
them (unless the number of files allowed is 1);
- The button text content is modified after the upload of files,
displaying "Add Files"/"Replace File" (if multiple/single files are
allowed) to show its role better.
- When files are uploaded, blocks containing each files name and a
cross to delete them are displayed.

In order to make these improvements, the file input is hidden and
replaced by an input of type=`button` when files are uploaded. This was
done for two reasons:
- It is not possible to modify the content of an input of type=`file`
but we can change the value of a button.
- The input did not look good with the file blocks, because it has a
text displaying file informations, which was redundant with the blocks.

task-2798576

Part-of: odoo/odoo#89055
2023-05-15 12:55:58 +02:00
..
2023-05-12 22:59:22 +02:00
2023-05-12 22:59:22 +02:00
2023-05-12 22:59:14 +02:00
2023-05-12 22:59:22 +02:00
2023-05-12 22:59:23 +02:00
2023-05-12 22:59:23 +02:00
2023-05-12 22:59:23 +02:00
2023-05-12 22:59:22 +02:00
2023-05-12 22:59:16 +02:00
2023-05-12 22:59:23 +02:00
2023-05-12 22:59:22 +02:00
2023-05-12 22:59:22 +02:00
2023-05-11 18:24:51 +02:00
2023-05-11 12:01:16 +02:00
2023-05-11 18:25:38 +02:00
2023-05-10 19:16:47 +02:00
2023-05-11 13:54:59 +02:00
2023-05-10 18:16:24 +02:00
2023-05-10 18:16:14 +02:00
2023-05-11 13:54:53 +02:00
2023-05-10 13:21:32 +02:00
2023-05-11 12:01:18 +02:00
2023-05-10 18:16:08 +02:00
2023-05-10 18:16:08 +02:00
2023-05-11 12:01:26 +02:00
2023-05-10 18:16:21 +02:00
2023-05-10 20:15:02 +02:00
2023-05-10 20:14:51 +02:00
2023-05-11 12:01:13 +02:00
2023-05-10 13:21:34 +02:00
2023-05-10 20:15:04 +02:00
2023-05-11 12:01:29 +02:00
2023-05-10 19:16:49 +02:00
2023-05-10 20:15:07 +02:00
2023-05-12 22:59:22 +02:00
2023-05-10 18:16:16 +02:00
2023-05-10 20:14:59 +02:00
2023-05-10 20:15:23 +02:00
2023-05-10 20:14:56 +02:00
2023-05-11 18:24:53 +02:00
2023-05-11 13:54:51 +02:00
2023-05-10 18:16:06 +02:00
2023-05-11 10:40:47 +02:00
2023-05-10 13:21:24 +02:00
2023-05-10 20:15:12 +02:00
2023-05-10 13:21:19 +02:00
2023-05-11 10:40:53 +02:00
2023-05-11 10:40:55 +02:00
2023-05-11 12:01:21 +02:00
2023-05-10 20:14:48 +02:00
2023-05-11 12:01:24 +02:00
2023-05-10 18:16:19 +02:00
2023-05-10 13:21:29 +02:00
2023-05-10 20:15:14 +02:00
2023-05-10 13:21:39 +02:00
2023-05-10 20:15:17 +02:00
2023-05-12 09:21:49 +02:00
2023-05-10 20:15:20 +02:00
2023-05-12 22:59:23 +02:00
2023-05-12 22:59:16 +02:00
2023-05-12 22:59:14 +02:00
2023-05-12 22:59:14 +02:00
2023-05-12 22:59:23 +02:00
2023-05-12 22:59:23 +02:00
2023-05-12 22:59:23 +02:00
2023-05-12 22:59:23 +02:00
2023-05-12 22:59:23 +02:00
2023-05-12 22:59:23 +02:00
2023-05-12 22:59:22 +02:00
2023-05-12 22:59:23 +02:00
…