add templates for instance buttons

This commit is contained in:
codl 2019-03-15 17:59:44 +01:00
parent 8cf12f31c8
commit 8cca6c2fe3
No known key found for this signature in database
GPG Key ID: 6CD7C8891ED1233A
1 changed files with 31 additions and 1 deletions

View File

@ -34,7 +34,7 @@
</a>
</p>
<p>
<p id='mastodon_instance_buttons'>
{% for instance in mastodon_instances %}
<a style='background-color:#282c37' class='btn primary' href="{{ url_for('mastodon_login_step1', instance_url=instance) }}">
@ -59,5 +59,35 @@
</p>
</section>
<script type="application/json" id="top_instances">
[
{% for instance in mastodon_instances %}
"{{instance}}"
{%- if not loop.last -%}
,
{%- endif %}
{% endfor %}
]
</script>
<script type="text/html+template" id="instance_button_template">
<a style='background-color:#282c37' class='btn primary'
href="{{ url_for('mastodon_login_step1') }}/${encodeURIcomponent(instance)}">
${ !first? '' : `
{{picture(st, 'mastodon', (20,40,80), ('webp', 'png'))}}
Log in with
`}
${ instance }
</a>
</script>
<script type="text/html+template" id="another_instance_button_template">
<a class='btn secondary' href="{{ url_for('mastodon_login_step1') }}">
Another Mastodon instance
</a>
</script>
{% endif %}
{% endblock %}