From b56e5a1faeca824a3a873743f9e2c547d5f7acb6 Mon Sep 17 00:00:00 2001 From: pluja Date: Thu, 27 Aug 2020 12:07:59 +0200 Subject: [PATCH] Allow /user/ url on youtube --- app/routes.py | 5 +++-- app/templates/_twitter_post.html | 2 +- app/templates/search.html | 4 ++-- app/templates/ytsearch.html | 14 ++++++-------- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/app/routes.py b/app/routes.py index d8951cf..572d4a6 100644 --- a/app/routes.py +++ b/app/routes.py @@ -162,9 +162,9 @@ def search(): else: return render_template('search.html', form = form) -@app.route('/user/') +@app.route('/u/') @login_required -def user(username): +def u(username): form = EmptyForm() avatarPath = "img/avatars/{}.png".format(str(random.randint(1,12))) user = getTwitterUserInfo(username) @@ -288,6 +288,7 @@ def unfollowYoutubeChannel(channelId): return redirect(request.referrer) @app.route('/channel/', methods=['GET']) +@app.route('/user/', methods=['GET']) @login_required def channel(id): form = ChannelForm() diff --git a/app/templates/_twitter_post.html b/app/templates/_twitter_post.html index 9b06a8b..9574cfb 100644 --- a/app/templates/_twitter_post.html +++ b/app/templates/_twitter_post.html @@ -14,7 +14,7 @@ - +
{{post.date}} {% if post.isPinned %} diff --git a/app/templates/search.html b/app/templates/search.html index 2e3d71b..1377fb4 100644 --- a/app/templates/search.html +++ b/app/templates/search.html @@ -21,9 +21,9 @@
{% if res.fullName|length > 20%} - {{res.fullName[0:23]}}... + {{res.fullName[0:23]}}... {% else %} - {{res.fullName}} + {{res.fullName}} {% endif %}
{{res.username}}
diff --git a/app/templates/ytsearch.html b/app/templates/ytsearch.html index 985e156..1221a32 100644 --- a/app/templates/ytsearch.html +++ b/app/templates/ytsearch.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block content %} -
+
{{ form.hidden_tag() }}

@@ -14,10 +14,9 @@

{{ form.submit() }}

-
+

Users

{% if channels %} -
-

Users

+
{% for res in channels %}
@@ -40,10 +39,10 @@
- {{res.username}} -
+ {{res.username}} +
{{res.subCount}} -
+
{% endfor %} @@ -63,7 +62,6 @@ {% include '_empty_feed.html' %} {% endif %}
-
{% endblock %} \ No newline at end of file