Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: by clicking on my name, you have a dropdown #93

Merged
merged 14 commits into from
Nov 20, 2023
Merged
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends "base.html" %}
{% load static %}
{% block tab_active %} active{% endblock %}
{% block centered_container %}
{% block container %}
<section id="head-section">
<div class="container">
<div class="row">
Expand Down
32 changes: 25 additions & 7 deletions example_sp/djangosaml2_sp/saml2_sp/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,37 @@
{% if not user.is_authenticated %}
<a class="btn btn-primary btn-icon btn-full" href="{{LOGIN_URL}}" title="Accedi all'area personale" aria-label="Accedi all'area personale" data-focus-mouse="false">
{% else %}
<a class="btn btn-primary btn-icon btn-full" href="{{LOGIN_REDIRECT_URL}}" title="{{user.first_name}}" aria-label="{{user.first_name}}" data-focus-mouse="false">
{% endif %}
<div class="dropdown text-center">
<!--<button class="btn btn-primary btn-icon btn-full" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">-->
<a class="btn btn-primary btn-icon btn-full" data-bs-toggle="dropdown" data-focus-mouse="false">
<span class="rounded-icon">
<svg class="icon icon-primary">
<use xlink:href="{% static 'svg/sprites.svg#it-user' %}"></use>
</svg>
</span>
<span class="d-none d-lg-block">{{user.first_name}}</span>
</a>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<div class="link-list-wrapper">
<ul class="link-list">
<li><a class="dropdown-item list-item" href="{{LOGIN_REDIRECT_URL}}"><span>Profilo Utente</span></a></li>
<li><a class="dropdown-item list-item" href="{{LOGOUT_URL}}"><span>Logout</span></a></li>
</ul>
</div>
</div>
</div>
<!--<a class="btn btn-primary btn-icon btn-full" href="{{LOGIN_REDIRECT_URL}}" title="{{user.first_name}}" aria-label="{{user.first_name}}" data-focus-mouse="false">
-->{% endif %}

{% if not user.is_authenticated %}
<span class="rounded-icon">
<svg class="icon icon-primary">
<use xlink:href="{% static 'svg/sprites.svg#it-user' %}"></use>
</svg>
</span>
{% if not user.is_authenticated %}
<span class="d-none d-lg-block">Accedi all'area personale</span>
{% else %}
<span class="d-none d-lg-block">{{user.first_name}}</span>
</a>
{% endif %}
</a>
</div>
{% endblock header_slim_buttons %}

Expand All @@ -52,7 +70,7 @@

{% endblock menu_links %}

{% block centered_container %}
{% block container %}
<section id="head-section">
<div class="container">
<div class="row">
Expand Down
40 changes: 22 additions & 18 deletions example_sp/djangosaml2_sp/saml2_sp/templates/echo_attributes.html
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
{% extends "base.html" %}
{% load i18n %}
{% load static %}
{% block container %}

{% block centered_container %}
<section id="area-riservata">
<div class="nav-tabs-hidescroll mt-4 mt-md-5">
<div class="tab-content">
<div id="profile" class="tab-pane fade show active">
<h5 class="text-center mb-4">Profilo Utente</h5>
<ul class="list-group">
<li class="list-group-item"><strong>Username:</strong> {{ user.username }}</li>
<li class="list-group-item"><strong>Email:</strong> {{ user.email }}</li>
<li class="list-group-item"><strong>Nome:</strong> {{ user.first_name }}</li>
<li class="list-group-item"><strong>Cognome:</strong> {{ user.last_name }}</li>
<li class="list-group-item"><strong>Attivo:</strong> {% if user.is_active %}Sì{% else %}No{% endif %}</li>
<li class="list-group-item"><strong>Matricola:</strong> {% if user.matricola %}{{ user.matricola }}{% else %}N/A{% endif %}</li>
<li class="list-group-item"><strong>Codice Fiscale:</strong> {% if user.codice_fiscale %}{{ user.codice_fiscale }}{% else %}N/A{% endif %}</li>
<li class="list-group-item"><strong>Genere:</strong> {% if user.gender %}{{ user.gender }}{% else %}N/A{% endif %}</li>
<li class="list-group-item"><strong>Data di Nascita:</strong> {% if user.birth_date %}{{ user.birth_date }}{% else %}N/A{% endif %}</li>
<li class="list-group-item"><strong>Luogo di Nascita:</strong> {% if user.place_of_birth %}{{ user.place_of_birth }}{% else %}N/A{% endif %}</li>
</ul>
</div>
<div class="container">
<div class="row">
<div class="nav-tabs-hidescroll mt-4 mt-md-5">
<div class="tab-content">
<div id="profile" class="tab-pane fade show active">
<h5 class="text-center mb-4">Profilo Utente</h5>
<ul class="list-group">
<li class="list-group-item"><strong>Username:</strong> {{ user.username }}</li>
<li class="list-group-item"><strong>Email:</strong> {{ user.email }}</li>
<li class="list-group-item"><strong>Nome:</strong> {{ user.first_name }}</li>
<li class="list-group-item"><strong>Cognome:</strong> {{ user.last_name }}</li>
<li class="list-group-item"><strong>Attivo:</strong> {% if user.is_active %}Sì{% else %}No{% endif %}</li>
<li class="list-group-item"><strong>Matricola:</strong> {% if user.matricola %}{{ user.matricola }}{% else %}N/A{% endif %}</li>
<li class="list-group-item"><strong>Codice Fiscale:</strong> {% if user.codice_fiscale %}{{ user.codice_fiscale }}{% else %}N/A{% endif %}</li>
<li class="list-group-item"><strong>Genere:</strong> {% if user.gender %}{{ user.gender }}{% else %}N/A{% endif %}</li>
<li class="list-group-item"><strong>Data di Nascita:</strong> {% if user.birth_date %}{{ user.birth_date }}{% else %}N/A{% endif %}</li>
<li class="list-group-item"><strong>Luogo di Nascita:</strong> {% if user.place_of_birth %}{{ user.place_of_birth }}{% else %}N/A{% endif %}</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
Expand Down
Loading