forked from rDrama/rDrama
fgMerge branch 'frost' of https://github.com/Aevann1/Drama into frost
commit
31aff561ef
|
@ -431,6 +431,7 @@ def changelog(v):
|
||||||
page=page,
|
page=page,
|
||||||
t=t,
|
t=t,
|
||||||
v=v,
|
v=v,
|
||||||
|
site=SITE
|
||||||
)
|
)
|
||||||
|
|
||||||
next_exists = (len(ids) > 25)
|
next_exists = (len(ids) > 25)
|
||||||
|
@ -443,7 +444,7 @@ def changelog(v):
|
||||||
|
|
||||||
|
|
||||||
@cache.memoize(timeout=86400)
|
@cache.memoize(timeout=86400)
|
||||||
def changeloglist(v=None, sort="new", page=1 ,t="all"):
|
def changeloglist(v=None, sort="new", page=1, t="all", site=None):
|
||||||
|
|
||||||
posts = g.db.query(Submission.id).filter_by(is_banned=False, private=False,).filter(Submission.deleted_utc == 0)
|
posts = g.db.query(Submission.id).filter_by(is_banned=False, private=False,).filter(Submission.deleted_utc == 0)
|
||||||
|
|
||||||
|
|
|
@ -68,11 +68,11 @@ def sidebar(v):
|
||||||
@auth_required
|
@auth_required
|
||||||
def participation_stats(v):
|
def participation_stats(v):
|
||||||
|
|
||||||
return render_template("admin/content_stats.html", v=v, title="Content Statistics", data=stats())
|
return render_template("admin/content_stats.html", v=v, title="Content Statistics", data=stats(site=SITE))
|
||||||
|
|
||||||
|
|
||||||
@cache.memoize(timeout=86400)
|
@cache.memoize(timeout=86400)
|
||||||
def stats():
|
def stats(site=None):
|
||||||
day = int(time.time()) - 86400
|
day = int(time.time()) - 86400
|
||||||
|
|
||||||
week = int(time.time()) - 604800
|
week = int(time.time()) - 604800
|
||||||
|
@ -177,20 +177,20 @@ def chart():
|
||||||
@app.get("/weekly_chart")
|
@app.get("/weekly_chart")
|
||||||
@auth_required
|
@auth_required
|
||||||
def weekly_chart(v):
|
def weekly_chart(v):
|
||||||
file = cached_chart(kind="weekly")
|
file = cached_chart(kind="weekly", site=SITE)
|
||||||
f = send_file(file)
|
f = send_file(file)
|
||||||
return f
|
return f
|
||||||
|
|
||||||
@app.get("/daily_chart")
|
@app.get("/daily_chart")
|
||||||
@auth_required
|
@auth_required
|
||||||
def daily_chart(v):
|
def daily_chart(v):
|
||||||
file = cached_chart(kind="daily")
|
file = cached_chart(kind="daily", site=SITE)
|
||||||
f = send_file(file)
|
f = send_file(file)
|
||||||
return f
|
return f
|
||||||
|
|
||||||
|
|
||||||
@cache.memoize(timeout=86400)
|
@cache.memoize(timeout=86400)
|
||||||
def cached_chart(kind):
|
def cached_chart(kind, site):
|
||||||
now = time.gmtime()
|
now = time.gmtime()
|
||||||
midnight_this_morning = time.struct_time((now.tm_year,
|
midnight_this_morning = time.struct_time((now.tm_year,
|
||||||
now.tm_mon,
|
now.tm_mon,
|
||||||
|
|
|
@ -169,7 +169,7 @@
|
||||||
<a class="dropdown-item" rel="nofollow noopener noreferrer" href="/report_bugs"><i class="fas fa-bug fa-fw mr-3"></i>Bugs/Suggestions</a>
|
<a class="dropdown-item" rel="nofollow noopener noreferrer" href="/report_bugs"><i class="fas fa-bug fa-fw mr-3"></i>Bugs/Suggestions</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if request.host not in ('pcmemes.net','watchpeopledie.co') %}
|
{% if SITE_NAME == 'rDrama' %}
|
||||||
<a class="dropdown-item" href="/discord"><i class="fab fa-discord fa-fw mr-3"></i>Discord</a>
|
<a class="dropdown-item" href="/discord"><i class="fab fa-discord fa-fw mr-3"></i>Discord</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if SITE_NAME != 'Cringetopia' %}
|
{% if SITE_NAME != 'Cringetopia' %}
|
||||||
|
@ -225,7 +225,7 @@
|
||||||
|
|
||||||
<a class="nav-item nav-link" rel="nofollow noopener noreferrer" href="https://github.com/Aevann1/rDrama"><i class="fab fa-github fa-fw mr-3"></i>Source code</a>
|
<a class="nav-item nav-link" rel="nofollow noopener noreferrer" href="https://github.com/Aevann1/rDrama"><i class="fab fa-github fa-fw mr-3"></i>Source code</a>
|
||||||
|
|
||||||
{% if request.host not in ('pcmemes.net','watchpeopledie.co') %}
|
{% if SITE_NAME == 'rDrama' %}
|
||||||
<a class="nav-item nav-link" href="/discord"><i class="fab fa-discord fa-fw mr-3"></i>Discord</a>
|
<a class="nav-item nav-link" href="/discord"><i class="fab fa-discord fa-fw mr-3"></i>Discord</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if SITE_NAME != 'Cringetopia' %}
|
{% if SITE_NAME != 'Cringetopia' %}
|
||||||
|
|
|
@ -310,7 +310,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
{% if request.host not in ('pcmemes.net','watchpeopledie.co') %}
|
{% if SITE_NAME == 'rDrama' %}
|
||||||
<h2 class="h5" name="referral">Linked Accounts</h2>
|
<h2 class="h5" name="referral">Linked Accounts</h2>
|
||||||
|
|
||||||
<p class="text-small text-muted">Manage your connections to other services.</p>
|
<p class="text-small text-muted">Manage your connections to other services.</p>
|
||||||
|
|
Loading…
Reference in New Issue