fdfd
This commit is contained in:
parent
be4852478c
commit
a3ceb61daf
3 changed files with 18 additions and 6 deletions
|
@ -39,6 +39,7 @@ class User(Base, Stndrd, Age_times):
|
||||||
banawards = Column(Integer, default=0)
|
banawards = Column(Integer, default=0)
|
||||||
created_utc = Column(Integer, default=0)
|
created_utc = Column(Integer, default=0)
|
||||||
suicide_utc = Column(Integer, default=0)
|
suicide_utc = Column(Integer, default=0)
|
||||||
|
rent_utc = Column(Integer, default=0)
|
||||||
admin_level = Column(Integer, default=0)
|
admin_level = Column(Integer, default=0)
|
||||||
agendaposter = Column(Boolean, default=False)
|
agendaposter = Column(Boolean, default=False)
|
||||||
agendaposter_expires_utc = Column(Integer, default=0)
|
agendaposter_expires_utc = Column(Integer, default=0)
|
||||||
|
|
|
@ -279,12 +279,23 @@ def u_username(username, v=None):
|
||||||
|
|
||||||
g.db.add(view)
|
g.db.add(view)
|
||||||
|
|
||||||
|
|
||||||
if u.is_private and (not v or (v.id != u.id and v.admin_level < 3)):
|
if u.is_private and (not v or (v.id != u.id and v.admin_level < 3)):
|
||||||
return {'html': lambda: render_template("userpage_private.html",
|
|
||||||
u=u,
|
paidrent = False
|
||||||
v=v),
|
if v and u.id == 253:
|
||||||
'api': lambda: {"error": "That userpage is private"}
|
if int(time.time()) - v.rent_utc < 600: paidrent = True
|
||||||
}
|
elif request.args.get("rent") == "true" and v.dramacoins > 500:
|
||||||
|
v.dramacoins -= 500
|
||||||
|
g.db.add(v)
|
||||||
|
paidrent = True
|
||||||
|
|
||||||
|
if not paidrent:
|
||||||
|
return {'html': lambda: render_template("userpage_private.html",
|
||||||
|
u=u,
|
||||||
|
v=v),
|
||||||
|
'api': lambda: {"error": "That userpage is private"}
|
||||||
|
}
|
||||||
|
|
||||||
if u.is_blocking and (not v or v.admin_level < 3):
|
if u.is_blocking and (not v or v.admin_level < 3):
|
||||||
return {'html': lambda: render_template("userpage_blocking.html",
|
return {'html': lambda: render_template("userpage_blocking.html",
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
</span>
|
</span>
|
||||||
<h2 class="h5">This account is private</h2>
|
<h2 class="h5">This account is private</h2>
|
||||||
<p class="text-muted">This user has enabled private mode to cloak their posting history.</p>
|
<p class="text-muted">This user has enabled private mode to cloak their posting history.</p>
|
||||||
|
{% if u.id == 253 %}<a class="btn btn-primary" href="/id/253?rent=true">Pay Rent to View (500 dramacoins)</a>{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue