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

Fix misleading message for non-admins when no scales are available #149

Merged
merged 2 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions news/141.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix misleading message for non-administrators when no scales are available
[laulaz]
41 changes: 26 additions & 15 deletions src/plone/app/imagecropping/browser/editor.pt
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,34 @@
>Image Cropping Editor</h1>

<tal:noscales condition="python:not view.show_cropping">
<p class="documentDescription"
i18n:translate="noscales_message"
>
There are no scales to crop. Make sure to add them to the
<a href="#"
tal:define="
portal context/@@plone_portal_state/portal_url;
"
tal:attributes="
href string:$portal/@@imagecropping-settings;
"
i18n:name="link"
i18n:translate=""
<tal:def define="
can_access_settings python:checkPermission('Manage portal', context);
">
<div class="alert alert-warning"
tal:condition="can_access_settings"
i18n:translate="noscales_message"
>
List of scales with crop support</a>
There are no scales to crop. Make sure to add them to the
<a href="#"
tal:define="
portal context/@@plone_portal_state/portal_url;
"
tal:attributes="
href string:$portal/@@imagecropping-settings;
"
i18n:name="link"
i18n:translate=""
>
List of scales with crop support</a>
in the controlpanel.
</p>
</div>
<div class="alert alert-info"
tal:condition="not: can_access_settings"
i18n:translate="noscales_short_message"
>
There are no scales to crop.
</div>
</tal:def>
</tal:noscales>

<tal:scales condition="python:view.show_cropping">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,11 @@ msgstr "nicht zugeschnitten"
msgid "noscales_message"
msgstr "Derzeit sind keine zuschneidbaren Bildgrößen definiert. Sie können diese unter ${link} hinzufügen."

#. Default: "There are no scales to crop."
#: ../browser/editor.pt:39
msgid "noscales_short_message"
msgstr "Derzeit sind keine zuschneidbaren Bildgrößen definiert."

#: ../browser/editor.pt:170
msgid "offset"
msgstr "Versatz"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ msgstr ""
msgid "noscales_message"
msgstr ""

#. Default: "There are no scales to crop."
#: ../browser/editor.pt:39
msgid "noscales_short_message"
msgstr ""

#: ../browser/editor.pt:170
msgid "offset"
msgstr ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,11 @@ msgstr "sin recortar"
msgid "noscales_message"
msgstr "No hay escalas para recortar. Asegúrate de añadirlas en ${link} en el panel de control."

#. Default: "There are no scales to crop."
#: ../browser/editor.pt:39
msgid "noscales_short_message"
msgstr "No hay escalas para recortar."

#: ../browser/editor.pt:170
msgid "offset"
msgstr ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ msgstr ""
msgid "noscales_message"
msgstr "Sivustolla ei ole määritetty kuvakokoja. Määritä kuvakoot osoitteessa ${link}."

#. Default: "There are no scales to crop."
#: ../browser/editor.pt:39
msgid "noscales_short_message"
msgstr "Sivustolla ei ole määritetty kuvakokoja."

#: ../browser/editor.pt:170
msgid "offset"
msgstr ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ msgstr "non-découpée"
msgid "noscales_message"
msgstr "Il n'y a pas d'échelles pour la découpe. Veuillez en ajouter dans la ${link} via le panneau de configuration."

#. Default: "There are no scales to crop."
#: ../browser/editor.pt:39
msgid "noscales_short_message"
msgstr "Il n'y a pas d'échelles pour la découpe."

#: ../browser/editor.pt:170
msgid "offset"
msgstr "décalage"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ msgstr "non ritagliata"
msgid "noscales_message"
msgstr "Non ci sono miniature da ritagliare. Controlla di averne aggiunte mediante il ${link} nel pannello di controllo."

#. Default: "There are no scales to crop."
#: ../browser/editor.pt:39
msgid "noscales_short_message"
msgstr "Non ci sono miniature da ritagliare."

#: ../browser/editor.pt:170
msgid "offset"
msgstr ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,11 @@ msgstr ""
msgid "noscales_message"
msgstr "Er zijn geen schalen om bij te snijden. Voeg ze toe aan de ${link} in het controlepaneel."

#. Default: "There are no scales to crop."
#: ../browser/editor.pt:39
msgid "noscales_short_message"
msgstr "Er zijn geen schalen om bij te snijden."

#: ../browser/editor.pt:170
msgid "offset"
msgstr ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ msgstr ""
msgid "noscales_message"
msgstr ""

#. Default: "There are no scales to crop."
#: ../browser/editor.pt:39
msgid "noscales_short_message"
msgstr ""

#: ../browser/editor.pt:170
msgid "offset"
msgstr ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ msgstr ""
msgid "noscales_message"
msgstr ""

#. Default: "There are no scales to crop."
#: ../browser/editor.pt:39
msgid "noscales_short_message"
msgstr ""

#: ../browser/editor.pt:170
msgid "offset"
msgstr ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ msgstr ""
msgid "noscales_message"
msgstr ""

#. Default: "There are no scales to crop."
#: ../browser/editor.pt:39
msgid "noscales_short_message"
msgstr ""

#: ../browser/editor.pt:170
msgid "offset"
msgstr ""
Expand Down
Loading