|
27 | 27 | ] |
28 | 28 | %} |
29 | 29 |
|
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 %} |
64 | 48 | </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 %} |
75 | 77 | {% endif %} |
76 | 78 | </div> |
77 | | -{% endif %} |
| 79 | +</div> |
0 commit comments