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',
|
||||
"color": 'bg-muted'
|
||||
},
|
||||
'edit_post': {
|
||||
"str": 'edited {self.target_link}',
|
||||
"icon": 'fa-edit',
|
||||
"color": 'bg-primary'
|
||||
},
|
||||
'enable_signups': {
|
||||
"str": 'enabled signups',
|
||||
"icon": 'fa-users',
|
||||
|
@ -215,6 +220,11 @@ ACTIONTYPES = {
|
|||
"icon": 'fa-shield',
|
||||
"color": 'bg-success'
|
||||
},
|
||||
'flair_post': {
|
||||
"str": 'set a flair on {self.target_link}',
|
||||
"icon": 'fa-tag',
|
||||
"color": 'bg-primary'
|
||||
},
|
||||
'grant_awards': {
|
||||
"str": 'granted awards to {self.target_link}',
|
||||
"icon": 'fa-gift',
|
||||
|
@ -375,3 +385,5 @@ ACTIONTYPES = {
|
|||
ACTIONTYPES2 = deepcopy(ACTIONTYPES)
|
||||
ACTIONTYPES2.pop("shadowban")
|
||||
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)
|
||||
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:
|
||||
notify_users = NOTIFY_USERS(f'{p.title} {p.body}', v)
|
||||
if notify_users:
|
||||
|
@ -565,6 +560,17 @@ def edit_post(pid, v):
|
|||
for x in notify_users:
|
||||
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()
|
||||
|
||||
return redirect(p.permalink)
|
||||
|
|
|
@ -26,6 +26,13 @@ def api_flag_post(pid, v):
|
|||
if reason.startswith('!') and v.admin_level > 1:
|
||||
post.flair = reason[1:]
|
||||
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:
|
||||
flag = Flag(post_id=post.id, user_id=v.id, reason=reason)
|
||||
g.db.add(flag)
|
||||
|
|
|
@ -233,7 +233,7 @@ def log(v):
|
|||
|
||||
actions = g.db.query(ModAction)
|
||||
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:
|
||||
actions = actions.filter_by(user_id=admin_id)
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
{% if v %}
|
||||
<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 %}
|
||||
<style>
|
||||
html {
|
||||
|
@ -39,7 +39,7 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<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 %}
|
||||
|
||||
</head>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<script src="/static/assets/js/bootstrap.js?v=245"></script>
|
||||
{% if v %}
|
||||
<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">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
|
@ -32,7 +32,7 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<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">
|
||||
{% endif %}
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
{% block content %}
|
||||
{% if v %}
|
||||
<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 %}
|
||||
<style>
|
||||
html {
|
||||
|
@ -30,7 +30,7 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<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 %}
|
||||
|
||||
<div class="row justify-content-around">
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
{% endblock %}
|
||||
|
||||
<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">
|
||||
|
||||
</head>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<title>2-Step Login - {{SITE_NAME}}</title>
|
||||
|
||||
<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>
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
|
||||
<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 %}
|
||||
<style>
|
||||
html {
|
||||
|
|
|
@ -39,10 +39,10 @@
|
|||
|
||||
{% if v %}
|
||||
<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 %}
|
||||
<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 %}
|
||||
</head>
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<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>
|
||||
<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>
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}{{SITE_NAME}}{% endif %}</title>
|
||||
|
||||
<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>
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
{% block stylesheets %}
|
||||
{% if v %}
|
||||
<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 %}
|
||||
<style>
|
||||
html {
|
||||
|
@ -50,7 +50,7 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<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">
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue