Skip to content

Commit 542d773

Browse files
author
roadiz-ci
committed
refacotr: update DOM structure for nodes pages
1 parent 77f6425 commit 542d773

12 files changed

Lines changed: 199 additions & 214 deletions

templates/macros/rz_menu_bar.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
{% if target is defined and target %} target="{{ target }}"{% endif %}
3939
>
4040
{% if icon is defined and icon %}
41-
<span class="{{ icon }}"></span>
41+
<span class="rz-menu-bar__icon {{ icon }}"></span>
4242
{% endif %}
4343
{% if label is defined and label and not iconOnly %}
4444
{{- label|trans -}}

templates/nodes/add.html.twig

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
{% block title %}{% trans %}add.a.node{% endtrans %} | {{ parent() }}{% endblock %}
44

55
{% block content %}
6-
<section class="content-global">
76
{% set title = 'add.a.node'|trans %}
87
{% if parentNode is defined and parentNode.nodeName %}
98
{% set subtitle = 'In'|trans ~ ' ' ~ parentNode.nodeName %}
@@ -29,7 +28,7 @@
2928
},
3029
} only %}
3130

32-
<article class="content">
31+
<section class="rz-page__body">
3332
{% form_theme form '@RoadizRozier/forms.html.twig' %}
3433
{{ form_start(form, {
3534
'attr': {
@@ -41,7 +40,6 @@
4140
{% import "@RoadizRozier/macros/rz_actions_menu.html.twig" as actions_menu %}
4241
{{ actions_menu.saveItem('#add-node-form') }}
4342
{{ form_end(form) }}
44-
</article>
43+
</section>
4544
{% include '@RoadizRozier/nodes/actionsMenu.html.twig' %}
46-
</section>
4745
{% endblock %}

templates/nodes/attributes/edit.html.twig

Lines changed: 138 additions & 140 deletions
Large diffs are not rendered by default.

templates/nodes/edit.html.twig

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
{% block title %}{{ "edit.node.%name%"|trans({'%name%': currentTitle})|truncate_title }} | {{ parent() }}{% endblock %}
1010

1111
{% block content %}
12-
<section class="content-global manage-node">
1312
{% include '@RoadizRozier/nodes/head.html.twig' with {
1413
node: node,
1514
title: "edit.node.%name%"|trans({'%name%': currentTitle})|truncate_title,
@@ -21,18 +20,18 @@
2120
with_nav_bar: true,
2221
} only %}
2322

24-
<article>
23+
<section class="rz-page__body">
2524
{% form_theme form '@RoadizRozier/forms.html.twig' %}
2625
{{ form_start(form, { attr: {id: 'edit-node-form'}}) }}
2726
{{ form_widget(form) }}
2827
{% import "@RoadizRozier/macros/rz_actions_menu.html.twig" as actions_menu %}
2928
{{ actions_menu.saveItem('#edit-node-form') }}
3029
{{ form_end(form) }}
31-
</article>
30+
</section>
3231

3332
{% if node.isHidingChildren %}
3433
<hr />
35-
<article>
34+
<section class="rz-page__body">
3635
<h2 class="text-h1-sm">{% trans %}stack.types{% endtrans %}</h2>
3736
{% embed '@RoadizRozier/includes/rz_table.html.twig' with {
3837
selection_available: false,
@@ -100,12 +99,12 @@
10099
{% endif %}
101100
{% endblock %}
102101
{% endembed %}
103-
</article>
102+
</section>
104103
{% endif %}
105104

106105
{% if translationForm %}
107106
<hr />
108-
<article>
107+
<section class="rz-page__body">
109108
<h2 class="text-h1-sm">{% trans %}translate.node{% endtrans %}</h2>
110109
{% form_theme translationForm '@RoadizRozier/forms.html.twig' %}
111110
{{ form_start(translationForm) }}
@@ -120,7 +119,7 @@
120119
}
121120
}) }}
122121
{{ form_end(translationForm) }}
123-
</article>
122+
</section>
124123
{% endif %}
125124

126125
{% include '@RoadizRozier/includes/rz_meta_item_table.html.twig' with {
@@ -129,5 +128,4 @@
129128
} only %}
130129

131130
{% include '@RoadizRozier/nodes/actionsMenu.html.twig' %}
132-
</section>
133131
{% endblock %}

templates/nodes/editAliases.html.twig

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
{% block title %}{{ "edit.node.%name%.seo"|trans({'%name%': currentTitle})|truncate_title }} | {{ parent() }}{% endblock %}
66

77
{% block content %}
8-
<section class="content-global">
98
{% include '@RoadizRozier/nodes/head.html.twig' with {
109
node: node,
1110
title: "edit.node.%name%.seo"|trans({'%name%': currentTitle})|truncate_title,
@@ -21,7 +20,7 @@
2120
route: 'nodesEditSEOPage',
2221
} only %}
2322

24-
<article class="content content-node-edit-seo">
23+
<section class="rz-page__body">
2524
{% if seoForm %}
2625
<h2 class="text-h1-sm">{% trans %}edit.node.seo{% endtrans %}</h2>
2726

@@ -142,8 +141,7 @@
142141
{% endif %}
143142
{% endblock %}
144143
{% endembed %}
145-
</article>
144+
</section>
146145

147146
{% include '@RoadizRozier/nodes/actionsMenu.html.twig' %}
148-
</section>
149147
{% endblock %}

templates/nodes/editSource.html.twig

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
{% import "@RoadizRozier/macros/rz_page_header.html.twig" as page_header %}
66

77
{% block content %}
8-
<section class="content-global">
98
{% include '@RoadizRozier/nodes/head.html.twig' with {
109
node: node,
1110
title: ("edit.nodeSource.%name%"|trans({'%name%': currentTitle}))|u.truncate(30, '[…]', false),
@@ -20,7 +19,7 @@
2019
source: source,
2120
} only %}
2221

23-
<div class="content content-node-edit-source">
22+
<section class="rz-page__body">
2423
{% form_theme form '@RoadizRozier/forms.html.twig' %}
2524
{{ form_start(form, { attr: {id: 'edit-node-source-form'}}) }}
2625
{% set groups = {} %}
@@ -106,8 +105,7 @@
106105
{{ actions_menu.saveItem('#edit-node-source-form') }}
107106
{% endif %}
108107
{{ form_end(form) }}
109-
</div>
108+
</section>
110109

111110
{% include '@RoadizRozier/nodes/actionsMenu.html.twig' %}
112-
</section>
113111
{% endblock %}

templates/nodes/editTags.html.twig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
{% block title %}{{ pageTitle }} | {{ parent() }}{% endblock %}
77

88
{% block content %}
9-
<section class="content-global" data-page-title="{{ pageTitle }} – {% trans %}back_office{% endtrans %}">
109
{% include '@RoadizRozier/nodes/head.html.twig' with {
1110
node: node,
1211
title: pageTitle,
@@ -17,14 +16,15 @@
1716
with_status_badge: true,
1817
with_nav_bar: true,
1918
} only %}
20-
<article class="content content-node-edit-tags">
19+
20+
<section class="rz-page__body">
2121
{% form_theme form '@RoadizRozier/forms.html.twig' %}
2222
{{ form_start(form, { attr: {id: 'edit-node-tags-form'}}) }}
2323
{{ form_widget(form) }}
2424
{% import "@RoadizRozier/macros/rz_actions_menu.html.twig" as actions_menu %}
2525
{{ actions_menu.saveItem('#edit-node-tags-form') }}
2626
{{ form_end(form) }}
27-
</article>
27+
</section>
28+
2829
{% include '@RoadizRozier/nodes/actionsMenu.html.twig' %}
29-
</section>
3030
{% endblock %}

templates/nodes/history.html.twig

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
{% block title %}{{ "history.for.%name%"|trans({"%name%":node.nodeName}) }} | {{ parent() }}{% endblock %}
44

55
{% block content %}
6-
<section class="content-global content-nav-and-filters">
76
{% include '@RoadizRozier/nodes/head.html.twig' with {
87
node: node,
98
title: "history.for.%name%"|trans({"%name%":node.nodeName}),
@@ -13,18 +12,18 @@
1312
with_status_badge: true,
1413
with_nav_bar: true,
1514
} only %}
15+
1616
{% include "@RoadizRozier/widgets/rz_filters_bar.html.twig" with {
1717
filters: filters,
1818
display_select_all_button: false,
1919
} only %}
2020

21-
<article>
21+
<section class="rz-page__body">
2222
{% include '@RoadizRozier/history/list_table.html.twig' with {
2323
levels: levels,
2424
log_list: entries
2525
} only %}
26-
</article>
26+
</section>
2727

2828
{% include '@RoadizRozier/nodes/actionsMenu.html.twig' %}
29-
</section>
3029
{% endblock %}

templates/nodes/list.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
statusNodesForm: statusNodesForm,
2525
} only %}
2626

27-
<article>
27+
<section class="rz-page__body">
2828
{% include '@RoadizRozier/nodes/list_table.html.twig' with {
2929
selection_available: true,
3030
actions_available: true,
3131
} %}
32-
</article>
32+
</section>
3333
</rz-bulk-section>
3434
{% endblock %}

templates/nodes/realms.html.twig

Lines changed: 33 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,41 @@
66
{% block title %}{{ "edit.node.%name%.realms"|trans({'%name%': currentTitle})|truncate_title }} | {{ parent() }}{% endblock %}
77

88
{% block content %}
9-
<section class="content-global">
10-
{% include '@RoadizRozier/nodes/head.html.twig' with {
9+
{% include '@RoadizRozier/nodes/head.html.twig' with {
10+
node: node,
11+
title: "edit.node.%name%.realms"|trans({'%name%': currentTitle})|truncate_title,
12+
current: 'realm',
13+
with_info_badge: true,
14+
with_status_badge: true,
15+
with_nav_bar: true,
16+
} only %}
17+
18+
<section class="rz-page__body">
19+
{% include '@RoadizRozier/nodes/realms_table.html.twig' with {
20+
nodeRealms: nodeRealms,
1121
node: node,
12-
title: "edit.node.%name%.realms"|trans({'%name%': currentTitle})|truncate_title,
13-
current: 'realm',
14-
with_info_badge: true,
15-
with_status_badge: true,
16-
with_nav_bar: true,
17-
} only %}
18-
19-
<article>
20-
{% include '@RoadizRozier/nodes/realms_table.html.twig' with {
21-
nodeRealms: nodeRealms,
22-
node: node,
23-
actions_available: true,
24-
} %}
25-
<hr>
26-
27-
{% if form %}
28-
<div>
29-
<h3 class="text-h1-sm">{% trans %}join.a.realm{% endtrans %}</h3>
30-
{% form_theme form '@RoadizRozier/forms.html.twig' %}
31-
{{ form_start(form) }}
32-
{{ form_widget(form) }}
33-
<div class="rz-form-field rz-form-field--align-start">
34-
<button class="rz-button rz-button--primary" type="submit">
35-
<span class="rz-button__label">{% trans %}join.realm{% endtrans %}</span>
36-
<span class="rz-button__icon rz-icon-ri--add-line"></span>
37-
</button>
38-
</div>
39-
{{ form_end(form) }}
22+
actions_available: true,
23+
} %}
24+
<hr>
25+
26+
{% if form %}
27+
<div>
28+
<h3 class="text-h1-sm">{% trans %}join.a.realm{% endtrans %}</h3>
29+
{% form_theme form '@RoadizRozier/forms.html.twig' %}
30+
{{ form_start(form) }}
31+
{{ form_widget(form) }}
32+
<div class="rz-form-field rz-form-field--align-start">
33+
<button class="rz-button rz-button--primary" type="submit">
34+
<span class="rz-button__label">{% trans %}join.realm{% endtrans %}</span>
35+
<span class="rz-button__icon rz-icon-ri--add-line"></span>
36+
</button>
4037
</div>
41-
{% endif %}
38+
{{ form_end(form) }}
39+
</div>
40+
{% endif %}
4241

43-
</div>
44-
</article>
42+
</div>
43+
</section >
4544

46-
{% include '@RoadizRozier/nodes/actionsMenu.html.twig' %}
47-
</section>
45+
{% include '@RoadizRozier/nodes/actionsMenu.html.twig' %}
4846
{% endblock %}

0 commit comments

Comments
 (0)