mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-14 00:35:41 +00:00
Admin page Corpus List fix
This commit is contained in:
parent
a54ff2e35a
commit
8aeafc33bd
@ -52,10 +52,12 @@ def users():
|
||||
@register_breadcrumb(bp, '.users.entity', '', dynamic_list_constructor=user_dlc)
|
||||
def user(user_id):
|
||||
user = User.query.get_or_404(user_id)
|
||||
corpora = Corpus.query.filter(Corpus.user == user).all()
|
||||
return render_template(
|
||||
'admin/user.html.j2',
|
||||
title=user.username,
|
||||
user=user
|
||||
user=user,
|
||||
corpora=corpora
|
||||
)
|
||||
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
corpusList.add(
|
||||
[
|
||||
{% for corpus in corpora %}
|
||||
{{ corpus.to_json_serializeable(backrefs=True)|tojson }},
|
||||
{{ corpus.to_json_serializeable(backrefs=True,relationships=True)|tojson }},
|
||||
{% endfor %}
|
||||
]
|
||||
);
|
||||
|
@ -56,7 +56,7 @@
|
||||
<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 class="corpus-list no-autoinit" data-user-id="{{ user.hashid }}"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -107,6 +107,16 @@
|
||||
{% block scripts %}
|
||||
{{ super() }}
|
||||
<script>
|
||||
|
||||
let corpusList = new CorpusList(document.querySelector('.corpus-list'));
|
||||
corpusList.add(
|
||||
[
|
||||
{% for corpus in corpora %}
|
||||
{{ corpus.to_json_serializeable(backrefs=True, relationships=True)|tojson }},
|
||||
{% endfor %}
|
||||
]
|
||||
);
|
||||
|
||||
let userRoleChip = document.querySelector('#user-role-chip');
|
||||
let userRoleChipTooltip = M.Tooltip.init(
|
||||
userRoleChip,
|
||||
|
Loading…
Reference in New Issue
Block a user