replace slippers with django-cotton
main reason: slippers cannot pass request via context inside its components, making it annoying to use template takes that take request. more reasons: not actively worked on, no named slots, having to define components in components.yaml + new components do not get registered without restarting server
This commit is contained in:
@ -65,12 +65,13 @@ def list_games(request: HttpRequest) -> HttpResponse:
|
||||
game.wikidata,
|
||||
game.created_at.strftime(dateformat),
|
||||
render_to_string(
|
||||
"components/button_group_sm.html",
|
||||
"cotton/button_group_sm.html",
|
||||
{
|
||||
"buttons": [
|
||||
{
|
||||
"href": reverse("edit_game", args=[game.pk]),
|
||||
"text": "Edit",
|
||||
"color": "gray",
|
||||
},
|
||||
{
|
||||
"href": reverse("delete_game", args=[game.pk]),
|
||||
@ -193,12 +194,13 @@ def view_game(request: HttpRequest, game_id: int) -> HttpResponse:
|
||||
edition.platform,
|
||||
edition.year_released,
|
||||
render_to_string(
|
||||
"components/button_group_sm.html",
|
||||
"cotton/button_group_sm.html",
|
||||
{
|
||||
"buttons": [
|
||||
{
|
||||
"href": reverse("edit_edition", args=[edition.pk]),
|
||||
"text": "Edit",
|
||||
"color": "gray",
|
||||
},
|
||||
{
|
||||
"href": reverse("delete_edition", args=[edition.pk]),
|
||||
@ -221,12 +223,13 @@ def view_game(request: HttpRequest, game_id: int) -> HttpResponse:
|
||||
purchase.get_type_display(),
|
||||
f"{purchase.price} {purchase.price_currency}",
|
||||
render_to_string(
|
||||
"components/button_group_sm.html",
|
||||
"cotton/button_group_sm.html",
|
||||
{
|
||||
"buttons": [
|
||||
{
|
||||
"href": reverse("edit_purchase", args=[purchase.pk]),
|
||||
"text": "Edit",
|
||||
"color": "gray",
|
||||
},
|
||||
{
|
||||
"href": reverse("delete_purchase", args=[purchase.pk]),
|
||||
@ -266,12 +269,13 @@ def view_game(request: HttpRequest, game_id: int) -> HttpResponse:
|
||||
else "-"
|
||||
),
|
||||
render_to_string(
|
||||
"components/button_group_sm.html",
|
||||
"cotton/button_group_sm.html",
|
||||
{
|
||||
"buttons": [
|
||||
{
|
||||
"href": reverse("edit_session", args=[session.pk]),
|
||||
"text": "Edit",
|
||||
"color": "gray",
|
||||
},
|
||||
{
|
||||
"href": reverse("delete_session", args=[session.pk]),
|
||||
|
Reference in New Issue
Block a user