improve export and slight ux

migrate-new-models
lza_menace 1 year ago
parent 12758c5bb5
commit c5d0b4a9ff

@ -12,7 +12,7 @@ if not wallet.connected:
print('Wallet not connected')
exit()
all_posts = Post.select().order_by(Post.timestamp.desc())
all_posts = Post.select().order_by(Post.timestamp.asc())
all_mods = Moderator.select()
all_profiles = Profile.select()
all_bans = Ban.select()
@ -49,8 +49,11 @@ for post in all_posts:
'out': True
})
}
txes = 0
all_data['posts'].append(post_data)
print(f'Exporting post {post.id}')
if 'in' in post_data['txes']:
txes = len(post_data['txes']['in'])
print(f'Exporting post {post.id}. Found {txes} txes')
for mod in all_mods:
all_data['moderators'].append(mod.username)

@ -35,7 +35,7 @@
</ul>
</div>
<!-- Post Info -->
<section class="section">
<section class="section" style="padding: 0;">
<div class="content">
<h1>{{ post.title }}</h1>
<p>{{ post.text }}</p>
@ -44,14 +44,18 @@
<a href="{{ url_for('post.delete', id=post.id) }}" class="button is-danger">Reject</a>
{% endif %}
<p class="mt-2">Submitted by <i><u><a href="/?submitter={{ post.user.username }}">{{ post.user.username }}</a></u></i> at <i>{{ post.timestamp }}</i></p>
<div style="max-width: 80vh; margin: 0 auto;">
{% if post.get_image_path().endswith('mp4') %}
<video style="max-height: 100vh!important;" controls>
<source src="{{ url_for('post.uploaded_file', filename=post.image_name) }}" type="video/mp4">
Your browser does not support the video tag.
</video>
{% else %}
<a href="{{ url_for('post.uploaded_file', filename=post.image_name, _external=True) }}">
<img alt="SuchWow #{{ post.id }} - {{ post.title }} by {{ post.user.username }}" src="{{ url_for('post.uploaded_file', filename=post.image_name) }}" />
</a>
{% endif %}
</div>
</div>
</section>