Compare commits
3 Commits
6f1886bca2
...
698c8966c0
Author | SHA1 | Date |
---|---|---|
Lukáš Kucharczyk | 698c8966c0 | |
Lukáš Kucharczyk | 7f6584ecf7 | |
Lukáš Kucharczyk | 540f5ee42c |
|
@ -3188,6 +3188,10 @@ textarea:disabled:is(.dark *) {
|
||||||
border-end-end-radius: 0.5rem;
|
border-end-end-radius: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.\[\&_\:last-child\]\:text-right :last-child {
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
.\[\&_a\]\:underline a {
|
.\[\&_a\]\:underline a {
|
||||||
text-decoration-line: underline;
|
text-decoration-line: underline;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg"
|
||||||
|
x="0px"
|
||||||
|
y="0px"
|
||||||
|
viewBox="0 0 48 48"
|
||||||
|
class="text-black dark:text-white w-4 h-4">
|
||||||
|
<path fill="currentColor" d="M 43.470703 8.9863281 A 1.50015 1.50015 0 0 0 42.439453 9.4394531 L 16.5 35.378906 L 5.5605469 24.439453 A 1.50015 1.50015 0 1 0 3.4394531 26.560547 L 15.439453 38.560547 A 1.50015 1.50015 0 0 0 17.560547 38.560547 L 44.560547 11.560547 A 1.50015 1.50015 0 0 0 43.470703 8.9863281 z">
|
||||||
|
</path>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 477 B |
|
@ -1,4 +1,4 @@
|
||||||
<tr class="odd:bg-white odd:dark:bg-gray-900 even:bg-gray-50 even:dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 [&_a]:underline [&_a]:underline-offset-4 [&_a]:decoration-2">
|
<tr class="odd:bg-white odd:dark:bg-gray-900 even:bg-gray-50 even:dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 [&_a]:underline [&_a]:underline-offset-4 [&_a]:decoration-2 [&_:last-child]:text-right">
|
||||||
{% if slot %}
|
{% if slot %}
|
||||||
{{ slot }}
|
{{ slot }}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
|
@ -54,6 +54,11 @@ urlpatterns = [
|
||||||
purchase.delete_purchase,
|
purchase.delete_purchase,
|
||||||
name="delete_purchase",
|
name="delete_purchase",
|
||||||
),
|
),
|
||||||
|
path(
|
||||||
|
"purchase/<int:purchase_id>/finish",
|
||||||
|
purchase.finish_purchase,
|
||||||
|
name="finish_purchase",
|
||||||
|
),
|
||||||
path(
|
path(
|
||||||
"purchase/list",
|
"purchase/list",
|
||||||
purchase.list_purchases,
|
purchase.list_purchases,
|
||||||
|
|
|
@ -229,11 +229,12 @@ def view_game(request: HttpRequest, game_id: int) -> HttpResponse:
|
||||||
}
|
}
|
||||||
|
|
||||||
purchase_data: dict[str, Any] = {
|
purchase_data: dict[str, Any] = {
|
||||||
"columns": ["Name", "Type", "Price", "Actions"],
|
"columns": ["Name", "Type", "Date", "Price", "Actions"],
|
||||||
"rows": [
|
"rows": [
|
||||||
[
|
[
|
||||||
purchase.name if purchase.name else purchase.edition.name,
|
purchase.name if purchase.name else purchase.edition.name,
|
||||||
purchase.get_type_display(),
|
purchase.get_type_display(),
|
||||||
|
purchase.date_purchased.strftime(dateformat),
|
||||||
f"{purchase.price} {purchase.price_currency}",
|
f"{purchase.price} {purchase.price_currency}",
|
||||||
render_to_string(
|
render_to_string(
|
||||||
"cotton/button_group.html",
|
"cotton/button_group.html",
|
||||||
|
|
|
@ -103,6 +103,15 @@ def list_purchases(request: HttpRequest) -> HttpResponse:
|
||||||
"cotton/button_group.html",
|
"cotton/button_group.html",
|
||||||
{
|
{
|
||||||
"buttons": [
|
"buttons": [
|
||||||
|
{
|
||||||
|
"href": reverse(
|
||||||
|
"finish_purchase", args=[purchase.pk]
|
||||||
|
),
|
||||||
|
"slot": Icon("checkmark"),
|
||||||
|
"title": "Mark as finished",
|
||||||
|
}
|
||||||
|
if not purchase.date_finished
|
||||||
|
else {},
|
||||||
{
|
{
|
||||||
"href": reverse(
|
"href": reverse(
|
||||||
"drop_purchase", args=[purchase.pk]
|
"drop_purchase", args=[purchase.pk]
|
||||||
|
@ -223,6 +232,14 @@ def refund_purchase(request: HttpRequest, purchase_id: int) -> HttpResponse:
|
||||||
return redirect("list_purchases")
|
return redirect("list_purchases")
|
||||||
|
|
||||||
|
|
||||||
|
@login_required
|
||||||
|
def finish_purchase(request: HttpRequest, purchase_id: int) -> HttpResponse:
|
||||||
|
purchase = get_object_or_404(Purchase, id=purchase_id)
|
||||||
|
purchase.date_finished = timezone.now()
|
||||||
|
purchase.save()
|
||||||
|
return redirect("list_purchases")
|
||||||
|
|
||||||
|
|
||||||
def related_purchase_by_edition(request: HttpRequest) -> HttpResponse:
|
def related_purchase_by_edition(request: HttpRequest) -> HttpResponse:
|
||||||
edition_id = request.GET.get("edition")
|
edition_id = request.GET.get("edition")
|
||||||
if not edition_id:
|
if not edition_id:
|
||||||
|
|
Loading…
Reference in New Issue