aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fietsboek/locale/de/LC_MESSAGES/messages.mobin10785 -> 11044 bytes
-rw-r--r--fietsboek/locale/de/LC_MESSAGES/messages.po42
-rw-r--r--fietsboek/locale/en/LC_MESSAGES/messages.mobin10158 -> 10405 bytes
-rw-r--r--fietsboek/locale/en/LC_MESSAGES/messages.po42
-rw-r--r--fietsboek/locale/fietslog.pot42
-rw-r--r--fietsboek/templates/browse.jinja214
-rw-r--r--fietsboek/views/browse.py12
7 files changed, 107 insertions, 45 deletions
diff --git a/fietsboek/locale/de/LC_MESSAGES/messages.mo b/fietsboek/locale/de/LC_MESSAGES/messages.mo
index a83f6ec..c4dab05 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 2068ad2..4399ede 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-28 13:56+0200\n"
+"POT-Creation-Date: 2022-07-28 19:48+0200\n"
"PO-Revision-Date: 2022-07-02 17:35+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language: de\n"
@@ -114,59 +114,71 @@ msgstr "Maximale Länge"
msgid "page.browse.filter.date_boundaries"
msgstr "Datumsgrenzen"
-#: fietsboek/templates/browse.jinja2:74
+#: fietsboek/templates/browse.jinja2:77
+msgid "page.browse.filter.my_tracks.only"
+msgstr "Zeige nur eigene Strecken"
+
+#: fietsboek/templates/browse.jinja2:78
+msgid "page.browse.filter.friends_tracks_only"
+msgstr "Zeige nur Strecken von Freunden"
+
+#: fietsboek/templates/browse.jinja2:79
+msgid "page.browse.filter.me_tagged_only"
+msgstr "Zeige nur Strecken, in denen ich markiert bin"
+
+#: fietsboek/templates/browse.jinja2:88
msgid "page.browse.filters.apply"
msgstr "Filter anwenden"
-#: fietsboek/templates/browse.jinja2:79
+#: fietsboek/templates/browse.jinja2:91
msgid "page.browse.filters.expand_advanced"
msgstr "Erweitert"
-#: fietsboek/templates/browse.jinja2:99 fietsboek/templates/details.jinja2:86
+#: fietsboek/templates/browse.jinja2:111 fietsboek/templates/details.jinja2:86
msgid "page.details.date"
msgstr "Datum"
-#: fietsboek/templates/browse.jinja2:101 fietsboek/templates/details.jinja2:98
+#: fietsboek/templates/browse.jinja2:113 fietsboek/templates/details.jinja2:98
msgid "page.details.length"
msgstr "Länge"
-#: fietsboek/templates/browse.jinja2:105 fietsboek/templates/details.jinja2:90
+#: fietsboek/templates/browse.jinja2:117 fietsboek/templates/details.jinja2:90
msgid "page.details.start_time"
msgstr "Startzeit"
-#: fietsboek/templates/browse.jinja2:107 fietsboek/templates/details.jinja2:94
+#: fietsboek/templates/browse.jinja2:119 fietsboek/templates/details.jinja2:94
msgid "page.details.end_time"
msgstr "Endzeit"
-#: fietsboek/templates/browse.jinja2:111 fietsboek/templates/details.jinja2:102
+#: fietsboek/templates/browse.jinja2:123 fietsboek/templates/details.jinja2:102
msgid "page.details.uphill"
msgstr "Bergauf"
-#: fietsboek/templates/browse.jinja2:113 fietsboek/templates/details.jinja2:106
+#: fietsboek/templates/browse.jinja2:125 fietsboek/templates/details.jinja2:106
msgid "page.details.downhill"
msgstr "Bergab"
-#: fietsboek/templates/browse.jinja2:117 fietsboek/templates/details.jinja2:110
+#: fietsboek/templates/browse.jinja2:129 fietsboek/templates/details.jinja2:110
msgid "page.details.moving_time"
msgstr "Fahrzeit"
-#: fietsboek/templates/browse.jinja2:119 fietsboek/templates/details.jinja2:114
+#: fietsboek/templates/browse.jinja2:131 fietsboek/templates/details.jinja2:114
msgid "page.details.stopped_time"
msgstr "Haltezeit"
-#: fietsboek/templates/browse.jinja2:123 fietsboek/templates/details.jinja2:118
+#: fietsboek/templates/browse.jinja2:135 fietsboek/templates/details.jinja2:118
msgid "page.details.max_speed"
msgstr "maximale Geschwindigkeit"
-#: fietsboek/templates/browse.jinja2:125 fietsboek/templates/details.jinja2:122
+#: fietsboek/templates/browse.jinja2:137 fietsboek/templates/details.jinja2:122
msgid "page.details.avg_speed"
msgstr "durchschnittliche Geschwindigkeit"
-#: fietsboek/templates/browse.jinja2:140
+#: fietsboek/templates/browse.jinja2:152
msgid "page.browse.download_multiple"
msgstr "ausgewählte Herunterladen"
-#: fietsboek/templates/browse.jinja2:142
+#: fietsboek/templates/browse.jinja2:154
msgid "page.browse.no_tracks"
msgstr ""
"Es wurden keine Strecken gefunden, auf die Du Zugriff hast. Versuche, "
diff --git a/fietsboek/locale/en/LC_MESSAGES/messages.mo b/fietsboek/locale/en/LC_MESSAGES/messages.mo
index 08658db..55f2b49 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 5d79e02..9409be5 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-28 13:56+0200\n"
+"POT-Creation-Date: 2022-07-28 19:48+0200\n"
"PO-Revision-Date: 2022-06-28 13:11+0200\n"
"Last-Translator: \n"
"Language: en\n"
@@ -114,59 +114,71 @@ msgstr "Maximum length"
msgid "page.browse.filter.date_boundaries"
msgstr "Date limits"
-#: fietsboek/templates/browse.jinja2:74
+#: fietsboek/templates/browse.jinja2:77
+msgid "page.browse.filter.my_tracks.only"
+msgstr "Show only my own tracks"
+
+#: fietsboek/templates/browse.jinja2:78
+msgid "page.browse.filter.friends_tracks_only"
+msgstr "Show only tracks of my friends"
+
+#: fietsboek/templates/browse.jinja2:79
+msgid "page.browse.filter.me_tagged_only"
+msgstr "Show only tracks in which I'm tagged"
+
+#: fietsboek/templates/browse.jinja2:88
msgid "page.browse.filters.apply"
msgstr "Apply filters"
-#: fietsboek/templates/browse.jinja2:79
+#: fietsboek/templates/browse.jinja2:91
msgid "page.browse.filters.expand_advanced"
msgstr "Advanced"
-#: fietsboek/templates/browse.jinja2:99 fietsboek/templates/details.jinja2:86
+#: fietsboek/templates/browse.jinja2:111 fietsboek/templates/details.jinja2:86
msgid "page.details.date"
msgstr "Date"
-#: fietsboek/templates/browse.jinja2:101 fietsboek/templates/details.jinja2:98
+#: fietsboek/templates/browse.jinja2:113 fietsboek/templates/details.jinja2:98
msgid "page.details.length"
msgstr "Length"
-#: fietsboek/templates/browse.jinja2:105 fietsboek/templates/details.jinja2:90
+#: fietsboek/templates/browse.jinja2:117 fietsboek/templates/details.jinja2:90
msgid "page.details.start_time"
msgstr "Record Start"
-#: fietsboek/templates/browse.jinja2:107 fietsboek/templates/details.jinja2:94
+#: fietsboek/templates/browse.jinja2:119 fietsboek/templates/details.jinja2:94
msgid "page.details.end_time"
msgstr "Record End"
-#: fietsboek/templates/browse.jinja2:111 fietsboek/templates/details.jinja2:102
+#: fietsboek/templates/browse.jinja2:123 fietsboek/templates/details.jinja2:102
msgid "page.details.uphill"
msgstr "Uphill"
-#: fietsboek/templates/browse.jinja2:113 fietsboek/templates/details.jinja2:106
+#: fietsboek/templates/browse.jinja2:125 fietsboek/templates/details.jinja2:106
msgid "page.details.downhill"
msgstr "Downhill"
-#: fietsboek/templates/browse.jinja2:117 fietsboek/templates/details.jinja2:110
+#: fietsboek/templates/browse.jinja2:129 fietsboek/templates/details.jinja2:110
msgid "page.details.moving_time"
msgstr "Moving Time"
-#: fietsboek/templates/browse.jinja2:119 fietsboek/templates/details.jinja2:114
+#: fietsboek/templates/browse.jinja2:131 fietsboek/templates/details.jinja2:114
msgid "page.details.stopped_time"
msgstr "Stopped Time"
-#: fietsboek/templates/browse.jinja2:123 fietsboek/templates/details.jinja2:118
+#: fietsboek/templates/browse.jinja2:135 fietsboek/templates/details.jinja2:118
msgid "page.details.max_speed"
msgstr "Max Speed"
-#: fietsboek/templates/browse.jinja2:125 fietsboek/templates/details.jinja2:122
+#: fietsboek/templates/browse.jinja2:137 fietsboek/templates/details.jinja2:122
msgid "page.details.avg_speed"
msgstr "Average Speed"
-#: fietsboek/templates/browse.jinja2:140
+#: fietsboek/templates/browse.jinja2:152
msgid "page.browse.download_multiple"
msgstr "Download selected"
-#: fietsboek/templates/browse.jinja2:142
+#: fietsboek/templates/browse.jinja2:154
msgid "page.browse.no_tracks"
msgstr "You currently do not have access to any tracks. Try logging in."
diff --git a/fietsboek/locale/fietslog.pot b/fietsboek/locale/fietslog.pot
index cb0267e..35f136c 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-28 13:56+0200\n"
+"POT-Creation-Date: 2022-07-28 19:48+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"
@@ -113,59 +113,71 @@ msgstr ""
msgid "page.browse.filter.date_boundaries"
msgstr ""
-#: fietsboek/templates/browse.jinja2:74
-msgid "page.browse.filters.apply"
+#: fietsboek/templates/browse.jinja2:77
+msgid "page.browse.filter.my_tracks.only"
+msgstr ""
+
+#: fietsboek/templates/browse.jinja2:78
+msgid "page.browse.filter.friends_tracks_only"
msgstr ""
#: fietsboek/templates/browse.jinja2:79
+msgid "page.browse.filter.me_tagged_only"
+msgstr ""
+
+#: fietsboek/templates/browse.jinja2:88
+msgid "page.browse.filters.apply"
+msgstr ""
+
+#: fietsboek/templates/browse.jinja2:91
msgid "page.browse.filters.expand_advanced"
msgstr ""
-#: fietsboek/templates/browse.jinja2:99 fietsboek/templates/details.jinja2:86
+#: fietsboek/templates/browse.jinja2:111 fietsboek/templates/details.jinja2:86
msgid "page.details.date"
msgstr ""
-#: fietsboek/templates/browse.jinja2:101 fietsboek/templates/details.jinja2:98
+#: fietsboek/templates/browse.jinja2:113 fietsboek/templates/details.jinja2:98
msgid "page.details.length"
msgstr ""
-#: fietsboek/templates/browse.jinja2:105 fietsboek/templates/details.jinja2:90
+#: fietsboek/templates/browse.jinja2:117 fietsboek/templates/details.jinja2:90
msgid "page.details.start_time"
msgstr ""
-#: fietsboek/templates/browse.jinja2:107 fietsboek/templates/details.jinja2:94
+#: fietsboek/templates/browse.jinja2:119 fietsboek/templates/details.jinja2:94
msgid "page.details.end_time"
msgstr ""
-#: fietsboek/templates/browse.jinja2:111 fietsboek/templates/details.jinja2:102
+#: fietsboek/templates/browse.jinja2:123 fietsboek/templates/details.jinja2:102
msgid "page.details.uphill"
msgstr ""
-#: fietsboek/templates/browse.jinja2:113 fietsboek/templates/details.jinja2:106
+#: fietsboek/templates/browse.jinja2:125 fietsboek/templates/details.jinja2:106
msgid "page.details.downhill"
msgstr ""
-#: fietsboek/templates/browse.jinja2:117 fietsboek/templates/details.jinja2:110
+#: fietsboek/templates/browse.jinja2:129 fietsboek/templates/details.jinja2:110
msgid "page.details.moving_time"
msgstr ""
-#: fietsboek/templates/browse.jinja2:119 fietsboek/templates/details.jinja2:114
+#: fietsboek/templates/browse.jinja2:131 fietsboek/templates/details.jinja2:114
msgid "page.details.stopped_time"
msgstr ""
-#: fietsboek/templates/browse.jinja2:123 fietsboek/templates/details.jinja2:118
+#: fietsboek/templates/browse.jinja2:135 fietsboek/templates/details.jinja2:118
msgid "page.details.max_speed"
msgstr ""
-#: fietsboek/templates/browse.jinja2:125 fietsboek/templates/details.jinja2:122
+#: fietsboek/templates/browse.jinja2:137 fietsboek/templates/details.jinja2:122
msgid "page.details.avg_speed"
msgstr ""
-#: fietsboek/templates/browse.jinja2:140
+#: fietsboek/templates/browse.jinja2:152
msgid "page.browse.download_multiple"
msgstr ""
-#: fietsboek/templates/browse.jinja2:142
+#: fietsboek/templates/browse.jinja2:154
msgid "page.browse.no_tracks"
msgstr ""
diff --git a/fietsboek/templates/browse.jinja2 b/fietsboek/templates/browse.jinja2
index 185b5d8..5b1e77c 100644
--- a/fietsboek/templates/browse.jinja2
+++ b/fietsboek/templates/browse.jinja2
@@ -65,6 +65,20 @@
<input name="max-date" type="date" class="form-control" value="{{ request.params.get('max-date', '') }}">
</div>
</div>
+
+ {% if request.identity %}
+ <div class="col-12">
+ {% macro render_switch(id, name, value, text) %}
+ <div class="form-check form-switch">
+ <input class="form-check-input" type="checkbox" role="switch" id="{{ id }}" name="{{ name }}" value="{{ value }}" {% if value in request.params.getall(name) %}checked{% endif %}>
+ <label class="form-check-label" for="{{ id }}">{{ text }}</label>
+ </div>
+ {% endmacro %}
+ {{ render_switch("switchOnlyMyTracks", "show-only[]", "mine", _("page.browse.filter.my_tracks.only")) }}
+ {{ render_switch("switchOnlyFriendsTracks", "show-only[]", "friends", _("page.browse.filter.friends_tracks_only")) }}
+ {{ render_switch("switchOnlyMeTagged", "user-tagged", "on", _("page.browse.filter.me_tagged_only")) }}
+ </div>
+ {% endif %}
</div>
<div class="row g-3 mb-3">
diff --git a/fietsboek/views/browse.py b/fietsboek/views/browse.py
index 678e207..e62ca0b 100644
--- a/fietsboek/views/browse.py
+++ b/fietsboek/views/browse.py
@@ -120,6 +120,18 @@ class TrackFilters:
max_date = _get_date(request, "max-date")
filters.append(lambda track: track.date.date() <= max_date)
+ if "mine" in request.params.getall('show-only[]'):
+ filters.append(lambda track: track.owner == request.identity)
+
+ if "friends" in request.params.getall('show-only[]'):
+ filters.append(lambda track: request.identity and
+ track.owner in request.identity.get_friends())
+
+ if request.params.get('user-tagged'):
+ filters.append(lambda track: request.identity and
+ (track.owner == request.identity or
+ request.identity in track.tagged_people))
+
return TrackFilters(filters)