RetroFed Forum
Your home away from modern life.
If the warning sign “Very low reputation. Beware!” appears twice, is this a bug, or is this user especially problematic?
Post Reply
AuthorMessage
Stefan_S_from_H piefed.zip Stefan_S_from_H@piefed.zip
Joined: 2025-12-21
Quote

I can't paste images into the body anymore, so here's a link to one example: https://piefed.zip/post/1645895#comment_6124522 (user “makeshif*”).

This appears twice in the HTML code:

        <span class="fe fe-warning red" title="Very low reputation. Beware."> </span>  
            <span class="fe fe-warning red" title="Very low reputation. Beware!"> </span>  

I just realize it's “… Beware.” and “… Beware!”. Two different texts.

15   Original
Stefan_S_from_H piefed.zip Stefan_S_from_H@piefed.zip
Joined: 2025-12-21
#2 · (edited) Quote Reply

It's so unimportant, but I couldn't let it go. I searched the source, and the following code is written this way in 4 different files:

        {% if user.reputation < -12 -%}  
            <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 < -3 -%}  
            <span class="fe fe-warning orangered" title="{{ _('Low reputation.') }}"> </span>  
        {% endif -%}  

So the answer is “especially problematic”. Probably twice because red and orangered aren't distinct enough.

Hardcore DRY fighters will see this as a bug because it's repeated in multiple files. But templates don't get more readable if you never repeat yourself.

7
Rimu Moderator rimu@piefed.social
Joined: 2024-01-04
#3 · Quote Reply

It's so unimportant, but I couldn't let it go. I searched the source, and the following code is written this way in 4 different files: {% if user.reputation &lt; -12 -%} &lt;span class="fe fe-warning red" title="{{ _('Very low reputation. Beware.') }}"&gt; &lt;/span&gt; &lt;span class="fe fe-warning red" title="{{ _('Very low reputation. Beware!') }}"&gt; &lt;/span&gt; {% elif user.reputation &...

Yes it's intentional.

Jinja templates get really slow if you have many levels of {% include %} inside loops, like when showing many comments or posts at once.

3
Post Reply
Back to top