forked from rDrama/rDrama
Merge branch 'frost' of github.com:Aevann1/rDrama into frost
commit
4e3489640b
|
@ -71,7 +71,7 @@ class Badge(Base):
|
||||||
def text(self):
|
def text(self):
|
||||||
if self.until:
|
if self.until:
|
||||||
text = self.badge.description + " until"
|
text = self.badge.description + " until"
|
||||||
elif self.badge_id in (28, 170):
|
elif self.badge_id in (28, 170, 179):
|
||||||
text = self.badge.description + " permanently"
|
text = self.badge.description + " permanently"
|
||||||
elif self.description:
|
elif self.description:
|
||||||
text = self.description
|
text = self.description
|
||||||
|
|
|
@ -141,7 +141,7 @@ class User(Base):
|
||||||
owoify = Column(Integer)
|
owoify = Column(Integer)
|
||||||
marsify = Column(Integer, default=0)
|
marsify = Column(Integer, default=0)
|
||||||
rainbow = Column(Integer)
|
rainbow = Column(Integer)
|
||||||
spider = Column(Integer)
|
spider = Column(Integer, default=0)
|
||||||
|
|
||||||
badges = relationship("Badge", order_by="Badge.created_utc", back_populates="user")
|
badges = relationship("Badge", order_by="Badge.created_utc", back_populates="user")
|
||||||
subscriptions = relationship("Subscription", back_populates="user")
|
subscriptions = relationship("Subscription", back_populates="user")
|
||||||
|
|
|
@ -108,6 +108,14 @@ def settings_profile_post(v):
|
||||||
badge = v.has_badge(170)
|
badge = v.has_badge(170)
|
||||||
if badge: g.db.delete(badge)
|
if badge: g.db.delete(badge)
|
||||||
|
|
||||||
|
elif request.values.get("spider", v.spider) != v.spider and v.spider <= 1:
|
||||||
|
updated = True
|
||||||
|
v.spider = int(request.values.get("spider") == 'true')
|
||||||
|
if v.spider: badge_grant(user=v, badge_id=179)
|
||||||
|
else:
|
||||||
|
badge = v.has_badge(170)
|
||||||
|
if badge: g.db.delete(badge)
|
||||||
|
|
||||||
elif request.values.get("bio") == "":
|
elif request.values.get("bio") == "":
|
||||||
v.bio = None
|
v.bio = None
|
||||||
v.bio_html = None
|
v.bio_html = None
|
||||||
|
|
|
@ -761,6 +761,21 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="d-lg-flex border-bottom">
|
||||||
|
<div class="title w-lg-25">
|
||||||
|
<label for="spiderswitch">Spider</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="body w-lg-100">
|
||||||
|
|
||||||
|
<div class="custom-control custom-switch">
|
||||||
|
<input autocomplete="off" type="checkbox" class="custom-control-input" id="spiderswitch" name="spider" {% if v.spider%}checked{% endif %} {% if v.spider > 1 %}disabled{% endif %} onchange="post_toast(this,'/settings/profile?spider='+document.getElementById('spiderswitch').checked)">
|
||||||
|
<label class="custom-control-label" for="spiderswitch"></label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<span class="text-small text-muted">Have a spider friend accompany you during your journey in the site.</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue