add working oauth and ldap client
This commit is contained in:
@ -0,0 +1,6 @@
|
||||
{% load supervisr_oauth_client %}
|
||||
|
||||
{% any_provider as enabled %}
|
||||
{% if enabled %}
|
||||
<div class="btn-group btn-primary btn-block">
|
||||
{% endif %}
|
||||
@ -0,0 +1,6 @@
|
||||
{% load supervisr_oauth_client %}
|
||||
|
||||
{% provider_exists 'facebook' as facebook_enabled %}
|
||||
{% if facebook_enabled %}
|
||||
<a href="{% url 'supervisr_mod_auth_oauth_client:oauth-client-login' provider='facebook' %}" class="btn" style="background-color:#4267b2;color:white;margin-top:10px;width:100%;"><i class="fa fa-facebook-official" aria-hidden="true"></i></a>
|
||||
{% endif %}
|
||||
@ -0,0 +1,6 @@
|
||||
{% load supervisr_oauth_client %}
|
||||
|
||||
{% provider_exists 'twitter' as twitter_enabled %}
|
||||
{% if twitter_enabled %}
|
||||
<a href="{% url 'supervisr_mod_auth_oauth_client:oauth-client-login' provider='twitter' %}" class="btn" style="background-color:#55ACEE;color:white;margin-top:10px;width:100%;"><i class="fa fa-twitter" aria-hidden="true"></i></a>
|
||||
{% endif %}
|
||||
@ -0,0 +1,7 @@
|
||||
{% load supervisr_oauth_client %}
|
||||
{% load static %}
|
||||
|
||||
{% provider_exists 'google' as google_enabled %}
|
||||
{% if google_enabled %}
|
||||
<a href="{% url 'supervisr_mod_auth_oauth_client:oauth-client-login' provider='google' %}" class="btn" style="background-color:white;color:black;margin-top:10px;width:100%;"><img src="{% static 'img/google.svg' %}" style="height:12px"></a>
|
||||
{% endif %}
|
||||
@ -0,0 +1,6 @@
|
||||
{% load supervisr_oauth_client %}
|
||||
|
||||
{% provider_exists 'github' as github_enabled %}
|
||||
{% if github_enabled %}
|
||||
<a href="{% url 'supervisr_mod_auth_oauth_client:oauth-client-login' provider='github' %}" class="btn" style="background-color:#444444;color:white;margin-top:10px;width:100%;"><i class="fa fa-github" aria-hidden="true"></i></a>
|
||||
{% endif %}
|
||||
@ -0,0 +1,7 @@
|
||||
{% load supervisr_oauth_client %}
|
||||
{% load static %}
|
||||
|
||||
{% provider_exists 'discord' as discord_enabled %}
|
||||
{% if discord_enabled %}
|
||||
<a href="{% url 'supervisr_mod_auth_oauth_client:oauth-client-login' provider='discord' %}" class="btn" style="background-color:#2C2F33;color:white;margin-top:10px;width:100%;"><img src="{% static 'img/discord.svg' %}" style="height:12px"></a>
|
||||
{% endif %}
|
||||
@ -0,0 +1,7 @@
|
||||
{% load supervisr_oauth_client %}
|
||||
{% load static %}
|
||||
|
||||
{% provider_exists 'reddit' as reddit_enabled %}
|
||||
{% if reddit_enabled %}
|
||||
<a href="{% url 'supervisr_mod_auth_oauth_client:oauth-client-login' provider='reddit' %}" class="btn" style="background-color:#ff4500;color:white;margin-top:10px;width:100%;"><img src="{% static 'img/reddit.svg' %}" style="height:20px;margin-top:-5px;"></a>
|
||||
{% endif %}
|
||||
@ -0,0 +1,6 @@
|
||||
{% load supervisr_oauth_client %}
|
||||
|
||||
{% any_provider as enabled %}
|
||||
{% if enabled %}
|
||||
</div>
|
||||
{% endif %}
|
||||
@ -0,0 +1,54 @@
|
||||
{% extends "user/base.html" %}
|
||||
|
||||
{% load supervisr_utils %}
|
||||
{% load i18n %}
|
||||
|
||||
{% block title %}
|
||||
{% title "Overview" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h1><clr-icon shape="connect" size="48"></clr-icon>{% trans "OAuth2" %}</h1>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
{% trans "Connected Accounts" %}
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
{% if provider_state %}
|
||||
<table class="table">
|
||||
<thead>
|
||||
<th>
|
||||
<th>{% trans 'Provider' %}</th>
|
||||
<th>{% trans 'Status' %}</th>
|
||||
<th>{% trans 'Action' %}</th>
|
||||
<th>{% trans 'ID' %}</th>
|
||||
</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for data in provider_state %}
|
||||
<tr>
|
||||
<td></td>
|
||||
<td>{% trans data.provider.ui_name %}</td>
|
||||
<td>{{ data.state|yesno:"Connected,Not Connected" }}</td>
|
||||
<td>
|
||||
{% if data.state == False %}
|
||||
<a href="{% url 'supervisr_mod_auth_oauth_client:oauth-client-login' provider=data.provider.name %}">Connect</a>
|
||||
{% else %}
|
||||
<a href="{% url 'supervisr_mod_auth_oauth_client:oauth-client-disconnect' provider=data.provider.name %}">Disconnect</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{ data.aas.first.identifier }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<p>{% trans "No Providers configured!" %}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user