nopaque/app/templates/admin/user.html.j2

132 lines
4.4 KiB
Plaintext
Raw Permalink Normal View History

{% extends "base.html.j2" %}
2019-11-15 10:45:04 +00:00
{% block page_content %}
2020-10-23 08:17:14 +00:00
<div class="container">
<div class="row">
2023-03-21 09:50:29 +00:00
<div class="col s12 l2">
<p>&nbsp;</p>
2023-06-07 13:13:47 +00:00
{# <img src="{{ url_for('users.user_avatar', user_id=user.id) }}" alt="user-image" class="circle responsive-img"> #}
2023-03-21 09:50:29 +00:00
</div>
<div class="col s12 l10">
2020-10-23 08:26:36 +00:00
<h1 id="title">{{ title }}</h1>
2023-03-23 16:42:51 +00:00
<p>
<span class="chip hoverable tooltipped no-autoinit" id="user-role-chip">{{ user.role.name }}</span>
{% if user.confirmed %}
<span class="chip white-text" id="user-confirmed-chip" style="background-color: #4caf50;">confirmed</span>
{% else %}
<span class="chip white-text" id="user-confirmed-chip" style="background-color: #f44336;">unconfirmed</span>
{% endif %}
</p>
2023-04-11 09:46:33 +00:00
{% if user.about_me %}
<p>{{ user.about_me }}</p>
{% endif %}
2020-10-23 08:17:14 +00:00
</div>
2019-11-15 10:45:04 +00:00
2023-03-23 16:42:51 +00:00
<div class="col s12 hide-on-med-and-down">&nbsp;</div>
2023-03-21 09:50:29 +00:00
<div class="col s12">
<ul class="tabs tabs-fixed-width z-depth-1">
<li class="tab"><a href="#user-info">User info</a></li>
<li class="tab"><a href="#user-corpora">Corpora</a></li>
<li class="tab"><a href="#user-jobs">Jobs</a></li>
<li class="tab"><a href="#user-tesseract-ocr-pipeline-models">Tesseract OCR Pipeline Models</a></li>
<li class="tab"><a href="#user-spacy-nlp-pipeline-models">SpaCy NLP Pipeline Models</a></li>
</ul>
2019-11-15 10:45:04 +00:00
</div>
2020-10-23 08:17:14 +00:00
2023-03-21 09:50:29 +00:00
<div class="col s12" id="user-info">
2020-10-23 08:17:14 +00:00
<div class="card">
<div class="card-content">
<ul>
<li>Username: {{ user.username }}</li>
<li>Email: {{ user.email }}</li>
2021-11-30 15:22:16 +00:00
<li>Id: {{ user.id }}</li>
<li>Hashid: {{ user.hashid }}</li>
2023-03-23 16:42:51 +00:00
<li>Member since: {{ user.member_since.strftime('%Y-%m-%d') }}</li>
<li>Last seen: {% if user.last_seen %}{{ user.last_seen.strftime('%Y-%m-%d') }}</li>{% endif %}
2020-10-23 08:17:14 +00:00
</ul>
</div>
<div class="card-action right-align">
2023-03-27 08:22:43 +00:00
<a class="btn waves-effect waves-light" href="{{ url_for('.user_settings', user_id=user.id) }}"><i class="material-icons left">edit</i>Edit</a>
2023-03-21 09:50:29 +00:00
<a class="btn red modal-trigger waves-effect waves-light" data-target="delete-user-modal"><i class="material-icons left">delete</i>Delete</a>
2020-10-23 08:17:14 +00:00
</div>
</div>
2019-11-15 10:45:04 +00:00
</div>
2023-03-21 09:50:29 +00:00
<div class="col s12" id="user-corpora">
<div class="card">
<div class="card-content">
2023-06-07 11:49:07 +00:00
<div class="corpus-list" data-user-id="{{ user.hashid }}"></div>
</div>
2019-11-15 10:45:04 +00:00
</div>
</div>
2023-03-21 09:50:29 +00:00
<div class="col s12" id="user-jobs">
<div class="card">
<div class="card-content">
2022-09-02 11:07:30 +00:00
<div class="job-list" data-user-id="{{ user.hashid }}"></div>
</div>
2019-11-15 10:45:04 +00:00
</div>
</div>
2023-03-20 15:02:12 +00:00
2023-03-21 09:50:29 +00:00
<div class="col s12" id="user-spacy-nlp-pipeline-models">
2023-03-20 15:02:12 +00:00
<div class="card">
<div class="card-content">
<div class="spacy-nlp-pipeline-model-list" data-user-id="{{ user.hashid }}"></div>
</div>
</div>
</div>
2023-03-21 09:50:29 +00:00
<div class="col s12" id="user-tesseract-ocr-pipeline-models">
2023-03-20 15:02:12 +00:00
<div class="card">
<div class="card-content">
<div class="tesseract-ocr-pipeline-model-list" data-user-id="{{ user.hashid }}"></div>
</div>
</div>
</div>
2019-11-15 10:45:04 +00:00
</div>
</div>
2021-12-01 13:15:20 +00:00
{% endblock page_content %}
2019-11-15 10:45:04 +00:00
2021-12-01 13:15:20 +00:00
{% block modals %}
{{ super() }}
2019-11-15 10:45:04 +00:00
<div id="delete-user-modal" class="modal">
<div class="modal-content">
2020-10-23 08:17:14 +00:00
<h3>Delete user</h3>
2019-11-15 10:45:04 +00:00
<p>Do you really want to delete the user {{ user.username }}? All associated data will be permanently deleted!</p>
</div>
<div class="modal-footer">
2023-03-23 16:42:51 +00:00
<a class="btn modal-close waves-effect waves-light">Cancel</a>
2023-03-29 12:32:35 +00:00
<a class="btn red modal-close waves-effect waves-light"><i class="material-icons left">delete</i>Delete</a>
2019-11-15 10:45:04 +00:00
</div>
</div>
2021-12-01 13:15:20 +00:00
{% endblock modals %}
2023-03-21 09:50:29 +00:00
{% block scripts %}
{{ super() }}
<script>
let userRoleChip = document.querySelector('#user-role-chip');
let userRoleChipTooltip = M.Tooltip.init(
userRoleChip,
{
html: `
<p>Permissions</p>
<p class="left-align">
{% for permission in ['ADMINISTRATE', 'CONTRIBUTE', 'USE_API'] %}
<label>
<input class="filled-in" type="checkbox" {{ 'checked' if user.can(permission) }}>
<span>{{ permission|capitalize }}</span>
</label>
{% if not loop.last %}
<br>
{% endif %}
{% endfor %}
</p>
`.trim()
}
);
</script>
{% endblock scripts %}