Skip to content

Commit f130cde

Browse files
Fix layout and styling for comment list
1 parent 5bb7043 commit f130cde

File tree

4 files changed

+39
-20
lines changed

4 files changed

+39
-20
lines changed

web/profiles/custom/os2loop/modules/os2loop_subscriptions/templates/os2loop-subscriptions-user.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{{ drupal_view('os2loop_subscriptions_node', 'block_1') }}
1010
</div>
1111

12-
<h2 class="h4 my-30">{{ 'Taxonomy term subscriptions'|t }}</h2>
12+
<h2 class="h4 mt-60 mb-30">{{ 'Taxonomy term subscriptions'|t }}</h2>
1313
<div class="os2loop-subscription-term">
1414
{{ drupal_view('os2loop_subscription_term', 'block_1') }}
1515
</div>

web/profiles/custom/os2loop/themes/os2loop_theme/assets/signifly-custom/custom-index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,4 @@
5252

5353
@import "pages/user-questions.scss";
5454
@import "pages/user-subscriptions.scss";
55+
@import "pages/user-replies.scss";
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.user-replies {
2+
.content-wrapper {
3+
@extend .block-primary-white, .p-30;
4+
5+
.views-rows-container {
6+
@extend .block-primary-gray, .p-30, .mt-30;
7+
}
8+
9+
.views-row {
10+
@extend .block-secondary-white, .py-20, .px-30;
11+
12+
+ .views-row {
13+
@extend .mt-20;
14+
}
15+
16+
// TODO: move this to bootstrap-custom
17+
.list-group-item {
18+
@extend .p-0;
19+
}
20+
}
21+
}
22+
}

web/profiles/custom/os2loop/themes/os2loop_theme/templates/content-entities/comment--list-display.html.twig

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -67,34 +67,30 @@
6767
*/
6868
#}
6969

70-
{% set node_value = commented_entity.os2loop_question_content.value is defined ? commented_entity.os2loop_question_content.value : commented_entity.os2loop_post_content.value %}
70+
{% set comment_title = commented_entity.label %}
7171
{% set comment_value = elements['#comment'].os2loop_question_answer.value is defined ? elements['#comment'].os2loop_question_answer.value : elements['#comment'].os2loop_post_comment.value %}
72-
{% set node_value_truncated = node_value|length > 200 ? true : false %}
72+
{% set comment_title_truncated = comment_title|length > 90 ? true : false %}
7373
{% set comment_value_truncated = comment_value|length > 200 ? true : false %}
7474
<div class="list-group">
75-
<article class="list-group-item mb-2 bg-light border-top">
75+
<article class="list-group-item">
7676
<div class="small">
7777
<span>{{ 'Created'|t }}</span>: {{ created }}
7878
</div>
79-
<div>
80-
{% if node_value_truncated %}
81-
{{ node_value|truncate(200, true)|raw }}
82-
<span>...</span>
79+
<div class="h5 mt-10 mb-0">
80+
{% if comment_title_truncated %}
81+
{{ comment_title|truncate(90, true, '...')|raw }}
8382
{% else %}
84-
{{ node_value|raw }}
83+
{{ comment_title|raw }}
8584
{% endif %}
8685
</div>
87-
<div class="d-flex">
88-
<h3 class="h6">
89-
<a href="{{ path('entity.comment.canonical', {'comment': comment.id}) }}#comment-{{ comment.id }}">
90-
{% if comment_value_truncated %}
91-
{{ comment_value|truncate(200, true)|raw }}
92-
<span>...</span>
93-
{% else %}
94-
{{ comment_value|raw }}
95-
{% endif %}
96-
</a>
97-
</h3>
86+
<div class="d-flex mt-10 mb-0">
87+
<a href="{{ path('entity.comment.canonical', {'comment': comment.id}) }}#comment-{{ comment.id }}" class="link-unstyled">
88+
{% if comment_value_truncated %}
89+
{{ comment_value|truncate(200, true, '...')|raw }}
90+
{% else %}
91+
{{ comment_value|raw }}
92+
{% endif %}
93+
</a>
9894
</div>
9995
</article>
10096
</div>

0 commit comments

Comments
 (0)