add table header actions
This commit is contained in:
@ -13,8 +13,9 @@ from django.template.loader import render_to_string
|
||||
from django.urls import reverse
|
||||
from django.utils import timezone
|
||||
|
||||
from common.time import dateformat, local_strftime
|
||||
from common.utils import A, Button, truncate_with_popover
|
||||
from common.components import A, Button, Icon
|
||||
from common.time import dateformat
|
||||
from common.utils import truncate_with_popover
|
||||
from games.forms import PurchaseForm
|
||||
from games.models import Edition, Purchase
|
||||
from games.views.general import use_custom_redirect
|
||||
@ -81,39 +82,39 @@ def list_purchases(request: HttpRequest) -> HttpResponse:
|
||||
purchase.price,
|
||||
purchase.price_currency,
|
||||
purchase.infinite,
|
||||
local_strftime(purchase.date_purchased, dateformat),
|
||||
purchase.date_purchased.strftime(dateformat),
|
||||
(
|
||||
local_strftime(purchase.date_refunded, dateformat)
|
||||
purchase.date_refunded.strftime(dateformat)
|
||||
if purchase.date_refunded
|
||||
else "-"
|
||||
),
|
||||
(
|
||||
local_strftime(purchase.date_finished, dateformat)
|
||||
purchase.date_finished.strftime(dateformat)
|
||||
if purchase.date_finished
|
||||
else "-"
|
||||
),
|
||||
(
|
||||
local_strftime(purchase.date_dropped, dateformat)
|
||||
purchase.date_dropped.strftime(dateformat)
|
||||
if purchase.date_dropped
|
||||
else "-"
|
||||
),
|
||||
local_strftime(purchase.created_at, dateformat),
|
||||
purchase.created_at.strftime(dateformat),
|
||||
render_to_string(
|
||||
"cotton/button_group_sm.html",
|
||||
"cotton/button_group.html",
|
||||
{
|
||||
"buttons": [
|
||||
{
|
||||
"href": reverse(
|
||||
"edit_purchase", args=[purchase.pk]
|
||||
),
|
||||
"text": "Edit",
|
||||
"slot": Icon("edit"),
|
||||
"color": "gray",
|
||||
},
|
||||
{
|
||||
"href": reverse(
|
||||
"delete_purchase", args=[purchase.pk]
|
||||
),
|
||||
"text": "Delete",
|
||||
"slot": Icon("delete"),
|
||||
"color": "red",
|
||||
},
|
||||
]
|
||||
|
Reference in New Issue
Block a user