Compare commits

...

5 Commits

@ -137,7 +137,10 @@ def delete(id):
if user == post.submitter or is_mod:
save_path_base = path.join(current_app.config["DATA_FOLDER"], "uploads")
save_path = path.join(save_path_base, post.image_name)
remove(save_path)
try:
remove(save_path)
except:
pass
audit_event(f'Deleted post {post.id}')
post.delete_instance()
flash("Deleted that shit, brah!", "is-success")

@ -4,12 +4,6 @@
<div class="container" style="text-align:center;">
<h1 class="title">Manage Mods</h1>
<nav class="breadcrumb is-centered" aria-label="breadcrumbs">
<ul>
<li><a href="/">Home</a></li>
<li><a href="{{ url_for('mod.main') }}">Mods</a></li>
</ul>
</nav>
<section class="section">
{% for ban in bans %}
<article class="message" style="width: 30%; margin: 2em auto;">

@ -3,13 +3,7 @@
{% block content %}
<div class="container" style="text-align:center;">
<h1 class="title">Manage Mods</h1>
<nav class="breadcrumb is-centered" aria-label="breadcrumbs">
<ul>
<li><a href="/">Home</a></li>
<li><a href="{{ url_for('mod.main') }}">Mods</a></li>
</ul>
</nav>
<h1 class="title">View Logs</h1>
<section class="section">
{% for log in logs %}
<article class="message" style="width: 40%; margin: 1em auto;">

@ -4,12 +4,6 @@
<div class="container" style="text-align:center;">
<h1 class="title">Manage Mods</h1>
<nav class="breadcrumb is-centered" aria-label="breadcrumbs">
<ul>
<li><a href="/">Home</a></li>
<li><a href="{{ url_for('mod.main') }}">Mods</a></li>
</ul>
</nav>
<section class="section">
{% for mod in mods %}
<div class="block">

@ -4,13 +4,7 @@
<div class="container" style="text-align:center;">
<h1 class="title">{% if title %}{{ title }}{% else %}Pending Posts{% endif %}</h1>
<nav class="breadcrumb is-centered" aria-label="breadcrumbs">
<ul>
<li><a href="/">Home</a></li>
<li><a href="{{ url_for('mod.main') }}">Mods</a></li>
</ul>
</nav>
<h1 class="title">Pending Posts</h1>
<section class="section">
{% if posts %}
{% for row in posts | batch(4) %}
@ -20,6 +14,7 @@
<div class="column">
<div class="card">
<div class="card-image">
<a href="{{ url_for('post.read', id=p.id) }}">
{% if p.get_image_path().endswith('mp4') %}
<video style="max-height: 100vh!important;" controls>
<source src="{{ url_for('post.uploaded_file', filename=p.image_name) }}" type="video/mp4">
@ -28,12 +23,13 @@
{% else %}
<img alt="SuchWow #{{ post.id }} - {{ post.title }} by {{ post.submitter }}" src="{{ url_for('post.uploaded_file', filename=post.thumbnail_name) }}" />
{% endif %}
</a>
</div>
<div class="card-content">
<div class="media">
<div class="media-content">
<p class="title is-4">
{{ post.title }}
<a href="{{ url_for('post.read', id=p.id) }}">{{ post.title }}</a>
</p>
<p class="subtitle is-6"><a href="/?submitter={{ post.submitter }}">{{ post.submitter }}</a></p>
</div>

@ -28,8 +28,10 @@
</div>
<a class="navbar-item" href="{{ url_for('main.about') }}">About</a>
<a class="navbar-item" href="{{ url_for('post.create') }}">Submit</a>
{% if session.auth.preferred_username | is_moderator %}
<a class="navbar-item" style="color: orange;" href="{{ url_for('mod.main') }}">Mods!</a>
{% if 'auth' in session %}
{% if session.auth.preferred_username | is_moderator %}
<a class="navbar-item" style="color: orange;" href="{{ url_for('mod.main') }}">Mods!</a>
{% endif %}
{% endif %}
</div>

@ -21,10 +21,10 @@
<h1>{{ post.title }}</h1>
<p>{{ post.text }}</p>
{% if not post.approved %}
<a href="{{ url_for('post.approve', id=post.id) }}"><button type="button" name="button">Approve</button></a>
<a href="{{ url_for('post.delete', id=post.id) }}"><button type="button" name="button">Reject</button></a>
<a href="{{ url_for('post.approve', id=post.id) }}" class="button is-success">Approve</a>
<a href="{{ url_for('post.delete', id=post.id) }}" class="button is-danger">Reject</a>
{% endif %}
<p>Submitted by <i><u><a href="/?submitter={{ post.submitter }}">{{ post.submitter }}</a></u></i> at <i>{{ post.timestamp }}</i></p>
<p class="mt-2">Submitted by <i><u><a href="/?submitter={{ post.submitter }}">{{ post.submitter }}</a></u></i> at <i>{{ post.timestamp }}</i></p>
<!-- <img src="{{ url_for('post.uploaded_file', filename=post.image_name) }}" width=600/ style="border-radius:4px;"> -->
{% if post.get_image_path().endswith('mp4') %}
<video style="max-height: 100vh!important;" controls>

@ -33,12 +33,16 @@ class Wallet(object):
r = requests.get(
self.endpoint,
data=json.dumps({'method': method, 'params': params}),
auth=self.auth
auth=self.auth,
timeout=10
)
if 'error' in r.json():
return r.json()['error']
else:
return r.json()['result']
def store(self):
self.make_wallet_rpc('store')
def height(self):
return self.make_wallet_rpc('get_height', {})
@ -58,6 +62,7 @@ class Wallet(object):
def new_account(self, label=None):
_account = self.make_wallet_rpc('create_account', {'label': label})
self.store()
return _account['account_index']
def addresses(self, account, addr_indices=None):
@ -83,6 +88,7 @@ class Wallet(object):
def new_address(self, account, label=None):
data = {'account_index': account, 'label': label}
_address = self.make_wallet_rpc('create_address', data)
self.store()
return (_address['address_index'], _address['address'])
def transfers(self, account, address_indices=[]):
@ -113,6 +119,7 @@ class Wallet(object):
'ring_size': 22
}
transfer = self.make_wallet_rpc('transfer', data)
self.store()
return transfer
def sweep_all(self, account, dest_address):
@ -121,6 +128,7 @@ class Wallet(object):
'account_index': account,
}
sweep = self.make_wallet_rpc('sweep_all', data)
self.store()
return sweep
def incoming_transfers(self, account, transfer_type='all', verbose=True):

Loading…
Cancel
Save