forked from rDrama/rDrama
Merge branch 'master' of https://github.com/Aevann1/Drama
commit
e4e13996d8
|
@ -38,7 +38,7 @@ services:
|
|||
- READ_ONLY=0
|
||||
- BOT_DISABLE=0
|
||||
- COINS_NAME=Dramacoins
|
||||
- DEFAULT_TIME_FILTER=day
|
||||
- DEFAULT_TIME_FILTER=all
|
||||
- DEFAULT_THEME=dark
|
||||
- DEFAULT_COLOR=ff66ac #YOU HAVE TO PICK ONE OF THOSE COLORS OR SHIT WILL BREAK: ff66ac, 805ad5, 62ca56, 38a169, 80ffff, 2a96f3, eb4963, ff0000, f39731, 30409f, 3e98a7, e4432d, 7b9ae4, ec72de, 7f8fa6, f8db58
|
||||
- SLOGAN=Dude bussy lmao
|
||||
|
@ -56,6 +56,7 @@ services:
|
|||
|
||||
redis:
|
||||
image: redis
|
||||
command: redis-server /drama/redis.conf
|
||||
volumes:
|
||||
- ./redis.conf:/drama/redis.conf
|
||||
ports:
|
||||
|
|
|
@ -554,25 +554,17 @@ class User(Base, Stndrd, Age_times):
|
|||
def refresh_selfset_badges(self):
|
||||
|
||||
# check self-setting badges
|
||||
badge_types = g.db.query(BadgeDef).filter(
|
||||
BadgeDef.qualification_expr.isnot(None)).all()
|
||||
badge_types = g.db.query(BadgeDef).filter(BadgeDef.qualification_expr.isnot(None)).all()
|
||||
for badge in badge_types:
|
||||
if eval(badge.qualification_expr, {}, {'v': self}):
|
||||
if not self.has_badge(badge.id):
|
||||
new_badge = Badge(user_id=self.id,
|
||||
badge_id=badge.id,
|
||||
)
|
||||
new_badge = Badge(user_id=self.id, badge_id=badge.id)
|
||||
g.db.add(new_badge)
|
||||
|
||||
else:
|
||||
bad_badge = self.has_badge(badge.id)
|
||||
if bad_badge:
|
||||
g.db.delete(bad_badge)
|
||||
if bad_badge: g.db.delete(bad_badge)
|
||||
|
||||
try:
|
||||
g.db.add(self)
|
||||
except:
|
||||
pass
|
||||
|
||||
@property
|
||||
def applications(self):
|
||||
|
|
|
@ -45,7 +45,9 @@ def post_pid_comment_cid(cid, pid=None, anything=None, v=None):
|
|||
|
||||
if not pid:
|
||||
if comment.parent_submission: pid = comment.parent_submission
|
||||
else: pid = 6489
|
||||
elif "rdrama" in request.host: pid = 6489
|
||||
elif "pcm" in request.host: pid = 382
|
||||
else: pid = 1
|
||||
|
||||
try: pid = int(pid)
|
||||
except: abort(404)
|
||||
|
|
|
@ -361,13 +361,11 @@ def changelog(v):
|
|||
@auth_desired
|
||||
def random_post(v):
|
||||
|
||||
|
||||
x = g.db.query(Submission).filter(Submission.deleted_utc == 0, Submission.is_banned == False)
|
||||
|
||||
total = x.count()
|
||||
n = random.randint(0, total - 1)
|
||||
n = random.randint(1, total - 2)
|
||||
|
||||
post = x.offset(n).limit(1).first()
|
||||
post = x.all()[n]
|
||||
return redirect(f"/post/{post.id}")
|
||||
|
||||
@cache.memoize(timeout=86400)
|
||||
|
|
|
@ -844,12 +844,3 @@ def settings_title_change(v):
|
|||
|
||||
g.db.add(v)
|
||||
return redirect("/settings/profile")
|
||||
|
||||
@app.post("/settings/badges")
|
||||
@auth_required
|
||||
@validate_formkey
|
||||
def settings_badge_recheck(v):
|
||||
|
||||
v.refresh_selfset_badges()
|
||||
|
||||
return {"message":"Badges Refreshed"}
|
||||
|
|
|
@ -375,6 +375,8 @@ def u_username(username, v=None):
|
|||
|
||||
u = get_user(username, v=v)
|
||||
|
||||
if v and v == u: v.refresh_selfset_badges()
|
||||
|
||||
# check for wrong cases
|
||||
|
||||
if username != u.username:
|
||||
|
|
|
@ -302,7 +302,7 @@
|
|||
{% endif %}
|
||||
|
||||
{% if v and v.admin_level==6 and v.id==c.author_id %}
|
||||
<li class="list-inline-item text-success d-none d-md-inline-block"><a id="distinguish-{{c.id}}" href="javascript:void(0)" onclick="admin_comment('{{c.id}}')"><i class="fas fa-id-badge fa-fw"></i>{{'Undistinguish' if c.distinguish_level else 'Distinguish'}}</a></li>
|
||||
<li class="list-inline-item text-info d-none d-md-inline-block"><a id="distinguish-{{c.id}}" href="javascript:void(0)" onclick="admin_comment('{{c.id}}')"><i class="fas fa-id-badge text-info fa-fw"></i>{{'Undistinguish' if c.distinguish_level else 'Distinguish'}}</a></li>
|
||||
{% endif %}
|
||||
|
||||
|
||||
|
@ -460,7 +460,7 @@
|
|||
|
||||
{% if v %}
|
||||
{% if v.admin_level>=1 and v.id==c.author_id %}
|
||||
<li class="list-group-item"><a class="text-success d-block" id="distinguish-{{c.id}}" href="javascript:void(0)" onclick="admin_comment('{{c.id}}', )" data-dismiss="modal"><i class="fas fa-id-badge"></i>{{'Undistinguish' if c.distinguish_level else 'Distinguish'}}</a></li>
|
||||
<li class="list-group-item text-info"><a class="d-block" id="distinguish-{{c.id}}" href="javascript:void(0)" onclick="admin_comment('{{c.id}}', )" data-dismiss="modal"><i class="fas fa-id-badge text-info"></i>{{'Undistinguish' if c.distinguish_level else 'Distinguish'}}</a></li>
|
||||
{% endif %}
|
||||
{% if v.admin_level>=3 %}
|
||||
<li class="list-group-item"><a class="text-success d-block" href="javascript:void(0)" onclick="approveComment('{{c.id}}')" data-dismiss="modal"><i class="fas fa-check text-success"></i>Approve</a></li>
|
||||
|
|
|
@ -161,7 +161,7 @@
|
|||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/settings"><i class="fas fa-cog fa-fw mr-3"></i>My account</a>
|
||||
<a class="nav-link" href="/settings"><i class="fas fa-cog fa-fw mr-3"></i>Settings</a>
|
||||
</li>
|
||||
<li class="nav-item"><a class="nav-link" href="/assets/{{'SITE_NAME' | app_config}}App.apk"><i class="fab fa-android fa-fw mr-3"></i>Android app</a></li>
|
||||
|
||||
|
|
|
@ -586,19 +586,6 @@
|
|||
|
||||
</div>
|
||||
|
||||
<div class="body d-lg-flex border-bottom">
|
||||
<label class="text-black w-lg-25">Badges</label>
|
||||
|
||||
<div class="w-lg-100">
|
||||
<p><a href="/badges">Profile badges</a> show off all of your site achievements. If your badges look not quite up to date, use this tool to refresh them.</p>
|
||||
<div class="d-flex">
|
||||
<a class="btn btn-primary ml-auto" id="badgeUpdate" href="javascript:void(0)" onclick="post_toast('/settings/badges')">Refresh badges</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="d-lg-flex border-bottom">
|
||||
|
||||
<div class="title w-lg-25">
|
||||
|
|
|
@ -290,10 +290,6 @@
|
|||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-link text-muted" data-dismiss="modal">Cancel</button>
|
||||
<input type="submit" id="deleteAccountBUtton" class="btn btn-danger" value="Delete my account"></button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- After report is made, show this -->
|
||||
|
|
2
setup
2
setup
|
@ -1,4 +1,3 @@
|
|||
sysctl vm.overcommit_memory=1
|
||||
sudo apt update
|
||||
sudo apt install apt-transport-https ca-certificates curl software-properties-common
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
|
||||
|
@ -8,4 +7,5 @@ apt-cache policy docker-ce
|
|||
sudo apt install docker-ce
|
||||
sudo curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
|
||||
sudo chmod +x /usr/local/bin/docker-compose
|
||||
sudo sysctl vm.overcommit_memory=1
|
||||
docker-compose up
|
Loading…
Reference in New Issue