stop using "flair" instead of "hole" in wpd

pull/215/head
Aevann 2023-10-07 21:04:12 +03:00
parent d3d7254e83
commit bbc7a4772f
14 changed files with 25 additions and 35 deletions

View File

@ -503,8 +503,6 @@ NOTIFICATION_SPAM_AGE_THRESHOLD = 0
COMMENT_SPAM_LENGTH_THRESHOLD = 0
UNDER_SIEGE_AGE_THRESHOLD = 10 * 60
HOLE_NAME = 'hole'
HOLE_STYLE_FLAIR = False
HOLE_REQUIRED = False
HOLE_COST = 0
GROUP_COST = 10000
@ -750,8 +748,6 @@ elif SITE == 'watchpeopledie.tv':
MAX_VIDEO_SIZE_MB = 500
MAX_VIDEO_SIZE_MB_PATRON = 500
HOLE_NAME = 'flair'
HOLE_STYLE_FLAIR = True
HOLE_REQUIRED = True
AUTOJANNY_ID = 1

View File

@ -126,7 +126,7 @@ def inject_constants():
"listdir":listdir, "os_path":path,
"PIZZASHILL_ID":PIZZASHILL_ID, "DEFAULT_COLOR":DEFAULT_COLOR,
"COLORS":COLORS, "time":time, "PERMS":PERMS, "FEATURES":FEATURES,
"HOLE_NAME":HOLE_NAME, "HOLE_STYLE_FLAIR":HOLE_STYLE_FLAIR, "HOLE_REQUIRED":HOLE_REQUIRED,
"HOLE_REQUIRED":HOLE_REQUIRED,
"DEFAULT_THEME":DEFAULT_THEME, "DESCRIPTION":DESCRIPTION,
"has_sidebar":has_sidebar, "has_logo":has_logo,
"FP":FP, "patron":patron, "get_setting": get_setting,

View File

@ -475,7 +475,7 @@ def submit_post(v, hole=None):
else: hole = None
if not hole and HOLE_REQUIRED:
abort(400, f"You must choose a {HOLE_NAME} for your post!")
abort(400, f"You must choose a hole for your post!")
if v.longpost and (len(body) < 280 or ' [](' in body or body.startswith('[](')):
abort(400, "You have to type more than 280 characters!")

View File

@ -175,7 +175,7 @@ def move_post(post, v, reason):
if hole_from == hole_to: abort(409, f"Post is already in {hole_to_in_notif}")
if post.author.exiler_username(hole_to):
abort(403, f"User is exiled from this {HOLE_NAME}!")
abort(403, f"User is exiled from this hole!")
if hole_to == 'changelog':
abort(403, "/h/changelog is archived!")

View File

@ -10,8 +10,6 @@ from files.helpers.get import *
from files.routes.wrappers import *
from files.__main__ import app
search_operator_hole = HOLE_NAME
valid_params = [
'author',
'domain',
@ -22,7 +20,7 @@ valid_params = [
'exact',
'title',
'sentto',
search_operator_hole,
'hole',
'subreddit',
]
@ -139,8 +137,8 @@ def searchposts(v):
posts = posts.filter(Post.url.ilike(f"https://old.reddit.com/r/{subreddit}/%"))
if search_operator_hole in criteria:
posts = posts.filter(Post.hole == criteria[search_operator_hole])
if 'hole' in criteria:
posts = posts.filter(Post.hole == criteria['hole'])
if 'after' in criteria:
after = criteria['after']
@ -238,8 +236,8 @@ def searchcomments(v):
if 'nsfw' in criteria: comments = comments.filter(Comment.nsfw == True)
if search_operator_hole in criteria:
comments = comments.filter(Post.hole == criteria[search_operator_hole])
if 'hole' in criteria:
comments = comments.filter(Post.hole == criteria['hole'])
comments = apply_time_filter(t, comments, Comment)

View File

@ -117,8 +117,8 @@
{% if v.admin_level >= PERMS['EDIT_RULES'] %}
<li><a href="/admin/edit_rules">Edit the Rules</a></li>
{%- endif %}
{% if v.admin_level >= PERMS['HOLE_CREATE'] %}
<li><a href="/create_hole">Create {{HOLE_NAME | capitalize}}</a></li>
{% if PERMS['HOLE_CREATE'] and v.admin_level >= PERMS['HOLE_CREATE'] %}
<li><a href="/create_hole">Create Hole</a></li>
{% endif %}
{% if v.admin_level >= PERMS['APPS_MODERATION'] %}
<li><a href="/admin/apps">Apps</a></li>

View File

@ -1,6 +1,6 @@
{%- set search_placeholder = "Search" -%}
{%- if hole -%}
{%- set search_placeholder = "Search (try '" ~ HOLE_NAME ~ ":" ~ hole.name ~ "')" -%}
{%- set search_placeholder = "Search (try 'hole:" ~ hole.name ~ "')" -%}
{%- endif -%}
<nav class="shadow-md fixed-top">
@ -124,7 +124,7 @@
</a>
{% if hole %}
<a id="hole-name" href="/h/{{hole}}" class="font-weight-bold flex-grow-1 ml-2 mt-1" {% if hole.name|length >= 17 %}style="font-size:max(10px,1.2vw)"{% endif %}>{% if not HOLE_STYLE_FLAIR %}/h/{% endif %}{{hole}}</a>
<a id="hole-name" href="/h/{{hole}}" class="font-weight-bold flex-grow-1 ml-2 mt-1" {% if hole.name|length >= 17 %}style="font-size:max(10px,1.2vw)"{% endif %}>/h/{{hole}}</a>
{% elif has_logo %}
<div id="logo-container" class="flex-grow-1 logo-container">
<a href="/">

View File

@ -1,12 +1,12 @@
{% extends "default.html" %}
{% block pagetitle %}Create a {{HOLE_NAME}}{% endblock %}
{% block pagetitle %}Create a hole{% endblock %}
{% block content %}
<form class="mt-3" id="submitform" action="/create_hole" method="post" data-nonce="{{g.nonce}}">
<div class="container">
<div class="row justify-content-center mb-4 pb-6">
<div class="col col-md-6 p-3 py-md-0">
<h1 class="d-mob-none">Create a {{HOLE_NAME}}</h1>
<h3 class=" d-md-none">Create a {{HOLE_NAME}}</h3>
<h1 class="d-mob-none">Create a hole</h1>
<h3 class=" d-md-none">Create a hole</h3>
<div class="body">
<input hidden name="formkey" value="{{v|formkey}}">
<label for="title">Hole Name</label>
@ -17,7 +17,7 @@
{% endif %}
<div class="footer">
<div class="d-flex">
<button type="submit" class="btn btn-primary ml-auto" {% if cost > v.coins + v.marseybux %}disabled{% endif %}>Create {{HOLE_NAME|capitalize}}</button>
<button type="submit" class="btn btn-primary ml-auto" {% if cost > v.coins + v.marseybux %}disabled{% endif %}>Create Hole</button>
</div>
<p class="mt-2 mr-1" style="float: right"><b>Cost</b>: {{cost}} coins or marseybux</p>
</div>

View File

@ -1,7 +1,7 @@
{% extends "default.html" %}
{% block pagetitle %}{{HOLE_NAME|capitalize}} List{% endblock %}
{% block pagetitle %}Hole List{% endblock %}
{% block content %}
<h5 class="mt-3 mb-1">{{HOLE_NAME|capitalize}} List</h5>
<h5 class="mt-3 mb-1">Hole List</h5>
<div class="overflow-x-auto">
<table class="table table-striped mb-5">
<thead class="bg-primary text-white">

View File

@ -39,7 +39,7 @@
{% block desktopBanner %}
{%- set search_placeholder = "Search" -%}
{%- if hole -%}
{%- set search_placeholder = "Search (try '" ~ HOLE_NAME ~ ":" ~ hole.name ~ "')" -%}
{%- set search_placeholder = "Search (try 'hole:" ~ hole.name ~ "')" -%}
{%- endif -%}
<div class="row" style="overflow: visible;padding-top:5px">
<div class="col">

View File

@ -56,8 +56,8 @@
</div>
{% elif request.path.startswith('/search/posts') or request.path.startswith('/search/comments') %}
<div>
<div style="display: inline-block; width: 150px; text-align: center">{{HOLE_NAME | capitalize}}:</div>
<button type="button" data-nonce="{{g.nonce}}" data-onclick="addParam(this)" class="searchparam mb-1">{{HOLE_NAME}}:music</button>
<div style="display: inline-block; width: 150px; text-align: center">Hole:</div>
<button type="button" data-nonce="{{g.nonce}}" data-onclick="addParam(this)" class="searchparam mb-1">hole:music</button>
</div>
{% if request.path.startswith('/search/comments') %}
<div>

View File

@ -57,8 +57,8 @@
<span id="sidebar--directory--head">DIRECTORY</span>
<span id="sidebar--directory--subhead">Submit Marseys & Art | Info Megathreads</span>
</a>
<a class="btn btn-primary btn-block mb-3" href="/holes">BROWSE {{HOLE_NAME|upper}}S</a>
<a class="btn btn-primary btn-block mb-3" href="/create_hole">CREATE {{HOLE_NAME|upper}}</a>
<a class="btn btn-primary btn-block mb-3" href="/holes">BROWSE HOLES</a>
<a class="btn btn-primary btn-block mb-3" href="/create_hole">CREATE HOLE</a>
{% if hole %}
<br>

View File

@ -17,7 +17,7 @@
<h2 class="mt-3">Create a post</h2>
<div class="body">
<input hidden name="formkey" value="{{v|formkey}}">
<label class='mt-4' for="title">{{HOLE_NAME|capitalize}}</label>
<label class='mt-4' for="title">Hole</label>
<div class="input-group">
{%- set hole_placeholder = 'Required' if HOLE_REQUIRED else 'Optional' -%}
<input list="holes" autocomplete="off" id="hole" class="form-control" form="submitform" name="hole" data-nonce="{{g.nonce}}" data-oninput="savetext()" {% if hole %}value="{{hole}}"{% endif %} placeholder="{{hole_placeholder}}" {% if HOLE_REQUIRED %}required{% endif %}>

View File

@ -10,11 +10,7 @@
{% macro post_meta(p) %}
{% if p.hole %}
{% if not HOLE_STYLE_FLAIR -%}
<a class="mr-2 font-weight-bold" href='/h/{{p.hole}}'>/h/{{p.hole}}</a>
{%- else -%}
<a href='/h/{{p.hole}}' class="hole-flair font-weight-bold">{{p.hole|capitalize}}</a>
{%- endif %}
<a class="mr-2 font-weight-bold" href='/h/{{p.hole}}'>/h/{{p.hole}}</a>
{% endif %}
{% if p.hole and p.author.exiler_username(p.hole) %}