Initial commit
This commit is contained in:
32
templates/_socialhelpers.html
Normal file
32
templates/_socialhelpers.html
Normal file
@@ -0,0 +1,32 @@
|
||||
{% 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 %}
|
||||
Reference in New Issue
Block a user