Fixed user colours in comments sections.

This commit is contained in:
flash 2023-08-28 13:33:39 +00:00
parent 57b9e82c10
commit 5bab957a7c

View file

@ -48,6 +48,7 @@
{% set poster = comment.user|default(null) %} {% set poster = comment.user|default(null) %}
{% if comment.post is defined %} {% if comment.post is defined %}
{% set userVote = comment.vote.weight %} {% set userVote = comment.vote.weight %}
{% set commenterColour = comment.colour %}
{% set comment = comment.post %} {% set comment = comment.post %}
{% set body = comment.body %} {% set body = comment.body %}
{% set likes = comment.votesPositive %} {% set likes = comment.votesPositive %}
@ -55,6 +56,7 @@
{% set isReply = comment.isReply %} {% set isReply = comment.isReply %}
{% else %} {% else %}
{% set body = comment.text %} {% set body = comment.text %}
{% set commenterColour = null %}
{% set userVote = comment.userVote %} {% set userVote = comment.userVote %}
{% set likes = comment.likes %} {% set likes = comment.likes %}
{% set dislikes = comment.dislikes %} {% set dislikes = comment.dislikes %}
@ -80,7 +82,7 @@
{% if not hide_details %} {% if not hide_details %}
<a class="comment__user comment__user--link" <a class="comment__user comment__user--link"
href="{{ url('user-profile', {'user': poster.id}) }}" href="{{ url('user-profile', {'user': poster.id}) }}"
style="--user-colour: {{ colour }}">{{ poster.name }}</a> style="--user-colour: {{ commenterColour }}">{{ poster.name }}</a>
{% endif %} {% endif %}
<a class="comment__link" href="#comment-{{ comment.id }}"> <a class="comment__link" href="#comment-{{ comment.id }}">
<time class="comment__date" <time class="comment__date"