forked from rDrama/rDrama
more hat shit
parent
520adaade0
commit
b3a56ca168
|
@ -80,7 +80,7 @@ socket.on('speak', function(json) {
|
||||||
document.getElementsByClassName('userlink')[0].classList.remove('d-none')
|
document.getElementsByClassName('userlink')[0].classList.remove('d-none')
|
||||||
document.getElementsByClassName('avatar')[0].classList.remove('d-none')
|
document.getElementsByClassName('avatar')[0].classList.remove('d-none')
|
||||||
document.getElementsByClassName('avatar-pic')[0].src = json['avatar']
|
document.getElementsByClassName('avatar-pic')[0].src = json['avatar']
|
||||||
if (json['hat']) document.getElementsByClassName('avatar-hat')[0].src = `/i/hats/${json['hat']}.webp?v=3`
|
if (json['hat']) document.getElementsByClassName('avatar-hat')[0].src = json['hat']} + '?v=3'
|
||||||
document.getElementsByClassName('userlink')[0].href = '/@' + json['username']
|
document.getElementsByClassName('userlink')[0].href = '/@' + json['username']
|
||||||
document.getElementsByClassName('userlink')[0].style.color = '#' + json['namecolor']
|
document.getElementsByClassName('userlink')[0].style.color = '#' + json['namecolor']
|
||||||
document.getElementsByClassName('time')[0].classList.remove('d-none')
|
document.getElementsByClassName('time')[0].classList.remove('d-none')
|
||||||
|
|
|
@ -49,7 +49,7 @@ function popclick(e) {
|
||||||
|
|
||||||
popover.getElementsByClassName('pop-banner')[0].src = author["bannerurl"]
|
popover.getElementsByClassName('pop-banner')[0].src = author["bannerurl"]
|
||||||
popover.getElementsByClassName('pop-picture')[0].src = author["profile_url"]
|
popover.getElementsByClassName('pop-picture')[0].src = author["profile_url"]
|
||||||
if (author["hat"]) popover.getElementsByClassName('pop-hat')[0].src = `/i/hats/${author['hat']}.webp?v=3`
|
if (author["hat"]) popover.getElementsByClassName('pop-hat')[0].src = author['hat'] + '?v=3'
|
||||||
popover.getElementsByClassName('pop-username')[0].innerHTML = author["username"]
|
popover.getElementsByClassName('pop-username')[0].innerHTML = author["username"]
|
||||||
if (popover.getElementsByClassName('pop-bio').length > 0) {
|
if (popover.getElementsByClassName('pop-bio').length > 0) {
|
||||||
popover.getElementsByClassName('pop-bio')[0].innerHTML = author["bio_html"]
|
popover.getElementsByClassName('pop-bio')[0].innerHTML = author["bio_html"]
|
||||||
|
|
|
@ -192,6 +192,13 @@ class User(Base):
|
||||||
def equipped_hat_ids(self):
|
def equipped_hat_ids(self):
|
||||||
return [x.hat_id for x in self.equipped_hats]
|
return [x.hat_id for x in self.equipped_hats]
|
||||||
|
|
||||||
|
@property
|
||||||
|
@lazy
|
||||||
|
def equipped_hat(self):
|
||||||
|
if self.equipped_hats:
|
||||||
|
return random.choice(self.equipped_hats)
|
||||||
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@lazy
|
@lazy
|
||||||
def hat_active(self):
|
def hat_active(self):
|
||||||
|
@ -199,10 +206,10 @@ class User(Base):
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
if self.is_cakeday:
|
if self.is_cakeday:
|
||||||
return 'Cakeday.webp'
|
return '/i/hats/Cakeday.webp'
|
||||||
|
|
||||||
if self.equipped_hats:
|
if self.equipped_hat:
|
||||||
return random.choice(self.equipped_hats)
|
return f'/i/hats/{self.equipped_hat.name}.webp'
|
||||||
|
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
@ -214,8 +221,8 @@ class User(Base):
|
||||||
if self.is_cakeday:
|
if self.is_cakeday:
|
||||||
return "I've spent another year rotting my brain with dramaposting, please ridicule me 🤓"
|
return "I've spent another year rotting my brain with dramaposting, please ridicule me 🤓"
|
||||||
|
|
||||||
if self.equipped_hats:
|
if self.equipped_hat:
|
||||||
return self.hat_active.name + ' - ' + self.hat_active.censored_description(v)
|
return self.equipped_hat.name + ' - ' + self.equipped_hat.censored_description(v)
|
||||||
|
|
||||||
return ''
|
return ''
|
||||||
|
|
||||||
|
@ -693,7 +700,7 @@ class User(Base):
|
||||||
'url': self.url,
|
'url': self.url,
|
||||||
'id': self.id,
|
'id': self.id,
|
||||||
'profile_url': self.profile_url,
|
'profile_url': self.profile_url,
|
||||||
'hat': self.hat_active.name,
|
'hat': self.hat_active,
|
||||||
'bannerurl': self.banner_url,
|
'bannerurl': self.banner_url,
|
||||||
'bio_html': self.bio_html_eager,
|
'bio_html': self.bio_html_eager,
|
||||||
'coins': self.coins,
|
'coins': self.coins,
|
||||||
|
|
|
@ -66,7 +66,7 @@ def speak(data, v):
|
||||||
|
|
||||||
data={
|
data={
|
||||||
"avatar": v.profile_url,
|
"avatar": v.profile_url,
|
||||||
"hat": v.hat_active.name,
|
"hat": v.hat_active,
|
||||||
"username": v.username,
|
"username": v.username,
|
||||||
"namecolor": v.namecolor,
|
"namecolor": v.namecolor,
|
||||||
"text": text,
|
"text": text,
|
||||||
|
|
|
@ -169,7 +169,7 @@
|
||||||
<div class="profile-pic-20-wrapper">
|
<div class="profile-pic-20-wrapper">
|
||||||
<img src="{{m['avatar']}}" class="pp20 mr-1">
|
<img src="{{m['avatar']}}" class="pp20 mr-1">
|
||||||
{% if m.get('hat') -%}
|
{% if m.get('hat') -%}
|
||||||
<img class="profile-pic-20-hat hat" loading="lazy" src="/i/hats/{{m['hat']}}?v=3">
|
<img class="profile-pic-20-hat hat" loading="lazy" src="{{m['hat']}}?v=3">
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -222,6 +222,6 @@
|
||||||
|
|
||||||
<script src="{{asset('js/lozad.js')}}"></script>
|
<script src="{{asset('js/lozad.js')}}"></script>
|
||||||
<script src="/assets/js/lite-youtube.js?v=4000"></script>
|
<script src="/assets/js/lite-youtube.js?v=4000"></script>
|
||||||
<script src="/chat.js?v=4003"></script>
|
<script src="/chat.js?v=4004"></script>
|
||||||
|
|
||||||
</body>
|
</body>
|
|
@ -171,7 +171,7 @@
|
||||||
<div class="profile-pic-30-wrapper">
|
<div class="profile-pic-30-wrapper">
|
||||||
<img loading="lazy" src="{{c.author.profile_url}}" class="profile-pic-30 mr-2">
|
<img loading="lazy" src="{{c.author.profile_url}}" class="profile-pic-30 mr-2">
|
||||||
{% if c.author.hat_active -%}
|
{% if c.author.hat_active -%}
|
||||||
<img class="profile-pic-30-hat hat" loading="lazy" src="/i/hats/{{c.author.hat_active.name}}.webp?v=3" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{c.author.hat_tooltip(v)}}">
|
<img class="profile-pic-30-hat hat" loading="lazy" src="{{c.author.hat_active}}?v=3" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{c.author.hat_tooltip(v)}}">
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
</div>
|
</div>
|
||||||
<span {% if c.author.patron and not c.distinguish_level %}class="patron" style="background-color:#{{c.author.name_color}};"{% elif c.distinguish_level %}class="mod"{% endif %}>{{c.author_name}}</span>
|
<span {% if c.author.patron and not c.distinguish_level %}class="patron" style="background-color:#{{c.author.name_color}};"{% elif c.distinguish_level %}class="mod"{% endif %}>{{c.author_name}}</span>
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
const profile_pic_hat = document.getElementById("profile-pic-35-hat");
|
const profile_pic_hat = document.getElementById("profile-pic-35-hat");
|
||||||
function extra_actions(xhr) {
|
function extra_actions(xhr) {
|
||||||
if(xhr.status == 200) {
|
if(xhr.status == 200) {
|
||||||
profile_pic_hat.src = `/i/hats/${hat_name}.webp?v=3`
|
profile_pic_hat.src = `${hat_name}.webp?v=3`
|
||||||
profile_pic_hat.classList.remove('d-none')
|
profile_pic_hat.classList.remove('d-none')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for hat, user in hats %}
|
{% for hat, user in hats %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><img loading="lazy" alt="{{hat.name}}" src="/i/hats/{{hat.name}}.webp?v=3" style="max-width:100%;height:auto"></td>
|
<td><img loading="lazy" alt="{{hat.name}}" src="{{hat.name}}.webp?v=3" style="max-width:100%;height:auto"></td>
|
||||||
<td>{{hat.name}}</td>
|
<td>{{hat.name}}</td>
|
||||||
<td style="word-break:break-word">{{hat.censored_description(v)}}</td>
|
<td style="word-break:break-word">{{hat.censored_description(v)}}</td>
|
||||||
{% if SITE == 'rdrama.net' %}
|
{% if SITE == 'rdrama.net' %}
|
||||||
|
|
|
@ -207,7 +207,7 @@
|
||||||
<div class="profile-pic-35-wrapper">
|
<div class="profile-pic-35-wrapper">
|
||||||
<img loading="lazy" src="{{v.profile_url}}" class="profile-pic-35">
|
<img loading="lazy" src="{{v.profile_url}}" class="profile-pic-35">
|
||||||
{% if v.hat_active -%}
|
{% if v.hat_active -%}
|
||||||
<img id="profile-pic-35-hat" class="profile-pic-35-hat hat" loading="lazy" src="/i/hats/{{v.hat_active.name}}.webp?v=3" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{v.hat_tooltip(v)}}">
|
<img id="profile-pic-35-hat" class="profile-pic-35-hat hat" loading="lazy" src="{{v.hat_active}}?v=3" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{v.hat_tooltip(v)}}">
|
||||||
{% elif request.path == '/hats' %}
|
{% elif request.path == '/hats' %}
|
||||||
<img id="profile-pic-35-hat" class="profile-pic-35-hat hat d-none" loading="lazy" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{v.hat_tooltip(v)}}">
|
<img id="profile-pic-35-hat" class="profile-pic-35-hat hat d-none" loading="lazy" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{v.hat_tooltip(v)}}">
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
|
|
|
@ -677,7 +677,7 @@
|
||||||
<div class="profile-pic-30-wrapper">
|
<div class="profile-pic-30-wrapper">
|
||||||
<img loading="lazy" src="{{p.author.profile_url}}" class="profile-pic-30 mr-2">
|
<img loading="lazy" src="{{p.author.profile_url}}" class="profile-pic-30 mr-2">
|
||||||
{% if p.author.hat_active -%}
|
{% if p.author.hat_active -%}
|
||||||
<img class="profile-pic-30-hat hat" loading="lazy" src="/i/hats/{{p.author.hat_active.name}}.webp?v=3" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{p.author.hat_tooltip(v)}}">
|
<img class="profile-pic-30-hat hat" loading="lazy" src="{{p.author.hat_active}}?v=3" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{p.author.hat_tooltip(v)}}">
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
</div>
|
</div>
|
||||||
<span {% if p.author.patron and not p.distinguish_level %}class="patron" style="background-color:#{{p.author.name_color}};"{% elif p.distinguish_level %}class="mod"{% endif %}>{{p.author_name}}</span>
|
<span {% if p.author.patron and not p.distinguish_level %}class="patron" style="background-color:#{{p.author.name_color}};"{% elif p.distinguish_level %}class="mod"{% endif %}>{{p.author_name}}</span>
|
||||||
|
|
|
@ -172,7 +172,7 @@
|
||||||
<div class="profile-pic-30-wrapper">
|
<div class="profile-pic-30-wrapper">
|
||||||
<img loading="lazy" src="{{p.author.profile_url}}" class="profile-pic-30 mr-2">
|
<img loading="lazy" src="{{p.author.profile_url}}" class="profile-pic-30 mr-2">
|
||||||
{% if p.author.hat_active -%}
|
{% if p.author.hat_active -%}
|
||||||
<img class="profile-pic-30-hat hat" loading="lazy" src="/i/hats/{{p.author.hat_active.name}}.webp?v=3" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{p.author.hat_tooltip(v)}}">
|
<img class="profile-pic-30-hat hat" loading="lazy" src="{{p.author.hat_active}}?v=3" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{p.author.hat_tooltip(v)}}">
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
</div>
|
</div>
|
||||||
<span {% if p.author.patron and not p.distinguish_level %}class="patron" style="background-color:#{{p.author.name_color}};"{% elif p.distinguish_level %}class="mod"{% endif %}>{{p.author_name}}</span>
|
<span {% if p.author.patron and not p.distinguish_level %}class="patron" style="background-color:#{{p.author.name_color}};"{% elif p.distinguish_level %}class="mod"{% endif %}>{{p.author_name}}</span>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="profile-pic-20-wrapper">
|
<div class="profile-pic-20-wrapper">
|
||||||
<img loading="lazy" src="{{user.profile_url}}" class="pp20">
|
<img loading="lazy" src="{{user.profile_url}}" class="pp20">
|
||||||
{% if user.hat_active -%}
|
{% if user.hat_active -%}
|
||||||
<img class="profile-pic-20-hat hat" loading="lazy" src="/i/hats/{{user.hat_active.name}}.webp?v=3" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{user.hat_tooltip(v)}}">
|
<img class="profile-pic-20-hat hat" loading="lazy" src="{{user.hat_active}}?v=3" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{user.hat_tooltip(v)}}">
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
</div>
|
</div>
|
||||||
<span {% if user.patron %}class="patron" style="background-color:#{{user.name_color}}"{% endif %}>{{user.username}}</span>
|
<span {% if user.patron %}class="patron" style="background-color:#{{user.name_color}}"{% endif %}>{{user.username}}</span>
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
<a rel="nofollow noopener noreferrer" href="{% if u.highres %}{{u.highres}}{% else %}{{u.profile_url}}{% endif %}" class="profile-pic-100-wrapper">
|
<a rel="nofollow noopener noreferrer" href="{% if u.highres %}{{u.highres}}{% else %}{{u.profile_url}}{% endif %}" class="profile-pic-100-wrapper">
|
||||||
<img onclick="expandDesktopImage('{% if u.highres %}{{u.highres}}{% else %}{{u.profile_url}}{% endif %}')" loading="lazy" src="{{u.profile_url}}" class="profile-pic profile-pic-100 mb-5">
|
<img onclick="expandDesktopImage('{% if u.highres %}{{u.highres}}{% else %}{{u.profile_url}}{% endif %}')" loading="lazy" src="{{u.profile_url}}" class="profile-pic profile-pic-100 mb-5">
|
||||||
{% if u.hat_active -%}
|
{% if u.hat_active -%}
|
||||||
<img onclick="expandDesktopImage('{% if u.highres %}{{u.highres}}{% else %}{{u.profile_url}}{% endif %}')" class="profile-pic-100-hat hat" loading="lazy" src="/i/hats/{{u.hat_active.name}}.webp?v=3" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{u.hat_tooltip(v)}}">
|
<img onclick="expandDesktopImage('{% if u.highres %}{{u.highres}}{% else %}{{u.profile_url}}{% endif %}')" class="profile-pic-100-hat hat" loading="lazy" src="{{u.hat_active}}?v=3" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{u.hat_tooltip(v)}}">
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -407,7 +407,7 @@
|
||||||
<a rel="nofollow noopener noreferrer" href="{% if u.highres %}{{u.highres}}{% else %}{{u.profile_url}}{% endif %}" class="profile-pic-65-wrapper">
|
<a rel="nofollow noopener noreferrer" href="{% if u.highres %}{{u.highres}}{% else %}{{u.profile_url}}{% endif %}" class="profile-pic-65-wrapper">
|
||||||
<img onclick="expandDesktopImage('{% if u.highres %}{{u.highres}}{% else %}{{u.profile_url}}{% endif %}')" loading="lazy" src="{{u.profile_url}}" class="profile-pic-65 bg-white border-2 border-white mb-2">
|
<img onclick="expandDesktopImage('{% if u.highres %}{{u.highres}}{% else %}{{u.profile_url}}{% endif %}')" loading="lazy" src="{{u.profile_url}}" class="profile-pic-65 bg-white border-2 border-white mb-2">
|
||||||
{% if u.hat_active -%}
|
{% if u.hat_active -%}
|
||||||
<img onclick="expandDesktopImage('{% if u.highres %}{{u.highres}}{% else %}{{u.profile_url}}{% endif %}')" class="profile-pic-65-hat hat" loading="lazy" src="/i/hats/{{u.hat_active.name}}.webp?v=3" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{u.hat_tooltip(v)}}">
|
<img onclick="expandDesktopImage('{% if u.highres %}{{u.highres}}{% else %}{{u.profile_url}}{% endif %}')" class="profile-pic-65-hat hat" loading="lazy" src="{{u.hat_active}}?v=3" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{u.hat_tooltip(v)}}">
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -18,7 +18,7 @@ set CACHE_VER = {
|
||||||
'js/award_modal.js': 4000,
|
'js/award_modal.js': 4000,
|
||||||
'js/bootstrap.js': 4000,
|
'js/bootstrap.js': 4000,
|
||||||
'js/category_modal.js': 4000,
|
'js/category_modal.js': 4000,
|
||||||
'js/comments+submission_listing.js': 4001,
|
'js/comments+submission_listing.js': 4002,
|
||||||
'js/comments_admin.js': 4000,
|
'js/comments_admin.js': 4000,
|
||||||
'js/comments_v.js': 4000,
|
'js/comments_v.js': 4000,
|
||||||
'js/submission_listing.js': 4000,
|
'js/submission_listing.js': 4000,
|
||||||
|
|
Loading…
Reference in New Issue