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(tender): Admin : réduire la taille de la page grâce aux collapse #1089

Merged
merged 3 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
19 changes: 8 additions & 11 deletions lemarche/tenders/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,15 +296,15 @@ class TenderAdmin(FieldsetsInlineMixin, admin.ModelAdmin):
),
},
),
("Partenaire APProch", {"fields": ("is_partner_approch", "partner_approch_id")}),
("Partenaire APProch", {"classes": ["collapse"], "fields": ("is_partner_approch", "partner_approch_id")}),
(
"Structures",
{
"fields": (
"siae_count_annotated_with_link",
"siae_email_send_count_annotated_with_link",
"siae_email_link_click_count_annotated_with_link",
"siae_detail_display_count_annotated_with_link",
# "siae_email_link_click_count_annotated_with_link",
# "siae_detail_display_count_annotated_with_link",
"siae_email_link_click_or_detail_display_count_annotated_with_link",
"siae_detail_contact_click_count_annotated_with_link",
"siae_detail_cocontracting_click_count_annotated_with_link",
Expand Down Expand Up @@ -336,12 +336,7 @@ class TenderAdmin(FieldsetsInlineMixin, admin.ModelAdmin):
),
(
"Utilité du marché de l'inclusion",
{
"fields": (
"scale_marche_useless",
"marche_benefits",
)
},
{"fields": ("scale_marche_useless",)},
),
(
"Status",
Expand All @@ -357,16 +352,18 @@ class TenderAdmin(FieldsetsInlineMixin, admin.ModelAdmin):
(
"Stats",
{
"classes": ["collapse"],
"fields": (
"marche_benefits",
"siae_list_last_seen_date",
"source",
"logs_display",
"extra_data_display",
),
},
),
("Si importé", {"fields": ("import_raw_object_display",)}),
("Dates", {"fields": ("created_at", "updated_at")}),
("Si importé", {"classes": ["collapse"], "fields": ("import_raw_object_display",)}),
("Dates", {"classes": ["collapse"], "fields": ("created_at", "updated_at")}),
]

change_form_template = "tenders/admin_change_form.html"
Expand Down
2 changes: 1 addition & 1 deletion lemarche/tenders/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ class Tender(models.Model):
"created_at",
"updated_at",
]
FIELDS_STATS = FIELDS_STATS_COUNT + FIELDS_STATS_TIMESTAMPS + []
FIELDS_STATS = FIELDS_STATS_COUNT + FIELDS_STATS_TIMESTAMPS + ["marche_benefits"]
READONLY_FIELDS = FIELDS_SURVEY_TRANSACTIONED + FIELDS_STATS

# used in templates
Expand Down
Loading