nicer, more compact mastodon login buttons

This commit is contained in:
codl 2017-08-23 23:32:21 +02:00
parent fac2a0e9b3
commit 5b047e4b94
No known key found for this signature in database
GPG Key ID: 6CD7C8891ED1233A
3 changed files with 18 additions and 15 deletions

View File

@ -229,5 +229,6 @@ a.btn:hover {
}
.btn-content {
margin: 0 .5em 0 .1em;
margin: 0 .5em;
line-height: 2em;
}

View File

@ -60,7 +60,7 @@ def index():
settings_error = 'settings_error' in request.args
)
else:
instances = MastodonInstance.query.filter(MastodonInstance.popularity > 1).order_by(db.desc(MastodonInstance.popularity)).limit(3)
instances = MastodonInstance.query.filter(MastodonInstance.popularity > 5).order_by(db.desc(MastodonInstance.popularity)).limit(5)
return render_template('index.html',
mastodon_instances = instances,
twitter_login_error = 'twitter_login_error' in request.args)
@ -219,7 +219,7 @@ def api_viewer_timers():
@app.route('/login/mastodon', methods=('GET', 'POST'))
def mastodon_login_step1(instance=None):
instances = MastodonInstance.query.filter(MastodonInstance.popularity > 1).order_by(db.desc(MastodonInstance.popularity)).limit(16)
instances = MastodonInstance.query.filter(MastodonInstance.popularity > 5).order_by(db.desc(MastodonInstance.popularity)).limit(16)
instance_url = request.args.get('instance_url', None) or request.form.get('instance_url', None)

View File

@ -30,28 +30,30 @@
<p>
<a style='background-color:#1da1f2' class='btn' href="/login/twitter">
<span class='btn-header'>
<img src='{{ st('twitter.png') }}'></span>
<span class='btn-content'>Log in with Twitter</span>
<img src='{{ st('twitter.png') }}'>
</span><span class='btn-content'>Log in with Twitter</span>
</a>
</p>
{% for instance in mastodon_instances %}
<p>
{% for instance in mastodon_instances %}
<a style='background-color:#282c37' class='btn' href="{{ url_for('mastodon_login_step1', instance_url=instance.instance) }}">
{% if loop.first %}
<span class='btn-header'>
<img src='{{ st('mastodon.png') }}'></span>
<span class='btn-content'>Log in with {{instance.instance}}</span>
<img src='{{ st('mastodon.png') }}'>
</span><span class='btn-content'>Log in with
{% else %}
<span class='btn-content'>
{% endif %}
{{instance.instance}}</span>
</a>
</p>
{% endfor %}
<p>
<a style='background-color:#282c37' class='btn' href="{{ url_for('mastodon_login_step1') }}">
<span class='btn-header'>
<img src='{{ st('mastodon.png') }}'></span>
<span class='btn-content'>Log in with another Mastodon instance</span>
<a style='background-color:#ddd; color:inherit;' class='btn' href="{{ url_for('mastodon_login_step1') }}">
<span class='btn-content'>Another Mastodon instance</span>
</a>
</p>
</section>