Compare commits

..

No commits in common. 'master' and 'revamp' have entirely different histories.

@ -137,10 +137,7 @@ 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)
try:
remove(save_path)
except:
pass
remove(save_path)
audit_event(f'Deleted post {post.id}')
post.delete_instance()
flash("Deleted that shit, brah!", "is-success")

@ -4,6 +4,12 @@
<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,7 +3,13 @@
{% block content %}
<div class="container" style="text-align:center;">
<h1 class="title">View Logs</h1>
<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 log in logs %}
<article class="message" style="width: 40%; margin: 1em auto;">

@ -4,6 +4,12 @@
<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,7 +4,13 @@
<div class="container" style="text-align:center;">
<h1 class="title">Pending Posts</h1>
<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>
<section class="section">
{% if posts %}
{% for row in posts | batch(4) %}
@ -14,7 +20,6 @@
<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">
@ -23,13 +28,12 @@
{% 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">
<a href="{{ url_for('post.read', id=p.id) }}">{{ post.title }}</a>
{{ post.title }}
</p>
<p class="subtitle is-6"><a href="/?submitter={{ post.submitter }}">{{ post.submitter }}</a></p>
</div>

@ -28,10 +28,8 @@
</div>
<a class="navbar-item" href="{{ url_for('main.about') }}">About</a>
<a class="navbar-item" href="{{ url_for('post.create') }}">Submit</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 %}
{% if session.auth.preferred_username | is_moderator %}
<a class="navbar-item" style="color: orange;" href="{{ url_for('mod.main') }}">Mods!</a>
{% 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) }}" class="button is-success">Approve</a>
<a href="{{ url_for('post.delete', id=post.id) }}" class="button is-danger">Reject</a>
<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>
{% endif %}
<p class="mt-2">Submitted by <i><u><a href="/?submitter={{ post.submitter }}">{{ post.submitter }}</a></u></i> at <i>{{ post.timestamp }}</i></p>
<p>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,16 +33,12 @@ class Wallet(object):
r = requests.get(
self.endpoint,
data=json.dumps({'method': method, 'params': params}),
auth=self.auth,
timeout=10
auth=self.auth
)
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', {})
@ -62,7 +58,6 @@ 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):
@ -88,7 +83,6 @@ 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=[]):
@ -119,7 +113,6 @@ class Wallet(object):
'ring_size': 22
}
transfer = self.make_wallet_rpc('transfer', data)
self.store()
return transfer
def sweep_all(self, account, dest_address):
@ -128,7 +121,6 @@ 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