mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-15 01:05:42 +00:00
169 lines
6.7 KiB
Django/Jinja
169 lines
6.7 KiB
Django/Jinja
{% extends "nopaque.html.j2" %}
|
|
|
|
{% block page_content %}
|
|
<div class="col s12 m4">
|
|
<h3 id="title">{{ user.username }}</h3>
|
|
<p id="description">Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren,</p>
|
|
<a class="waves-effect waves-light btn" href="{{ url_for('admin.index') }}"><i class="material-icons left">arrow_back</i>Back to admin board</a>
|
|
</div>
|
|
|
|
<div class="col s12 m8">
|
|
<div class="card">
|
|
<div class="card-content">
|
|
<span class="card-title">User information</span>
|
|
<ul>
|
|
<li>Username: {{ user.username }}</li>
|
|
<li>Email: {{ user.email }}</li>
|
|
<li>ID: {{ user.id }}</li>
|
|
<li>Member since: {{ user.member_since.strftime('%m/%d/%Y, %H:%M:%S %p') }}</li>
|
|
<li>Confirmed status: {{ user.confirmed }}</li>
|
|
<li>Last seen: {{ user.last_seen.strftime('%m/%d/%Y, %H:%M:%S %p') }}</li>
|
|
<li>Role ID: {{ user.role_id }}</li>
|
|
<li>Permissions as Int: {{ user.role.permissions }}</li>
|
|
<li>Role name: {{ user.role.name }}</li>
|
|
</ul>
|
|
</div>
|
|
<div class="card-action right-align">
|
|
<a href="{{ url_for('admin.edit_user', user_id=user.id) }}" class="waves-effect waves-light btn"><i class="material-icons left">edit</i>Edit</a>
|
|
<a data-target="delete-user-modal" class="waves-effect waves-light btn red modal-trigger"><i class="material-icons left">delete</i>Delete</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col s12 l6">
|
|
<h3>Corpora</h3>
|
|
<div class="card">
|
|
<div class="card-content" id="corpora">
|
|
<div class="input-field">
|
|
<i class="material-icons prefix">search</i>
|
|
<input id="search-corpus" class="search" type="search"></input>
|
|
<label for="search-corpus">Search corpus</label>
|
|
</div>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th></th>
|
|
<th>
|
|
<span class="sort" data-sort="title">Title</span>
|
|
<span class="sort" data-sort="description">Description</span>
|
|
</th>
|
|
<th><span class="sort" data-sort="status">Status</span></th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="list"></tbody>
|
|
</table>
|
|
<ul class="pagination"></ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col s12 l6">
|
|
<h3>Jobs</h3>
|
|
<div class="card">
|
|
<div class="card-content" id="jobs">
|
|
<div class="input-field">
|
|
<i class="material-icons prefix">search</i>
|
|
<input id="search-job" class="search" type="search"></input>
|
|
<label for="search-job">Search job</label>
|
|
</div>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th><span class="sort" data-sort="service">Service</span></th>
|
|
<th>
|
|
<span class="sort" data-sort="title">Title</span>
|
|
<span class="sort" data-sort="description">Description</span>
|
|
</th>
|
|
<th><span class="sort" data-sort="status">Status</span></th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="list"></tbody>
|
|
</table>
|
|
<ul class="pagination"></ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- Modals -->
|
|
<div id="delete-corpus-modal" class="modal">
|
|
<div class="modal-content">
|
|
<h4>Confirm corpus deletion</h4>
|
|
<p>Do you really want to delete the corpus <b id="selected-corpus-title"></b>? All files will be permanently deleted!</p>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<a href="#!" class="btn modal-close waves-effect waves-light">Cancel</a>
|
|
<a class="btn modal-close red waves-effect waves-light" id="selected-corpus-delete-link"><i class="material-icons left">delete</i>Delete</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="delete-job-modal" class="modal">
|
|
<div class="modal-content">
|
|
<h4>Confirm job deletion</h4>
|
|
<p>Do you really want to delete the job <b id="selected-job-title"></b>? All files will be permanently deleted!</p>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<a href="#!" class="btn modal-close waves-effect waves-light">Cancel</a>
|
|
<a class="btn modal-close red waves-effect waves-light" id="selected-job-delete-link"><i class="material-icons left">delete</i>Delete</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="delete-user-modal" class="modal">
|
|
<div class="modal-content">
|
|
<h4>Confirm user deletion</h4>
|
|
<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="modal-close waves-effect waves-light btn">Cancel</a>
|
|
<a href="{{ url_for('admin.delete_user', user_id=user.id) }}" class="modal-close waves-effect waves-light btn red"><i class="material-icons left">delete</i>Delete</a>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<script>
|
|
var corpusList = new RessourceList("corpora", nopaque.foreignCorporaSubscribers, "Corpus");
|
|
var jobList = new RessourceList("jobs", nopaque.foreignJobsSubscribers, "Job");
|
|
var deleteCorpusModalElement = document.getElementById("delete-corpus-modal");
|
|
var deleteCorpusModal;
|
|
var deleteJobModalElement = document.getElementById("delete-job-modal");
|
|
var deleteJobModal;
|
|
var selectedCorpusDeleteLinkElement = document.getElementById("selected-corpus-delete-link");
|
|
var selectedCorpusTitleElement = document.getElementById("selected-corpus-title");
|
|
var selectedJobDeleteLinkElement = document.getElementById("selected-job-delete-link");
|
|
var selectedJobTitleElement = document.getElementById("selected-job-title");
|
|
function prepareDeleteCorpusModal(selectedCorpusId) {
|
|
var selectedCorpus;
|
|
if (selectedCorpusId in nopaque.foreignUser.corpora) {
|
|
selectedCorpus = nopaque.foreignUser.corpora[selectedCorpusId];
|
|
selectedCorpusDeleteLinkElement.href = `/corpora/${selectedCorpus.id}/delete`;
|
|
selectedCorpusTitleElement.innerText = selectedCorpus.title;
|
|
} else {
|
|
selectedQueryResult = undefined;
|
|
selectedCorpusDeleteLinkElement.href = "";
|
|
selectedCorpusTitleElement.innerText = "";
|
|
}
|
|
deleteCorpusModal.open();
|
|
}
|
|
function prepareDeleteJobModal(selectedJobId) {
|
|
var selectedJob;
|
|
if (selectedJobId in nopaque.foreignUser.jobs) {
|
|
selectedJob = nopaque.foreignUser.jobs[selectedJobId];
|
|
selectedJobDeleteLinkElement.href = `/jobs/${selectedJob.id}/delete`;
|
|
selectedJobTitleElement.innerText = selectedJob.title;
|
|
} else {
|
|
selectedJob = undefined;
|
|
selectedJobDeleteLinkElement.href = "";
|
|
selectedJobTitleElement.innerText = "";
|
|
}
|
|
deleteJobModal.open();
|
|
}
|
|
document.addEventListener("DOMContentLoaded", () => {
|
|
nopaque.socket.emit("foreign_user_data_stream_init", {{ user.id }});
|
|
deleteCorpusModal = M.Modal.init(deleteCorpusModalElement);
|
|
deleteJobModal = M.Modal.init(deleteJobModalElement);
|
|
});
|
|
</script>
|
|
{% endblock %}
|