diff --git a/core/management/commands/populate.py b/core/management/commands/populate.py index 492f971b..33a9fa2f 100644 --- a/core/management/commands/populate.py +++ b/core/management/commands/populate.py @@ -50,7 +50,7 @@ from com.ics_calendar import IcsCalendar from com.models import News, NewsDate, Sith, Weekmail from core.models import BanGroup, Group, Page, PageRev, SithFile, User from core.utils import resize_image -from counter.models import Counter, Product, ProductType, StudentCard +from counter.models import Counter, Product, ProductType, ReturnableProduct, StudentCard from election.models import Candidature, Election, ElectionList, Role from forum.models import Forum from pedagogy.models import UV @@ -470,7 +470,6 @@ Welcome to the wiki page! limit_age=18, ) cons = Product.objects.create( - id=settings.SITH_ECOCUP_CONS, name="Consigne Eco-cup", code="CONS", product_type=verre, @@ -480,7 +479,6 @@ Welcome to the wiki page! club=main_club, ) dcons = Product.objects.create( - id=settings.SITH_ECOCUP_DECO, name="Déconsigne Eco-cup", code="DECO", product_type=verre, @@ -529,6 +527,9 @@ Welcome to the wiki page! special_selling_price="0", club=refound, ) + ReturnableProduct.objects.create( + product=cons, returned_product=dcons, max_return=3 + ) # Accounting test values: BankAccount.objects.create(name="AE TG", club=main_club) diff --git a/core/static/core/components/card.scss b/core/static/core/components/card.scss index c8e59098..941b32a5 100644 --- a/core/static/core/components/card.scss +++ b/core/static/core/components/card.scss @@ -55,6 +55,14 @@ width: 80%; } + .card-top-left { + position: absolute; + top: 10px; + right: 10px; + padding: 10px; + text-align: center; + } + .card-content { color: black; display: flex; diff --git a/core/templates/core/delete_confirm.jinja b/core/templates/core/delete_confirm.jinja index 3a393b67..6ae8a1b2 100644 --- a/core/templates/core/delete_confirm.jinja +++ b/core/templates/core/delete_confirm.jinja @@ -10,10 +10,17 @@ {% block nav %} {% endblock %} +{# if the template context has the `object_name` variable, + then this one will be used, + instead of the result of `str(object)` #} +{% if object and not object_name %} + {% set object_name=object %} +{% endif %} + {% block content %}