Improve 'following' UI

This commit is contained in:
pluja 2020-08-27 12:27:17 +02:00
parent b56e5a1fae
commit 5d94b677a8
2 changed files with 21 additions and 29 deletions

View File

@ -150,7 +150,6 @@ def following():
@login_required
def search():
form = SearchForm()
parsedResults = []
if form.validate_on_submit():
user = form.username.data
results = twitterUserSearch(user)
@ -604,7 +603,6 @@ def getPosts(account):
def getYoutubePosts(ids):
videos = []
ydl = YoutubeDL()
with FuturesSession() as session:
futures = [session.get('https://www.youtube.com/feeds/videos.xml?channel_id={id}'.format(id=id.channelId)) for id in ids]
for future in as_completed(futures):

View File

@ -1,35 +1,29 @@
{% extends "base.html" %}
{% block content %}
<div style="margin: 0em;" class="ui one column centered grid">
<div style="margin-top: 1em;" class="row">
<img class="ui tiny circular image" src="{{ url_for('static',filename='img/avatars/')}}{{range(1, 12) | random}}.png">
</div>
<div style="margin: 1.5em;" class="row">
<h2 class="ui header">Accounts you follow ({{ count }}):</h2>
</div>
</div>
<hr>
<div class="ui text container">
<div class="row">
<h2 class="ui header">Following ({{ count }}):</h2>
</div>
<div style="margin: 0em;" class="ui one column centered grid">
<div class="ui middle aligned divided list">
{% for acc in accounts %}
<div class="item">
<div class="right floated content">
<p>
<form action="{{ url_for('unfollow', username=acc.username) }}" method="post">
{{ form.hidden_tag() }}
{{ form.submit(value='Unfollow') }}
</form>
</p>
</div>
<img class="ui avatar image" src="{{ url_for('static',filename='img/avatars/')}}{{range(1, 12) | random}}.png">
<div class="content">
{{acc.username}}
</div>
<div class="ui relaxed divided list">
{% for acc in accounts %}
<div class="item">
<div class="right floated content">
<p>
<form action="{{ url_for('unfollow', username=acc.username) }}" method="post">
{{ form.hidden_tag() }}
{{ form.submit(value='Unfollow') }}
</form>
</p>
</div>
<div class="content">
<a href="{{ url_for('u',username=acc.username)}}" class="header">{{acc.username}}</a>
<div class="description">@{{acc.username}}</div>
</div>
</div>
{% endfor %}
</div>
{% endfor %}
</div>
</div>
{% endblock %}