Compare commits
6 Commits
6e4db38ee4
...
0.1.0
Author | SHA1 | Date | |
---|---|---|---|
250f841e00 | |||
89adf479f6 | |||
5f9ca5781f | |||
1a2f0b974d | |||
c6bb60bbbb | |||
126e758172 |
@ -8,7 +8,11 @@ steps:
|
|||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
repo: registry.kucharczyk.xyz/timetracker
|
repo: registry.kucharczyk.xyz/timetracker
|
||||||
tags: latest
|
environment:
|
||||||
|
VERSION_NUMBER: $(git describe --tags --abbrev=0)
|
||||||
|
tags:
|
||||||
|
- latest
|
||||||
|
- $VERSION_NUMBER
|
||||||
trigger:
|
trigger:
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "timetracker"
|
name = "timetracker"
|
||||||
version = "0.1.0"
|
version = "0.0.0"
|
||||||
description = "A simple time tracker."
|
description = "A simple time tracker."
|
||||||
authors = ["Lukáš Kucharczyk <lukas@kucharczyk.xyz>"]
|
authors = ["Lukáš Kucharczyk <lukas@kucharczyk.xyz>"]
|
||||||
license = "GPL"
|
license = "GPL"
|
||||||
|
@ -41,6 +41,9 @@ class Session(models.Model):
|
|||||||
return f"{str(self.purchase)} {str(self.timestamp_start.date())} ({self.total_duration()}{mark})"
|
return f"{str(self.purchase)} {str(self.timestamp_start.date())} ({self.total_duration()}{mark})"
|
||||||
|
|
||||||
def calculated_duration(self):
|
def calculated_duration(self):
|
||||||
|
if self.timestamp_end == None or self.timestamp_start == None:
|
||||||
|
return 0
|
||||||
|
else:
|
||||||
return self.timestamp_end - self.timestamp_start
|
return self.timestamp_end - self.timestamp_start
|
||||||
|
|
||||||
def total_duration(self):
|
def total_duration(self):
|
||||||
|
@ -717,6 +717,26 @@ select {
|
|||||||
position: static;
|
position: static;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.absolute {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
.left-0 {
|
||||||
|
left: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom-0 {
|
||||||
|
bottom: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.left-1 {
|
||||||
|
left: 0.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bottom-1 {
|
||||||
|
bottom: 0.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
.mx-auto {
|
.mx-auto {
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
margin-right: auto;
|
margin-right: auto;
|
||||||
@ -848,6 +868,16 @@ select {
|
|||||||
line-height: 1.75rem;
|
line-height: 1.75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.text-sm {
|
||||||
|
font-size: 0.875rem;
|
||||||
|
line-height: 1.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-xs {
|
||||||
|
font-size: 0.75rem;
|
||||||
|
line-height: 1rem;
|
||||||
|
}
|
||||||
|
|
||||||
.font-semibold {
|
.font-semibold {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
@ -857,6 +887,36 @@ select {
|
|||||||
color: rgb(255 255 255 / var(--tw-text-opacity));
|
color: rgb(255 255 255 / var(--tw-text-opacity));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.text-slate-800 {
|
||||||
|
--tw-text-opacity: 1;
|
||||||
|
color: rgb(30 41 59 / var(--tw-text-opacity));
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-slate-700 {
|
||||||
|
--tw-text-opacity: 1;
|
||||||
|
color: rgb(51 65 85 / var(--tw-text-opacity));
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-slate-600 {
|
||||||
|
--tw-text-opacity: 1;
|
||||||
|
color: rgb(71 85 105 / var(--tw-text-opacity));
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-slate-500 {
|
||||||
|
--tw-text-opacity: 1;
|
||||||
|
color: rgb(100 116 139 / var(--tw-text-opacity));
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-slate-400 {
|
||||||
|
--tw-text-opacity: 1;
|
||||||
|
color: rgb(148 163 184 / var(--tw-text-opacity));
|
||||||
|
}
|
||||||
|
|
||||||
|
.text-slate-300 {
|
||||||
|
--tw-text-opacity: 1;
|
||||||
|
color: rgb(203 213 225 / var(--tw-text-opacity));
|
||||||
|
}
|
||||||
|
|
||||||
.shadow {
|
.shadow {
|
||||||
--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
||||||
--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
|
--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
|
||||||
@ -908,6 +968,11 @@ form input[type=submit] {
|
|||||||
background-color: rgb(51 65 85 / var(--tw-bg-opacity));
|
background-color: rgb(51 65 85 / var(--tw-bg-opacity));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dark .dark\:bg-slate-400 {
|
||||||
|
--tw-bg-opacity: 1;
|
||||||
|
background-color: rgb(148 163 184 / var(--tw-bg-opacity));
|
||||||
|
}
|
||||||
|
|
||||||
.dark .dark\:text-white {
|
.dark .dark\:text-white {
|
||||||
--tw-text-opacity: 1;
|
--tw-text-opacity: 1;
|
||||||
color: rgb(255 255 255 / var(--tw-text-opacity));
|
color: rgb(255 255 255 / var(--tw-text-opacity));
|
||||||
@ -923,6 +988,11 @@ form input[type=submit] {
|
|||||||
color: rgb(203 213 225 / var(--tw-text-opacity));
|
color: rgb(203 213 225 / var(--tw-text-opacity));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dark .dark\:text-slate-600 {
|
||||||
|
--tw-text-opacity: 1;
|
||||||
|
color: rgb(71 85 105 / var(--tw-text-opacity));
|
||||||
|
}
|
||||||
|
|
||||||
@media (min-width: 768px) {
|
@media (min-width: 768px) {
|
||||||
.md\:block {
|
.md\:block {
|
||||||
display: block;
|
display: block;
|
||||||
|
@ -32,6 +32,8 @@
|
|||||||
</nav>
|
</nav>
|
||||||
{% block content %}No content here.{% endblock %}
|
{% block content %}No content here.{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
|
{% load version %}
|
||||||
|
<span id="version-info" class="absolute left-1 bottom-1 text-xs text-slate-300 dark:text-slate-600">{% version %} ({% version_date %})</span>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
18
src/web/tracker/templatetags/version.py
Normal file
18
src/web/tracker/templatetags/version.py
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
from django import template
|
||||||
|
import time
|
||||||
|
import os
|
||||||
|
|
||||||
|
register = template.Library()
|
||||||
|
|
||||||
|
|
||||||
|
@register.simple_tag
|
||||||
|
def version_date():
|
||||||
|
return time.strftime(
|
||||||
|
"%d-%b-%Y %H:%m",
|
||||||
|
time.gmtime(os.path.getmtime(os.path.abspath(os.path.join(".git")))),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@register.simple_tag
|
||||||
|
def version():
|
||||||
|
return os.environ.get("VERSION_NUMBER", "UNKNOWN VERSION")
|
@ -12,6 +12,7 @@ https://docs.djangoproject.com/en/4.1/ref/settings/
|
|||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
|
|
||||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||||
@ -107,7 +108,7 @@ AUTH_PASSWORD_VALIDATORS = [
|
|||||||
|
|
||||||
LANGUAGE_CODE = "en-us"
|
LANGUAGE_CODE = "en-us"
|
||||||
|
|
||||||
TIME_ZONE = "UTC"
|
TIME_ZONE = os.environ.get("TZ", "UTC")
|
||||||
|
|
||||||
USE_I18N = True
|
USE_I18N = True
|
||||||
|
|
||||||
@ -131,3 +132,5 @@ LOGGING = {
|
|||||||
"handlers": {"console": {"class": "logging.StreamHandler"}},
|
"handlers": {"console": {"class": "logging.StreamHandler"}},
|
||||||
"root": {"handlers": ["console"], "level": "WARNING"},
|
"root": {"handlers": ["console"], "level": "WARNING"},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CSRF_TRUSTED_ORIGINS = ["https://tracker.kucharczyk.xyz"]
|
||||||
|
Reference in New Issue
Block a user