Skip to content

Commit da5e618

Browse files
Fix layout of my answers and translations
1 parent e6612de commit da5e618

File tree

3 files changed

+7478
-8496
lines changed

3 files changed

+7478
-8496
lines changed

web/profiles/custom/os2loop/themes/os2loop_theme/assets/signifly-custom/pages/user-replies.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
.content-wrapper {
33
@extend .block-primary-white, .p-30;
44

5-
.views-rows-container {
6-
@extend .block-primary-gray, .p-30, .mt-30;
5+
.user-reply-wrapper {
6+
@extend .block-primary-gray, .p-30;
77
}
88

99
.views-row {

web/profiles/custom/os2loop/themes/os2loop_theme/templates/views/views-view-unformatted--os2loop-user-answers.html.twig

Lines changed: 47 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -27,51 +27,53 @@
2727
]
2828
%}
2929

30-
<h3 class="views-rows-title mt-30 mb-0">
31-
{% if content_type == 'os2loop_question' %}
32-
{{ 'Answers to questions'|t }}
33-
{% elseif content_type == 'os2loop_post' %}
34-
{{ 'Comments to posts'|t }}
35-
{% else %}
36-
{{ 'Unknown comment content_type'|t }}
37-
{% endif %}
38-
</h3>
39-
<div class="views-rows-container mt-30">
40-
{% if rows is empty %}
41-
<div class="views-row alternate-text">
42-
{% if content_type == 'os2loop_question' %}
43-
{{ 'You do not have any answers yet'|t }}
44-
{% else %}
45-
{{ 'You do not have any comments yet'|t }}
46-
{% endif %}
47-
</div>
48-
{% else %}
49-
{% for row in rows|slice(0, row_limit) %}
50-
<div{{ row.attributes.addClass(row_classes) }}>
51-
{{- row.content -}}
52-
</div>
53-
{% endfor %}
54-
{% if hidden_rows is not empty %}
55-
{% set reply_type = comment_type|split('_')|last %}
56-
{% set show_all_label = ('Show all ' ~ reply_type ~ 's')|t %}
57-
{% set show_fewer_label = ('Show fewer ' ~ reply_type ~ 's')|t %}
58-
<div class="hidden-views-rows-container collapse mt-20" id="toggle-{{ reply_type }}">
59-
{% for row in hidden_rows %}
60-
<div{{ row.attributes.addClass(row_classes) }}>
61-
{{- row.content -}}
62-
</div>
63-
{% endfor %}
30+
<div class="user-reply-wrapper mt-30">
31+
<h3 class="views-rows-title mb-0">
32+
{% if content_type == 'os2loop_question' %}
33+
{{ 'Answers to questions'|t }}
34+
{% elseif content_type == 'os2loop_post' %}
35+
{{ 'Comments to posts'|t }}
36+
{% else %}
37+
{{ 'Unknown comment content_type'|t }}
38+
{% endif %}
39+
</h3>
40+
<div class="views-rows-container mt-30">
41+
{% if rows is empty %}
42+
<div class="views-row alternate-text">
43+
{% if content_type == 'os2loop_question' %}
44+
{{ 'You do not have any answers yet'|t }}
45+
{% else %}
46+
{{ 'You do not have any comments yet'|t }}
47+
{% endif %}
6448
</div>
65-
<button id="button-{{ reply_type }}" class="btn btn-primary mt-20" content_type="button" data-toggle="collapse" data-target="#toggle-{{ reply_type }}" aria-expanded="false" aria-controls="toggle-{{ reply_type }}">
66-
{{- show_all_label -}}
67-
</button>
68-
{# Change label of button when it is clicked #}
69-
<script>
70-
const button = document.getElementById("button-{{ reply_type }}");
71-
button.addEventListener("click", function() {
72-
button.innerText = button.innerText === "{{ show_all_label }}" ? "{{ show_fewer_label }}" : "{{ show_all_label }}";
73-
});
74-
</script>
49+
{% else %}
50+
{% for row in rows|slice(0, row_limit) %}
51+
<div{{ row.attributes.addClass(row_classes) }}>
52+
{{- row.content -}}
53+
</div>
54+
{% endfor %}
55+
{% if hidden_rows is not empty %}
56+
{% set reply_type = comment_type|split('_')|last %}
57+
{% set show_all_label = ('Show all ' ~ reply_type ~ 's')|t %}
58+
{% set show_fewer_label = ('Show fewer ' ~ reply_type ~ 's')|t %}
59+
<div class="hidden-views-rows-container collapse mt-20" id="toggle-{{ reply_type }}">
60+
{% for row in hidden_rows %}
61+
<div{{ row.attributes.addClass(row_classes) }}>
62+
{{- row.content -}}
63+
</div>
64+
{% endfor %}
65+
</div>
66+
<button id="button-{{ reply_type }}" class="btn btn-primary mt-20" content_type="button" data-toggle="collapse" data-target="#toggle-{{ reply_type }}" aria-expanded="false" aria-controls="toggle-{{ reply_type }}">
67+
{{- show_all_label -}}
68+
</button>
69+
{# Change label of button when it is clicked #}
70+
<script>
71+
const button = document.getElementById("button-{{ reply_type }}");
72+
button.addEventListener("click", function() {
73+
button.innerText = button.innerText === "{{ show_all_label }}" ? "{{ show_fewer_label }}" : "{{ show_all_label }}";
74+
});
75+
</script>
76+
{% endif %}
7577
{% endif %}
7678
</div>
77-
{% endif %}
79+
</div>

0 commit comments

Comments
 (0)