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 %} -