forked from rDrama/rDrama
subs
parent
65602240ab
commit
925109d74f
|
@ -99,11 +99,17 @@ def publish(pid, v):
|
||||||
if not post.ghost:
|
if not post.ghost:
|
||||||
notify_users = NOTIFY_USERS(post.body_html, v) | NOTIFY_USERS2(post.title, v)
|
notify_users = NOTIFY_USERS(post.body_html, v) | NOTIFY_USERS2(post.title, v)
|
||||||
|
|
||||||
cid = notif_comment(f"@{v.username} has mentioned you: [{post.title}]({post.sl})")
|
text = f"@{v.username} has mentioned you: [{post.title}]({post.sl})"
|
||||||
|
if post.sub: text += f" in <a href='/s/{post.sub}'>/s/{post.sub}"
|
||||||
|
|
||||||
|
cid = notif_comment(text)
|
||||||
for x in notify_users:
|
for x in notify_users:
|
||||||
add_notif(cid, x)
|
add_notif(cid, x)
|
||||||
|
|
||||||
cid = notif_comment(f"@{v.username} has made a new post: [{post.title}]({post.sl})", autojanny=True)
|
text = f"@{v.username} has made a new post: [{post.title}]({post.sl})"
|
||||||
|
if post.sub: text += f" in <a href='/s/{post.sub}'>/s/{post.sub}"
|
||||||
|
|
||||||
|
cid = notif_comment(text, autojanny=True)
|
||||||
for follow in v.followers:
|
for follow in v.followers:
|
||||||
user = get_account(follow.user_id)
|
user = get_account(follow.user_id)
|
||||||
if post.club and not user.paid_dues: continue
|
if post.club and not user.paid_dues: continue
|
||||||
|
@ -129,7 +135,7 @@ def submit_get(v, sub=None):
|
||||||
|
|
||||||
if request.path.startswith('/s/') and not sub: abort(404)
|
if request.path.startswith('/s/') and not sub: abort(404)
|
||||||
|
|
||||||
SUBS = () if SITE_NAME == 'Drama' and not sub else [[0] for x in g.db.query(Sub.name).order_by(Sub.name).all()]
|
SUBS = [x[0] for x in g.db.query(Sub.name).order_by(Sub.name).all()]
|
||||||
|
|
||||||
return render_template("submit.html", SUBS=SUBS, v=v, sub=sub, ghost=submit_ghost(v,g.db))
|
return render_template("submit.html", SUBS=SUBS, v=v, sub=sub, ghost=submit_ghost(v,g.db))
|
||||||
|
|
||||||
|
@ -853,7 +859,7 @@ def submit_post(v, sub=None):
|
||||||
def error(error):
|
def error(error):
|
||||||
if request.headers.get("Authorization") or request.headers.get("xhr"): return {"error": error}, 403
|
if request.headers.get("Authorization") or request.headers.get("xhr"): return {"error": error}, 403
|
||||||
|
|
||||||
SUBS = () if SITE_NAME == 'Drama' and not sub else [x[0] for x in g.db.query(Sub.name).order_by(Sub.name).all()]
|
SUBS = [x[0] for x in g.db.query(Sub.name).order_by(Sub.name).all()]
|
||||||
return render_template("submit.html", SUBS=SUBS, v=v, error=error, title=title, url=url, body=body, ghost=submit_ghost(v,g.db)), 400
|
return render_template("submit.html", SUBS=SUBS, v=v, error=error, title=title, url=url, body=body, ghost=submit_ghost(v,g.db)), 400
|
||||||
|
|
||||||
|
|
||||||
|
@ -1099,7 +1105,7 @@ def submit_post(v, sub=None):
|
||||||
|
|
||||||
if embed and len(embed) > 1500: embed = None
|
if embed and len(embed) > 1500: embed = None
|
||||||
|
|
||||||
new_post = Submission(
|
post = Submission(
|
||||||
private=bool(request.values.get("private","")),
|
private=bool(request.values.get("private","")),
|
||||||
club=club,
|
club=club,
|
||||||
author_id=v.id,
|
author_id=v.id,
|
||||||
|
@ -1116,7 +1122,7 @@ def submit_post(v, sub=None):
|
||||||
ghost=False
|
ghost=False
|
||||||
)
|
)
|
||||||
|
|
||||||
g.db.add(new_post)
|
g.db.add(post)
|
||||||
g.db.flush()
|
g.db.flush()
|
||||||
|
|
||||||
if request.values.get('ghost'):
|
if request.values.get('ghost'):
|
||||||
|
@ -1129,21 +1135,21 @@ def submit_post(v, sub=None):
|
||||||
).first()
|
).first()
|
||||||
|
|
||||||
if ghost_award:
|
if ghost_award:
|
||||||
ghost_award.submission_id = new_post.id
|
ghost_award.submission_id = post.id
|
||||||
new_post.ghost = True
|
post.ghost = True
|
||||||
else:
|
else:
|
||||||
price = ghost_price(v)
|
price = ghost_price(v)
|
||||||
if v.coins >= price:
|
if v.coins >= price:
|
||||||
v.coins -= price
|
v.coins -= price
|
||||||
new_post.ghost = True
|
post.ghost = True
|
||||||
elif v.procoins >= price:
|
elif v.procoins >= price:
|
||||||
v.procoins -= price
|
v.procoins -= price
|
||||||
new_post.ghost = True
|
post.ghost = True
|
||||||
|
|
||||||
if v and v.admin_level > 2:
|
if v and v.admin_level > 2:
|
||||||
for option in bet_options:
|
for option in bet_options:
|
||||||
bet_option = Comment(author_id=AUTOBETTER_ID,
|
bet_option = Comment(author_id=AUTOBETTER_ID,
|
||||||
parent_submission=new_post.id,
|
parent_submission=post.id,
|
||||||
level=1,
|
level=1,
|
||||||
body_html=filter_emojis_only(option),
|
body_html=filter_emojis_only(option),
|
||||||
upvotes=0,
|
upvotes=0,
|
||||||
|
@ -1154,7 +1160,7 @@ def submit_post(v, sub=None):
|
||||||
|
|
||||||
for option in options:
|
for option in options:
|
||||||
c = Comment(author_id=AUTOPOLLER_ID,
|
c = Comment(author_id=AUTOPOLLER_ID,
|
||||||
parent_submission=new_post.id,
|
parent_submission=post.id,
|
||||||
level=1,
|
level=1,
|
||||||
body_html=filter_emojis_only(option),
|
body_html=filter_emojis_only(option),
|
||||||
upvotes=0,
|
upvotes=0,
|
||||||
|
@ -1164,7 +1170,7 @@ def submit_post(v, sub=None):
|
||||||
|
|
||||||
for choice in choices:
|
for choice in choices:
|
||||||
c = Comment(author_id=AUTOCHOICE_ID,
|
c = Comment(author_id=AUTOCHOICE_ID,
|
||||||
parent_submission=new_post.id,
|
parent_submission=post.id,
|
||||||
level=1,
|
level=1,
|
||||||
body_html=filter_emojis_only(choice),
|
body_html=filter_emojis_only(choice),
|
||||||
upvotes=0,
|
upvotes=0,
|
||||||
|
@ -1174,7 +1180,7 @@ def submit_post(v, sub=None):
|
||||||
|
|
||||||
vote = Vote(user_id=v.id,
|
vote = Vote(user_id=v.id,
|
||||||
vote_type=1,
|
vote_type=1,
|
||||||
submission_id=new_post.id
|
submission_id=post.id
|
||||||
)
|
)
|
||||||
g.db.add(vote)
|
g.db.add(vote)
|
||||||
|
|
||||||
|
@ -1185,51 +1191,57 @@ def submit_post(v, sub=None):
|
||||||
if file.content_type.startswith('image/'):
|
if file.content_type.startswith('image/'):
|
||||||
name = f'/images/{time.time()}'.replace('.','')[:-5] + '.webp'
|
name = f'/images/{time.time()}'.replace('.','')[:-5] + '.webp'
|
||||||
file.save(name)
|
file.save(name)
|
||||||
new_post.url = process_image(name)
|
post.url = process_image(name)
|
||||||
|
|
||||||
name2 = name.replace('.webp', 'r.webp')
|
name2 = name.replace('.webp', 'r.webp')
|
||||||
copyfile(name, name2)
|
copyfile(name, name2)
|
||||||
new_post.thumburl = process_image(name2, resize=100)
|
post.thumburl = process_image(name2, resize=100)
|
||||||
elif file.content_type.startswith('video/'):
|
elif file.content_type.startswith('video/'):
|
||||||
file.save("video.mp4")
|
file.save("video.mp4")
|
||||||
with open("video.mp4", 'rb') as f:
|
with open("video.mp4", 'rb') as f:
|
||||||
try: url = requests.request("POST", "https://api.imgur.com/3/upload", headers={'Authorization': f'Client-ID {IMGUR_KEY}'}, files=[('video', f)]).json()['data']['link']
|
try: url = requests.request("POST", "https://api.imgur.com/3/upload", headers={'Authorization': f'Client-ID {IMGUR_KEY}'}, files=[('video', f)]).json()['data']['link']
|
||||||
except: return error( "Imgur error")
|
except: return error( "Imgur error")
|
||||||
if url.endswith('.'): url += 'mp4'
|
if url.endswith('.'): url += 'mp4'
|
||||||
new_post.url = url
|
post.url = url
|
||||||
else:
|
else:
|
||||||
return error("Image/Video files only.")
|
return error("Image/Video files only.")
|
||||||
|
|
||||||
if not new_post.thumburl and new_post.url:
|
if not post.thumburl and post.url:
|
||||||
if request.host in new_post.url or new_post.url.startswith('/') or new_post.domain == SITE:
|
if request.host in post.url or post.url.startswith('/') or post.domain == SITE:
|
||||||
new_post.thumburl = f'/static/assets/images/{SITE_NAME}/site_preview.webp'
|
post.thumburl = f'/static/assets/images/{SITE_NAME}/site_preview.webp'
|
||||||
elif request.headers.get('cf-ipcountry')!="T1":
|
elif request.headers.get('cf-ipcountry')!="T1":
|
||||||
gevent.spawn( thumbnail_thread, new_post.id)
|
gevent.spawn( thumbnail_thread, post.id)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if not new_post.private and not new_post.ghost:
|
if not post.private and not post.ghost:
|
||||||
|
|
||||||
notify_users = NOTIFY_USERS(body_html, v) | NOTIFY_USERS2(title, v)
|
notify_users = NOTIFY_USERS(body_html, v) | NOTIFY_USERS2(title, v)
|
||||||
|
|
||||||
cid = notif_comment(f"@{v.username} has mentioned you: [{title}]({new_post.sl})")
|
text = f"@{v.username} has mentioned you: [{post.title}]({post.sl})"
|
||||||
|
if post.sub: text += f" in <a href='/s/{post.sub}'>/s/{post.sub}"
|
||||||
|
|
||||||
|
cid = notif_comment(text)
|
||||||
for x in notify_users:
|
for x in notify_users:
|
||||||
add_notif(cid, x)
|
add_notif(cid, x)
|
||||||
|
|
||||||
cid = notif_comment(f"@{v.username} has made a new post: [{title}]({new_post.sl})", autojanny=True)
|
text = f"@{v.username} has made a new post: [{post.title}]({post.sl})"
|
||||||
|
if post.sub: text += f" in <a href='/s/{post.sub}'>/s/{post.sub}"
|
||||||
|
|
||||||
|
cid = notif_comment(text, autojanny=True)
|
||||||
for follow in v.followers:
|
for follow in v.followers:
|
||||||
user = get_account(follow.user_id)
|
user = get_account(follow.user_id)
|
||||||
if new_post.club and not user.paid_dues: continue
|
if post.club and not user.paid_dues: continue
|
||||||
add_notif(cid, user.id)
|
add_notif(cid, user.id)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if v.agendaposter and not v.marseyawarded and AGENDAPOSTER_PHRASE not in f'{new_post.body}{new_post.title}'.lower():
|
if v.agendaposter and not v.marseyawarded and AGENDAPOSTER_PHRASE not in f'{post.body}{post.title}'.lower():
|
||||||
new_post.is_banned = True
|
post.is_banned = True
|
||||||
new_post.ban_reason = "AutoJanny"
|
post.ban_reason = "AutoJanny"
|
||||||
|
|
||||||
body = AGENDAPOSTER_MSG.format(username=v.username, type='post', AGENDAPOSTER_PHRASE=AGENDAPOSTER_PHRASE)
|
body = AGENDAPOSTER_MSG.format(username=v.username, type='post', AGENDAPOSTER_PHRASE=AGENDAPOSTER_PHRASE)
|
||||||
|
|
||||||
|
@ -1238,7 +1250,7 @@ def submit_post(v, sub=None):
|
||||||
|
|
||||||
|
|
||||||
c_jannied = Comment(author_id=NOTIFICATIONS_ID,
|
c_jannied = Comment(author_id=NOTIFICATIONS_ID,
|
||||||
parent_submission=new_post.id,
|
parent_submission=post.id,
|
||||||
level=1,
|
level=1,
|
||||||
over_18=False,
|
over_18=False,
|
||||||
is_bot=True,
|
is_bot=True,
|
||||||
|
@ -1254,13 +1266,13 @@ def submit_post(v, sub=None):
|
||||||
n = Notification(comment_id=c_jannied.id, user_id=v.id)
|
n = Notification(comment_id=c_jannied.id, user_id=v.id)
|
||||||
g.db.add(n)
|
g.db.add(n)
|
||||||
|
|
||||||
elif SITE_NAME == 'Drama' and 'nigg' in f'{new_post.body}{new_post.title}'.lower() and not v.nwordpass:
|
elif SITE_NAME == 'Drama' and 'nigg' in f'{post.body}{post.title}'.lower() and not v.nwordpass:
|
||||||
|
|
||||||
new_post.is_banned = True
|
post.is_banned = True
|
||||||
new_post.ban_reason = "AutoJanny"
|
post.ban_reason = "AutoJanny"
|
||||||
|
|
||||||
c_jannied = Comment(author_id=NOTIFICATIONS_ID,
|
c_jannied = Comment(author_id=NOTIFICATIONS_ID,
|
||||||
parent_submission=new_post.id,
|
parent_submission=post.id,
|
||||||
level=1,
|
level=1,
|
||||||
over_18=False,
|
over_18=False,
|
||||||
is_bot=True,
|
is_bot=True,
|
||||||
|
@ -1293,39 +1305,39 @@ def submit_post(v, sub=None):
|
||||||
body = body[1:]
|
body = body[1:]
|
||||||
vote = Vote(user_id=SNAPPY_ID,
|
vote = Vote(user_id=SNAPPY_ID,
|
||||||
vote_type=-1,
|
vote_type=-1,
|
||||||
submission_id=new_post.id,
|
submission_id=post.id,
|
||||||
real = True
|
real = True
|
||||||
)
|
)
|
||||||
g.db.add(vote)
|
g.db.add(vote)
|
||||||
new_post.downvotes += 1
|
post.downvotes += 1
|
||||||
if body.startswith('OP is a Trump supporter'):
|
if body.startswith('OP is a Trump supporter'):
|
||||||
flag = Flag(post_id=new_post.id, user_id=SNAPPY_ID, reason='Trump supporter')
|
flag = Flag(post_id=post.id, user_id=SNAPPY_ID, reason='Trump supporter')
|
||||||
g.db.add(flag)
|
g.db.add(flag)
|
||||||
elif body.startswith('▲'):
|
elif body.startswith('▲'):
|
||||||
body = body[1:]
|
body = body[1:]
|
||||||
vote = Vote(user_id=SNAPPY_ID,
|
vote = Vote(user_id=SNAPPY_ID,
|
||||||
vote_type=1,
|
vote_type=1,
|
||||||
submission_id=new_post.id,
|
submission_id=post.id,
|
||||||
real = True
|
real = True
|
||||||
)
|
)
|
||||||
g.db.add(vote)
|
g.db.add(vote)
|
||||||
new_post.upvotes += 1
|
post.upvotes += 1
|
||||||
|
|
||||||
|
|
||||||
body += "\n\n"
|
body += "\n\n"
|
||||||
|
|
||||||
if new_post.url:
|
if post.url:
|
||||||
if new_post.url.startswith('https://old.reddit.com/r/'):
|
if post.url.startswith('https://old.reddit.com/r/'):
|
||||||
rev = new_post.url.replace('https://old.reddit.com/', '')
|
rev = post.url.replace('https://old.reddit.com/', '')
|
||||||
rev = f"* [unddit.com](https://unddit.com/{rev})\n"
|
rev = f"* [unddit.com](https://unddit.com/{rev})\n"
|
||||||
else: rev = ''
|
else: rev = ''
|
||||||
newposturl = new_post.url
|
newposturl = post.url
|
||||||
if newposturl.startswith('/'): newposturl = f"{SITE_FULL}{newposturl}"
|
if newposturl.startswith('/'): newposturl = f"{SITE_FULL}{newposturl}"
|
||||||
body += f"Snapshots:\n\n{rev}* [archive.org](https://web.archive.org/{newposturl})\n* [archive.ph](https://archive.ph/?url={quote(newposturl)}&run=1) (click to archive)\n\n"
|
body += f"Snapshots:\n\n{rev}* [archive.org](https://web.archive.org/{newposturl})\n* [archive.ph](https://archive.ph/?url={quote(newposturl)}&run=1) (click to archive)\n\n"
|
||||||
gevent.spawn(archiveorg, newposturl)
|
gevent.spawn(archiveorg, newposturl)
|
||||||
|
|
||||||
url_regex = '<a href=\"(https?:\/\/[a-z]{1,20}\.[^\"]+)\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">(.*?)<\/a>'
|
url_regex = '<a href=\"(https?:\/\/[a-z]{1,20}\.[^\"]+)\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">(.*?)<\/a>'
|
||||||
for url_match in list(re.finditer(url_regex, new_post.body_html))[:20]:
|
for url_match in list(re.finditer(url_regex, post.body_html))[:20]:
|
||||||
href = url_match.group(1)
|
href = url_match.group(1)
|
||||||
if not href: continue
|
if not href: continue
|
||||||
|
|
||||||
|
@ -1345,7 +1357,7 @@ def submit_post(v, sub=None):
|
||||||
if len(body_html) < 40000:
|
if len(body_html) < 40000:
|
||||||
c = Comment(author_id=SNAPPY_ID,
|
c = Comment(author_id=SNAPPY_ID,
|
||||||
distinguish_level=6,
|
distinguish_level=6,
|
||||||
parent_submission=new_post.id,
|
parent_submission=post.id,
|
||||||
level=1,
|
level=1,
|
||||||
over_18=False,
|
over_18=False,
|
||||||
is_bot=True,
|
is_bot=True,
|
||||||
|
@ -1363,39 +1375,39 @@ def submit_post(v, sub=None):
|
||||||
if body.startswith('!slots1000'):
|
if body.startswith('!slots1000'):
|
||||||
check_for_slots_command(body, snappy, c)
|
check_for_slots_command(body, snappy, c)
|
||||||
|
|
||||||
new_post.comment_count += 1
|
post.comment_count += 1
|
||||||
|
|
||||||
v.post_count = g.db.query(Submission.id).filter_by(author_id=v.id, is_banned=False, deleted_utc=0).count()
|
v.post_count = g.db.query(Submission.id).filter_by(author_id=v.id, is_banned=False, deleted_utc=0).count()
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
|
|
||||||
cache.delete_memoized(frontlist)
|
cache.delete_memoized(frontlist)
|
||||||
cache.delete_memoized(User.userpagelisting)
|
cache.delete_memoized(User.userpagelisting)
|
||||||
if v.admin_level > 0 and ("[changelog]" in new_post.title.lower() or "(changelog)" in new_post.title.lower()) and not new_post.private:
|
if v.admin_level > 0 and ("[changelog]" in post.title.lower() or "(changelog)" in post.title.lower()) and not post.private:
|
||||||
send_discord_message(new_post.permalink)
|
send_discord_message(post.permalink)
|
||||||
cache.delete_memoized(changeloglist)
|
cache.delete_memoized(changeloglist)
|
||||||
|
|
||||||
if v.id in {PIZZASHILL_ID, HIL_ID}:
|
if v.id in {PIZZASHILL_ID, HIL_ID}:
|
||||||
autovote = Vote(user_id=CARP_ID, submission_id=new_post.id, vote_type=1)
|
autovote = Vote(user_id=CARP_ID, submission_id=post.id, vote_type=1)
|
||||||
g.db.add(autovote)
|
g.db.add(autovote)
|
||||||
autovote = Vote(user_id=AEVANN_ID, submission_id=new_post.id, vote_type=1)
|
autovote = Vote(user_id=AEVANN_ID, submission_id=post.id, vote_type=1)
|
||||||
g.db.add(autovote)
|
g.db.add(autovote)
|
||||||
autovote = Vote(user_id=CRAT_ID, submission_id=new_post.id, vote_type=1)
|
autovote = Vote(user_id=CRAT_ID, submission_id=post.id, vote_type=1)
|
||||||
g.db.add(autovote)
|
g.db.add(autovote)
|
||||||
v.coins += 3
|
v.coins += 3
|
||||||
v.truecoins += 3
|
v.truecoins += 3
|
||||||
g.db.add(v)
|
g.db.add(v)
|
||||||
new_post.upvotes += 3
|
post.upvotes += 3
|
||||||
g.db.add(new_post)
|
g.db.add(post)
|
||||||
|
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
|
|
||||||
if request.headers.get("Authorization"): return new_post.json
|
if request.headers.get("Authorization"): return post.json
|
||||||
else:
|
else:
|
||||||
new_post.voted = 1
|
post.voted = 1
|
||||||
if 'megathread' in new_post.title.lower(): sort = 'new'
|
if 'megathread' in post.title.lower(): sort = 'new'
|
||||||
else: sort = v.defaultsortingcomments
|
else: sort = v.defaultsortingcomments
|
||||||
if len(body_html) < 40000: new_post.replies = [c]
|
if len(body_html) < 40000: post.replies = [c]
|
||||||
return render_template('submission.html', v=v, p=new_post, sort=sort, render_replies=True, offset=0, success=True, sub=new_post.subr)
|
return render_template('submission.html', v=v, p=post, sort=sort, render_replies=True, offset=0, success=True, sub=post.subr)
|
||||||
|
|
||||||
|
|
||||||
@app.post("/delete_post/<pid>")
|
@app.post("/delete_post/<pid>")
|
||||||
|
|
|
@ -134,6 +134,10 @@
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="font-weight-bold"><a href="{{c.post.permalink}}">{{c.post.realtitle(v) | safe}}</a></span>
|
<span class="font-weight-bold"><a href="{{c.post.permalink}}">{{c.post.realtitle(v) | safe}}</a></span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if c.post.sub %}
|
||||||
|
<span class="ml-1"> in <a href="/s/{{c.post.sub}}" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %}>/s/{{c.post.sub}}</a></span>
|
||||||
|
{% endif %}
|
||||||
{% elif c.author_id==NOTIFICATIONS_ID or c.author_id==AUTOJANNY_ID %}
|
{% elif c.author_id==NOTIFICATIONS_ID or c.author_id==AUTOJANNY_ID %}
|
||||||
<span class="font-weight-bold">Notification</span>
|
<span class="font-weight-bold">Notification</span>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
{% if ccmode=="false" %}<a title="Only show country club posts" data-bs-original-title="Only show country club posts" class="btn btn-secondary text-small-m mx-2" href="?sort={{sort}}&t={{t}}&ccmode=true"></i>CC</a>{% endif %}
|
{% if ccmode=="false" %}<a title="Only show country club posts" data-bs-original-title="Only show country club posts" class="btn btn-secondary text-small-m mx-2" href="?sort={{sort}}&t={{t}}&ccmode=true"></i>CC</a>{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if request.path == '/' and v and v.admin_level > 1 and SITE_NAME == 'Drama' %}
|
{% if request.path in ('/','/logged_out') and SITE_NAME == 'Drama' %}
|
||||||
{% if subs %}
|
{% if subs %}
|
||||||
{% set classes='btn-primary text-primary' %}
|
{% set classes='btn-primary text-primary' %}
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
{% for sub, count in subs %}
|
{% for sub, count in subs %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{loop.index}}</td>
|
<td>{{loop.index}}</td>
|
||||||
<td><a href="/s/{{sub.name}}">{{sub}}</a></td>
|
<td><a href="/s/{{sub.name}}" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %}>{{sub}}</a></td>
|
||||||
<td>{{count}}</a>
|
<td>{{count}}</a>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -79,19 +79,16 @@
|
||||||
|
|
||||||
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
|
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
|
||||||
|
|
||||||
{% if SITE_NAME != 'Drama' or sub %}
|
<label class='mt-4' for="title">Sub</label>
|
||||||
|
|
||||||
<label class='mt-4' for="title">Sub</label>
|
<div class="input-group mb2">
|
||||||
|
<input list="subs" autocomplete="off" id='sub' class="form-control" form="submitform" name="sub" oninput="savetext()" {% if sub %}value="{{sub.name}}"{% endif %} {% if SITE_NAME == 'Ruqqus' %}required{% else %}placeholder="Optional"{% endif %}>
|
||||||
<div class="input-group mb2">
|
<datalist id="subs">
|
||||||
<input list="subs" autocomplete="off" id='sub' class="form-control" form="submitform" name="sub" oninput="savetext()" {% if sub %}value="{{sub.name}}"{% endif %} {% if SITE_NAME == 'Ruqqus' %}required{% endif %}>
|
{% for s in SUBS %}
|
||||||
<datalist id="subs">
|
<option value="{{s}}"></option>
|
||||||
{% for s in SUBS %}
|
{% endfor %}
|
||||||
<option value="{{s}}"></option>
|
</datalist>
|
||||||
{% endfor %}
|
</div>
|
||||||
</datalist>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<label class='mt-4' for="title">Post Title</label>
|
<label class='mt-4' for="title">Post Title</label>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue