This repository has been archived by the owner on Nov 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
templates: overwrite some templates from socialaccount
- Loading branch information
Showing
2 changed files
with
71 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{% extends "a4_candy_account/account_dashboard.html" %} | ||
|
||
{% load i18n widget_tweaks %} | ||
|
||
{% block title %}{% trans "Social Connections" %}{% endblock %} | ||
|
||
{% block dashboard_content %} | ||
<div> | ||
<h1 class="u-first-heading">{% trans "Social Connections" %}</h1> | ||
{% if form.accounts %} | ||
<p>{% blocktrans %}You can sign in to your account using any of the following third party | ||
accounts:{% endblocktrans %}</p> | ||
<form method="post" action="{% url 'socialaccount_connections' %}"> | ||
{% csrf_token %} | ||
<div class="form-group"> | ||
{% if form.non_field_errors %} | ||
<div id="errorMsg">{{ form.non_field_errors }}</div> | ||
{% endif %} | ||
{% for base_account in form.accounts %} | ||
{% with base_account.get_provider_account as account %} | ||
<div class="form-check"> | ||
<label for="id_account_{{ base_account.id }}" class="form-check-label"> | ||
<input id="id_account_{{ base_account.id }}" type="radio" name="account" | ||
class="form-check-input" value="{{ base_account.id }}"/> | ||
<span class="{{ base_account.provider }} {{ account.get_brand.id }}">{{ account.get_brand.name }}</span>: | ||
{{ account }} | ||
</label> | ||
</div> | ||
{% endwith %} | ||
{% endfor %} | ||
<div class="u-spacer-bottom"> | ||
<button class="btn btn--danger" type="submit">{% trans 'Remove' %}</button> | ||
</div> | ||
</div> | ||
</form> | ||
|
||
</div> | ||
{% else %} | ||
<p>{% trans 'You currently have no social network accounts connected to this account.' %}</p> | ||
{% endif %} | ||
<h4>{% trans 'Add a 3rd Party Account' %}</h4> | ||
<ul class="socialaccount_providers"> | ||
{% include "socialaccount/snippets/provider_list.html" with process="connect" %} | ||
</ul> | ||
|
||
{% endblock %} |
25 changes: 25 additions & 0 deletions
25
liqd_product/templates/socialaccount/snippets/provider_list.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{% load socialaccount i18n %} | ||
|
||
{% get_providers as socialaccount_providers %} | ||
|
||
{% if socialaccount_providers %} | ||
<ul class="list-group"> | ||
{% for provider in socialaccount_providers %} | ||
{% if provider.id == "openid" %} | ||
{% for brand in provider.get_brands %} | ||
<li class="list-group-item border-0 pl-0"> | ||
<a title="{{ brand.name }}" | ||
class="socialaccount-provider {{ provider.id }} {{ brand.id }}" | ||
href="{% provider_login_url provider.id openid=brand.openid_url process=process %}" | ||
>{{ brand.name }}</a> | ||
</li> | ||
{% endfor %} | ||
{% endif %} | ||
<li class="list-group-item border-0 pl-0"> | ||
<a title="{% trans 'Login with ' %} {{ provider.name }}" | ||
class="socialaccount-provider btn btn-{{ provider.id }} btn-wide {{ provider.id }}" | ||
href="{% provider_login_url provider.id process=process scope=scope auth_params=auth_params %}">{% trans 'Login with ' %} {{ provider.id|capfirst }}</a> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
{% endif %} |