Skip to content

Commit

Permalink
draft offer actions in offer section
Browse files Browse the repository at this point in the history
  • Loading branch information
mrf7777 committed Feb 9, 2024
1 parent 51667b1 commit 9d4a997
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions furfolio/templates/furfolio/offers/offer_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@

{% block content %}

{% if show_creator_functions %}
{% include "./components/offer_actions.html" with username=request.user.username only %}
<hr>
{% endif %}

<form method="get" class="mb-3">
{{ search_form }}
</form>
Expand Down
2 changes: 2 additions & 0 deletions furfolio/views/offers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 9d4a997

Please sign in to comment.