master
Aevann 2024-03-02 12:25:26 +02:00
parent 527d33b81b
commit b02347bc73
2 changed files with 15 additions and 20 deletions

View File

@ -712,12 +712,13 @@ class User(Base):
@lazy
def unchud_string(self):
if self.chud == 1:
return "permanently chudded"
text = "permanently chudded"
else:
text = "unchud in "
wait = self.chud - int(time.time())
if wait < 60:
text = f"{wait}s"
text += f"{wait}s"
else:
days = wait//(24*60*60)
wait -= days*24*60*60
@ -727,9 +728,9 @@ class User(Base):
mins = wait//60
text = f"{days}d {hours:02d}h {mins:02d}m"
text += f"{days}d {hours:02d}h {mins:02d}m"
return f'''Unchud in {text} - Chud phrase: "{self.chud_phrase[0].upper()}{self.chud_phrase[1:].replace('israel', 'Israel').replace('ukraine', 'Ukraine').replace('ccp', 'CCP')}"'''
return f'''{text} - chud phrase: "{self.chud_phrase[0].upper()}{self.chud_phrase[1:].replace('israel', 'Israel').replace('ukraine', 'Ukraine').replace('ccp', 'CCP')}"'''
@property
@lazy

View File

@ -1,13 +1,7 @@
{% macro userBanBlock(deviceType) %}
{% if u.chud %}
<h5 class="text-primary" id="profile-{{deviceType}}--chudded">CHUDDED USER:
(by {{u.chudder | safe}})
{% if u.chud > 1 %}
- {{u.unchud_string}}
{% endif %}
- "{{u.chud_phrase[0].upper() + u.chud_phrase[1:]}}"
(by {{u.chudder | safe}}) - {{u.unchud_string}}
</h5>
{% endif %}
{% if u.is_suspended %}