fart
This commit is contained in:
parent
207b3c1980
commit
6c97156856
15 changed files with 48 additions and 23 deletions
File diff suppressed because one or more lines are too long
|
@ -205,6 +205,11 @@ ACTIONTYPES = {
|
||||||
"icon": 'fa-trash-alt',
|
"icon": 'fa-trash-alt',
|
||||||
"color": 'bg-muted'
|
"color": 'bg-muted'
|
||||||
},
|
},
|
||||||
|
'edit_post': {
|
||||||
|
"str": 'edited {self.target_link}',
|
||||||
|
"icon": 'fa-edit',
|
||||||
|
"color": 'bg-primary'
|
||||||
|
},
|
||||||
'enable_signups': {
|
'enable_signups': {
|
||||||
"str": 'enabled signups',
|
"str": 'enabled signups',
|
||||||
"icon": 'fa-users',
|
"icon": 'fa-users',
|
||||||
|
@ -215,6 +220,11 @@ ACTIONTYPES = {
|
||||||
"icon": 'fa-shield',
|
"icon": 'fa-shield',
|
||||||
"color": 'bg-success'
|
"color": 'bg-success'
|
||||||
},
|
},
|
||||||
|
'flair_post': {
|
||||||
|
"str": 'set a flair on {self.target_link}',
|
||||||
|
"icon": 'fa-tag',
|
||||||
|
"color": 'bg-primary'
|
||||||
|
},
|
||||||
'grant_awards': {
|
'grant_awards': {
|
||||||
"str": 'granted awards to {self.target_link}',
|
"str": 'granted awards to {self.target_link}',
|
||||||
"icon": 'fa-gift',
|
"icon": 'fa-gift',
|
||||||
|
@ -374,4 +384,6 @@ ACTIONTYPES = {
|
||||||
|
|
||||||
ACTIONTYPES2 = deepcopy(ACTIONTYPES)
|
ACTIONTYPES2 = deepcopy(ACTIONTYPES)
|
||||||
ACTIONTYPES2.pop("shadowban")
|
ACTIONTYPES2.pop("shadowban")
|
||||||
ACTIONTYPES2.pop("unshadowban")
|
ACTIONTYPES2.pop("unshadowban")
|
||||||
|
ACTIONTYPES2.pop("flair_post")
|
||||||
|
ACTIONTYPES2.pop("edit_post")
|
|
@ -553,11 +553,6 @@ def edit_post(pid, v):
|
||||||
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)
|
||||||
|
|
||||||
|
|
||||||
if v.id == p.author_id:
|
|
||||||
if int(time.time()) - p.created_utc > 60 * 3: p.edited_utc = int(time.time())
|
|
||||||
g.db.add(p)
|
|
||||||
|
|
||||||
if not p.private and not p.ghost:
|
if not p.private and not p.ghost:
|
||||||
notify_users = NOTIFY_USERS(f'{p.title} {p.body}', v)
|
notify_users = NOTIFY_USERS(f'{p.title} {p.body}', v)
|
||||||
if notify_users:
|
if notify_users:
|
||||||
|
@ -565,6 +560,17 @@ def edit_post(pid, v):
|
||||||
for x in notify_users:
|
for x in notify_users:
|
||||||
add_notif(cid, x)
|
add_notif(cid, x)
|
||||||
|
|
||||||
|
if v.id == p.author_id:
|
||||||
|
if int(time.time()) - p.created_utc > 60 * 3: p.edited_utc = int(time.time())
|
||||||
|
g.db.add(p)
|
||||||
|
else:
|
||||||
|
ma=ModAction(
|
||||||
|
kind="edit_post",
|
||||||
|
user_id=v.id,
|
||||||
|
target_submission_id=p.id
|
||||||
|
)
|
||||||
|
g.db.add(ma)
|
||||||
|
|
||||||
g.db.commit()
|
g.db.commit()
|
||||||
|
|
||||||
return redirect(p.permalink)
|
return redirect(p.permalink)
|
||||||
|
|
|
@ -26,6 +26,13 @@ def api_flag_post(pid, v):
|
||||||
if reason.startswith('!') and v.admin_level > 1:
|
if reason.startswith('!') and v.admin_level > 1:
|
||||||
post.flair = reason[1:]
|
post.flair = reason[1:]
|
||||||
g.db.add(post)
|
g.db.add(post)
|
||||||
|
ma=ModAction(
|
||||||
|
kind="flair_post",
|
||||||
|
user_id=v.id,
|
||||||
|
target_submission_id=post.id,
|
||||||
|
_note=f'"{post.flair}"'
|
||||||
|
)
|
||||||
|
g.db.add(ma)
|
||||||
else:
|
else:
|
||||||
flag = Flag(post_id=post.id, user_id=v.id, reason=reason)
|
flag = Flag(post_id=post.id, user_id=v.id, reason=reason)
|
||||||
g.db.add(flag)
|
g.db.add(flag)
|
||||||
|
|
|
@ -233,7 +233,7 @@ def log(v):
|
||||||
|
|
||||||
actions = g.db.query(ModAction)
|
actions = g.db.query(ModAction)
|
||||||
if not (v and v.admin_level > 1):
|
if not (v and v.admin_level > 1):
|
||||||
actions = actions.filter(ModAction.kind.notin_(["shadowban","unshadowban"]))
|
actions = actions.filter(ModAction.kind.notin_(["shadowban","unshadowban","flair_post","edit_post"]))
|
||||||
|
|
||||||
if admin_id:
|
if admin_id:
|
||||||
actions = actions.filter_by(user_id=admin_id)
|
actions = actions.filter_by(user_id=admin_id)
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
|
|
||||||
{% if v %}
|
{% if v %}
|
||||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=180"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=30">
|
<link rel="stylesheet" href="/static/assets/css/main.css?v=181"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=30">
|
||||||
{% if v.agendaposter %}
|
{% if v.agendaposter %}
|
||||||
<style>
|
<style>
|
||||||
html {
|
html {
|
||||||
|
@ -39,7 +39,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=180"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
<link rel="stylesheet" href="/static/assets/css/main.css?v=181"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<script src="/static/assets/js/bootstrap.js?v=245"></script>
|
<script src="/static/assets/js/bootstrap.js?v=245"></script>
|
||||||
{% if v %}
|
{% if v %}
|
||||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=180">
|
<link rel="stylesheet" href="/static/assets/css/main.css?v=181">
|
||||||
<link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=30">
|
<link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=30">
|
||||||
{% if v.agendaposter %}
|
{% if v.agendaposter %}
|
||||||
<style>
|
<style>
|
||||||
|
@ -32,7 +32,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=180">
|
<link rel="stylesheet" href="/static/assets/css/main.css?v=181">
|
||||||
<link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
<link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% if v %}
|
{% if v %}
|
||||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=180"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=30">
|
<link rel="stylesheet" href="/static/assets/css/main.css?v=181"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=30">
|
||||||
{% if v.agendaposter %}
|
{% if v.agendaposter %}
|
||||||
<style>
|
<style>
|
||||||
html {
|
html {
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=180"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
<link rel="stylesheet" href="/static/assets/css/main.css?v=181"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div class="row justify-content-around">
|
<div class="row justify-content-around">
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=180">
|
<link rel="stylesheet" href="/static/assets/css/main.css?v=181">
|
||||||
<link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
<link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
<title>2-Step Login - {{SITE_NAME}}</title>
|
<title>2-Step Login - {{SITE_NAME}}</title>
|
||||||
|
|
||||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=180"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
<link rel="stylesheet" href="/static/assets/css/main.css?v=181"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
|
|
||||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=180"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=30">
|
<link rel="stylesheet" href="/static/assets/css/main.css?v=181"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=30">
|
||||||
{% if v.agendaposter %}
|
{% if v.agendaposter %}
|
||||||
<style>
|
<style>
|
||||||
html {
|
html {
|
||||||
|
|
|
@ -39,10 +39,10 @@
|
||||||
|
|
||||||
{% if v %}
|
{% if v %}
|
||||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=180"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=30">
|
<link rel="stylesheet" href="/static/assets/css/main.css?v=181"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=30">
|
||||||
{% else %}
|
{% else %}
|
||||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=180"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
<link rel="stylesheet" href="/static/assets/css/main.css?v=181"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
<title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}Sign up - {{SITE_NAME}}{% endif %}</title>
|
<title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}Sign up - {{SITE_NAME}}{% endif %}</title>
|
||||||
|
|
||||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=180"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
<link rel="stylesheet" href="/static/assets/css/main.css?v=181"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
<title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}{{SITE_NAME}}{% endif %}</title>
|
<title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}{{SITE_NAME}}{% endif %}</title>
|
||||||
|
|
||||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=180"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
<link rel="stylesheet" href="/static/assets/css/main.css?v=181"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
{% block stylesheets %}
|
{% block stylesheets %}
|
||||||
{% if v %}
|
{% if v %}
|
||||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=180"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=30">
|
<link rel="stylesheet" href="/static/assets/css/main.css?v=181"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=30">
|
||||||
{% if v.agendaposter %}
|
{% if v.agendaposter %}
|
||||||
<style>
|
<style>
|
||||||
html {
|
html {
|
||||||
|
@ -50,7 +50,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||||
<link rel="stylesheet" href="/static/assets/css/main.css?v=180">
|
<link rel="stylesheet" href="/static/assets/css/main.css?v=181">
|
||||||
<link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
<link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=30">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue