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(user-info): display all db fields #204

Merged
merged 2 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ class TRoles(GenericRepository):
pass5 = db.Column("pass", db.Unicode)
pass_plus = db.Column(db.Unicode)
champs_addi = db.Column(JSONB)
date_insert = db.Column(db.DateTime, default=db.func.now(), nullable=False)
date_update = db.Column(
db.DateTime, default=db.func.now(), nullable=False, onupdate=db.func.now()
)

# Add synonym for column pass
# Hack because pass is an python reserved word
Expand Down
23 changes: 23 additions & 0 deletions app/templates/info_user.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
{%set is_remarques = user['remarques'] is not none and user['remarques'] != '' %}
{%set is_champs_addi = user['champs_addi']['organisme'] is not none
and user['champs_addi']['organisme'] != '' %}
{%set is_date_insert = user['date_insert'] is not none and user['date_insert'] != '' %}
{%set is_date_update = user['date_update'] is not none and user['date_update'] != '' %}
{%set is_mail = user['email'] is not none and user['email'] != '' %}
{%set is_group = groups|length > 0 %}
{%set is_list = lists|length > 0 %}
Expand Down Expand Up @@ -36,6 +38,27 @@ <h3>Utilisateur "{{fullname}}"</h3>
{% if is_remarques %}
<br /><strong>Remarques :</strong> {{user['remarques']}}
{% endif %}
{% if user['pass_plus'] == "" or user["pass_plus"] is none %}
<br /><strong>Mot de passe Plus :</strong> Non
{%else %}
<br /><strong>Mot de passe Plus :</strong> Oui
{% endif %}
{% if user['pass_md5'] == "" or user["pass_md5"] is none %}
<br /><strong>Mot de passe Md5 :</strong> Non
{%else %}
<br /><strong>Mot de passe Md5 :</strong> Oui
{% endif %}
{% if user['active'] == True %}
<br /><strong>Compte Actif :</strong> Oui
{%else %}
<br /><strong>Compte Actif :</strong> Non
{% endif %}
{% if is_date_insert %}
<br /><strong class="text-muted">Date de création :</strong> {{user['date_insert']|truncate(10, True, '', 0)}}
{% endif %}
{% if is_date_update %}
<br /><strong class="text-muted">Date de mise à jour :</strong> {{user['date_update']|truncate(10, True, '', 0)}}
{% endif %}
</small>
</div>

Expand Down
Loading