1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{# Admin inlines — Django TabularInline / StackedInline display.
Issue #50 slice 1: read-only listing of child rows on the parent
detail page. Each panel is one `register_admin_inline!` registration.
Rendered with `{{ value | safe }}` because the cell renderer
already HTML-escapes its inputs. #}
{% if inline_panels and inline_panels | length > 0 %}
{% for panel in inline_panels %}
{{ panel.label }}
{% if panel.empty %}
No related rows.
{% else %}
{% if panel.kind == "tabular" %}
{% for label in panel.field_labels %}{{ label }}{% endfor %}
{% for row in panel.rows %}
{% for cell in row.cells %}{{ cell.value | safe }}{% endfor %}
{% if row.pk %}
View
{% endif %}
{% endfor %}
{% else %}
{# stacked #}
{% for row in panel.rows %}
{% if row.pk %}
#{{ row.pk }}
{% else %}
Row
{% endif %}
{% for cell in row.cells %}
{{ cell.label }}
{{ cell.value | safe }}
{% endfor %}
{% endfor %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}