diff --git a/akarpov/static/css/project.css b/akarpov/static/css/project.css
index c4c827c..c906842 100644
--- a/akarpov/static/css/project.css
+++ b/akarpov/static/css/project.css
@@ -531,3 +531,37 @@ p {
.nav-active {
color: white;
}
+
+.username {
+ max-width: 120px; /* Adjust as needed */
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.username:hover {
+ text-decoration: underline;
+ cursor: pointer;
+}
+
+/* Tooltip CSS */
+.username:hover::after {
+ content: attr(title);
+ position: absolute;
+ bottom: -20px;
+ left: 50%;
+ transform: translateX(-50%);
+ background-color: black;
+ color: white;
+ padding: 5px;
+ border-radius: 5px;
+ font-size: smaller;
+ white-space: nowrap;
+}
+
+/* Responsive font size */
+@media (max-width: 600px) {
+ .username {
+ font-size: smaller;
+ }
+}
diff --git a/akarpov/static/js/project.js b/akarpov/static/js/project.js
index d26d23b..3cd6379 100644
--- a/akarpov/static/js/project.js
+++ b/akarpov/static/js/project.js
@@ -1 +1,29 @@
-/* Project specific Javascript goes here. */
+
+ function sleep(ms) {
+ return new Promise(resolve => setTimeout(resolve, ms));
+ }
+
+ function timeSince(date) {
+ let seconds = Math.floor((new Date() - date) / 1000);
+ let interval = seconds / 31536000;
+ if (interval > 1) {
+ return Math.floor(interval) + " years";
+ }
+ interval = seconds / 2592000;
+ if (interval > 1) {
+ return Math.floor(interval) + " months";
+ }
+ interval = seconds / 86400;
+ if (interval > 1) {
+ return Math.floor(interval) + " days";
+ }
+ interval = seconds / 3600;
+ if (interval > 1) {
+ return Math.floor(interval) + " hours";
+ }
+ interval = seconds / 60;
+ if (interval > 1) {
+ return Math.floor(interval) + " minutes";
+ }
+ return Math.floor(seconds) + " seconds";
+ }
diff --git a/akarpov/templates/base.html b/akarpov/templates/base.html
index 41f00e7..4e76284 100644
--- a/akarpov/templates/base.html
+++ b/akarpov/templates/base.html
@@ -68,11 +68,11 @@
Files
{% endif %}
-
-
+
+
-
+
- QR generator
- UUID tools
- URL shortcuter
@@ -88,7 +88,7 @@
{% if request.user.is_authenticated %}
{% if request.user.image_cropped %}{% endif %}
- {{ request.user.username }}
+ {{ request.user.username }}
- Settings
@@ -156,35 +156,6 @@
let notification_socket = new WebSocket(socketPath);
- function sleep(ms) {
- return new Promise(resolve => setTimeout(resolve, ms));
- }
-
- function timeSince(date) {
- let seconds = Math.floor((new Date() - date) / 1000);
- let interval = seconds / 31536000;
- if (interval > 1) {
- return Math.floor(interval) + " years";
- }
- interval = seconds / 2592000;
- if (interval > 1) {
- return Math.floor(interval) + " months";
- }
- interval = seconds / 86400;
- if (interval > 1) {
- return Math.floor(interval) + " days";
- }
- interval = seconds / 3600;
- if (interval > 1) {
- return Math.floor(interval) + " hours";
- }
- interval = seconds / 60;
- if (interval > 1) {
- return Math.floor(interval) + " minutes";
- }
- return Math.floor(seconds) + " seconds";
- }
-
const toastContainer = document.getElementById('toastContainer')
diff --git a/config/settings/local.py b/config/settings/local.py
index e950733..c61be07 100644
--- a/config/settings/local.py
+++ b/config/settings/local.py
@@ -24,21 +24,23 @@
# django-debug-toolbar
# ------------------------------------------------------------------------------
# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#prerequisites
-INSTALLED_APPS += ["debug_toolbar"] # noqa F405
-# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#middleware
-MIDDLEWARE += ["debug_toolbar.middleware.DebugToolbarMiddleware"] # noqa F405
-# https://django-debug-toolbar.readthedocs.io/en/latest/configuration.html#debug-toolbar-config
-DEBUG_TOOLBAR_CONFIG = {
- "DISABLE_PANELS": ["debug_toolbar.panels.redirects.RedirectsPanel"],
- "SHOW_TEMPLATE_CONTEXT": True,
-}
-# https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#internal-ips
-INTERNAL_IPS = ["127.0.0.1", "10.0.2.2"]
-if env("USE_DOCKER") == "yes":
- import socket
+USE_DEBUG_TOOLBAR = DEBUG and not env.bool("USE_DOCKER", default=False)
+if USE_DEBUG_TOOLBAR:
+ INSTALLED_APPS += ["debug_toolbar"] # noqa F405
+ # https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#middleware
+ MIDDLEWARE += ["debug_toolbar.middleware.DebugToolbarMiddleware"] # noqa F405
+ # https://django-debug-toolbar.readthedocs.io/en/latest/configuration.html#debug-toolbar-config
+ DEBUG_TOOLBAR_CONFIG = {
+ "DISABLE_PANELS": ["debug_toolbar.panels.redirects.RedirectsPanel"],
+ "SHOW_TEMPLATE_CONTEXT": True,
+ }
+ # https://django-debug-toolbar.readthedocs.io/en/latest/installation.html#internal-ips
+ INTERNAL_IPS = ["127.0.0.1", "10.0.2.2"]
+ if env("USE_DOCKER") == "yes":
+ import socket
- hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
- INTERNAL_IPS += [".".join(ip.split(".")[:-1] + ["1"]) for ip in ips]
+ hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
+ INTERNAL_IPS += [".".join(ip.split(".")[:-1] + ["1"]) for ip in ips]
# django-extensions
# ------------------------------------------------------------------------------
diff --git a/config/urls.py b/config/urls.py
index e6edb69..db10036 100644
--- a/config/urls.py
+++ b/config/urls.py
@@ -68,7 +68,7 @@
),
]
-if settings.DEBUG:
+if settings.USE_DEBUG_TOOLBAR:
# This allows the error pages to be debugged during development, just visit
# these url in browser to see how these error pages look like.
urlpatterns += [