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: if user == post.submitter or is_mod:
save_path_base = path.join(current_app.config["DATA_FOLDER"], "uploads") save_path_base = path.join(current_app.config["DATA_FOLDER"], "uploads")
save_path = path.join(save_path_base, post.image_name) save_path = path.join(save_path_base, post.image_name)
try: remove(save_path)
remove(save_path)
except:
pass
audit_event(f'Deleted post {post.id}') audit_event(f'Deleted post {post.id}')
post.delete_instance() post.delete_instance()
flash("Deleted that shit, brah!", "is-success") flash("Deleted that shit, brah!", "is-success")

@ -4,6 +4,12 @@
<div class="container" style="text-align:center;"> <div class="container" style="text-align:center;">
<h1 class="title">Manage Mods</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"> <section class="section">
{% for ban in bans %} {% for ban in bans %}
<article class="message" style="width: 30%; margin: 2em auto;"> <article class="message" style="width: 30%; margin: 2em auto;">

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

@ -4,6 +4,12 @@
<div class="container" style="text-align:center;"> <div class="container" style="text-align:center;">
<h1 class="title">Manage Mods</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"> <section class="section">
{% for mod in mods %} {% for mod in mods %}
<div class="block"> <div class="block">

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

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

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

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

Loading…
Cancel
Save