Compare commits
No commits in common. "ac8cd6534a0023c376fd3f5c68a90a6f8d81423c" and "c337d2200f82a59e6bf7854c6f283456f9ac5321" have entirely different histories.
ac8cd6534a
...
c337d2200f
|
@ -1,4 +1,4 @@
|
||||||
## 1.0.2 / 2023-02-18 21:48+01:00
|
## Unreleased
|
||||||
|
|
||||||
* Add support for device info (https://git.kucharczyk.xyz/lukas/timetracker/issues/49)
|
* Add support for device info (https://git.kucharczyk.xyz/lukas/timetracker/issues/49)
|
||||||
* Add support for purchase ownership information (https://git.kucharczyk.xyz/lukas/timetracker/issues/48)
|
* Add support for purchase ownership information (https://git.kucharczyk.xyz/lukas/timetracker/issues/48)
|
||||||
|
|
|
@ -6,7 +6,7 @@ RUN npm install && \
|
||||||
|
|
||||||
FROM python:3.10.9-slim-bullseye
|
FROM python:3.10.9-slim-bullseye
|
||||||
|
|
||||||
ENV VERSION_NUMBER 1.0.2
|
ENV VERSION_NUMBER 1.0.0
|
||||||
ENV PROD 1
|
ENV PROD 1
|
||||||
ENV PYTHONUNBUFFERED=1
|
ENV PYTHONUNBUFFERED=1
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
{% if purchase %}<a class="dark:text-white hover:underline block" href="{% url 'list_sessions_by_edition' purchase.edition.id %}">See all platforms</a>{% endif %}
|
{% if purchase %}<a class="dark:text-white hover:underline block" href="{% url 'list_sessions_by_edition' purchase.edition.id %}">See all platforms</a>{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if dataset.count >= 1 %}
|
{% if dataset.count >= 1 %}
|
||||||
<a href="{% url 'start_session' last.id %}">
|
<a href="{% url 'start_session' last.purchase.id %}">
|
||||||
<button type="button" title="Track last tracked" class="mt-10 py-1 px-2 bg-green-600 hover:bg-green-700 focus:ring-green-500 focus:ring-offset-blue-200 text-white transition ease-in duration-200 text-center text-base font-semibold shadow-md focus:outline-none focus:ring-2 focus:ring-offset-2 rounded-lg ">
|
<button type="button" title="Track last tracked" class="mt-10 py-1 px-2 bg-green-600 hover:bg-green-700 focus:ring-green-500 focus:ring-offset-blue-200 text-white transition ease-in duration-200 text-center text-base font-semibold shadow-md focus:outline-none focus:ring-2 focus:ring-offset-2 rounded-lg ">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="self-center w-6 h-6 inline">
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="self-center w-6 h-6 inline">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" d="M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.348a1.125 1.125 0 010 1.971l-11.54 6.347a1.125 1.125 0 01-1.667-.985V5.653z" />
|
<path stroke-linecap="round" stroke-linejoin="round" d="M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.348a1.125 1.125 0 010 1.971l-11.54 6.347a1.125 1.125 0 01-1.667-.985V5.653z" />
|
||||||
|
|
|
@ -19,7 +19,7 @@ urlpatterns = [
|
||||||
name="update_session",
|
name="update_session",
|
||||||
),
|
),
|
||||||
path(
|
path(
|
||||||
"start-session/<int:last_session_id>",
|
"start-session/<int:purchase_id>",
|
||||||
views.start_session,
|
views.start_session,
|
||||||
name="start_session",
|
name="start_session",
|
||||||
),
|
),
|
||||||
|
@ -30,10 +30,8 @@ urlpatterns = [
|
||||||
),
|
),
|
||||||
path("add-purchase/", views.add_purchase, name="add_purchase"),
|
path("add-purchase/", views.add_purchase, name="add_purchase"),
|
||||||
path("add-edition/", views.add_edition, name="add_edition"),
|
path("add-edition/", views.add_edition, name="add_edition"),
|
||||||
path("edit-edition/<int:edition_id>", views.edit_edition, name="edit_edition"),
|
|
||||||
path("add-device/", views.add_device, name="add_device"),
|
path("add-device/", views.add_device, name="add_device"),
|
||||||
path("edit-session/<int:session_id>", views.edit_session, name="edit_session"),
|
path("edit-session/<int:session_id>", views.edit_session, name="edit_session"),
|
||||||
path("edit-purchase/<int:purchase_id>", views.edit_purchase, name="edit_purchase"),
|
|
||||||
path("list-sessions/", views.list_sessions, name="list_sessions"),
|
path("list-sessions/", views.list_sessions, name="list_sessions"),
|
||||||
path(
|
path(
|
||||||
"list-sessions/by-purchase/<int:purchase_id>",
|
"list-sessions/by-purchase/<int:purchase_id>",
|
||||||
|
|
|
@ -67,39 +67,8 @@ def edit_session(request, session_id=None):
|
||||||
return render(request, "add.html", context)
|
return render(request, "add.html", context)
|
||||||
|
|
||||||
|
|
||||||
def edit_purchase(request, purchase_id=None):
|
def start_session(request, purchase_id=None):
|
||||||
context = {}
|
session = SessionForm({"purchase": purchase_id, "timestamp_start": now_with_tz()})
|
||||||
purchase = Purchase.objects.get(id=purchase_id)
|
|
||||||
form = PurchaseForm(request.POST or None, instance=purchase)
|
|
||||||
if form.is_valid():
|
|
||||||
form.save()
|
|
||||||
return redirect("list_sessions")
|
|
||||||
context["title"] = "Edit Purchase"
|
|
||||||
context["form"] = form
|
|
||||||
return render(request, "add.html", context)
|
|
||||||
|
|
||||||
|
|
||||||
def edit_edition(request, edition_id=None):
|
|
||||||
context = {}
|
|
||||||
edition = Edition.objects.get(id=edition_id)
|
|
||||||
form = EditionForm(request.POST or None, instance=edition)
|
|
||||||
if form.is_valid():
|
|
||||||
form.save()
|
|
||||||
return redirect("list_sessions")
|
|
||||||
context["title"] = "Edit Edition"
|
|
||||||
context["form"] = form
|
|
||||||
return render(request, "add.html", context)
|
|
||||||
|
|
||||||
|
|
||||||
def start_session(request, last_session_id: int):
|
|
||||||
last_session = Session.objects.get(id=last_session_id)
|
|
||||||
session = SessionForm(
|
|
||||||
{
|
|
||||||
"purchase": last_session.purchase.id,
|
|
||||||
"timestamp_start": now_with_tz(),
|
|
||||||
"device": last_session.device,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
session.save()
|
session.save()
|
||||||
return redirect("list_sessions")
|
return redirect("list_sessions")
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "timetracker"
|
name = "timetracker"
|
||||||
version = "1.0.2"
|
version = "1.0.1"
|
||||||
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"
|
||||||
|
|
Loading…
Reference in New Issue