Since cfe079221c, unsplash is not working anymore as that commit did not adapt
the unsplash code to that change.
task-2581567
closesodoo/odoo#76617
X-original-commit: 9a4723628e868836c7bbe8bec31ec9b6ce3f2554
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
*: website, web_unplash
The html alt attribute is supposed to contain a description of an
image's content (an alternative to the visual representation), a lot of
snippets contained alt attributes that were not descriptive of their
content, and would as such be counter-productive in terms of
accessibility. This commit removes those.
Previously, the alt attribute on img tags had to be set manually by the
user through the editor. This commit makes use of the description field
on ir.attachment to store image description, and sets the alt attribute
on images to that description when choosing an image from the media
dialog.
task-2091417
closesodoo/odoo#45174
Related: odoo/enterprise#9520
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit removes the field `datas_fname` from `ir.attachment` as
it was unnecessary and most of the time the duplicate of `name` or
`url`.
Task #1909865closesodoo/odoo#32976
Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
* = web_unsplash, website
Remove iframe upload and replace it with a proper RPC. The route is now only
accepting one file at a time, which makes it easier to maintain, and allows to
process the first file as soon as it is ready, instead of having to wait on
everything.
Also fix a bug where a document could not be uploaded because it would try to
parse it as an image.
Remove filter after search result from the JS and add the corresponding
conditions in the domain to avoid processing and returning unnecessary records.
If multiple attachments exist with the same URL, now display them all to avoid
confusion.
Compute all the necessary values in the python model instead of in the JS.
Allow SVG in the widget (the server already accepted them before).
Disable multiple image upload when not in multiImages mode.
task-1930726
PR: #31208
* = web_unsplash, website_blog
Rename "image" to "attachment" when appropriate in FileWidget
Improve image selection / highlight code (now based on attachment id)
Improve image grid view:
- Remove the row mechanism and replace it by a single loop over the images.
- Take advantage of row wrap for a responsive display.
- Uniformize the height (prevent tall images from moving down everything).
- Load a miniature of the images when possible, remove the loading placeholder.
This should significantly reduce the download size when opening the dialog,
at the cost of CPU usage on the server.
- Split the existing image view into one view for the loop and one view for the
image itself. This way in a following commit we can reuse the image view
when adding a new one, instead of having to render everything again.
task-1930726
PR: #31208
* = hr, im_livechat, mail, payment, purchase, web, web_editor, web_unsplash,
website_profile, website_slides
Since the merge of all image tools into one function, the intermediary functions
are not needed anymore.
task-1958000
PR: #31811
This commit introduces the possibility to resize and to select the quality when
optimizing an image for web.
This will be used by the media dialog in a future commit.
The arbitrary resolution limit of 42e6 has been increased to 45e6 to fit some
of the biggest images we might get from Unsplash, and this value has been moved
into a variable so it can be customized.
The mimetype computation has been moved after the image processing because in a
next commit the operation could return the image in a different format than what
was originally given. Eg. BMP -> PNG, or unsupported format -> JPEG.
task-1958000
PR: #31811
Before this commit:
An unsplash image would be saved as an attachement with:
- A name like 'x54ze78z.JPEG'
- An url like '/unsplash/x54ze78z.JPEG'
- A filename like 'x54ze78z.JPGED'
We would not store the searched terms in the name/url.
Then, we would not be able to search on local attachement in the media dialog
to retrieve the images based on what we searched.
Now:
We store the searched terms in the name/url so it can be used later in the
media dialog search:
- Name like 'big_lion.jpg' (duplicates may be possible)
- Url like '/unsplash/x54ze78z/big_lion.jpg'
- Filename like 'unsplash_x54ze78z_big_lion.jpg'
Task-1911345
Unsplash CEO asked us to stop exposing our key client side (even if it was
only in the browser network and previously allowed by their API team leader).
After multiple exchange, it has been negociated that:
1. Our non saas user won't be able to apply for a production key and should
prefix they Unsplash application name by 'Odoo:'. Their key will remain in
test mode.
Indeed, Unsplash won't be able to review every Odoo application and ensure
it respects the API terms and it is a real application.
2. Our saas user will query Unsplash with a dedicated enterprise key
3. The documentation should explain it all
Task-1911345
Unsplash API requirements does not directly allow to store their images on
our server (We should use hotlinking unless the image is edited (cropped etc)).
Still, they have the `Image Beacon Alternative` to allow to store their images
on our server if we really need it with our use case.
With the Beacon Alternative, we should ping Unsplash server to notify an image
view.
To do so, we need to be able to recognize Unsplash imagesin the DOM, this is
why we are now using /unsplash/ in the URL.
The Unsplash image name should be the image ID as it will be the identifier
needed to ping their server.
This commit also adds credit to Unsplash in the media dialog next to the
unsplash input search.
It also add the `w-100` on the media dialog card as we lost that UI behavior
from BS3 to BS4.
opw-35060
closesodoo/odoo#27377