low reputation warning

This commit is contained in:
rimu 2023-12-27 11:00:30 +13:00
parent 03f10c36aa
commit 852470b433
8 changed files with 78 additions and 10 deletions

View file

@ -4,4 +4,12 @@ $green: #00b550;
$green-hover: #83f188; $green-hover: #83f188;
$light-grey: #ddd; $light-grey: #ddd;
$grey: #bbb; $grey: #bbb;
$dark-grey: #777; $dark-grey: #777;
.red {
color: red;
}
.orangered {
color: orangered;
}

View file

@ -137,6 +137,10 @@
content: "\e9d7"; content: "\e9d7";
} }
.fe-warning::before {
content: "\e904";
}
.fe-arrow-up::before { .fe-arrow-up::before {
content: "\e914"; content: "\e914";
} }

View file

@ -1,5 +1,13 @@
/* This file contains SCSS used for creating the general structure of pages. Selectors should be things like body, h1, /* This file contains SCSS used for creating the general structure of pages. Selectors should be things like body, h1,
nav, etc which are used site-wide */ nav, etc which are used site-wide */
.red {
color: red;
}
.orangered {
color: orangered;
}
.pl-0 { .pl-0 {
padding-left: 0 !important; padding-left: 0 !important;
} }
@ -140,6 +148,10 @@ nav, etc which are used site-wide */
content: "\e9d7"; content: "\e9d7";
} }
.fe-warning::before {
content: "\e904";
}
.fe-arrow-up::before { .fe-arrow-up::before {
content: "\e914"; content: "\e914";
} }
@ -638,4 +650,13 @@ fieldset legend {
display: block !important; display: block !important;
} }
.moderator_list {
list-style-type: none;
padding-left: 0;
}
.moderator_list li {
display: inline-block;
padding-right: 5px;
}
/*# sourceMappingURL=structure.css.map */ /*# sourceMappingURL=structure.css.map */

View file

@ -373,4 +373,14 @@ nav, etc which are used site-wide */
.show_menu { .show_menu {
display: block!important; display: block!important;
} }
.moderator_list {
list-style-type: none;
padding-left: 0;
li {
display: inline-block;
padding-right: 5px;
}
}

View file

@ -1,4 +1,12 @@
/* */ /* */
.red {
color: red;
}
.orangered {
color: orangered;
}
.pl-0 { .pl-0 {
padding-left: 0 !important; padding-left: 0 !important;
} }
@ -139,6 +147,10 @@
content: "\e9d7"; content: "\e9d7";
} }
.fe-warning::before {
content: "\e904";
}
.fe-arrow-up::before { .fe-arrow-up::before {
content: "\e914"; content: "\e914";
} }

View file

@ -11,6 +11,12 @@
{% if user.created_recently() %} {% if user.created_recently() %}
<span class="fe fe-new-account" title="New account"> </span> <span class="fe fe-new-account" title="New account"> </span>
{% endif %} {% endif %}
{% if user.reputation < -10 %}
<span class="fe fe-warning red" title="Very low reputation. Beware."> </span>
<span class="fe fe-warning red" title="Very low reputation. Beware!"> </span>
{% elif user.reputation < 0 %}
<span class="fe fe-warning orangered" title="Low reputation."> </span>
{% endif %}
{% endif %} {% endif %}
</span> </span>
{% endmacro %} {% endmacro %}

View file

@ -84,11 +84,11 @@
<h2>{{ _('About community') }}</h2> <h2>{{ _('About community') }}</h2>
</div> </div>
<div class="card-body"> <div class="card-body">
<p>{{ community.description_html|safe }}</p> <p>{{ community.description_html|safe if community.description_html else '' }}</p>
<p>{{ community.rules_html|safe }}</p> <p>{{ community.rules_html|safe if community.rules_html else '' }}</p>
{% if len(mods) > 0 and not community.private_mods %} {% if len(mods) > 0 and not community.private_mods %}
<h3>Moderators</h3> <h3>Moderators</h3>
<ul> <ul class="moderator_list">
{% for mod in mods %} {% for mod in mods %}
<li>{{ render_username(mod) }}</li> <li>{{ render_username(mod) }}</li>
{% endfor %} {% endfor %}

View file

@ -47,7 +47,8 @@
<div class="row post_replies"> <div class="row post_replies">
<div class="col"> <div class="col">
{% macro render_comment(comment) %} {% macro render_comment(comment) %}
<div id="comment_{{ comment['comment'].id }}" class="comment {% if comment['comment'].score <= -10 %}low_score{% endif %}"> <div id="comment_{{ comment['comment'].id }}" class="comment {% if comment['comment'].score <= -10 %}low_score{% endif %}
{% if comment['comment'].author.id == post.author.id %}original_poster{% endif %}">
<div class="limit_height"> <div class="limit_height">
<div class="voting_buttons"> <div class="voting_buttons">
{% with comment=comment['comment'] %} {% with comment=comment['comment'] %}
@ -75,6 +76,12 @@
{% if comment['comment'].author.created_recently() %} {% if comment['comment'].author.created_recently() %}
<span class="fe fe-new-account small" title="New account"> </span> <span class="fe fe-new-account small" title="New account"> </span>
{% endif %} {% endif %}
{% if comment['comment'].author.reputation < -10 %}
<span class="fe fe-warning red" title="Very low reputation. Beware."> </span>
<span class="fe fe-warning red" title="Very low reputation. Beware!"> </span>
{% elif comment['comment'].author.reputation < 0 %}
<span class="fe fe-warning orangered" title="Low reputation."> </span>
{% endif %}
{% if comment['comment'].author.id == post.author.id %}<span title="Submitter of original post" aria-label="submitter" class="small">[OP]</span>{% endif %} {% if comment['comment'].author.id == post.author.id %}<span title="Submitter of original post" aria-label="submitter" class="small">[OP]</span>{% endif %}
<span class="text-muted small">{{ moment(comment['comment'].posted_at).fromNow(refresh=True) }}{% if comment['comment'].edited_at %}, edited {{ moment(comment['comment'].edited_at).fromNow(refresh=True) }} {% endif %}</span> <span class="text-muted small">{{ moment(comment['comment'].posted_at).fromNow(refresh=True) }}{% if comment['comment'].edited_at %}, edited {{ moment(comment['comment'].edited_at).fromNow(refresh=True) }} {% endif %}</span>
</div> </div>
@ -146,15 +153,15 @@
<h2>{{ _('About community') }}</h2> <h2>{{ _('About community') }}</h2>
</div> </div>
<div class="card-body"> <div class="card-body">
<p>{{ post.community.description_html|safe }}</p> <p>{{ community.description_html|safe if community.description_html else '' }}</p>
<p>{{ post.community.rules_html|safe }}</p> <p>{{ community.rules_html|safe if community.rules_html else '' }}</p>
{% if len(mods) > 0 and not post.community.private_mods %} {% if len(mods) > 0 and not post.community.private_mods %}
<h3>Moderators</h3> <h3>Moderators</h3>
<ol> <ul class="moderator_list">
{% for mod in mods %} {% for mod in mods %}
<li><a href="/u/{{ mod.user_name }}">{{ mod.user_name }}</a></li> <li><a href="/u/{{ mod.user_name }}">{{ mod.user_name }}</a></li>
{% endfor %} {% endfor %}
</ol> </ul>
{% endif %} {% endif %}
</div> </div>
</div> </div>