Skip to content
This repository has been archived by the owner on Nov 7, 2019. It is now read-only.

Commit

Permalink
templates: overwrite some templates from socialaccount
Browse files Browse the repository at this point in the history
  • Loading branch information
Magdalena Noffke authored and rmader committed Sep 26, 2019
1 parent a936361 commit 54dd0d1
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
46 changes: 46 additions & 0 deletions liqd_product/templates/socialaccount/connections.html
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 liqd_product/templates/socialaccount/snippets/provider_list.html
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 %}

0 comments on commit 54dd0d1

Please sign in to comment.