diff --git a/files/assets/css/main.css b/files/assets/css/main.css index 9c8333919..0fd288026 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -5058,7 +5058,7 @@ img[glow]:not([data-src]) { color: white; font-size: min(3vw,16px); } -.srd * { +.srd *, .srd a:hover { color: white; } #srd-discuss { diff --git a/files/classes/user.py b/files/classes/user.py index a116e954b..7bae16015 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -774,3 +774,14 @@ class User(Base): @lazy def can_create_hole(self): 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 diff --git a/files/routes/users.py b/files/routes/users.py index 0f712ccff..f75bf6479 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -887,7 +887,7 @@ def following(username, v): @app.get("/views") @auth_required 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) viewers=sorted(v.viewers, key = lambda x: x.last_view_utc, reverse=True) 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): 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() if view: view.last_view_utc = int(time.time()) diff --git a/files/templates/util/assetcache.html b/files/templates/util/assetcache.html index 610731efa..08b835f8d 100644 --- a/files/templates/util/assetcache.html +++ b/files/templates/util/assetcache.html @@ -1,6 +1,6 @@ {%- set CACHE_VER = { - 'css/main.css': 453, + 'css/main.css': 454, 'css/catalog.css': 2, 'css/4chan.css': 61,