From 56ab6636ccefe8ceb039c71e63991af0b68c3db0 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Thu, 3 Jun 2021 21:28:05 -0700 Subject: [PATCH] Add Swipe UI. --- .../backend/endpoints/photo_endpoints.py | 7 + .../etiquette_flask/templates/search.html | 14 + .../etiquette_flask/templates/swipe.html | 542 ++++++++++++++++++ 3 files changed, 563 insertions(+) create mode 100644 frontends/etiquette_flask/templates/swipe.html diff --git a/frontends/etiquette_flask/backend/endpoints/photo_endpoints.py b/frontends/etiquette_flask/backend/endpoints/photo_endpoints.py index dc8f49b..edb7c32 100644 --- a/frontends/etiquette_flask/backend/endpoints/photo_endpoints.py +++ b/frontends/etiquette_flask/backend/endpoints/photo_endpoints.py @@ -549,3 +549,10 @@ def get_search_json(): tag.jsonify(minimal=True) for tag in search_results['total_tags'] ] return jsonify.make_json_response(search_results) + +# Swipe ############################################################################################ + +@site.route('/swipe') +def get_swipe(): + response = common.render_template(request, 'swipe.html') + return response diff --git a/frontends/etiquette_flask/templates/search.html b/frontends/etiquette_flask/templates/search.html index cc039bd..b72f31e 100644 --- a/frontends/etiquette_flask/templates/search.html +++ b/frontends/etiquette_flask/templates/search.html @@ -318,6 +318,7 @@ + {% if total_tags %}

Tags on this page:

@@ -622,6 +623,19 @@ function submit_search() return false; } +function submit_swipe() +{ + const parameters = build_search_params().toString(); + let url = "/swipe"; + if (parameters !== "") + { + url += "?" + parameters.toString(); + } + console.log(url); + window.location.href = url; + return false; +} + function tags_on_this_page_add_must(event, tagname) { add_searchtag( diff --git a/frontends/etiquette_flask/templates/swipe.html b/frontends/etiquette_flask/templates/swipe.html new file mode 100644 index 0000000..9056156 --- /dev/null +++ b/frontends/etiquette_flask/templates/swipe.html @@ -0,0 +1,542 @@ + + + + {% import "header.html" as header %} + {% import "clipboard_tray.html" as clipboard_tray %} + Swipe + + + + + + + {% if theme %}{% endif %} + + + + + + + + + + + + +{{header.make_header(session=session)}} +
+ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+
+{{clipboard_tray.clipboard_tray()}} + + + +