mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 01:05:42 +00:00
124 lines
4.2 KiB
Django/Jinja
124 lines
4.2 KiB
Django/Jinja
{% extends "base.html.j2" %}
|
|
|
|
{% block page_content %}
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="col s12 l2">
|
|
<p> </p>
|
|
<img src="{{ url_for('users.user_avatar', user_id=user.id) }}" alt="user-image" class="circle responsive-img">
|
|
</div>
|
|
<div class="col s12 l10">
|
|
<h1 id="title">{{ title }}</h1>
|
|
<span class="chip hoverable tooltipped no-autoinit" id="user-role-chip">{{ user.role.name }}</span>
|
|
<span class="chip white-text" id="user-confirmed-chip" style="background-color: {{ '#4caf50' if user.confirmed else '#f44336' }};">{{ 'confirmed' if user.confirmed else 'unconfirmed' }}</span>
|
|
<p id="description">{{ user.about_me }}</p>
|
|
</div>
|
|
|
|
<div class="col s12"> </div>
|
|
|
|
<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>
|
|
</div>
|
|
|
|
<div class="col s12" id="user-info">
|
|
<div class="card">
|
|
<div class="card-content">
|
|
<ul>
|
|
<li>Username: {{ user.username }}</li>
|
|
<li>Email: {{ user.email }}</li>
|
|
<li>Id: {{ user.id }}</li>
|
|
<li>Hashid: {{ user.hashid }}</li>
|
|
<li>Member since: {{ user.member_since }}</li>
|
|
<li>Last seen: {{ user.last_seen }}</li>
|
|
</ul>
|
|
</div>
|
|
<div class="card-action right-align">
|
|
<a class="btn waves-effect waves-light" href="{{ url_for('.edit_user', user_id=user.id) }}"><i class="material-icons left">edit</i>Edit</a>
|
|
<a class="btn red modal-trigger waves-effect waves-light" data-target="delete-user-modal"><i class="material-icons left">delete</i>Delete</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col s12" id="user-corpora">
|
|
<div class="card">
|
|
<div class="card-content">
|
|
<div class="corpus-list" data-user-id="{{ user.hashid }}"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col s12" id="user-jobs">
|
|
<div class="card">
|
|
<div class="card-content">
|
|
<div class="job-list" data-user-id="{{ user.hashid }}"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col s12" id="user-spacy-nlp-pipeline-models">
|
|
<div class="card">
|
|
<div class="card-content">
|
|
<div class="spacy-nlp-pipeline-model-list" data-user-id="{{ user.hashid }}"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col s12" id="user-tesseract-ocr-pipeline-models">
|
|
<div class="card">
|
|
<div class="card-content">
|
|
<div class="tesseract-ocr-pipeline-model-list" data-user-id="{{ user.hashid }}"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock page_content %}
|
|
|
|
|
|
{% block modals %}
|
|
{{ super() }}
|
|
<div id="delete-user-modal" class="modal">
|
|
<div class="modal-content">
|
|
<h3>Delete user</h3>
|
|
<p>Do you really want to delete the user {{ user.username }}? All associated data will be permanently deleted!</p>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<a href="#!" class="btn modal-close waves-effect waves-light">Cancel</a>
|
|
<a href="{{ url_for('.delete_user', user_id=user.id) }}" class="btn red modal-close waves-effect waves-light"><i class="material-icons left">delete</i>Delete</a>
|
|
</div>
|
|
</div>
|
|
{% endblock modals %}
|
|
|
|
|
|
{% 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 %}
|