From 6622875703c864caa5742947883b13dca490450f Mon Sep 17 00:00:00 2001 From: itdominator <1itdominator@gmail.com> Date: Sat, 13 Nov 2021 13:41:05 -0600 Subject: [PATCH] Updated ui and scripts --- src/dropper/config.py | 3 +- src/dropper/static/js/post-ajax.js | 2 +- src/dropper/templates/index.html | 140 +++++++++++++---------------- 3 files changed, 67 insertions(+), 78 deletions(-) diff --git a/src/dropper/config.py b/src/dropper/config.py index 70544a0..4b48dc7 100644 --- a/src/dropper/config.py +++ b/src/dropper/config.py @@ -18,7 +18,8 @@ class Config(object): DEBUG = False TESTING = False THREADED = True - SECRET_KEY = secrets.token_hex(32) + SECRET_KEY = "2A#GQafbREoblgMSQYomZSxbaPE6dt#" + # SECRET_KEY = secrets.token_hex(32) HOME_PTH = os.path.expanduser("~") ROOT_FILE_PTH = os.path.dirname(os.path.realpath(__file__)) diff --git a/src/dropper/static/js/post-ajax.js b/src/dropper/static/js/post-ajax.js index 02adf1f..2be20c7 100644 --- a/src/dropper/static/js/post-ajax.js +++ b/src/dropper/static/js/post-ajax.js @@ -26,7 +26,7 @@ const postAjaxController = (data, action, hash, fname) => { if (action === "delete") { query = '[fileHash="' + hash + '"]'; elm = document.querySelector(query); - while ( !elm.className.includes("row r") ) { + while ( !elm.className.includes("list-group-item") ) { elm = elm.parentElement; } elm.parentElement.removeChild(elm); diff --git a/src/dropper/templates/index.html b/src/dropper/templates/index.html index abc9357..2d010f9 100644 --- a/src/dropper/templates/index.html +++ b/src/dropper/templates/index.html @@ -2,116 +2,105 @@ {% block content %}
-
-
-
-
- +
+
+
+
+
+ +
+ {% if oidc_isAdmin() %} +
+ +
+
+ +
+
+ +
+ {% endif %} + {% if oidc_loggedin() %} + + + + {% else %} + + + + {% endif %}
- {% if oidc_isAdmin() %} -
- -
-
- -
-
- -
- {% endif %} - {% if oidc_loggedin() %} - - - - {% else %} - - - - {% endif %} -
-
-
- -
+
+
+ +
+
-
+
-
-

Server Files:

+
{% if oidc_isAdmin() %}
    {% for note in notes %} -
  • -
    -

    - Delete -

    -
    - -
    - {% if "youtu.be" in note["string"].strip().lower() or "www.youtube.com/watch?v=" in note["string"].strip().lower() %} - {% if "youtu.be" in note["string"].strip() %} - +
  • + + Delete + + {% if "youtu.be" in note["string"].strip().lower() or "www.youtube.com/watch?v=" in note["string"].strip().lower() %} + {% if "youtu.be" in note["string"].strip() %} {{note["string"]}} - - {% elif "www.youtube.com/watch?v=" in note["string"].strip().lower() %} - + {% elif "www.youtube.com/watch?v=" in note["string"].strip().lower() %} {{note["string"]}} - - {% endif %} - {% elif note["string"].strip().startswith( ("http:", "https:", "ftp:", "file:") ) %} - {% if note["string"].strip().endswith( (".jpg", ".jpeg", ".png", ".gif") ) %} -
    + {% endif %} + {% elif note["string"].strip().startswith( ("http:", "https:", "ftp:", "file:") ) %} + {% if note["string"].strip().endswith( (".jpg", ".jpeg", ".png", ".gif") ) %} {{note["string"]}} -
    - {% else %} - - {{note["string"]}} - + {% else %} + + {{note["string"]}} + + {% endif %} + {% elif note["string"].strip() %} +
    {{note["string"]}}
    {% endif %} - {% elif note["string"].strip() %} -
    {{note["string"]}}
    - {% endif %} -
- + {% endfor %} {% for file in files %} -
  • -
    +
  • {{file[0]}}

    {% if file[0].lower().endswith( (".png", ".jpg", ".jpeg") ) %} - - {{file[0]}} + + {{file[0]}} {% elif file[0].lower().endswith( (".mp4", ".webm") ) %} {% else %} - {{file[0]}} + {{file[0]}} {% endif %} -
  • - + {% endfor %}