2
0
mirror of https://github.com/codl/forget synced 2024-12-14 01:14:34 +01:00
forget-cancellare-vecchi-toot/templates/logged_in.html

107 lines
4.4 KiB
HTML
Raw Normal View History

2017-08-03 16:05:28 +02:00
{% from 'lib/interval.html' import interval_input -%}
{% extends 'lib/layout.html' %}
{% block body -%}
<section class=viewer>
<p>Hello,
<img class=avatar src="{{g.viewer.account.avatar_url}}"/>
{{g.viewer.account.display_name}}!
<a href="{{url_for('logout')}}">Log out</a>
</p>
{% set enabled_disabled = "enabled" if g.viewer.account.policy_enabled else "disabled" %}
<div class="banner {{enabled_disabled}}">Forget is currently {{ enabled_disabled }} on your account.
{% if g.viewer.account.policy_enabled -%}
<form action='{{url_for("disable")}}' method='post' enctype='multipart/form-data'>
<input type='submit' value='Disable'>
</form>
{% else -%}
<form action='{{url_for("enable")}}' method='post' enctype='multipart/form-data'>
<input type='submit' value='Enable'>
</form>
{% endif %}
</div>
{% set post_count = g.viewer.account.post_count() %}
2017-08-03 21:37:00 +02:00
<p>Currently keeping track of {{ post_count }} of your posts, roughly {{ g.viewer.account.estimate_eligible_for_delete() }} of which currently match your expiration rules.</p>
{% if g.viewer.account.service == 'twitter'
and g.viewer.account.reported_post_count
and post_count < g.viewer.account.reported_post_count * 3/4
and g.viewer.account.reported_post_count > 3200 -%}
<div class='banner warning'>Are we missing some of your posts? Try uploading a tweet archive below</div>
{% endif %}
2017-08-03 16:05:28 +02:00
</section>
<section>
<h2>Settings</h2>
{% if request.args.get('settings_saved') != None %}
<div class='banner success'>Settings saved successfully</div>
{% endif %}
2017-08-07 16:26:25 +02:00
{% if settings_error %}
<div class='banner error'>Something went wrong trying to save your settings. Please try again later.</div>
{% endif %}
2017-08-03 16:05:28 +02:00
<form action='{{url_for("settings")}}' method='post' enctype='multipart/form-data'>
2017-08-03 21:37:00 +02:00
<p>Posts that are less than
2017-08-03 16:05:28 +02:00
{{interval_input(g.viewer.account, 'policy_keep_younger', scales)}}
2017-08-03 21:37:00 +02:00
old are considered fresh
2017-08-03 16:05:28 +02:00
</p>
2017-08-03 21:37:00 +02:00
<p>Your latest
2017-08-03 16:05:28 +02:00
<input type=number name=policy_keep_latest min=0 step=1 style='max-width:8ch' value={{g.viewer.account.policy_keep_latest}}>
2017-08-03 21:37:00 +02:00
posts are considered fresh
2017-08-03 16:05:28 +02:00
</p>
2017-08-04 00:30:08 +02:00
<p>Posts that you have liked / favourited will stay fresh forever
2017-08-04 00:59:00 +02:00
<span style='display:inline-block'>
2017-08-04 00:27:38 +02:00
<label><input type=radio name=policy_keep_favourites value=true {{ "checked" if g.viewer.account.policy_keep_favourites }}> Yes</label>
<label><input type=radio name=policy_keep_favourites value=false {{ "checked" if not g.viewer.account.policy_keep_favourites }}> No</label>
2017-08-04 00:59:00 +02:00
</span>
2017-08-03 16:05:28 +02:00
</p>
<p>Posts that have media attached will stay fresh forever
<span style='display:inline-block'>
<label><input type=radio name=policy_keep_media value=true {{ "checked" if g.viewer.account.policy_keep_media }}> Yes</label>
<label><input type=radio name=policy_keep_media value=false {{ "checked" if not g.viewer.account.policy_keep_media }}> No</label>
</span>
</p>
2017-08-03 21:37:00 +02:00
<p>Any post that is not kept fresh by any of these rules is considered expired. One random expired post will be deleted every
{{interval_input(g.viewer.account, 'policy_delete_every', scales)}}
</p>
2017-08-03 16:05:28 +02:00
<input type=submit value='Save settings'>
</form>
</section>
{% if g.viewer.account.service == 'twitter' %}
<section>
2017-08-07 15:44:21 +02:00
<h2 id='tweet_archive_import'>Tweet archive import</h2>
2017-08-03 16:28:27 +02:00
<p>
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
<a href="https://twitter.com/settings/account">Twitter's settings page</a>,
and upload it here.
</p>
2017-08-07 15:44:21 +02:00
{% if tweet_archive_failed %}
<div class="banner error">The file you uploaded is not a valid tweet archive. No posts have been imported.</div>
{% endif %}
2017-08-03 16:05:28 +02:00
<form action='{{url_for('upload_tweet_archive')}}' method='post' enctype='multipart/form-data'>
<input type="file" name='file'><input type="submit" value="Upload">
</form>
2017-08-03 16:05:28 +02:00
{% if g.viewer.account.twitter_archives %}
2017-08-04 01:17:05 +02:00
<h3 id="recent_archives">Recent archives</h3>
2017-08-03 16:05:28 +02:00
<ul>
{% for archive in g.viewer.account.twitter_archives %}
2017-08-07 15:53:34 +02:00
<li class="tweet_archive" data-status="{{archive.status()}}">{{archive.created_at.strftime('%Y-%m-%d %H:%M')}}<br>
2017-08-07 15:58:08 +02:00
{% if archive.chunks is none %}
2017-08-07 15:53:34 +02:00
Archive could not be opened
2017-08-07 16:00:50 +02:00
{% else %}
{{archive.chunks_successful}}/{{archive.chunks}} months imported, {{archive.chunks_failed}} failed</li>
2017-08-07 15:53:34 +02:00
{% endif %}
2017-08-03 16:05:28 +02:00
{% endfor %}
</ul>
{% endif %}
</section>
{% endif %}
{% endblock %}