Skip to content

Commit

Permalink
tec: Use default turbo-confirm attribute
Browse files Browse the repository at this point in the history
This allows to remove the custom "Confirmation" Stimulus controller.

I wasn't able to replace the confirm message on the addons page, but it
wasn't very important.
  • Loading branch information
marienfressinaud committed Oct 7, 2022
1 parent 9f2534c commit 2d08f05
Show file tree
Hide file tree
Showing 10 changed files with 56 additions and 96 deletions.
Binary file modified locales/fr_FR/LC_MESSAGES/main.mo
Binary file not shown.
110 changes: 51 additions & 59 deletions locales/fr_FR/LC_MESSAGES/main.po
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
msgid ""
msgstr ""
"Project-Id-Version: flusio\n"
"POT-Creation-Date: 2022-10-06 19:27+0200\n"
"PO-Revision-Date: 2022-10-06 19:27+0200\n"
"POT-Creation-Date: 2022-10-07 14:27+0200\n"
"PO-Revision-Date: 2022-10-07 14:27+0200\n"
"Last-Translator: Marien Fressinaud <dev@marienfressinaud.fr>\n"
"Language-Team: \n"
"Language: fr_FR\n"
Expand All @@ -16,8 +16,8 @@ msgstr ""
"X-Poedit-SearchPath-0: .\n"

#: assets/javascripts/controllers/back_button_controller.js:47
#: views/_layouts/connected.phtml:217
#: views/_layouts/connected_blocked.phtml:176
#: views/_layouts/connected.phtml:221
#: views/_layouts/connected_blocked.phtml:180
#: views/_layouts/not_connected.phtml:147
msgid "Back"
msgstr "Retour"
Expand Down Expand Up @@ -584,55 +584,55 @@ msgstr "Nouveau"
msgid "Menu of %s"
msgstr "Menu de %s"

#: views/_layouts/connected.phtml:143
#: views/_layouts/connected_blocked.phtml:102 views/my/profile/edit.phtml:3
#: views/_layouts/connected.phtml:147
#: views/_layouts/connected_blocked.phtml:106 views/my/profile/edit.phtml:3
#: views/my/profile/edit.phtml:13
msgid "Profile"
msgstr "Profil"

#: views/_layouts/connected.phtml:153
#: views/_layouts/connected_blocked.phtml:112 views/my/preferences/edit.phtml:3
#: views/_layouts/connected.phtml:157
#: views/_layouts/connected_blocked.phtml:116 views/my/preferences/edit.phtml:3
#: views/my/preferences/edit.phtml:12
msgid "Preferences"
msgstr "Préférences"

#: views/_layouts/connected.phtml:163
#: views/_layouts/connected_blocked.phtml:122 views/my/account/show.phtml:3
#: views/_layouts/connected.phtml:167
#: views/_layouts/connected_blocked.phtml:126 views/my/account/show.phtml:3
#: views/my/account/show.phtml:11
msgid "Account & data"
msgstr "Compte & données"

#: views/_layouts/connected.phtml:175
#: views/_layouts/connected_blocked.phtml:134 views/pages/addons.phtml:3
#: views/_layouts/connected.phtml:179
#: views/_layouts/connected_blocked.phtml:138 views/pages/addons.phtml:3
#: views/pages/addons.phtml:11
msgid "Add-ons"
msgstr "Extensions"

#: views/_layouts/connected.phtml:185
#: views/_layouts/connected_blocked.phtml:144 views/support/show.phtml:3
#: views/_layouts/connected.phtml:189
#: views/_layouts/connected_blocked.phtml:148 views/support/show.phtml:3
#: views/support/show.phtml:12
msgid "Help & support"
msgstr "Aide & support"

#: views/_layouts/connected.phtml:194
#: views/_layouts/connected_blocked.phtml:153
#: views/_layouts/connected.phtml:198
#: views/_layouts/connected_blocked.phtml:157
msgid "Log out"
msgstr "Se déconnecter"

#: views/_layouts/connected.phtml:228 views/_layouts/connected.phtml:229
#: views/_layouts/connected.phtml:232 views/_layouts/connected.phtml:233
msgid "Search links by words or URL"
msgstr "Rechercher des liens par mots ou URL"

#: views/_layouts/connected.phtml:237 views/links/searches/show.phtml:47
#: views/_layouts/connected.phtml:241 views/links/searches/show.phtml:47
#: views/links/searches/show.phtml:63
msgid "Search"
msgstr "Rechercher"

#: views/_layouts/connected.phtml:274 views/_layouts/not_connected.phtml:188
#: views/_layouts/connected.phtml:278 views/_layouts/not_connected.phtml:188
msgid "Close"
msgstr "Fermer"

#: views/_layouts/connected.phtml:275 views/_layouts/not_connected.phtml:189
#: views/_layouts/connected.phtml:279 views/_layouts/not_connected.phtml:189
msgid "Close this window"
msgstr "Fermer cette fenêtre"

Expand Down Expand Up @@ -690,7 +690,7 @@ msgstr "Page suivante"
#: views/links/collections/index.phtml:29 views/links/edit.phtml:43
#: views/links/edit.phtml:72 views/links/new.phtml:41 views/links/new.phtml:58
#: views/links/repairing/_new.phtml:42 views/links/searches/show.phtml:54
#: views/links/show.phtml:185 views/messages/edit.phtml:37
#: views/links/show.phtml:183 views/messages/edit.phtml:37
#: views/my/account/deletion.phtml:63 views/my/preferences/edit.phtml:41
#: views/my/profile/edit.phtml:55 views/my/profile/edit.phtml:91
#: views/my/security/show_confirmed.phtml:41
Expand Down Expand Up @@ -735,15 +735,15 @@ msgid "Place here the links you want to consult later on."
msgstr "Placez ici les liens que vous souhaitez consulter plus tard."

#: views/bookmarks/index.phtml:28 views/collections/_collection.phtml:31
#: views/collections/show.phtml:169 views/collections/show_public.phtml:214
#: views/collections/show.phtml:167 views/collections/show_public.phtml:214
#: views/links/searches/show.phtml:106 views/read/index.phtml:29
#, php-format
msgid "%s link"
msgid_plural "%s links"
msgstr[0] "%s lien"
msgstr[1] "%s liens"

#: views/bookmarks/index.phtml:43 views/collections/show.phtml:184
#: views/bookmarks/index.phtml:43 views/collections/show.phtml:182
msgid "Add a link"
msgstr "Ajouter un lien"

Expand Down Expand Up @@ -1081,16 +1081,16 @@ msgstr "Placer dans un groupe"
msgid "Change the illustration"
msgstr "Changer l’illustration"

#: views/collections/show.phtml:142
#: views/collections/show.phtml:140
msgid ""
"Are you sure that you want to delete this collection? You may lose the links "
"that are attached only to this collection."
msgstr ""
"Êtes-vous sur·e de vouloir supprimer cette collection ? Vous pourriez perdre "
"les liens qui lui sont attachés."

#: views/collections/show.phtml:153 views/links/_link.phtml:313
#: views/links/show.phtml:143
#: views/collections/show.phtml:151 views/links/_link.phtml:311
#: views/links/show.phtml:141
msgid "Delete"
msgstr "Supprimer"

Expand Down Expand Up @@ -1235,15 +1235,15 @@ msgstr "Modification d’un groupe"
msgid "The name of your group"
msgstr "Le nom de votre groupe"

#: views/groups/edit.phtml:63
#: views/groups/edit.phtml:61
msgid ""
"Are you sure that you want to delete this group? The associated collections "
"will NOT be deleted."
msgstr ""
"Êtes-vous sur·e de vouloir supprimer ce groupe ? Les collections associées "
"ne seront PAS supprimées."

#: views/groups/edit.phtml:70
#: views/groups/edit.phtml:68
msgid "Delete the group"
msgstr "Supprimer le groupe"

Expand Down Expand Up @@ -1487,23 +1487,23 @@ msgstr "Copier le lien externe"
msgid "Repair"
msgstr "Réparer"

#: views/links/_link.phtml:301
#: views/links/_link.phtml:299
msgid "Are you sure that you want to delete this link?"
msgstr "Êtes-vous sur·e de vouloir supprimer ce lien ?"

#: views/links/_link.phtml:325 views/links/_link.phtml:328
#: views/links/_link.phtml:323 views/links/_link.phtml:326
msgid "Mark as read"
msgstr "Marquer comme lu"

#: views/links/_link.phtml:338 views/links/_link.phtml:341
#: views/links/_link.phtml:336 views/links/_link.phtml:339
msgid "Remove from read list"
msgstr "Retirer des liens lus"

#: views/links/_link.phtml:351 views/links/_link.phtml:354
#: views/links/_link.phtml:349 views/links/_link.phtml:352
msgid "Read later"
msgstr "Lire plus tard"

#: views/links/_link.phtml:367 views/links/_link.phtml:371
#: views/links/_link.phtml:365 views/links/_link.phtml:369
#: views/links/collections/index.phtml:134
msgid "Store the link"
msgstr "Ranger le lien"
Expand All @@ -1520,11 +1520,11 @@ msgstr "Collections"
msgid "You already commented this link."
msgstr "Vous avez déjà commenté ce lien."

#: views/links/collections/index.phtml:96 views/links/show.phtml:169
#: views/links/collections/index.phtml:96 views/links/show.phtml:167
msgid "Anything else to add?"
msgstr "Des choses à ajouter ?"

#: views/links/collections/index.phtml:114 views/links/show.phtml:167
#: views/links/collections/index.phtml:114 views/links/show.phtml:165
msgid "What do you think?"
msgstr "Qu’en pensez-vous ?"

Expand Down Expand Up @@ -1665,15 +1665,15 @@ msgstr "lire"
msgid "(open a new window)"
msgstr "(ouvre une nouvelle fenêtre)"

#: views/links/show.phtml:135
#: views/links/show.phtml:133
msgid "Are you sure that you want to delete this message?"
msgstr "Êtes-vous sur·e de vouloir supprimer ce message ?"

#: views/links/show.phtml:194
#: views/links/show.phtml:192
msgid "Comment"
msgstr "Commenter"

#: views/links/show.phtml:201
#: views/links/show.phtml:199
msgid "This link being hidden, the comments are private."
msgstr "Ce lien étant masqué, les commentaires sont privés."

Expand Down Expand Up @@ -1976,39 +1976,39 @@ msgstr "Vider le journal"
msgid "Read the links later"
msgstr "Lire les liens plus tard"

#: views/news/index.phtml:77
#: views/news/index.phtml:75
msgid ""
"You’ll remove all the news links, this action cannot be canceled. Are you "
"sure?"
msgstr ""
"Vous allez retirer tous les liens du journal, cette action ne peut pas être "
"annulée. Confirmez-vous ?"

#: views/news/index.phtml:85
#: views/news/index.phtml:83
msgid "Never see the links again"
msgstr "Ne plus revoir les liens"

#: views/news/index.phtml:96
#: views/news/index.phtml:91
msgid "Fill the news with…"
msgstr "Remplissez votre journal avec…"

#: views/news/index.phtml:116
#: views/news/index.phtml:114
msgid "the latest publications"
msgstr "les dernières publications"

#: views/news/index.phtml:117
#: views/news/index.phtml:115
msgid "from your followed feeds"
msgstr "depuis vos flux suivis"

#: views/news/index.phtml:132
#: views/news/index.phtml:130
msgid "3 links of -10 minutes"
msgstr "3 liens de -10 minutes"

#: views/news/index.phtml:133 views/news/index.phtml:149
#: views/news/index.phtml:131 views/news/index.phtml:147
msgid "from your bookmarks"
msgstr "depuis vos signets"

#: views/news/index.phtml:148
#: views/news/index.phtml:146
msgid "1 link of +10 minutes"
msgstr "1 lien de +10 minutes"

Expand Down Expand Up @@ -2342,36 +2342,28 @@ msgstr ""
"Glissez et déposez ce lien dans la barre de marque-pages de votre "
"navigateur :"

#: views/pages/addons.phtml:53
msgid ""
"Clicking on this link does nothing: just drag and drop it to your browser "
"bookmarks bar :)"
msgstr ""
"Cliquer sur ce lien ne fait rien : glissez et déposez-le simplement dans la "
"barre de marque-pages de votre navigateur :)"

#: views/pages/addons.phtml:55
#: views/pages/addons.phtml:52
#, php-format
msgid "Add to %s"
msgstr "Ajouter à %s"

#: views/pages/addons.phtml:62
#: views/pages/addons.phtml:59
msgid "Using a smartphone?"
msgstr "Vous utilisez un smartphone ?"

#: views/pages/addons.phtml:66
#: views/pages/addons.phtml:63
msgid "Sorry, there’s no app for that."
msgstr "Désolé, il n’y a pas d’application pour ça."

#: views/pages/addons.phtml:70
#: views/pages/addons.phtml:67
#, php-format
msgid ""
"Instead, you can <strong>add a shortcut to %s on your home screen.</strong>"
msgstr ""
"À la place, vous pouvez <strong>ajouter un raccourci vers %s à votre écran "
"d’accueil.</strong>"

#: views/pages/addons.phtml:71
#: views/pages/addons.phtml:68
msgid "With modern browsers, it will work as a mobile application."
msgstr ""
"Avec les navigateurs modernes, il fonctionnera comme une application mobile."
Expand Down
2 changes: 0 additions & 2 deletions src/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import AutosubmitController from 'js/controllers/autosubmit_controller.js';
import BackButtonController from 'js/controllers/back_button_controller.js';
import CaptionSwitcherController from 'js/controllers/caption_switcher_controller.js';
import CollectionsSelectorController from 'js/controllers/collections_selector_controller.js';
import ConfirmationController from 'js/controllers/confirmation_controller.js';
import CopyToClipboardController from 'js/controllers/copy_to_clipboard_controller.js';
import CsrfLoaderController from 'js/controllers/csrf_loader_controller.js';
import FormFileController from 'js/controllers/form_file_controller.js';
Expand All @@ -24,7 +23,6 @@ application.register('autosubmit', AutosubmitController);
application.register('back-button', BackButtonController);
application.register('caption-switcher', CaptionSwitcherController);
application.register('collections-selector', CollectionsSelectorController);
application.register('confirmation', ConfirmationController);
application.register('copy-to-clipboard', CopyToClipboardController);
application.register('csrf-loader', CsrfLoaderController);
application.register('form-file', FormFileController);
Expand Down
17 changes: 0 additions & 17 deletions src/assets/javascripts/controllers/confirmation_controller.js

This file was deleted.

4 changes: 1 addition & 3 deletions src/views/collections/show.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@
<form
method="post"
action="<?= url('delete collection', ['id' => $collection->id]) ?>"
data-controller="confirmation"
data-action="confirmation#confirm"
data-confirmation-message-value="<?= _('Are you sure that you want to delete this collection? You may lose the links that are attached only to this collection.') ?>"
data-turbo-confirm="<?= _('Are you sure that you want to delete this collection? You may lose the links that are attached only to this collection.') ?>"
>
<input type="hidden" name="csrf" value="<?= $csrf_token ?>" />
<input type="hidden" name="from" value="<?= url('collection', $current_url_params) ?>" />
Expand Down
4 changes: 1 addition & 3 deletions src/views/groups/edit.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@
class="form--danger"
method="post"
action="<?= url('delete group', ['id' => $group->id]) ?>"
data-controller="confirmation"
data-action="confirmation#confirm"
data-confirmation-message-value="<?= _('Are you sure that you want to delete this group? The associated collections will NOT be deleted.') ?>"
data-turbo-confirm="<?= _('Are you sure that you want to delete this group? The associated collections will NOT be deleted.') ?>"
>
<input type="hidden" name="csrf" value="<?= $csrf_token ?>" />
<input type="hidden" name="from" value="<?= $from ?>" />
Expand Down
4 changes: 1 addition & 3 deletions src/views/links/_link.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,7 @@
data-turbo-preserve-scroll
method="post"
action="<?= url('delete link', ['id' => $link->id]) ?>"
data-controller="confirmation"
data-action="confirmation#confirm"
data-confirmation-message-value="<?= _('Are you sure that you want to delete this link?') ?>"
data-turbo-confirm="<?= _('Are you sure that you want to delete this link?') ?>"
>
<input type="hidden" name="csrf" value="<?= $csrf_token ?>" />
<input type="hidden" name="from" value="<?= $from ?>" />
Expand Down
4 changes: 1 addition & 3 deletions src/views/links/show.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,7 @@
data-turbo-preserve-scroll
method="post"
action="<?= url('delete message', ['id' => $message->id]) ?>"
data-controller="confirmation"
data-action="confirmation#confirm"
data-confirmation-message-value="<?= _('Are you sure that you want to delete this message?') ?>"
data-turbo-confirm="<?= _('Are you sure that you want to delete this message?') ?>"
role="menuitem"
>
<input type="hidden" name="csrf" value="<?= $csrf_token ?>" />
Expand Down
4 changes: 1 addition & 3 deletions src/views/news/index.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@
<form
method="post"
action="<?= url('never read collection', ['id' => $news->id]) ?>"
data-controller="confirmation"
data-action="confirmation#confirm"
data-confirmation-message-value="<?= _('You’ll remove all the news links, this action cannot be canceled. Are you sure?') ?>"
data-turbo-confirm="<?= _('You’ll remove all the news links, this action cannot be canceled. Are you sure?') ?>"
role="menuitem"
>
<input type="hidden" name="csrf" value="<?= $csrf_token ?>" />
Expand Down
Loading

0 comments on commit 2d08f05

Please sign in to comment.