forked from rDrama/rDrama
Merge branch 'frost' of https://github.com/Aevann1/rDrama into frost
commit
425af13e4c
|
@ -5058,7 +5058,7 @@ img[glow]:not([data-src]) {
|
||||||
color: white;
|
color: white;
|
||||||
font-size: min(3vw,16px);
|
font-size: min(3vw,16px);
|
||||||
}
|
}
|
||||||
.srd * {
|
.srd *, .srd a:hover {
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
#srd-discuss {
|
#srd-discuss {
|
||||||
|
|
|
@ -774,3 +774,14 @@ class User(Base):
|
||||||
@lazy
|
@lazy
|
||||||
def can_create_hole(self):
|
def can_create_hole(self):
|
||||||
return self.admin_level >= PERMS['HOLE_CREATE']
|
return self.admin_level >= PERMS['HOLE_CREATE']
|
||||||
|
|
||||||
|
@property
|
||||||
|
@lazy
|
||||||
|
def viewers_recorded(self):
|
||||||
|
if SITE_NAME == 'WPD': # WPD gets profile views
|
||||||
|
return True
|
||||||
|
elif self.admin_level >= 2: # Admins get profile views
|
||||||
|
return True
|
||||||
|
elif self.patron: # Patrons get profile views as a perk
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
|
@ -887,7 +887,7 @@ def following(username, v):
|
||||||
@app.get("/views")
|
@app.get("/views")
|
||||||
@auth_required
|
@auth_required
|
||||||
def visitors(v):
|
def visitors(v):
|
||||||
if v.admin_level < 2 and (not v.patron and SITE_NAME != 'WPD'):
|
if not v.viewers_recorded:
|
||||||
return render_template("errors/patron.html", v=v)
|
return render_template("errors/patron.html", v=v)
|
||||||
viewers=sorted(v.viewers, key = lambda x: x.last_view_utc, reverse=True)
|
viewers=sorted(v.viewers, key = lambda x: x.last_view_utc, reverse=True)
|
||||||
return render_template("viewers.html", v=v, viewers=viewers)
|
return render_template("viewers.html", v=v, viewers=viewers)
|
||||||
|
@ -925,7 +925,7 @@ def u_username(username, v=None):
|
||||||
if u.shadowbanned and not (v and v.admin_level >= 2) and not (v and v.id == u.id):
|
if u.shadowbanned and not (v and v.admin_level >= 2) and not (v and v.id == u.id):
|
||||||
abort(404)
|
abort(404)
|
||||||
|
|
||||||
if v and v.id not in (u.id, DAD_ID) and (u.patron or u.admin_level > 1):
|
if v and v.id not in (u.id, DAD_ID) and u.viewers_recorded:
|
||||||
view = g.db.query(ViewerRelationship).filter_by(viewer_id=v.id, user_id=u.id).one_or_none()
|
view = g.db.query(ViewerRelationship).filter_by(viewer_id=v.id, user_id=u.id).one_or_none()
|
||||||
|
|
||||||
if view: view.last_view_utc = int(time.time())
|
if view: view.last_view_utc = int(time.time())
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{%-
|
{%-
|
||||||
set CACHE_VER = {
|
set CACHE_VER = {
|
||||||
'css/main.css': 453,
|
'css/main.css': 454,
|
||||||
'css/catalog.css': 2,
|
'css/catalog.css': 2,
|
||||||
|
|
||||||
'css/4chan.css': 61,
|
'css/4chan.css': 61,
|
||||||
|
|
Loading…
Reference in New Issue