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

Improve the widget for the sector logo #747

Merged
merged 1 commit into from
May 27, 2024
Merged

Improve the widget for the sector logo #747

merged 1 commit into from
May 27, 2024

Conversation

ale-rt
Copy link
Member

@ale-rt ale-rt commented May 27, 2024

Allows to remove a customized template that rewrites the whole form in other packages, see for example:

But we have something similar for other projects.

Copy link
Member

@thet thet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but two remarks I'd look into.



class LogoWidget(NamedImageWidget):
pass
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could limit the accepted types via the accept attribute, if you want.
e.g.:

class LogoWidget(NamedImageWidget):
    accept = ("*.png", "*.jpg", "*.gif",  "*.webp")

... or maybe add the accept parameter in the directives statement above.

Note: out of my head, untested....

See: plone/plone.namedfile#158

title="Information"
i18n:attributes="title"
i18n:translate="help_sector_logo"
>The logo will appear on the client side app that your user group will see. Make sure your image is of format png, jpg or gif and does not contain any special characters. The new logo will only become visible after you've saved your changes and published the OiRA tool.</dfn>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also recommend to use webp as it produces very good results with a lower filesize and also offers lossless compression.

@ale-rt
Copy link
Member Author

ale-rt commented May 27, 2024

What you propose are different tasks that should be done in other PR.
This PR has the only one and clear focus of getting rid of the custom template in osha.oira.

@ale-rt ale-rt merged commit 5cb25a2 into main May 27, 2024
2 checks passed
@ale-rt ale-rt deleted the logo-widget branch May 27, 2024 14:26
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 this pull request may close these issues.

None yet

2 participants