mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-25 19:04:18 +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)
|
@register_breadcrumb(bp, '.users.entity', '', dynamic_list_constructor=user_dlc)
|
||||||
def user(user_id):
|
def user(user_id):
|
||||||
user = User.query.get_or_404(user_id)
|
user = User.query.get_or_404(user_id)
|
||||||
|
corpora = Corpus.query.filter(Corpus.user == user).all()
|
||||||
return render_template(
|
return render_template(
|
||||||
'admin/user.html.j2',
|
'admin/user.html.j2',
|
||||||
title=user.username,
|
title=user.username,
|
||||||
user=user
|
user=user,
|
||||||
|
corpora=corpora
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
corpusList.add(
|
corpusList.add(
|
||||||
[
|
[
|
||||||
{% for corpus in corpora %}
|
{% for corpus in corpora %}
|
||||||
{{ corpus.to_json_serializeable(backrefs=True)|tojson }},
|
{{ corpus.to_json_serializeable(backrefs=True,relationships=True)|tojson }},
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
<div class="col s12" id="user-corpora">
|
<div class="col s12" id="user-corpora">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-content">
|
<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>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -107,6 +107,16 @@
|
|||||||
{% block scripts %}
|
{% block scripts %}
|
||||||
{{ super() }}
|
{{ super() }}
|
||||||
<script>
|
<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 userRoleChip = document.querySelector('#user-role-chip');
|
||||||
let userRoleChipTooltip = M.Tooltip.init(
|
let userRoleChipTooltip = M.Tooltip.init(
|
||||||
userRoleChip,
|
userRoleChip,
|
||||||
|
Loading…
Reference in New Issue
Block a user