Bug fixes

This commit is contained in:
Patrick Jentsch 2021-12-03 16:10:54 +01:00
parent 5b5d7a6601
commit b3f34648c4
2 changed files with 12 additions and 29 deletions

View File

@ -16,7 +16,7 @@ class CorpusDisplay extends RessourceDisplay {
this.setNumTokens(corpus.num_tokens);
}
patch(patch) {
usersPatchHandler(patch) {
let filteredPatch;
let operation;
let re;
@ -33,12 +33,12 @@ class CorpusDisplay extends RessourceDisplay {
}
re = new RegExp(`^/users/${this.userId}/corpora/${this.corpusId}/num_tokens`);
if (re.test(operation.path)) {
this.numTokens(operation.value);
this.setNumTokens(operation.value);
break;
}
re = new RegExp(`^/users/${this.userId}/corpora/${this.corpusId}/status$`);
if (re.test(operation.path)) {
this.status(operation.value);
this.setStatus(operation.value);
break;
}
break;

View File

@ -22,7 +22,7 @@
<p>Nopaque lets you create and upload as many text corpora as you want. It makes use of CQP Query Language, which allows for complex search requests with the aid of metadata and NLP tags. The results can either be displayed as text or abstract visualizations.</p>
</div>
<div class="col s12" id="corpora">
<div class="col s12 nopaque-ressource-list" data-ressource-type="Corpus" data-user-id="{{ current_user.hashid }}" id="corpora">
<h2>My Corpora</h2>
<div class="card">
<div class="card-content">
@ -31,15 +31,12 @@
<input id="search-corpus" class="search" type="search"></input>
<label for="search-corpus">Search corpus</label>
</div>
<table class="highlight ressource-list">
<table class="highlight">
<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>Title and Description</th>
<th>Status</th>
<th></th>
</tr>
</thead>
@ -54,7 +51,7 @@
</div>
</div>
<div class="col s12" id="query-results">
<div class="col s12 nopaque-ressource-list" data-ressource-type="QueryResult" data-user-id="{{ current_user.hashid }}" id="query-results">
<h2>My query results</h2>
<div class="card">
<div class="card-content">
@ -63,17 +60,11 @@
<input id="search-query-results" class="search" type="search"></input>
<label for="search-query-results">Search query result</label>
</div>
<table class="highlight ressource-list">
<table class="highlight">
<thead>
<tr>
<th>
<span class="sort" data-sort="title">Title</span> and<br>
<span class="sort" data-sort="description">Description</span>
</th>
<th>
<span class="sort" data-sort="corpus">Corpus</span> and<br>
<span class="sort" data-sort="query">Query</span>
</th>
<th>Title and Description</th>
<th>Corpus and Query</th>
<th></th>
</tr>
</thead>
@ -82,18 +73,10 @@
<ul class="pagination"></ul>
</div>
<div class="card-action right-align">
<a class="btn waves-effect waves-light" href="{{ url_for('corpora.add_query_result') }}">Add query result<i class="material-icons right">file_upload</i></a>
<a class="btn waves-effect waves-light disabled">Add query result<i class="material-icons right">file_upload</i></a>
</div>
</div>
</div>
</div>
</div>
{% endblock page_content %}
{% block scripts %}
{{ super() }}
<script>
let corpusList = new CorpusList(document.querySelector('#corpora'));
let queryResultList = new QueryResultList(document.querySelector('#query-results'));
</script>
{% endblock scripts %}