Skip to content

Commit

Permalink
feat(dev): user's requests (#291)
Browse files Browse the repository at this point in the history
  • Loading branch information
eugena committed Jul 9, 2023
1 parent f21fc1a commit 068aae3
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
14 changes: 5 additions & 9 deletions acesta/front/templatetags/requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,13 @@
register = template.Library()


@register.inclusion_tag("include/request_modal.html", takes_context=True)
def request_modal(context, subject):
@register.inclusion_tag("include/request_modal.html")
def request_modal(request, subject):
return dict(
REQUEST_CONSULTATION=settings.REQUEST_CONSULTATION,
REQUEST_CHANNELS=dict(settings.REQUEST_CHANNELS_OUTSIDE),
consultation_form=get_request_form(
getattr(context.get("request"), "user"), settings.REQUEST_CONSULTATION
),
presentation_form=get_request_form(
getattr(context.get("request"), "user"), settings.REQUEST_PRESENTATION
),
request=context["request"],
consultation_form=get_request_form(request.user, settings.REQUEST_CONSULTATION),
presentation_form=get_request_form(request.user, settings.REQUEST_PRESENTATION),
request=request,
subject=subject,
)
2 changes: 1 addition & 1 deletion acesta/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</head>
<body>
{% block modals %}
{% request_modal subject=REQUEST_CONSULTATION %}
{% request_modal request=request subject=REQUEST_CONSULTATION %}
{% endblock %}

{% block body %}{% endblock %}
Expand Down
2 changes: 1 addition & 1 deletion acesta/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

{% block modals %}
{{ block.super }}
{% request_modal subject="presentation" %}
{% request_modal request=request subject="presentation" %}
{% endblock %}

{% block body %}
Expand Down
2 changes: 1 addition & 1 deletion acesta/templates/outside.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{% block modals %}
{{ block.super }}
{% request_modal subject="presentation" %}
{% request_modal request=request subject="presentation" %}
{% endblock %}

{% block body %}
Expand Down

0 comments on commit 068aae3

Please sign in to comment.