forked from MarseyWorld/MarseyWorld
dedup
parent
527d33b81b
commit
b02347bc73
|
@ -712,24 +712,25 @@ class User(Base):
|
|||
@lazy
|
||||
def unchud_string(self):
|
||||
if self.chud == 1:
|
||||
return "permanently chudded"
|
||||
|
||||
wait = self.chud - int(time.time())
|
||||
|
||||
if wait < 60:
|
||||
text = f"{wait}s"
|
||||
text = "permanently chudded"
|
||||
else:
|
||||
days = wait//(24*60*60)
|
||||
wait -= days*24*60*60
|
||||
text = "unchud in "
|
||||
wait = self.chud - int(time.time())
|
||||
|
||||
hours = wait//(60*60)
|
||||
wait -= hours*60*60
|
||||
if wait < 60:
|
||||
text += f"{wait}s"
|
||||
else:
|
||||
days = wait//(24*60*60)
|
||||
wait -= days*24*60*60
|
||||
|
||||
mins = wait//60
|
||||
hours = wait//(60*60)
|
||||
wait -= hours*60*60
|
||||
|
||||
text = f"{days}d {hours:02d}h {mins:02d}m"
|
||||
mins = wait//60
|
||||
|
||||
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')}"'''
|
||||
text += f"{days}d {hours:02d}h {mins:02d}m"
|
||||
|
||||
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
|
||||
|
|
|
@ -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 %}
|
||||
|
|
Loading…
Reference in New Issue