33 lines
1.7 KiB
HTML
33 lines
1.7 KiB
HTML
{% macro social_register(provider_id, display_name) %}
|
|
<form action="{{ url_for('social.login', provider_id=provider_id) }}" method="POST">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
|
<button type="submit" class="btn btn-primary btn-large">Register with {{ display_name }}</button>
|
|
</form>
|
|
{% endmacro %}
|
|
|
|
{% macro social_login(provider_id, display_name) %}
|
|
<form action="{{ url_for('social.login', provider_id=provider_id) }}" method="POST">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
|
<button type="submit" class="btn btn-primary btn-large">Login with {{ display_name }}</button>
|
|
</form>
|
|
{% endmacro %}
|
|
|
|
{% macro show_provider_button(provider_id, display_name, conn, btn_type='primary') %}
|
|
{% if conn %}
|
|
{#
|
|
<form action="{{ url_for('social.remove_connection', provider_id=conn.provider_id, provider_user_id=conn.provider_user_id) }}?__METHOD_OVERRIDE__=DELETE" method="POST">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
|
<div class="btn-group" role="group" aria-label="...">
|
|
<button type="submit" class="btn btn-{{ btn_type }}">Disconnect {{ display_name }}</button>
|
|
</div>
|
|
</form>
|
|
#}
|
|
<button type="button" class="btn btn-default invite-friends">Invite {{ display_name }} friends <i class="glyphicon glyphicon-share-alt"></i></button>
|
|
{% else %}
|
|
<form action="{{ url_for('social.connect', provider_id=provider_id) }}" method="POST">
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
|
<button type="submit" class="btn btn-{{ btn_type }}">Connect {{ display_name }}</button>
|
|
</form>
|
|
{% endif %}
|
|
{% endmacro %}
|