Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(admin_tenders): Rediriger vers la section structures après la validation des DDB #1111

Merged
merged 3 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions lemarche/templates/admin/includes/fieldset.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<fieldset class="module aligned {{ fieldset.classes }}">
{% if fieldset.name %}<h2 id="{{fieldset.name|slugify}}">{{ fieldset.name }}</h2>{% endif %}
madjid-asa marked this conversation as resolved.
Show resolved Hide resolved
{% if fieldset.description %}
<div class="description">{{ fieldset.description|safe }}</div>

{% endif %}
{% for line in fieldset %}
<div class="form-row{% if line.fields|length == 1 and line.errors %} errors{% endif %}{% if not line.has_visible_field %} hidden{% endif %}{% for field in line %}{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% endfor %}">
{% if line.fields|length == 1 %}{{ line.errors }}{% else %}<div class="flex-container form-multiline">{% endif %}
{% for field in line %}
<div>
{% if not line.fields|length == 1 and not field.is_readonly %}{{ field.errors }}{% endif %}
<div class="flex-container{% if not line.fields|length == 1 %} fieldBox{% if field.field.name %} field-{{ field.field.name }}{% endif %}{% if not field.is_readonly and field.errors %} errors{% endif %}{% if field.field.is_hidden %} hidden{% endif %}{% elif field.is_checkbox %} checkbox-row{% endif %}">
{% if field.is_checkbox %}
{{ field.field }}{{ field.label_tag }}
{% else %}
{{ field.label_tag }}
{% if field.is_readonly %}
<div class="readonly">{{ field.contents }}</div>
{% else %}
{{ field.field }}
{% endif %}
{% endif %}
</div>
{% if field.field.help_text %}
<div class="help"{% if field.field.id_for_label %} id="{{ field.field.id_for_label }}_helptext"{% endif %}>
<div>{{ field.field.help_text|safe }}</div>
</div>
{% endif %}
</div>
{% endfor %}
{% if not line.fields|length == 1 %}</div>{% endif %}
</div>
{% endfor %}
</fieldset>
2 changes: 1 addition & 1 deletion lemarche/tenders/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ def response_change(self, request, obj: Tender):
if request.POST.get("_calculate_tender"):
obj.set_siae_found_list()
self.message_user(request, "Les structures concernées ont été mises à jour.")
return HttpResponseRedirect(".")
return HttpResponseRedirect("./#structures") # redirect to structures sections
if request.POST.get("_validate_tender"):
obj.set_validated()
self.message_user(request, "Ce dépôt de besoin a été validé. Il sera envoyé en temps voulu :)")
Expand Down
Loading