diff --git a/furfolio/templates/furfolio/offers/offer_list.html b/furfolio/templates/furfolio/offers/offer_list.html index e0f437d..a32b11f 100644 --- a/furfolio/templates/furfolio/offers/offer_list.html +++ b/furfolio/templates/furfolio/offers/offer_list.html @@ -9,6 +9,11 @@ {% block content %} +{% if show_creator_functions %} + {% include "./components/offer_actions.html" with username=request.user.username only %} +
+{% endif %} +
{{ search_form }}
diff --git a/furfolio/views/offers.py b/furfolio/views/offers.py index 92b7270..3eedb46 100644 --- a/furfolio/views/offers.py +++ b/furfolio/views/offers.py @@ -47,6 +47,8 @@ def get_queryset(self) -> QuerySet[Any]: def get_context_data(self, **kwargs: Any) -> dict[str, Any]: context = super().get_context_data(**kwargs) context["search_form"] = forms.OfferSearchForm(self.request.GET) + if self.request.user.is_authenticated: + context["show_creator_functions"] = (self.request.user.role == models.User.ROLE_CREATOR) return context