Corpus List update

This commit is contained in:
Inga Kirschnick
2023-06-06 15:39:47 +02:00
parent 59950aba5b
commit 4c277cd685
9 changed files with 142 additions and 51 deletions

View File

@ -48,7 +48,8 @@
'js/ResourceLists/TesseractOCRPipelineModelList.js',
'js/ResourceLists/UserList.js',
'js/ResourceLists/AdminUserList.js',
'js/ResourceLists/CorpusFollowerList.js'
'js/ResourceLists/CorpusFollowerList.js',
'js/ResourceLists/DetailledPublicCorpusList.js'
%}
<script src="{{ ASSET_URL }}"></script>
{%- endassets %}

View File

@ -270,7 +270,7 @@ publicCorpusFollowerList.add(
{% endif %}
// #region Build Corpus Request
{% if cfr.has_permission('MANAGE_CORPUS') %}
{% if cfr.has_permission('MANAGE_FILES') %}
let followerBuildRequest = document.querySelector('#follower-build-request');
followerBuildRequest.addEventListener('click', () => {
Requests.corpora.entity.build({{ corpus.hashid|tojson }})

View File

@ -143,7 +143,7 @@
corpusList.add(
[
{% for corpus in corpora %}
{{ corpus.to_json_serializeable(backrefs=True)|tojson }},
{{ corpus.to_json_serializeable(backrefs=True, relationships=True)|tojson }},
{% endfor %}
]
);

View File

@ -70,11 +70,11 @@
{% endfor %}
]
);
let publicCorpusList = new PublicCorpusList(document.querySelector('.public-corpus-list'));
let publicCorpusList = new DetailledPublicCorpusList(document.querySelector('.public-corpus-list'));
publicCorpusList.add(
[
{% for corpus in corpora %}
{{ corpus.to_json_serializeable(backrefs=True)|tojson }},
{{ corpus.to_json_serializeable(backrefs=True, relationships=True)|tojson }},
{% endfor %}
]
);

View File

@ -127,7 +127,7 @@ followedCorpusList.add(
[
{% for corpus in user.followed_corpora %}
{% if (corpus.is_public or corpus.user == current_user or user == current_user or current_user.is_following_corpus(corpus)) %}
{{ corpus.to_json_serializeable(backrefs=True)|tojson }},
{{ corpus.to_json_serializeable(backrefs=True, relationships=True)|tojson }},
{% endif %}
{% endfor %}
]
@ -137,7 +137,7 @@ publicCorpusList.add(
[
{% for corpus in user.corpora %}
{% if corpus.is_public %}
{{ corpus.to_json_serializeable(backrefs=True)|tojson }},
{{ corpus.to_json_serializeable(backrefs=True, relationships=True)|tojson }},
{% endif %}
{% endfor %}
]