Add a confirmation message for delete actions, except for session
I do not like confirmation messages: they question user’s actions, and in general it is better to offer an undo option afterward. However, undo is harder to implement, and currently i do not have time to do this. The delete for the session is different because the only repercussion would be to log in again; the user is not in danger of losing any data whatsoever.
This commit is contained in:
parent
d4cabce7f5
commit
650d3bff7b
33
po/ca.po
33
po/ca.po
|
@ -8,7 +8,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: camper\n"
|
||||
"Report-Msgid-Bugs-To: jordi@tandem.blog\n"
|
||||
"POT-Creation-Date: 2023-09-26 16:50+0200\n"
|
||||
"POT-Creation-Date: 2023-09-26 16:55+0200\n"
|
||||
"PO-Revision-Date: 2023-07-22 23:45+0200\n"
|
||||
"Last-Translator: jordi fita mas <jordi@tandem.blog>\n"
|
||||
"Language-Team: Catalan <ca@dodds.net>\n"
|
||||
|
@ -20,7 +20,7 @@ msgstr ""
|
|||
|
||||
#: web/templates/public/services.gohtml:6
|
||||
#: web/templates/public/services.gohtml:15
|
||||
#: web/templates/admin/services/index.gohtml:50
|
||||
#: web/templates/admin/services/index.gohtml:53
|
||||
msgctxt "title"
|
||||
msgid "Services"
|
||||
msgstr "Serveis"
|
||||
|
@ -338,7 +338,7 @@ msgstr "Nom"
|
|||
|
||||
#: web/templates/admin/campsite/type/index.gohtml:18
|
||||
#: web/templates/admin/services/index.gohtml:19
|
||||
#: web/templates/admin/services/index.gohtml:57
|
||||
#: web/templates/admin/services/index.gohtml:60
|
||||
#: web/templates/admin/home/index.gohtml:19
|
||||
msgctxt "campsite type"
|
||||
msgid "Translations"
|
||||
|
@ -473,35 +473,44 @@ msgid "Caption"
|
|||
msgstr "Llegenda"
|
||||
|
||||
#: web/templates/admin/services/index.gohtml:20
|
||||
#: web/templates/admin/services/index.gohtml:58
|
||||
#: web/templates/admin/services/index.gohtml:61
|
||||
#: web/templates/admin/home/index.gohtml:20
|
||||
msgctxt "campsite type"
|
||||
msgid "Actions"
|
||||
msgstr "Accions"
|
||||
|
||||
#: web/templates/admin/services/index.gohtml:39
|
||||
#: web/templates/admin/services/index.gohtml:74
|
||||
#: web/templates/admin/home/index.gohtml:39
|
||||
#: web/templates/admin/services/index.gohtml:24
|
||||
#: web/templates/admin/home/index.gohtml:24
|
||||
msgid "Are you sure you wish to delete this slide?"
|
||||
msgstr "Esteu segur de voler esborrar aquesta diapositiva?"
|
||||
|
||||
#: web/templates/admin/services/index.gohtml:42
|
||||
#: web/templates/admin/services/index.gohtml:80
|
||||
#: web/templates/admin/home/index.gohtml:42
|
||||
msgctxt "action"
|
||||
msgid "Delete"
|
||||
msgstr "Esborra"
|
||||
|
||||
#: web/templates/admin/services/index.gohtml:47
|
||||
#: web/templates/admin/home/index.gohtml:47
|
||||
#: web/templates/admin/services/index.gohtml:50
|
||||
#: web/templates/admin/home/index.gohtml:50
|
||||
msgid "No slides added yet."
|
||||
msgstr "No s’ha afegit cap diapositiva encara."
|
||||
|
||||
#: web/templates/admin/services/index.gohtml:51
|
||||
#: web/templates/admin/services/index.gohtml:54
|
||||
msgctxt "action"
|
||||
msgid "Add service"
|
||||
msgstr "Afegeix servei"
|
||||
|
||||
#: web/templates/admin/services/index.gohtml:56
|
||||
#: web/templates/admin/services/index.gohtml:59
|
||||
msgctxt "header"
|
||||
msgid "Service"
|
||||
msgstr "Servei"
|
||||
|
||||
#: web/templates/admin/services/index.gohtml:82
|
||||
#: web/templates/admin/services/index.gohtml:65
|
||||
msgid "Are you sure you wish to delete this service?"
|
||||
msgstr "Esteu segur de voler esborrar aquest servei?"
|
||||
|
||||
#: web/templates/admin/services/index.gohtml:88
|
||||
msgid "No services added yet."
|
||||
msgstr "No s’ha afegit cap servei encara."
|
||||
|
||||
|
|
33
po/es.po
33
po/es.po
|
@ -8,7 +8,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: camper\n"
|
||||
"Report-Msgid-Bugs-To: jordi@tandem.blog\n"
|
||||
"POT-Creation-Date: 2023-09-26 16:50+0200\n"
|
||||
"POT-Creation-Date: 2023-09-26 16:55+0200\n"
|
||||
"PO-Revision-Date: 2023-07-22 23:46+0200\n"
|
||||
"Last-Translator: jordi fita mas <jordi@tandem.blog>\n"
|
||||
"Language-Team: Spanish <es@tp.org.es>\n"
|
||||
|
@ -20,7 +20,7 @@ msgstr ""
|
|||
|
||||
#: web/templates/public/services.gohtml:6
|
||||
#: web/templates/public/services.gohtml:15
|
||||
#: web/templates/admin/services/index.gohtml:50
|
||||
#: web/templates/admin/services/index.gohtml:53
|
||||
msgctxt "title"
|
||||
msgid "Services"
|
||||
msgstr "Servicios"
|
||||
|
@ -338,7 +338,7 @@ msgstr "Nombre"
|
|||
|
||||
#: web/templates/admin/campsite/type/index.gohtml:18
|
||||
#: web/templates/admin/services/index.gohtml:19
|
||||
#: web/templates/admin/services/index.gohtml:57
|
||||
#: web/templates/admin/services/index.gohtml:60
|
||||
#: web/templates/admin/home/index.gohtml:19
|
||||
msgctxt "campsite type"
|
||||
msgid "Translations"
|
||||
|
@ -473,35 +473,44 @@ msgid "Caption"
|
|||
msgstr "Leyenda"
|
||||
|
||||
#: web/templates/admin/services/index.gohtml:20
|
||||
#: web/templates/admin/services/index.gohtml:58
|
||||
#: web/templates/admin/services/index.gohtml:61
|
||||
#: web/templates/admin/home/index.gohtml:20
|
||||
msgctxt "campsite type"
|
||||
msgid "Actions"
|
||||
msgstr "Acciones"
|
||||
|
||||
#: web/templates/admin/services/index.gohtml:39
|
||||
#: web/templates/admin/services/index.gohtml:74
|
||||
#: web/templates/admin/home/index.gohtml:39
|
||||
#: web/templates/admin/services/index.gohtml:24
|
||||
#: web/templates/admin/home/index.gohtml:24
|
||||
msgid "Are you sure you wish to delete this slide?"
|
||||
msgstr "¿Estáis seguro de querer borrar esta diapositiva?"
|
||||
|
||||
#: web/templates/admin/services/index.gohtml:42
|
||||
#: web/templates/admin/services/index.gohtml:80
|
||||
#: web/templates/admin/home/index.gohtml:42
|
||||
msgctxt "action"
|
||||
msgid "Delete"
|
||||
msgstr "Borrar"
|
||||
|
||||
#: web/templates/admin/services/index.gohtml:47
|
||||
#: web/templates/admin/home/index.gohtml:47
|
||||
#: web/templates/admin/services/index.gohtml:50
|
||||
#: web/templates/admin/home/index.gohtml:50
|
||||
msgid "No slides added yet."
|
||||
msgstr "No se ha añadido ninguna diapositiva todavía."
|
||||
|
||||
#: web/templates/admin/services/index.gohtml:51
|
||||
#: web/templates/admin/services/index.gohtml:54
|
||||
msgctxt "action"
|
||||
msgid "Add service"
|
||||
msgstr "Añadir servicio"
|
||||
|
||||
#: web/templates/admin/services/index.gohtml:56
|
||||
#: web/templates/admin/services/index.gohtml:59
|
||||
msgctxt "header"
|
||||
msgid "Service"
|
||||
msgstr "Servicio"
|
||||
|
||||
#: web/templates/admin/services/index.gohtml:82
|
||||
#: web/templates/admin/services/index.gohtml:65
|
||||
msgid "Are you sure you wish to delete this service?"
|
||||
msgstr "¿Estáis seguro de querer borrar este servicio?"
|
||||
|
||||
#: web/templates/admin/services/index.gohtml:88
|
||||
msgid "No services added yet."
|
||||
msgstr "No se ha añadido ningún servicio todavía."
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ $confirm := (gettext "Are you sure you wish to delete this slide?")}}
|
||||
{{ range $slide := .Slides -}}
|
||||
<tr>
|
||||
<td><a href="/admin/home/slides/{{ .ID }}"><img src="{{ .Media }}" alt=""></a></td>
|
||||
|
@ -35,7 +36,9 @@
|
|||
{{ end }}
|
||||
</td>
|
||||
<td>
|
||||
<form data-hx-delete="/admin/home/slides/{{ .ID }}" data-hx-headers='{ {{ CSRFHeader }} }'>
|
||||
<form data-hx-delete="/admin/home/slides/{{ .ID }}"
|
||||
data-hx-confirm="{{ $confirm }}"
|
||||
data-hx-headers='{ {{ CSRFHeader }} }'>
|
||||
<button type="submit">{{( pgettext "Delete" "action" )}}</button>
|
||||
</form>
|
||||
</td>
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ $confirm := ( gettext "Are you sure you wish to delete this slide?" )}}
|
||||
{{ range $slide := .Slides -}}
|
||||
<tr>
|
||||
<td><a href="/admin/services/slides/{{ .ID }}"><img src="{{ .Media }}" alt=""></a></td>
|
||||
|
@ -35,7 +36,9 @@
|
|||
{{ end }}
|
||||
</td>
|
||||
<td>
|
||||
<form data-hx-delete="/admin/services/slides/{{ .ID }}" data-hx-headers='{ {{ CSRFHeader }} }'>
|
||||
<form data-hx-delete="/admin/services/slides/{{ .ID }}"
|
||||
data-hx-confirm="{{ $confirm }}"
|
||||
data-hx-headers='{ {{ CSRFHeader }} }'>
|
||||
<button type="submit">{{( pgettext "Delete" "action" )}}</button>
|
||||
</form>
|
||||
</td>
|
||||
|
@ -59,6 +62,7 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ $confirm := ( gettext "Are you sure you wish to delete this service?" )}}
|
||||
{{ range .Services -}}
|
||||
<tr>
|
||||
<td class="icon_{{ .Icon }}"><a href="{{ .URL }}">{{ .Name }}</a></td>
|
||||
|
@ -70,7 +74,9 @@
|
|||
{{ end }}
|
||||
</td>
|
||||
<td>
|
||||
<form data-hx-delete="{{ .URL }}" data-hx-headers='{ {{ CSRFHeader }} }'>
|
||||
<form data-hx-delete="{{ .URL }}"
|
||||
data-hx-confirm="{{ $confirm }}"
|
||||
data-hx-headers='{ {{ CSRFHeader }} }'>
|
||||
<button type="submit">{{( pgettext "Delete" "action" )}}</button>
|
||||
</form>
|
||||
</td>
|
||||
|
|
Loading…
Reference in New Issue