aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2022-07-09 15:33:42 +0200
committerDaniel Schadt <kingdread@gmx.de>2022-07-09 15:33:42 +0200
commit372632796697092a3d6931017b52dc8702edfdfe (patch)
tree135a51c34af720647b47b430399a8e5f4a80bf12
parent60d4a87cb5655af9e3a848385ba925f2165bba9d (diff)
downloadfietsboek-372632796697092a3d6931017b52dc8702edfdfe.tar.gz
fietsboek-372632796697092a3d6931017b52dc8702edfdfe.tar.bz2
fietsboek-372632796697092a3d6931017b52dc8702edfdfe.zip
add a "Delete" button to tracks
-rw-r--r--fietsboek/locale/de/LC_MESSAGES/messages.mobin9389 -> 9769 bytes
-rw-r--r--fietsboek/locale/de/LC_MESSAGES/messages.po168
-rw-r--r--fietsboek/locale/en/LC_MESSAGES/messages.mobin8833 -> 9197 bytes
-rw-r--r--fietsboek/locale/en/LC_MESSAGES/messages.po164
-rw-r--r--fietsboek/locale/fietslog.pot164
-rw-r--r--fietsboek/routes.py2
-rw-r--r--fietsboek/templates/details.jinja222
-rw-r--r--fietsboek/util.py3
-rw-r--r--fietsboek/views/detail.py16
9 files changed, 325 insertions, 214 deletions
diff --git a/fietsboek/locale/de/LC_MESSAGES/messages.mo b/fietsboek/locale/de/LC_MESSAGES/messages.mo
index 3741a7d..b0d23d3 100644
--- a/fietsboek/locale/de/LC_MESSAGES/messages.mo
+++ b/fietsboek/locale/de/LC_MESSAGES/messages.mo
Binary files differ
diff --git a/fietsboek/locale/de/LC_MESSAGES/messages.po b/fietsboek/locale/de/LC_MESSAGES/messages.po
index 54b7f50..47bcabb 100644
--- a/fietsboek/locale/de/LC_MESSAGES/messages.po
+++ b/fietsboek/locale/de/LC_MESSAGES/messages.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2022-07-07 23:27+0200\n"
+"POT-Creation-Date: 2022-07-09 15:04+0200\n"
"PO-Revision-Date: 2022-07-02 17:35+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: de\n"
@@ -18,11 +18,11 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.10.3\n"
-#: fietsboek/util.py:261
+#: fietsboek/util.py:262
msgid "password_constraint.mismatch"
msgstr "Passwörter stimmen nicht überein"
-#: fietsboek/util.py:263
+#: fietsboek/util.py:264
msgid "password_constraint.length"
msgstr "Passwort zu kurz"
@@ -62,23 +62,23 @@ msgstr "Administration"
msgid "page.admin.badges"
msgstr "Wappen"
-#: fietsboek/templates/admin.jinja2:22
+#: fietsboek/templates/admin.jinja2:23
msgid "page.admin.badge.edit"
msgstr "Bearbeiten"
-#: fietsboek/templates/admin.jinja2:27
+#: fietsboek/templates/admin.jinja2:29
msgid "page.admin.badge.delete_badge"
msgstr "Löschen"
-#: fietsboek/templates/admin.jinja2:35
+#: fietsboek/templates/admin.jinja2:37
msgid "page.admin.badges.badge_title"
msgstr "Titel"
-#: fietsboek/templates/admin.jinja2:39
+#: fietsboek/templates/admin.jinja2:41
msgid "page.admin.badges.badge_image"
msgstr "Bild"
-#: fietsboek/templates/admin.jinja2:42
+#: fietsboek/templates/admin.jinja2:45
msgid "page.admin.badges.add_badge"
msgstr "Hinzufügen"
@@ -86,51 +86,51 @@ msgstr "Hinzufügen"
msgid "page.browse.title"
msgstr "Stöbern"
-#: fietsboek/templates/browse.jinja2:17 fietsboek/templates/details.jinja2:63
+#: fietsboek/templates/browse.jinja2:17 fietsboek/templates/details.jinja2:86
msgid "page.details.date"
msgstr "Datum"
-#: fietsboek/templates/browse.jinja2:19 fietsboek/templates/details.jinja2:75
+#: fietsboek/templates/browse.jinja2:19 fietsboek/templates/details.jinja2:98
msgid "page.details.length"
msgstr "Länge"
-#: fietsboek/templates/browse.jinja2:23 fietsboek/templates/details.jinja2:67
+#: fietsboek/templates/browse.jinja2:23 fietsboek/templates/details.jinja2:90
msgid "page.details.start_time"
msgstr "Startzeit"
-#: fietsboek/templates/browse.jinja2:25 fietsboek/templates/details.jinja2:71
+#: fietsboek/templates/browse.jinja2:25 fietsboek/templates/details.jinja2:94
msgid "page.details.end_time"
msgstr "Endzeit"
-#: fietsboek/templates/browse.jinja2:29 fietsboek/templates/details.jinja2:79
+#: fietsboek/templates/browse.jinja2:29 fietsboek/templates/details.jinja2:102
msgid "page.details.uphill"
msgstr "Bergauf"
-#: fietsboek/templates/browse.jinja2:31 fietsboek/templates/details.jinja2:83
+#: fietsboek/templates/browse.jinja2:31 fietsboek/templates/details.jinja2:106
msgid "page.details.downhill"
msgstr "Bergab"
-#: fietsboek/templates/browse.jinja2:35 fietsboek/templates/details.jinja2:87
+#: fietsboek/templates/browse.jinja2:35 fietsboek/templates/details.jinja2:110
msgid "page.details.moving_time"
msgstr "Fahrzeit"
-#: fietsboek/templates/browse.jinja2:37 fietsboek/templates/details.jinja2:91
+#: fietsboek/templates/browse.jinja2:37 fietsboek/templates/details.jinja2:114
msgid "page.details.stopped_time"
msgstr "Haltezeit"
-#: fietsboek/templates/browse.jinja2:41 fietsboek/templates/details.jinja2:95
+#: fietsboek/templates/browse.jinja2:41 fietsboek/templates/details.jinja2:118
msgid "page.details.max_speed"
msgstr "maximale Geschwindigkeit"
-#: fietsboek/templates/browse.jinja2:43 fietsboek/templates/details.jinja2:99
+#: fietsboek/templates/browse.jinja2:43 fietsboek/templates/details.jinja2:122
msgid "page.details.avg_speed"
msgstr "durchschnittliche Geschwindigkeit"
#: fietsboek/templates/browse.jinja2:59
msgid "page.browse.no_tracks"
msgstr ""
-"Es wurden keine Strecken gefunden, auf die Du Zugriff hast. "
-"Versuche, Dich anzumelden."
+"Es wurden keine Strecken gefunden, auf die Du Zugriff hast. Versuche, "
+"Dich anzumelden."
#: fietsboek/templates/create_account.jinja2:4
msgid "page.create_account.title"
@@ -184,70 +184,90 @@ msgstr "Bearbeiten"
msgid "page.details.share"
msgstr "Teilen"
-#: fietsboek/templates/details.jinja2:16
+#: fietsboek/templates/details.jinja2:11
+msgid "page.details.delete"
+msgstr "Löschen"
+
+#: fietsboek/templates/details.jinja2:17
msgid "page.details.sharelink.title"
msgstr "Link zum Teilen"
-#: fietsboek/templates/details.jinja2:20
+#: fietsboek/templates/details.jinja2:21
msgid "page.details.sharelink.info"
msgstr "Jeder mit Zugang zu diesem Link kann die Strecke ansehen!"
-#: fietsboek/templates/details.jinja2:26
+#: fietsboek/templates/details.jinja2:28
msgid "page.details.sharelink.invalidate"
msgstr "Link invalidieren"
-#: fietsboek/templates/details.jinja2:28
+#: fietsboek/templates/details.jinja2:30
msgid "page.details.sharelink.close"
msgstr "Schließen"
+#: fietsboek/templates/details.jinja2:40
+msgid "page.details.delete.title"
+msgstr "Strecke Löschen"
+
#: fietsboek/templates/details.jinja2:44
+msgid "page.details.delete.info"
+msgstr "Das Löschen der Strecke wird alle damit verbundenen Informationen löschen!"
+
+#: fietsboek/templates/details.jinja2:49
+msgid "page.details.delete.delete"
+msgstr "Löschen"
+
+#: fietsboek/templates/details.jinja2:51
+msgid "page.details.delete.close"
+msgstr "Abbrechen"
+
+#: fietsboek/templates/details.jinja2:67
msgid "page.details.tags"
msgstr "Schlagwörter"
-#: fietsboek/templates/details.jinja2:53 fietsboek/templates/edit.jinja2:9
-#: fietsboek/templates/finish_upload.jinja2:9
+#: fietsboek/templates/details.jinja2:76 fietsboek/templates/edit.jinja2:10
+#: fietsboek/templates/finish_upload.jinja2:10
msgid "page.noscript"
msgstr ""
"JavaScript ist deaktiviert, zum Nutzen aller Funktionen bitte JavaScript "
"aktivieren"
-#: fietsboek/templates/details.jinja2:58
+#: fietsboek/templates/details.jinja2:81
msgid "page.details.download"
msgstr "Herunterladen"
-#: fietsboek/templates/details.jinja2:117
+#: fietsboek/templates/details.jinja2:140
msgid "page.details.comments"
msgstr "Kommentare"
-#: fietsboek/templates/details.jinja2:121
+#: fietsboek/templates/details.jinja2:144
msgid "page.details.comments.author"
msgstr "Kommentar von {}"
-#: fietsboek/templates/details.jinja2:138
+#: fietsboek/templates/details.jinja2:161
msgid "page.details.comments.new.title"
msgstr "Kommentar erstellen"
-#: fietsboek/templates/details.jinja2:141
+#: fietsboek/templates/details.jinja2:164
msgid "page.details.comments.new.input_title"
msgstr "Titel"
-#: fietsboek/templates/details.jinja2:142
+#: fietsboek/templates/details.jinja2:165
msgid "page.details.comments.new.input_comment"
msgstr "Kommentar"
-#: fietsboek/templates/details.jinja2:145
+#: fietsboek/templates/details.jinja2:168
msgid "page.details.comments.new.submit"
msgstr "Absenden"
-#: fietsboek/templates/edit.jinja2:7
+#: fietsboek/templates/edit.jinja2:8
msgid "page.edit.title"
msgstr "Strecke Bearbeiten"
-#: fietsboek/templates/edit.jinja2:14
+#: fietsboek/templates/edit.jinja2:16
msgid "page.edit.form.submit"
msgstr "Speichern"
-#: fietsboek/templates/edit.jinja2:15
+#: fietsboek/templates/edit.jinja2:17
msgid "page.edit.form.cancel"
msgstr "Abbrechen"
@@ -313,17 +333,17 @@ msgstr "Wappen"
msgid "page.track.form.description"
msgstr "Beschreibung"
-#: fietsboek/templates/finish_upload.jinja2:7
-#: fietsboek/templates/upload.jinja2:5
+#: fietsboek/templates/finish_upload.jinja2:8
+#: fietsboek/templates/upload.jinja2:6
msgid "page.upload.title"
msgstr "Hochladen"
-#: fietsboek/templates/finish_upload.jinja2:14
-#: fietsboek/templates/upload.jinja2:11
+#: fietsboek/templates/finish_upload.jinja2:16
+#: fietsboek/templates/upload.jinja2:13
msgid "page.upload.form.submit"
msgstr "Absenden"
-#: fietsboek/templates/finish_upload.jinja2:15
+#: fietsboek/templates/finish_upload.jinja2:17
msgid "page.upload.form.cancel"
msgstr "Abbrechen"
@@ -371,121 +391,121 @@ msgstr "Profil"
msgid "page.navbar.admin"
msgstr "Admin"
-#: fietsboek/templates/login.jinja2:5
+#: fietsboek/templates/login.jinja2:7
msgid "page.login.title"
msgstr "Anmelden"
-#: fietsboek/templates/login.jinja2:11
+#: fietsboek/templates/login.jinja2:13
msgid "page.login.email"
msgstr "E-Mail-Adresse"
-#: fietsboek/templates/login.jinja2:19
+#: fietsboek/templates/login.jinja2:21
msgid "page.login.password"
msgstr "Passwort"
-#: fietsboek/templates/login.jinja2:25
+#: fietsboek/templates/login.jinja2:28
msgid "page.login.submit"
msgstr "Anmelden"
-#: fietsboek/templates/login.jinja2:30
+#: fietsboek/templates/login.jinja2:33
msgid "page.login.forgot_password"
msgstr "Passwort vergessen"
-#: fietsboek/templates/password_reset.jinja2:4
+#: fietsboek/templates/password_reset.jinja2:5
msgid "page.password_reset.title"
msgstr "Passwort Zurücksetzen"
-#: fietsboek/templates/password_reset.jinja2:10
+#: fietsboek/templates/password_reset.jinja2:11
msgid "page.password_reset.password"
msgstr "Passwort"
-#: fietsboek/templates/password_reset.jinja2:12
+#: fietsboek/templates/password_reset.jinja2:13
msgid "page.password_reset.password_invalid"
msgstr "Passwort zu kurz"
-#: fietsboek/templates/password_reset.jinja2:21
+#: fietsboek/templates/password_reset.jinja2:22
msgid "page.password_reset.repeat_password"
msgstr "Passwort wiederholen"
-#: fietsboek/templates/password_reset.jinja2:23
+#: fietsboek/templates/password_reset.jinja2:24
msgid "page.password_reset.password_mismatch"
msgstr "Passwörter stimmen nicht überein"
-#: fietsboek/templates/password_reset.jinja2:28
+#: fietsboek/templates/password_reset.jinja2:30
msgid "page.password_reset.reset"
msgstr "Zurücksetzen"
-#: fietsboek/templates/profile.jinja2:5
+#: fietsboek/templates/profile.jinja2:7
msgid "page.my_profile.title"
msgstr "Mein Profil"
-#: fietsboek/templates/profile.jinja2:9
+#: fietsboek/templates/profile.jinja2:11
msgid "page.my_profile.personal_data"
msgstr "Persönliche Daten"
-#: fietsboek/templates/profile.jinja2:14
+#: fietsboek/templates/profile.jinja2:16
msgid "page.my_profile.personal_data.name"
msgstr "Name"
-#: fietsboek/templates/profile.jinja2:19
+#: fietsboek/templates/profile.jinja2:21
msgid "page.my_profile.personal_data.password_invalid"
msgstr "Passwort zu kurz"
-#: fietsboek/templates/profile.jinja2:21
+#: fietsboek/templates/profile.jinja2:23
msgid "page.my_profile.personal_data.password"
msgstr "Passwort"
-#: fietsboek/templates/profile.jinja2:26
+#: fietsboek/templates/profile.jinja2:28
msgid "page.my_profile.personal_data.password_must_match"
msgstr "Passwörter müssen übereinstimmen"
-#: fietsboek/templates/profile.jinja2:28
+#: fietsboek/templates/profile.jinja2:30
msgid "page.my_profile.personal_data.repeat_password"
msgstr "Passwort wiederholen"
-#: fietsboek/templates/profile.jinja2:30
+#: fietsboek/templates/profile.jinja2:33
msgid "page.my_profile.personal_data.save"
msgstr "Speichern"
-#: fietsboek/templates/profile.jinja2:35
+#: fietsboek/templates/profile.jinja2:38
msgid "page.my_profile.friends"
msgstr "Freunde"
-#: fietsboek/templates/profile.jinja2:42
+#: fietsboek/templates/profile.jinja2:46
msgid "page.my_profile.unfriend"
msgstr "Entfreunden"
-#: fietsboek/templates/profile.jinja2:51
+#: fietsboek/templates/profile.jinja2:56
msgid "page.my_profile.accept_friend"
msgstr "Annehmen"
-#: fietsboek/templates/profile.jinja2:67
+#: fietsboek/templates/profile.jinja2:73
msgid "page.my_profile.friend_request_email"
msgstr "E-Mail-Adresse des Freundes"
-#: fietsboek/templates/profile.jinja2:71
+#: fietsboek/templates/profile.jinja2:77
msgid "page.my_profile.send_friend_request"
msgstr "Freundschaftsanfrage senden"
-#: fietsboek/templates/request_password.jinja2:4
+#: fietsboek/templates/request_password.jinja2:5
msgid "page.request_password.title"
msgstr "Passwortzurücksetzung Beantragen"
-#: fietsboek/templates/request_password.jinja2:5
+#: fietsboek/templates/request_password.jinja2:6
msgid "page.request_password.info"
msgstr ""
"Wenn Du Dein Passwort vergessen hast, kannst Du Deine E-Mail-Adresse hier"
" eingeben und einen Link zum Zurücksetzen Deines Passworts erhalten."
-#: fietsboek/templates/request_password.jinja2:11
+#: fietsboek/templates/request_password.jinja2:12
msgid "page.request_password.email"
msgstr "E-Mail-Adresse"
-#: fietsboek/templates/request_password.jinja2:15
+#: fietsboek/templates/request_password.jinja2:17
msgid "page.request_password.request"
msgstr "Anfrage senden"
-#: fietsboek/templates/upload.jinja2:8
+#: fietsboek/templates/upload.jinja2:9
msgid "page.upload.form.gpx"
msgstr "GPX Datei"
@@ -568,6 +588,10 @@ msgstr "E-Mail-Adresse bestätigt"
msgid "flash.password_updated"
msgstr "Passwort aktualisiert"
+#: fietsboek/views/detail.py:71
+msgid "flash.track_deleted"
+msgstr "Strecke gelöscht"
+
#: fietsboek/views/profile.py:57
msgid "flash.personal_data_updated"
msgstr "Persönliche Daten wurden gespeichert"
@@ -596,11 +620,11 @@ msgstr "Keine Datei ausgewählt"
msgid "flash.invalid_file"
msgstr "Ungültige GPX-Datei gesendet"
-#: fietsboek/views/upload.py:167
+#: fietsboek/views/upload.py:172
msgid "flash.upload_success"
msgstr "Hochladen erfolgreich"
-#: fietsboek/views/upload.py:182
+#: fietsboek/views/upload.py:187
msgid "flash.upload_cancelled"
msgstr "Hochladen abgebrochen"
diff --git a/fietsboek/locale/en/LC_MESSAGES/messages.mo b/fietsboek/locale/en/LC_MESSAGES/messages.mo
index 204c327..493c094 100644
--- a/fietsboek/locale/en/LC_MESSAGES/messages.mo
+++ b/fietsboek/locale/en/LC_MESSAGES/messages.mo
Binary files differ
diff --git a/fietsboek/locale/en/LC_MESSAGES/messages.po b/fietsboek/locale/en/LC_MESSAGES/messages.po
index 414fc7b..acc5a7e 100644
--- a/fietsboek/locale/en/LC_MESSAGES/messages.po
+++ b/fietsboek/locale/en/LC_MESSAGES/messages.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2022-07-07 23:27+0200\n"
+"POT-Creation-Date: 2022-07-09 15:04+0200\n"
"PO-Revision-Date: 2022-06-28 13:11+0200\n"
"Last-Translator: \n"
"Language: en\n"
@@ -18,11 +18,11 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.10.3\n"
-#: fietsboek/util.py:261
+#: fietsboek/util.py:262
msgid "password_constraint.mismatch"
msgstr "Passwords don't match"
-#: fietsboek/util.py:263
+#: fietsboek/util.py:264
msgid "password_constraint.length"
msgstr "Password not long enough"
@@ -62,23 +62,23 @@ msgstr "Administration"
msgid "page.admin.badges"
msgstr "Badges"
-#: fietsboek/templates/admin.jinja2:22
+#: fietsboek/templates/admin.jinja2:23
msgid "page.admin.badge.edit"
msgstr "Edit"
-#: fietsboek/templates/admin.jinja2:27
+#: fietsboek/templates/admin.jinja2:29
msgid "page.admin.badge.delete_badge"
msgstr "Delete badge"
-#: fietsboek/templates/admin.jinja2:35
+#: fietsboek/templates/admin.jinja2:37
msgid "page.admin.badges.badge_title"
msgstr "Badge Title"
-#: fietsboek/templates/admin.jinja2:39
+#: fietsboek/templates/admin.jinja2:41
msgid "page.admin.badges.badge_image"
msgstr "Badge Image"
-#: fietsboek/templates/admin.jinja2:42
+#: fietsboek/templates/admin.jinja2:45
msgid "page.admin.badges.add_badge"
msgstr "Add Badge"
@@ -86,43 +86,43 @@ msgstr "Add Badge"
msgid "page.browse.title"
msgstr "Browse"
-#: fietsboek/templates/browse.jinja2:17 fietsboek/templates/details.jinja2:63
+#: fietsboek/templates/browse.jinja2:17 fietsboek/templates/details.jinja2:86
msgid "page.details.date"
msgstr "Date"
-#: fietsboek/templates/browse.jinja2:19 fietsboek/templates/details.jinja2:75
+#: fietsboek/templates/browse.jinja2:19 fietsboek/templates/details.jinja2:98
msgid "page.details.length"
msgstr "Length"
-#: fietsboek/templates/browse.jinja2:23 fietsboek/templates/details.jinja2:67
+#: fietsboek/templates/browse.jinja2:23 fietsboek/templates/details.jinja2:90
msgid "page.details.start_time"
msgstr "Record Start"
-#: fietsboek/templates/browse.jinja2:25 fietsboek/templates/details.jinja2:71
+#: fietsboek/templates/browse.jinja2:25 fietsboek/templates/details.jinja2:94
msgid "page.details.end_time"
msgstr "Record End"
-#: fietsboek/templates/browse.jinja2:29 fietsboek/templates/details.jinja2:79
+#: fietsboek/templates/browse.jinja2:29 fietsboek/templates/details.jinja2:102
msgid "page.details.uphill"
msgstr "Uphill"
-#: fietsboek/templates/browse.jinja2:31 fietsboek/templates/details.jinja2:83
+#: fietsboek/templates/browse.jinja2:31 fietsboek/templates/details.jinja2:106
msgid "page.details.downhill"
msgstr "Downhill"
-#: fietsboek/templates/browse.jinja2:35 fietsboek/templates/details.jinja2:87
+#: fietsboek/templates/browse.jinja2:35 fietsboek/templates/details.jinja2:110
msgid "page.details.moving_time"
msgstr "Moving Time"
-#: fietsboek/templates/browse.jinja2:37 fietsboek/templates/details.jinja2:91
+#: fietsboek/templates/browse.jinja2:37 fietsboek/templates/details.jinja2:114
msgid "page.details.stopped_time"
msgstr "Stopped Time"
-#: fietsboek/templates/browse.jinja2:41 fietsboek/templates/details.jinja2:95
+#: fietsboek/templates/browse.jinja2:41 fietsboek/templates/details.jinja2:118
msgid "page.details.max_speed"
msgstr "Max Speed"
-#: fietsboek/templates/browse.jinja2:43 fietsboek/templates/details.jinja2:99
+#: fietsboek/templates/browse.jinja2:43 fietsboek/templates/details.jinja2:122
msgid "page.details.avg_speed"
msgstr "Average Speed"
@@ -182,68 +182,88 @@ msgstr "Edit"
msgid "page.details.share"
msgstr "Share"
-#: fietsboek/templates/details.jinja2:16
+#: fietsboek/templates/details.jinja2:11
+msgid "page.details.delete"
+msgstr "Delete"
+
+#: fietsboek/templates/details.jinja2:17
msgid "page.details.sharelink.title"
msgstr "Share Link"
-#: fietsboek/templates/details.jinja2:20
+#: fietsboek/templates/details.jinja2:21
msgid "page.details.sharelink.info"
msgstr "Everyone with access to this link can view the track!"
-#: fietsboek/templates/details.jinja2:26
+#: fietsboek/templates/details.jinja2:28
msgid "page.details.sharelink.invalidate"
msgstr "Invalidate link"
-#: fietsboek/templates/details.jinja2:28
+#: fietsboek/templates/details.jinja2:30
msgid "page.details.sharelink.close"
msgstr "Close"
+#: fietsboek/templates/details.jinja2:40
+msgid "page.details.delete.title"
+msgstr "Delete Track"
+
#: fietsboek/templates/details.jinja2:44
+msgid "page.details.delete.info"
+msgstr "Deleting this track will remove all associated information with it!"
+
+#: fietsboek/templates/details.jinja2:49
+msgid "page.details.delete.delete"
+msgstr "Delete"
+
+#: fietsboek/templates/details.jinja2:51
+msgid "page.details.delete.close"
+msgstr "Abort"
+
+#: fietsboek/templates/details.jinja2:67
msgid "page.details.tags"
msgstr "Tagged as"
-#: fietsboek/templates/details.jinja2:53 fietsboek/templates/edit.jinja2:9
-#: fietsboek/templates/finish_upload.jinja2:9
+#: fietsboek/templates/details.jinja2:76 fietsboek/templates/edit.jinja2:10
+#: fietsboek/templates/finish_upload.jinja2:10
msgid "page.noscript"
msgstr "JavaScript is disabled, please enable JavaScript"
-#: fietsboek/templates/details.jinja2:58
+#: fietsboek/templates/details.jinja2:81
msgid "page.details.download"
msgstr "Download Tour"
-#: fietsboek/templates/details.jinja2:117
+#: fietsboek/templates/details.jinja2:140
msgid "page.details.comments"
msgstr "Comments"
-#: fietsboek/templates/details.jinja2:121
+#: fietsboek/templates/details.jinja2:144
msgid "page.details.comments.author"
msgstr "Comment by {}"
-#: fietsboek/templates/details.jinja2:138
+#: fietsboek/templates/details.jinja2:161
msgid "page.details.comments.new.title"
msgstr "Create a new comment"
-#: fietsboek/templates/details.jinja2:141
+#: fietsboek/templates/details.jinja2:164
msgid "page.details.comments.new.input_title"
msgstr "Title"
-#: fietsboek/templates/details.jinja2:142
+#: fietsboek/templates/details.jinja2:165
msgid "page.details.comments.new.input_comment"
msgstr "Comment"
-#: fietsboek/templates/details.jinja2:145
+#: fietsboek/templates/details.jinja2:168
msgid "page.details.comments.new.submit"
msgstr "Submit"
-#: fietsboek/templates/edit.jinja2:7
+#: fietsboek/templates/edit.jinja2:8
msgid "page.edit.title"
msgstr "Edit Track"
-#: fietsboek/templates/edit.jinja2:14
+#: fietsboek/templates/edit.jinja2:16
msgid "page.edit.form.submit"
msgstr "Save"
-#: fietsboek/templates/edit.jinja2:15
+#: fietsboek/templates/edit.jinja2:17
msgid "page.edit.form.cancel"
msgstr "Cancel"
@@ -309,17 +329,17 @@ msgstr "Badges"
msgid "page.track.form.description"
msgstr "Description"
-#: fietsboek/templates/finish_upload.jinja2:7
-#: fietsboek/templates/upload.jinja2:5
+#: fietsboek/templates/finish_upload.jinja2:8
+#: fietsboek/templates/upload.jinja2:6
msgid "page.upload.title"
msgstr "Upload"
-#: fietsboek/templates/finish_upload.jinja2:14
-#: fietsboek/templates/upload.jinja2:11
+#: fietsboek/templates/finish_upload.jinja2:16
+#: fietsboek/templates/upload.jinja2:13
msgid "page.upload.form.submit"
msgstr "Upload"
-#: fietsboek/templates/finish_upload.jinja2:15
+#: fietsboek/templates/finish_upload.jinja2:17
msgid "page.upload.form.cancel"
msgstr "Cancel"
@@ -367,121 +387,121 @@ msgstr "Profile"
msgid "page.navbar.admin"
msgstr "Admin"
-#: fietsboek/templates/login.jinja2:5
+#: fietsboek/templates/login.jinja2:7
msgid "page.login.title"
msgstr "Login"
-#: fietsboek/templates/login.jinja2:11
+#: fietsboek/templates/login.jinja2:13
msgid "page.login.email"
msgstr "E-Mail"
-#: fietsboek/templates/login.jinja2:19
+#: fietsboek/templates/login.jinja2:21
msgid "page.login.password"
msgstr "Password"
-#: fietsboek/templates/login.jinja2:25
+#: fietsboek/templates/login.jinja2:28
msgid "page.login.submit"
msgstr "Login"
-#: fietsboek/templates/login.jinja2:30
+#: fietsboek/templates/login.jinja2:33
msgid "page.login.forgot_password"
msgstr "Forgot password"
-#: fietsboek/templates/password_reset.jinja2:4
+#: fietsboek/templates/password_reset.jinja2:5
msgid "page.password_reset.title"
msgstr "Reset Your Password"
-#: fietsboek/templates/password_reset.jinja2:10
+#: fietsboek/templates/password_reset.jinja2:11
msgid "page.password_reset.password"
msgstr "Password"
-#: fietsboek/templates/password_reset.jinja2:12
+#: fietsboek/templates/password_reset.jinja2:13
msgid "page.password_reset.password_invalid"
msgstr "Password not long enough"
-#: fietsboek/templates/password_reset.jinja2:21
+#: fietsboek/templates/password_reset.jinja2:22
msgid "page.password_reset.repeat_password"
msgstr "Repeat password"
-#: fietsboek/templates/password_reset.jinja2:23
+#: fietsboek/templates/password_reset.jinja2:24
msgid "page.password_reset.password_mismatch"
msgstr "Passwords must match"
-#: fietsboek/templates/password_reset.jinja2:28
+#: fietsboek/templates/password_reset.jinja2:30
msgid "page.password_reset.reset"
msgstr "Reset"
-#: fietsboek/templates/profile.jinja2:5
+#: fietsboek/templates/profile.jinja2:7
msgid "page.my_profile.title"
msgstr "My Profile"
-#: fietsboek/templates/profile.jinja2:9
+#: fietsboek/templates/profile.jinja2:11
msgid "page.my_profile.personal_data"
msgstr "Personal Data"
-#: fietsboek/templates/profile.jinja2:14
+#: fietsboek/templates/profile.jinja2:16
msgid "page.my_profile.personal_data.name"
msgstr "My name"
-#: fietsboek/templates/profile.jinja2:19
+#: fietsboek/templates/profile.jinja2:21
msgid "page.my_profile.personal_data.password_invalid"
msgstr "Password not long enough"
-#: fietsboek/templates/profile.jinja2:21
+#: fietsboek/templates/profile.jinja2:23
msgid "page.my_profile.personal_data.password"
msgstr "Password"
-#: fietsboek/templates/profile.jinja2:26
+#: fietsboek/templates/profile.jinja2:28
msgid "page.my_profile.personal_data.password_must_match"
msgstr "Passwords must match"
-#: fietsboek/templates/profile.jinja2:28
+#: fietsboek/templates/profile.jinja2:30
msgid "page.my_profile.personal_data.repeat_password"
msgstr "Repeat password"
-#: fietsboek/templates/profile.jinja2:30
+#: fietsboek/templates/profile.jinja2:33
msgid "page.my_profile.personal_data.save"
msgstr "Save"
-#: fietsboek/templates/profile.jinja2:35
+#: fietsboek/templates/profile.jinja2:38
msgid "page.my_profile.friends"
msgstr "Friends"
-#: fietsboek/templates/profile.jinja2:42
+#: fietsboek/templates/profile.jinja2:46
msgid "page.my_profile.unfriend"
msgstr "Unfriend"
-#: fietsboek/templates/profile.jinja2:51
+#: fietsboek/templates/profile.jinja2:56
msgid "page.my_profile.accept_friend"
msgstr "Accept"
-#: fietsboek/templates/profile.jinja2:67
+#: fietsboek/templates/profile.jinja2:73
msgid "page.my_profile.friend_request_email"
msgstr "Email of the friend"
-#: fietsboek/templates/profile.jinja2:71
+#: fietsboek/templates/profile.jinja2:77
msgid "page.my_profile.send_friend_request"
msgstr "Send friend request"
-#: fietsboek/templates/request_password.jinja2:4
+#: fietsboek/templates/request_password.jinja2:5
msgid "page.request_password.title"
msgstr "Request a Password Reset"
-#: fietsboek/templates/request_password.jinja2:5
+#: fietsboek/templates/request_password.jinja2:6
msgid "page.request_password.info"
msgstr ""
"If you forgot your password, you can type in your email address below and"
" receive a link to reset your password"
-#: fietsboek/templates/request_password.jinja2:11
+#: fietsboek/templates/request_password.jinja2:12
msgid "page.request_password.email"
msgstr "Email"
-#: fietsboek/templates/request_password.jinja2:15
+#: fietsboek/templates/request_password.jinja2:17
msgid "page.request_password.request"
msgstr "Send request"
-#: fietsboek/templates/upload.jinja2:8
+#: fietsboek/templates/upload.jinja2:9
msgid "page.upload.form.gpx"
msgstr "GPX file"
@@ -563,6 +583,10 @@ msgstr "Your email address has been verified"
msgid "flash.password_updated"
msgstr "Password has been updated"
+#: fietsboek/views/detail.py:71
+msgid "flash.track_deleted"
+msgstr "Track has been deleted"
+
#: fietsboek/views/profile.py:57
msgid "flash.personal_data_updated"
msgstr "Personal data has been updated"
@@ -591,11 +615,11 @@ msgstr "No file selected"
msgid "flash.invalid_file"
msgstr "Invalid GPX file selected"
-#: fietsboek/views/upload.py:167
+#: fietsboek/views/upload.py:172
msgid "flash.upload_success"
msgstr "Upload successful"
-#: fietsboek/views/upload.py:182
+#: fietsboek/views/upload.py:187
msgid "flash.upload_cancelled"
msgstr "Upload cancelled"
diff --git a/fietsboek/locale/fietslog.pot b/fietsboek/locale/fietslog.pot
index e3cebbb..ee0be47 100644
--- a/fietsboek/locale/fietslog.pot
+++ b/fietsboek/locale/fietslog.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2022-07-07 23:27+0200\n"
+"POT-Creation-Date: 2022-07-09 15:04+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,11 +17,11 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.10.3\n"
-#: fietsboek/util.py:261
+#: fietsboek/util.py:262
msgid "password_constraint.mismatch"
msgstr ""
-#: fietsboek/util.py:263
+#: fietsboek/util.py:264
msgid "password_constraint.length"
msgstr ""
@@ -61,23 +61,23 @@ msgstr ""
msgid "page.admin.badges"
msgstr ""
-#: fietsboek/templates/admin.jinja2:22
+#: fietsboek/templates/admin.jinja2:23
msgid "page.admin.badge.edit"
msgstr ""
-#: fietsboek/templates/admin.jinja2:27
+#: fietsboek/templates/admin.jinja2:29
msgid "page.admin.badge.delete_badge"
msgstr ""
-#: fietsboek/templates/admin.jinja2:35
+#: fietsboek/templates/admin.jinja2:37
msgid "page.admin.badges.badge_title"
msgstr ""
-#: fietsboek/templates/admin.jinja2:39
+#: fietsboek/templates/admin.jinja2:41
msgid "page.admin.badges.badge_image"
msgstr ""
-#: fietsboek/templates/admin.jinja2:42
+#: fietsboek/templates/admin.jinja2:45
msgid "page.admin.badges.add_badge"
msgstr ""
@@ -85,43 +85,43 @@ msgstr ""
msgid "page.browse.title"
msgstr ""
-#: fietsboek/templates/browse.jinja2:17 fietsboek/templates/details.jinja2:63
+#: fietsboek/templates/browse.jinja2:17 fietsboek/templates/details.jinja2:86
msgid "page.details.date"
msgstr ""
-#: fietsboek/templates/browse.jinja2:19 fietsboek/templates/details.jinja2:75
+#: fietsboek/templates/browse.jinja2:19 fietsboek/templates/details.jinja2:98
msgid "page.details.length"
msgstr ""
-#: fietsboek/templates/browse.jinja2:23 fietsboek/templates/details.jinja2:67
+#: fietsboek/templates/browse.jinja2:23 fietsboek/templates/details.jinja2:90
msgid "page.details.start_time"
msgstr ""
-#: fietsboek/templates/browse.jinja2:25 fietsboek/templates/details.jinja2:71
+#: fietsboek/templates/browse.jinja2:25 fietsboek/templates/details.jinja2:94
msgid "page.details.end_time"
msgstr ""
-#: fietsboek/templates/browse.jinja2:29 fietsboek/templates/details.jinja2:79
+#: fietsboek/templates/browse.jinja2:29 fietsboek/templates/details.jinja2:102
msgid "page.details.uphill"
msgstr ""
-#: fietsboek/templates/browse.jinja2:31 fietsboek/templates/details.jinja2:83
+#: fietsboek/templates/browse.jinja2:31 fietsboek/templates/details.jinja2:106
msgid "page.details.downhill"
msgstr ""
-#: fietsboek/templates/browse.jinja2:35 fietsboek/templates/details.jinja2:87
+#: fietsboek/templates/browse.jinja2:35 fietsboek/templates/details.jinja2:110
msgid "page.details.moving_time"
msgstr ""
-#: fietsboek/templates/browse.jinja2:37 fietsboek/templates/details.jinja2:91
+#: fietsboek/templates/browse.jinja2:37 fietsboek/templates/details.jinja2:114
msgid "page.details.stopped_time"
msgstr ""
-#: fietsboek/templates/browse.jinja2:41 fietsboek/templates/details.jinja2:95
+#: fietsboek/templates/browse.jinja2:41 fietsboek/templates/details.jinja2:118
msgid "page.details.max_speed"
msgstr ""
-#: fietsboek/templates/browse.jinja2:43 fietsboek/templates/details.jinja2:99
+#: fietsboek/templates/browse.jinja2:43 fietsboek/templates/details.jinja2:122
msgid "page.details.avg_speed"
msgstr ""
@@ -181,68 +181,88 @@ msgstr ""
msgid "page.details.share"
msgstr ""
-#: fietsboek/templates/details.jinja2:16
+#: fietsboek/templates/details.jinja2:11
+msgid "page.details.delete"
+msgstr ""
+
+#: fietsboek/templates/details.jinja2:17
msgid "page.details.sharelink.title"
msgstr ""
-#: fietsboek/templates/details.jinja2:20
+#: fietsboek/templates/details.jinja2:21
msgid "page.details.sharelink.info"
msgstr ""
-#: fietsboek/templates/details.jinja2:26
+#: fietsboek/templates/details.jinja2:28
msgid "page.details.sharelink.invalidate"
msgstr ""
-#: fietsboek/templates/details.jinja2:28
+#: fietsboek/templates/details.jinja2:30
msgid "page.details.sharelink.close"
msgstr ""
+#: fietsboek/templates/details.jinja2:40
+msgid "page.details.delete.title"
+msgstr ""
+
#: fietsboek/templates/details.jinja2:44
+msgid "page.details.delete.info"
+msgstr ""
+
+#: fietsboek/templates/details.jinja2:49
+msgid "page.details.delete.delete"
+msgstr ""
+
+#: fietsboek/templates/details.jinja2:51
+msgid "page.details.delete.close"
+msgstr ""
+
+#: fietsboek/templates/details.jinja2:67
msgid "page.details.tags"
msgstr ""
-#: fietsboek/templates/details.jinja2:53 fietsboek/templates/edit.jinja2:9
-#: fietsboek/templates/finish_upload.jinja2:9
+#: fietsboek/templates/details.jinja2:76 fietsboek/templates/edit.jinja2:10
+#: fietsboek/templates/finish_upload.jinja2:10
msgid "page.noscript"
msgstr ""
-#: fietsboek/templates/details.jinja2:58
+#: fietsboek/templates/details.jinja2:81
msgid "page.details.download"
msgstr ""
-#: fietsboek/templates/details.jinja2:117
+#: fietsboek/templates/details.jinja2:140
msgid "page.details.comments"
msgstr ""
-#: fietsboek/templates/details.jinja2:121
+#: fietsboek/templates/details.jinja2:144
msgid "page.details.comments.author"
msgstr ""
-#: fietsboek/templates/details.jinja2:138
+#: fietsboek/templates/details.jinja2:161
msgid "page.details.comments.new.title"
msgstr ""
-#: fietsboek/templates/details.jinja2:141
+#: fietsboek/templates/details.jinja2:164
msgid "page.details.comments.new.input_title"
msgstr ""
-#: fietsboek/templates/details.jinja2:142
+#: fietsboek/templates/details.jinja2:165
msgid "page.details.comments.new.input_comment"
msgstr ""
-#: fietsboek/templates/details.jinja2:145
+#: fietsboek/templates/details.jinja2:168
msgid "page.details.comments.new.submit"
msgstr ""
-#: fietsboek/templates/edit.jinja2:7
+#: fietsboek/templates/edit.jinja2:8
msgid "page.edit.title"
msgstr ""
-#: fietsboek/templates/edit.jinja2:14
+#: fietsboek/templates/edit.jinja2:16
msgid "page.edit.form.submit"
msgstr ""
-#: fietsboek/templates/edit.jinja2:15
+#: fietsboek/templates/edit.jinja2:17
msgid "page.edit.form.cancel"
msgstr ""
@@ -306,17 +326,17 @@ msgstr ""
msgid "page.track.form.description"
msgstr ""
-#: fietsboek/templates/finish_upload.jinja2:7
-#: fietsboek/templates/upload.jinja2:5
+#: fietsboek/templates/finish_upload.jinja2:8
+#: fietsboek/templates/upload.jinja2:6
msgid "page.upload.title"
msgstr ""
-#: fietsboek/templates/finish_upload.jinja2:14
-#: fietsboek/templates/upload.jinja2:11
+#: fietsboek/templates/finish_upload.jinja2:16
+#: fietsboek/templates/upload.jinja2:13
msgid "page.upload.form.submit"
msgstr ""
-#: fietsboek/templates/finish_upload.jinja2:15
+#: fietsboek/templates/finish_upload.jinja2:17
msgid "page.upload.form.cancel"
msgstr ""
@@ -364,119 +384,119 @@ msgstr ""
msgid "page.navbar.admin"
msgstr ""
-#: fietsboek/templates/login.jinja2:5
+#: fietsboek/templates/login.jinja2:7
msgid "page.login.title"
msgstr ""
-#: fietsboek/templates/login.jinja2:11
+#: fietsboek/templates/login.jinja2:13
msgid "page.login.email"
msgstr ""
-#: fietsboek/templates/login.jinja2:19
+#: fietsboek/templates/login.jinja2:21
msgid "page.login.password"
msgstr ""
-#: fietsboek/templates/login.jinja2:25
+#: fietsboek/templates/login.jinja2:28
msgid "page.login.submit"
msgstr ""
-#: fietsboek/templates/login.jinja2:30
+#: fietsboek/templates/login.jinja2:33
msgid "page.login.forgot_password"
msgstr ""
-#: fietsboek/templates/password_reset.jinja2:4
+#: fietsboek/templates/password_reset.jinja2:5
msgid "page.password_reset.title"
msgstr ""
-#: fietsboek/templates/password_reset.jinja2:10
+#: fietsboek/templates/password_reset.jinja2:11
msgid "page.password_reset.password"
msgstr ""
-#: fietsboek/templates/password_reset.jinja2:12
+#: fietsboek/templates/password_reset.jinja2:13
msgid "page.password_reset.password_invalid"
msgstr ""
-#: fietsboek/templates/password_reset.jinja2:21
+#: fietsboek/templates/password_reset.jinja2:22
msgid "page.password_reset.repeat_password"
msgstr ""
-#: fietsboek/templates/password_reset.jinja2:23
+#: fietsboek/templates/password_reset.jinja2:24
msgid "page.password_reset.password_mismatch"
msgstr ""
-#: fietsboek/templates/password_reset.jinja2:28
+#: fietsboek/templates/password_reset.jinja2:30
msgid "page.password_reset.reset"
msgstr ""
-#: fietsboek/templates/profile.jinja2:5
+#: fietsboek/templates/profile.jinja2:7
msgid "page.my_profile.title"
msgstr ""
-#: fietsboek/templates/profile.jinja2:9
+#: fietsboek/templates/profile.jinja2:11
msgid "page.my_profile.personal_data"
msgstr ""
-#: fietsboek/templates/profile.jinja2:14
+#: fietsboek/templates/profile.jinja2:16
msgid "page.my_profile.personal_data.name"
msgstr ""
-#: fietsboek/templates/profile.jinja2:19
+#: fietsboek/templates/profile.jinja2:21
msgid "page.my_profile.personal_data.password_invalid"
msgstr ""
-#: fietsboek/templates/profile.jinja2:21
+#: fietsboek/templates/profile.jinja2:23
msgid "page.my_profile.personal_data.password"
msgstr ""
-#: fietsboek/templates/profile.jinja2:26
+#: fietsboek/templates/profile.jinja2:28
msgid "page.my_profile.personal_data.password_must_match"
msgstr ""
-#: fietsboek/templates/profile.jinja2:28
+#: fietsboek/templates/profile.jinja2:30
msgid "page.my_profile.personal_data.repeat_password"
msgstr ""
-#: fietsboek/templates/profile.jinja2:30
+#: fietsboek/templates/profile.jinja2:33
msgid "page.my_profile.personal_data.save"
msgstr ""
-#: fietsboek/templates/profile.jinja2:35
+#: fietsboek/templates/profile.jinja2:38
msgid "page.my_profile.friends"
msgstr ""
-#: fietsboek/templates/profile.jinja2:42
+#: fietsboek/templates/profile.jinja2:46
msgid "page.my_profile.unfriend"
msgstr ""
-#: fietsboek/templates/profile.jinja2:51
+#: fietsboek/templates/profile.jinja2:56
msgid "page.my_profile.accept_friend"
msgstr ""
-#: fietsboek/templates/profile.jinja2:67
+#: fietsboek/templates/profile.jinja2:73
msgid "page.my_profile.friend_request_email"
msgstr ""
-#: fietsboek/templates/profile.jinja2:71
+#: fietsboek/templates/profile.jinja2:77
msgid "page.my_profile.send_friend_request"
msgstr ""
-#: fietsboek/templates/request_password.jinja2:4
+#: fietsboek/templates/request_password.jinja2:5
msgid "page.request_password.title"
msgstr ""
-#: fietsboek/templates/request_password.jinja2:5
+#: fietsboek/templates/request_password.jinja2:6
msgid "page.request_password.info"
msgstr ""
-#: fietsboek/templates/request_password.jinja2:11
+#: fietsboek/templates/request_password.jinja2:12
msgid "page.request_password.email"
msgstr ""
-#: fietsboek/templates/request_password.jinja2:15
+#: fietsboek/templates/request_password.jinja2:17
msgid "page.request_password.request"
msgstr ""
-#: fietsboek/templates/upload.jinja2:8
+#: fietsboek/templates/upload.jinja2:9
msgid "page.upload.form.gpx"
msgstr ""
@@ -552,6 +572,10 @@ msgstr ""
msgid "flash.password_updated"
msgstr ""
+#: fietsboek/views/detail.py:71
+msgid "flash.track_deleted"
+msgstr ""
+
#: fietsboek/views/profile.py:57
msgid "flash.personal_data_updated"
msgstr ""
@@ -580,11 +604,11 @@ msgstr ""
msgid "flash.invalid_file"
msgstr ""
-#: fietsboek/views/upload.py:167
+#: fietsboek/views/upload.py:172
msgid "flash.upload_success"
msgstr ""
-#: fietsboek/views/upload.py:182
+#: fietsboek/views/upload.py:187
msgid "flash.upload_cancelled"
msgstr ""
diff --git a/fietsboek/routes.py b/fietsboek/routes.py
index 27a8f90..dad8026 100644
--- a/fietsboek/routes.py
+++ b/fietsboek/routes.py
@@ -27,6 +27,8 @@ def includeme(config):
factory='fietsboek.models.Track.factory')
config.add_route('invalidate-share', '/track/{track_id}/invalidate-link',
factory='fietsboek.models.Track.factory')
+ config.add_route('delete-track', '/track/{track_id}/delete',
+ factory='fietsboek.models.Track.factory')
config.add_route('add-comment', '/track/{track_id}/comment',
factory='fietsboek.models.Track.factory')
diff --git a/fietsboek/templates/details.jinja2 b/fietsboek/templates/details.jinja2
index f83ecb1..4d88224 100644
--- a/fietsboek/templates/details.jinja2
+++ b/fietsboek/templates/details.jinja2
@@ -8,6 +8,7 @@
<div class="btn-group" role="group">
<a class="btn btn-success" href="{{ request.route_path('edit', track_id=track.id) }}"><i class="bi-pencil-square"></i> {{ _("page.details.edit") }}</a>
<button type="button" class="btn btn-info" id="showShareLink" data-bs-toggle="modal" data-bs-target="#shareLinkModal"><i class="bi-share"></i> {{ _("page.details.share") }}</button>
+ <button type="button" class="btn btn-danger" id="deleteLink" data-bs-toggle="modal" data-bs-target="#deleteModal"><i class="bi bi-trash"></i> {{ _("page.details.delete") }}</button>
</div>
<div class="modal fade" id="shareLinkModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog">
@@ -32,6 +33,27 @@
</div>
</div>
+ <div class="modal fade" id="deleteModal" tabindex="-1" aria-hidden="true">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <h5 class="modal-title">{{ _("page.details.delete.title") }}</h5>
+ <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
+ </div>
+ <div class="modal-body">
+ <p>{{ _("page.details.delete.info") }}</p>
+ </div>
+ <div class="modal-footer">
+ <form method="POST" action="{{ request.route_url('delete-track', track_id=track.id) }}">
+ {{ util.hidden_csrf_input() }}
+ <button type="submit" class="btn btn-danger">{{ _("page.details.delete.delete") }}</button>
+ </form>
+ <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{ _("page.details.delete.close") }}</button>
+ </div>
+ </div>
+ </div>
+ </div>
+
{% endif %}
<ul>
diff --git a/fietsboek/util.py b/fietsboek/util.py
index 7ca0d62..d3a4064 100644
--- a/fietsboek/util.py
+++ b/fietsboek/util.py
@@ -296,5 +296,4 @@ def read_localized_resource(locale_name, path, raise_on_error=False):
pass
if raise_on_error:
raise FileNotFoundError(f"Resource {path!r} not found")
- else:
- return f"{locale_name}:{path}"
+ return f"{locale_name}:{path}"
diff --git a/fietsboek/views/detail.py b/fietsboek/views/detail.py
index 9153047..4990953 100644
--- a/fietsboek/views/detail.py
+++ b/fietsboek/views/detail.py
@@ -3,6 +3,7 @@ import datetime
from pyramid.view import view_config
from pyramid.response import Response
+from pyramid.i18n import TranslationString as _
from pyramid.httpexceptions import HTTPFound
from .. import models, util
@@ -56,6 +57,21 @@ def invalidate_share(request):
return HTTPFound(request.route_url('details', track_id=track.id))
+@view_config(route_name='delete-track', request_method='POST', permission='track.delete')
+def delete_track(request):
+ """Endpoint to delete the track.
+
+ :param request: The Pyramid request.
+ :type request: pyramid.request.Request
+ :return: The HTTP response.
+ :rtype: pyramid.response.Response
+ """
+ track = request.context
+ request.dbsession.delete(track)
+ request.session.flash(request.localizer.translate(_("flash.track_deleted")))
+ return HTTPFound(request.route_url('home'))
+
+
@view_config(route_name='badge', http_cache=3600)
def badge(request):
"""Returns the image data associated with a badge.