nicer, more compact mastodon login buttons
This commit is contained in:
parent
fac2a0e9b3
commit
5b047e4b94
|
@ -229,5 +229,6 @@ a.btn:hover {
|
|||
}
|
||||
|
||||
.btn-content {
|
||||
margin: 0 .5em 0 .1em;
|
||||
margin: 0 .5em;
|
||||
line-height: 2em;
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue