fix: avoid Jinja dict method collisions in admin templates
This commit is contained in:
@@ -121,7 +121,7 @@ def list_employees_page(
|
||||
order = desc(sort_column) if direction == "desc" else sort_column
|
||||
employees = db.scalars(base_stmt.order_by(order).limit(limit).offset(offset)).all()
|
||||
return {
|
||||
"items": [employee_display_payload(employee) for employee in employees],
|
||||
"employees": [employee_display_payload(employee) for employee in employees],
|
||||
"total": total,
|
||||
"limit": limit,
|
||||
"offset": offset,
|
||||
@@ -243,7 +243,7 @@ def _normalize_section(section: Any) -> dict[str, Any]:
|
||||
"type": section_type,
|
||||
"raw_text": raw_text,
|
||||
"paragraphs": paragraphs,
|
||||
"items": items,
|
||||
"list_items": items,
|
||||
"links": _normalize_links(section.get("links")),
|
||||
"year_entries": _normalize_year_entries(section.get("year_entries")),
|
||||
"publications": _normalize_publications(section.get("publications")),
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for employee in page.items %}
|
||||
{% for employee in page.employees %}
|
||||
<tr class="directory-table__row" data-row-href="/admin/employees/{{ employee.id }}">
|
||||
<td class="directory-table__cell" data-column="full_name">{{ employee.full_name or "No name" }}</td>
|
||||
<td class="directory-table__cell" data-column="status"><span class="badge {% if employee.status == "dismissed" %}badge--dismissed{% endif %}">{{ employee.status }}</span></td>
|
||||
|
||||
@@ -162,9 +162,9 @@
|
||||
<p class="employee-section__text">{{ paragraph }}</p>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if section.items %}
|
||||
{% if section.list_items %}
|
||||
<ul class="employee-card__list">
|
||||
{% for item in section.items %}
|
||||
{% for item in section.list_items %}
|
||||
<li class="employee-card__list-item">{{ item }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
APP_VERSION = "0.2.4"
|
||||
FRONTEND_VERSION = "0.2.4"
|
||||
BACKEND_VERSION = "0.2.4"
|
||||
APP_VERSION = "0.2.5"
|
||||
FRONTEND_VERSION = "0.2.5"
|
||||
BACKEND_VERSION = "0.2.5"
|
||||
|
||||
Reference in New Issue
Block a user