remove useless tabs

pull/146/head
Aevann 2023-05-06 00:45:25 +03:00
parent 92f0154e67
commit f3a0080698
33 changed files with 70 additions and 70 deletions

View File

@ -1,6 +1,6 @@
function punishModal(t, kind, link, name, fullname) {
const kind_title = kind.charAt(0).toUpperCase() + kind.slice(1)
document.getElementById(`${kind}ModalTitle`).innerHTML = `${kind_title} @${name}`;
document.getElementById(`${kind}_reason`).value = link;
@ -12,7 +12,7 @@ function punishModal(t, kind, link, name, fullname) {
"days": document.getElementById(`${kind}_days`).value,
"reason": document.getElementById(`${kind}_reason`).value
}
if (kind == "ban") {
values["alts"] = document.getElementById(`${kind}_alts`).value;
}

View File

@ -112,7 +112,7 @@ function disable_btn(t) {
setTimeout(() => {
t.disabled = true;
}, 0.1);
setTimeout(() => {
t.classList.remove("disabled");
t.disabled = false;
@ -209,14 +209,14 @@ document.addEventListener("click", function (e) {
if (!element.classList.contains("areyousure")) {
document.querySelectorAll(".areyousure").forEach(i => {
i.classList.remove("areyousure")
if (i.dataset.oldvalue)
i.value = i.dataset.oldvalue
else
i.innerHTML = i.dataset.oldhtml
i.setAttribute("data-onclick", "areyousure(this)");
if (i.dataset.dismiss)
i.removeAttribute("data-bs-dismiss")
});

View File

@ -243,7 +243,7 @@ function post_comment(fullname, hide){
const upload_prog = document.getElementById(`upload-prog-${fullname}`);
xhr.upload.onprogress = (e) => {handleUploadProgress(e, upload_prog)};
xhr.setRequestHeader('xhr', 'xhr');
xhr.onload=function(){
upload_prog.classList.add("d-none")

View File

@ -460,7 +460,7 @@ let oldfiles = {};
function handle_files(input, newfiles) {
if (!newfiles) return;
const ta = input.parentElement.parentElement.parentElement.parentElement.querySelector('textarea.file-ta');
if (oldfiles[ta.id]) {
@ -596,7 +596,7 @@ function cancel_files(element) {
function handleUploadProgress(e, upload_prog) {
const bar = upload_prog.firstElementChild;
const percentIndicator = upload_prog.lastElementChild;
upload_prog.classList.remove("d-none")
if (e.lengthComputable) {
const progressPercent = Math.floor((e.loaded / e.total) * 100);
@ -634,7 +634,7 @@ document.querySelectorAll('form').forEach(form => {
if (form.classList.contains('is-submitting')) {
e.preventDefault();
}
form.classList.add('is-submitting');
});
});

View File

@ -377,7 +377,7 @@ function populate_speed_emoji_modal(results, textbox)
if(emoji.author !== undefined && emoji.author !== null)
emoji_option_text.title += "\nauthor\t" + emoji.author
if(emoji.count !== undefined)
emoji_option_text.title += "\nused\t" + emoji.count;

View File

@ -804,7 +804,7 @@ var Bug = {
if (!this.bug) {
this.makeBug();
}
if(!this.bug) return;
this.stop();
@ -855,7 +855,7 @@ var Bug = {
if (!this.bug) {
this.makeBug();
}
if(!this.bug) return;
this.stop();
@ -949,7 +949,7 @@ var Bug = {
rotationRate = this.random(0, 20, true),
startTime = Date.now(),
that = this;
this.bug.classList.add('bug-dead');
this.dropTimer = requestAnimFrame(function(t) {

View File

@ -15,7 +15,7 @@ for (const key of save_checked) {
const element = document.getElementById(key)
if (element) element.checked = (value == 'true')
}
}
function savetext() {

View File

@ -99,7 +99,7 @@ def add_options(self, body, v):
body += option_body
return body
class Comment(Base):
__tablename__ = "comments"
@ -337,7 +337,7 @@ class Comment(Base):
if body:
if not (self.parent_submission and self.post.sub == 'chudrama'):
body = censor_slurs(body, v)
body = normalize_urls_runtime(body, v)
if not v or v.controversial:
captured = []

View File

@ -332,7 +332,7 @@ class Submission(Base):
@lazy
def realtitle(self, v):
title = self.title_html
if self.sub != 'chudrama':
title = censor_slurs(title, v)

View File

@ -119,10 +119,10 @@ def execute_snappy(post:Submission, v:User):
group = g.db.query(Group).order_by(func.random()).first()
group_members = group.member_ids
if group.name == 'biofoids': mul = 10
else: mul = 5
g.db.query(User).filter(User.id.in_(group_members)).update({ User.coins: User.coins + mul })
cost = len(group_members) * mul
@ -561,7 +561,7 @@ def process_poll_options(v:User, target:Union[Submission, Comment]):
body_html=body_html,
exclusive=exclusive,
).first()
if not existing:
option = cls(
parent_id=target.id,

View File

@ -165,19 +165,19 @@ def NOTIFY_USERS(text, v, oldtext=None, ghost=False):
if not group: continue
members = group.member_ids - notify_users - v.all_twoway_blocks
notify_users.update(members)
if ghost or v.id not in group.member_ids:
if group.name == 'biofoids': mul = 10
else: mul = 5
cost += len(members) * mul
if cost > v.coins:
abort(403, f"You need {cost} coins to mention these ping groups!")
g.db.query(User).filter(User.id.in_(members)).update({ User.coins: User.coins + mul })
v.charge_account('coins', cost)

View File

@ -74,7 +74,7 @@ def award_timers(v, bot=False):
v.bite = None
badge = v.has_badge(168)
if badge: g.db.delete(badge)
v.house = v.old_house
notify_if_not_bot(f"Your vampire status has ended. You're now back in House {v.old_house.replace(' Founder', '')}!")
v.old_house = ''

View File

@ -37,7 +37,7 @@ def _initialize_snappy_marseys_and_quotes():
global SNAPPY_MARSEYS, SNAPPY_QUOTES
SNAPPY_MARSEYS = [f':#{x}:' for x in marseys_const2]
if IS_FISTMAS():
filename = f"snappy_fistmas_{SITE_NAME}.txt"
else:

View File

@ -119,7 +119,7 @@ def _generate_emojis_zip():
m = md5()
with open('files/assets/emojis.zip', "rb") as f:
data = f.read()
m.update(data)
cache.set('emojis_hash', m.hexdigest())

View File

@ -57,7 +57,7 @@ def process_files(files, v, body, is_dm=False, dm_user=None):
url = f'{SITE_FULL}{process_audio(file, v)}'
else:
abort(415)
body = body.replace(f'[{file.filename}]', f' {url} ', 1)
if is_dm:
@ -117,7 +117,7 @@ def convert_to_mp4(old, new, vid, db):
if os.path.isfile(tmp):
os.remove(tmp)
abort(400)
os.replace(tmp, new)
os.remove(old)

View File

@ -32,7 +32,7 @@ def chart(kind, site):
num_of_weeks = int(time_diff / 604800)
else:
num_of_weeks = 30
chart_width = int(num_of_weeks/0.7)
if kind == 'daily':

View File

@ -737,7 +737,7 @@ def admin_removed(v):
listing = g.db.query(Submission).options(load_only(Submission.id)).join(Submission.author).filter(
or_(Submission.is_banned==True, User.shadowbanned != None))
total = listing.count()
listing = listing.order_by(Submission.id.desc()).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE).all()
listing = [x.id for x in listing]
@ -761,13 +761,13 @@ def admin_removed_comments(v):
listing = g.db.query(Comment).options(load_only(Comment.id)).join(Comment.author).filter(
or_(Comment.is_banned==True, User.shadowbanned != None))
total = listing.count()
listing = listing.order_by(Comment.id.desc()).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE).all()
listing = [x.id for x in listing]
comments = get_comments(listing, v=v)
return render_template("admin/removed_comments.html",
v=v,
listing=comments,

View File

@ -180,7 +180,7 @@ def approve_emoji(v, name):
badge_grant(badge_id=113, user=author)
else:
badge_grant(badge_id=112, user=author)
cache.delete("emojis")

View File

@ -227,12 +227,12 @@ def award_thing(v, thing_type, id):
link_text_in_notif = thing.title
msg = f"@{v.username} has given [{link_text_in_notif}]({thing.shortlink}) the {AWARDS[kind]['title']} Award"
if kind == 'shit':
msg += f" and has stolen from you {awarded_coins} coins as a result"
elif awarded_coins:
msg += f" and you have received {awarded_coins} coins as a result"
msg += "!"
if note:
note = '\n\n> '.join(note.splitlines())
@ -250,7 +250,7 @@ def award_thing(v, thing_type, id):
link_text_in_notif = link
else:
link_text_in_notif = thing.title
ban_reason = f'1-Day ban award used by <a href="/@{v.username}">@{v.username}</a> on <a href="{link}">{link}</a>'
if not author.is_suspended:
author.ban(reason=ban_reason, days=1)
@ -428,7 +428,7 @@ def award_thing(v, thing_type, id):
else:
if author.house.startswith("Vampire"):
abort(400, f"{safe_username} is already a permanent vampire!")
author.bite = int(time.time()) + 172800
author.old_house = author.house
author.house = "Vampire"

View File

@ -132,7 +132,7 @@ def comment(v:User):
parent_user = parent if isinstance(parent, User) else parent.author
posting_to_submission = isinstance(post_target, Submission)
if not User.can_see(v, parent): abort(403)
if not isinstance(parent, User) and parent.deleted_utc != 0:

View File

@ -203,7 +203,7 @@ def comment_idlist(v=None, page=1, sort="new", t="day", gt=0, lt=0):
total = comments.count()
comments = sort_objects(sort, comments, Comment)
comments = comments.offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE).all()
return [x.id for x in comments], total

View File

@ -103,7 +103,7 @@ def leave_group(v:User, group_name):
send_notification(group.owner.id, text)
g.db.delete(existing)
return {"message": msg}
return {"message": ''}
@ -142,10 +142,10 @@ def group_approve(v:User, group_name, user_id):
group = g.db.get(Group, group_name)
if not group: abort(404)
if v.id != group.owner.id and v.admin_level < PERMS['MODS_EVERY_GROUP']:
abort(403, f"Only the group owner (@{group.owner.username}) can approve applications!")
application = g.db.query(GroupMembership).filter_by(user_id=user_id, group_name=group.name).one_or_none()
if not application:
abort(404, "There is no application to approve!")
@ -168,7 +168,7 @@ def group_reject(v:User, group_name, user_id):
group = g.db.get(Group, group_name)
if not group: abort(404)
if v.id != group.owner.id and v.admin_level < PERMS['MODS_EVERY_GROUP']:
abort(403, f"Only the group owner (@{group.owner.username}) can reject memberships!")

View File

@ -38,12 +38,12 @@ def hats(v:User):
hats = hats.order_by(key).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE).all()
elif sort == "owners":
hat_count = {x[0]:x[1] for x in g.db.query(Hat.hat_id, func.count(Hat.hat_id)).group_by(Hat.hat_id).all()}
if SITE == 'rdrama.net':
hats = sorted(hats.all(), key=lambda x: hat_count[x[0].id] if x[0].id in hat_count else 0, reverse=True)
else:
hats = sorted(hats.all(), key=lambda x: hat_count[x.id] if x.id in hat_count else 0, reverse=True)
firstrange = PAGE_SIZE * (page - 1)
secondrange = firstrange + PAGE_SIZE
hats = hats[firstrange:secondrange]
@ -163,7 +163,7 @@ def hat_owners(v:User, hat_id):
users = g.db.query(User).join(Hat.owners).filter(Hat.hat_id == hat_id)
total = users.count()
users = users.order_by(Hat.created_utc.desc()).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE).all()
return render_template("user_cards.html",

View File

@ -64,7 +64,7 @@ def notifications_modmail(v):
sentto=MODMAIL_ID,
level=1,
)
total = comments.count()
listing = comments.order_by(Comment.id.desc()).offset(PAGE_SIZE*(page-1)).limit(PAGE_SIZE).all()
@ -115,7 +115,7 @@ def notifications_messages(v:User):
thread_order.c.top_comment_id == Comment.top_comment_id)
# Clear notifications (used for unread indicator only) for all user messages.
if not session.get("GLOBAL"):
notifs_unread_row = g.db.query(Notification.comment_id).join(Comment).filter(
Notification.user_id == v.id,
@ -350,7 +350,7 @@ def notifications(v:User):
total.extend(c.replies2)
for x in c.replies2:
if x.replies2 == None: x.replies2 = []
count = 0
while count < 30 and c.parent_comment and (c.parent_comment.author_id == v.id or c.parent_comment.id in cids):
count += 1

View File

@ -90,7 +90,7 @@ def request_api_keys(v):
for admin_id in admin_ids:
notif = Notification(comment_id=new_comment.id, user_id=admin_id)
g.db.add(notif)
push_notif(admin_ids, 'New notification', body, f'{SITE_FULL}/comment/{new_comment.id}?read=true#context')
return redirect('/settings/apps')

View File

@ -350,7 +350,7 @@ def searchmessages(v:User):
comments = comments.offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE).all()
for x in comments: x.unread = True
comments = [x.top_comment for x in comments]
if v.client: return {"total":total, "data":[x.json(db=g.db) for x in comments]}

View File

@ -46,9 +46,9 @@ def upvoters_downvoters(v, username, uid, cls, vote_cls, vote_dir, template, sta
cls.author_id==id,
vote_cls.user_id==uid,
)
total = listing.count()
listing = listing.order_by(cls.created_utc.desc()).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE).all()
listing = [x.id for x in listing]
@ -112,9 +112,9 @@ def upvoting_downvoting(v, username, uid, cls, vote_cls, vote_dir, template, sta
vote_cls.user_id==id,
cls.author_id==uid,
)
total = listing.count()
listing = listing.order_by(cls.created_utc.desc()).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE).all()
listing = [x.id for x in listing]
@ -174,7 +174,7 @@ def user_voted(v, username, cls, vote_cls, template, standalone):
)
total = listing.count()
listing = listing.order_by(cls.created_utc.desc()).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE).all()
listing = [x.id for x in listing]
@ -1194,11 +1194,11 @@ def get_saves_and_subscribes(v, template, relationship_cls, page:int, standalone
cls = Comment
else:
raise TypeError("Relationships supported is SaveRelationship, Subscription, CommentSaveRelationship")
listing = g.db.query(query).join(join).filter(relationship_cls.user_id == v.id)
total = listing.count()
listing = listing.order_by(cls.created_utc.desc()).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE).all()
ids = [x[0] for x in listing]
@ -1299,9 +1299,9 @@ def bid_list(v:User, bid):
page = get_page()
users = g.db.query(User).join(User.badges).filter(Badge.badge_id==bid)
total = users.count()
users = users.order_by(Badge.created_utc.desc()).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE).all()
return render_template("user_cards.html",
@ -1469,9 +1469,9 @@ def users_list(v):
page = get_page()
users = g.db.query(User)
total = users.count()
users = users.order_by(User.id.desc()).offset(PAGE_SIZE * (page - 1)).limit(PAGE_SIZE).all()
return render_template("user_cards.html",

View File

@ -13,7 +13,7 @@
<label class="btn btn-secondary m-0 format" data-nonce="{{g.nonce}}" data-onclick="loadEmojis('input-message')" data-bs-toggle="modal" data-bs-target="#emojiModal" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Add Emoji">
<i class="fas fa-smile-beam"></i>
</label>
{{macros.file_input('file-uplod', False)}}
<input type="submit" value="Submit" class="btn btn-primary fl-r">

View File

@ -35,7 +35,7 @@
{% set banner_url = src %}
{% else %}
{% set path = "files/assets/images/" ~ SITE_NAME %}
{%- if not v and os_path.exists(path ~ "/cached.webp") -%}
{% set banner_url = 'cached.webp' | asset_siteimg %}
{% elif os_path.exists(path ~ "/banners") -%}
@ -44,7 +44,7 @@
{% set banner_url = 'banner.webp' | asset_siteimg %}
{% endif %}
{% endif %}
<div class="banner-wrapper">
<div style="padding: 0 0 12.2%">
<div>

View File

@ -31,7 +31,7 @@
Cancel Application
{%- endif -%}
</button>
<button id="apply-{{group}}" type="button" class="ml-3 ml-md-5 {% if v.id in group.membership_user_ids %}d-none{% endif %} btn btn-primary" data-nonce="{{g.nonce}}" data-onclick="postToastSwitch(this,'/!{{group}}/apply','leave-{{group}}','apply-{{group}}','d-none')">Apply to Join</button>
{% endif %}
</td>

View File

@ -67,7 +67,7 @@
{% include rules %}
</div>
{% endif %}
<br>
<hr>
<div class="mt-3">

View File

@ -60,7 +60,7 @@
<small class="btn btn-secondary format d-inline-block m-0"><span class="font-weight-bolder text-uppercase" data-nonce="{{g.nonce}}" data-onclick="getGifs('post-text')" data-bs-toggle="modal" data-bs-target="#gifModal" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Add GIF">GIF</span></small>
<button type="button" data-nonce="{{g.nonce}}" data-onclick="loadEmojis('post-text')" class="btn btn-secondary format d-inline-block m-0 ml-2" id="emoji-reply-btn" data-bs-toggle="modal" data-bs-target="#emojiModal" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Add Emoji"><i class="fas fa-smile-beam"></i></button>
{{macros.file_input('file-upload-submit', False)}}
<div id="preview" class="preview my-3"></div>

View File

@ -81,7 +81,7 @@
{% endfor %}
</select>
</div>
<div><label class="mt-3" for="{{emoji.name}}-submitter">Submitter</label></div>
<input autocomplete="off" type="text" id="{{emoji.name}}-submitter" class="form-control" maxlength="30" value="{{emoji.submitter}}" readonly>