From f7b36ad257a8ed8e0dba2207c45f39a2cb001a9a Mon Sep 17 00:00:00 2001 From: codl Date: Mon, 7 Aug 2017 15:44:21 +0200 Subject: [PATCH] yes --- routes.py | 4 ++-- templates/logged_in.html | 18 ++++++++---------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/routes.py b/routes.py index 080a6a1..e43f5f6 100644 --- a/routes.py +++ b/routes.py @@ -32,7 +32,7 @@ def touch_viewer(resp): def index(): if g.viewer: return render_template('logged_in.html', scales=lib.interval_scales, - error=request.args.get('error', None)) + tweet_archive_failed = 'tweet_archive_failed' in request.args) else: return render_template('index.html') @@ -77,7 +77,7 @@ def upload_tweet_archive(): return redirect(url_for('index', _anchor='recent_archives')) except (BadZipFile, AssertionError): - return redirect(url_for('index', error='The file you uploaded is not a valid tweet archive. No posts have been imported.')) + return redirect(url_for('index', tweet_archive_failed='', _anchor='tweet_archive_import')) @app.route('/settings', methods=('POST',)) @require_auth diff --git a/templates/logged_in.html b/templates/logged_in.html index ccde9e8..bae07a2 100644 --- a/templates/logged_in.html +++ b/templates/logged_in.html @@ -2,12 +2,6 @@ {% extends 'lib/layout.html' %} {% block body -%} -{% if error %} -
- -
-{% endif %} -

Hello, @@ -68,15 +62,19 @@ {% if g.viewer.account.service == 'twitter' %}

-

Tweet archive import

+

Tweet archive import

Twitter's API only lets us access up to 3200 of your most recent tweets. If you have more tweets than that, you can request an archive of your tweets from Twitter's settings page, and upload it here.

-
- -
+
+ +
+ + {% if tweet_archive_failed %} + + {% endif %} {% if g.viewer.account.twitter_archives %}

Recent archives