Link keycloak on profile page
This commit is contained in:
parent
c28fa71b9d
commit
b11c7ecc21
2 changed files with 73 additions and 30 deletions
|
@ -1,5 +1,5 @@
|
||||||
{% extends "frontend/base.html" %}
|
{% extends "frontend/base.html" %}
|
||||||
{% load i18n %}
|
{% load i18n static %}
|
||||||
{% block html_title %}
|
{% block html_title %}
|
||||||
{% block page_title %}
|
{% block page_title %}
|
||||||
{% translate "Profile" %}
|
{% translate "Profile" %}
|
||||||
|
@ -10,12 +10,16 @@
|
||||||
<h4 class="card-title">{% translate "Account" %}</h4>
|
<h4 class="card-title">{% translate "Account" %}</h4>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block card_content %}
|
{% block content %}
|
||||||
<p>
|
<section>
|
||||||
{% blocktranslate trimmed %}
|
<div class="row match-height">
|
||||||
You are logged in with your VSHN user account. You will be able to change your password and other settings here in the future.
|
<div class="col-md-6 col-12">
|
||||||
{% endblocktranslate %}
|
<div class="card">
|
||||||
</p>
|
<div class="card-header">
|
||||||
|
<h4 class="card-title">{% translate "Profile" %}</h4>
|
||||||
|
</div>
|
||||||
|
<div class="card-content">
|
||||||
|
<div class="card-body">
|
||||||
<div class="table-responsive">
|
<div class="table-responsive">
|
||||||
<table class="table table-lg">
|
<table class="table table-lg">
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -38,4 +42,31 @@
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
{% endblock card_content %}
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6 col-12">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-header">
|
||||||
|
<h4 class="card-title">{% translate "Account" %}</h4>
|
||||||
|
</div>
|
||||||
|
<div class="card-content">
|
||||||
|
<div class="card-body">
|
||||||
|
<p>
|
||||||
|
{% blocktranslate trimmed %}
|
||||||
|
You are logged in with your VSHN user account. Change your password and other account data here:
|
||||||
|
{% endblocktranslate %}
|
||||||
|
</p>
|
||||||
|
<a href="{{ account_href }}"
|
||||||
|
class="btn btn-warning btn-lg icon icon-left">
|
||||||
|
<img src="{% static 'img/keycloak.svg' %}" style="height: 30px">
|
||||||
|
<span class="mx-1">{% translate "VSHN Account" %}</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
{% endblock content %}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
from django.conf import settings
|
||||||
from django.views.generic import TemplateView
|
from django.views.generic import TemplateView
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,3 +8,14 @@ class IndexView(TemplateView):
|
||||||
|
|
||||||
class ProfileView(TemplateView):
|
class ProfileView(TemplateView):
|
||||||
template_name = "frontend/profile.html"
|
template_name = "frontend/profile.html"
|
||||||
|
|
||||||
|
def get_context_data(self, **kwargs):
|
||||||
|
context = super().get_context_data(**kwargs)
|
||||||
|
keycloak_server_url = settings.SOCIALACCOUNT_PROVIDERS["openid_connect"][
|
||||||
|
"APPS"
|
||||||
|
][0]["settings"]["server_url"]
|
||||||
|
account_url = keycloak_server_url.replace(
|
||||||
|
"/.well-known/openid-configuration", "/account"
|
||||||
|
)
|
||||||
|
context["account_href"] = account_url
|
||||||
|
return context
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue