2019-08-01 08:33:05 +00:00
{% extends "base.html.j2" %}
{% block page_content %}
<div class="col s12 m4">
<h3>Corpora</h3>
<p>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>
</div>
<div class="col s12 m8">
2019-08-08 13:28:15 +00:00
<div id="corpus-list">
<div class="card">
<div class="card-content">
<div class="row">
<div class="col s12 m8">
<div class="input-field">
<i class="material-icons prefix">search</i>
<input id="search-corpus" class="search" type="text"></input>
<label for="search-corpus">Search corpus</label>
</div>
</div>
<div class="col s12 m4">
<p><a data-target="new-corpus-modal" class="waves-effect waves-light btn modal-trigger right"><i class="material-icons left">add</i>New corpus</a></p>
</div>
<div class="col s12">
<ul class="pagination"></ul>
2019-08-02 12:48:27 +00:00
</div>
</div>
</div>
2019-08-08 13:28:15 +00:00
</div>
2019-08-16 12:54:29 +00:00
<div class="collection list"></div>
2019-08-08 13:28:15 +00:00
</div>
2019-08-01 08:33:05 +00:00
</div>
2019-08-08 13:28:15 +00:00
<script>
2019-08-14 14:59:39 +00:00
corpusList = new List("corpus-list", {valueNames: ["title"],
page: 4,
pagination: true});
corpusList.on("filterComplete", updatePagination);
corpusList.on("searchComplete", updatePagination);
2019-08-16 12:54:29 +00:00
createCorpusElements(corpusList);
subscribers.corpora.push(function() {
console.log('[Corpora]: Something changed.');
});
2019-08-08 13:28:15 +00:00
</script>
2019-08-01 08:33:05 +00:00
<div class="col s12">
2019-08-02 11:25:54 +00:00
<p> </p>
</div>
<div class="col s12 m4">
<h3>Jobs</h3>
2019-08-07 13:53:37 +00:00
<p>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>
2019-08-02 11:25:54 +00:00
</div>
<div class="col s12 m8">
2019-08-08 13:28:15 +00:00
<div id="job-list">
<div class="card">
<div class="card-content">
<div class="row">
<div class="col s12 m8">
<div class="input-field">
<i class="material-icons prefix">search</i>
<input id="search-job" class="search" type="text"></input>
<label for="search-job">Search job</label>
</div>
</div>
<div class="col s12 m4">
<p><a id="new-job" class="dropdown-trigger waves-effect waves-light btn right no-autoinit" href="#" data-target="new-job-dropdown"><i class="material-icons left">add</i>New job</a></p>
</div>
<div class="col s12">
<ul class="pagination"></ul>
2019-08-02 12:48:27 +00:00
</div>
</div>
</div>
2019-08-08 13:28:15 +00:00
</div>
2019-08-16 07:49:27 +00:00
<div class="collection list"></div>
2019-08-08 13:28:15 +00:00
</div>
2019-08-01 08:33:05 +00:00
</div>
2019-08-08 13:28:15 +00:00
<script>
2019-08-19 15:09:01 +00:00
var template = '<a><span class="title"></span></a>'
var jobList = new List("job-list", {item: '<a><span class="title"></span></a>',
2019-08-14 14:59:39 +00:00
page: 4,
2019-08-19 15:09:01 +00:00
pagination: true,
valueNames: ["description",
"title",
{data: ["id"]}]});
2019-08-14 14:59:39 +00:00
jobList.on("filterComplete", updatePagination);
jobList.on("searchComplete", updatePagination);
2019-08-16 12:54:29 +00:00
createJobElements(jobList);
2019-08-19 15:09:01 +00:00
subscribers.jobs.push(function(delta) {
for (key in delta) {
if (key === "_t") {continue;}
if (key.startsWith("_")) {
jobList.remove("id", delta[key][0].id);
} else if (Array.isArray(delta[key])) {
jobElement = createJobElement(delta[key][0]);
listItem = jobList.add({"description": delta[key][0].description,
"title": delta[key][0].title,
"id": delta[key][0].id})[0];
listItem.elm.replaceWith(jobElement);
listItem.elm = jobElement;
} else {
var listItem = jobList.get("id", jobs[parseInt(key)].id)[0];
if (delta[key]["status"]) {
var jobStatusElement = listItem.elm.querySelector(".status");
jobStatusElement.classList.remove(STATUS_COLORS[delta[key]["status"][0]]);
jobStatusElement.classList.add(STATUS_COLORS[delta[key]["status"][1]]);
jobStatusElement.innerHTML = delta[key]["status"][1];
}
if (delta[key]["description"]) {
listItem.values({"description": delta[key]["description"][1]});
}
if (delta[key]["title"]) {
listItem.values({"title": delta[key]["title"][1]});
}
}
}
2019-08-16 12:54:29 +00:00
});
2019-08-16 07:49:27 +00:00
</script>
2019-08-02 12:48:27 +00:00
<div id="new-corpus-modal" class="modal">
<div class="modal-content">
<h4>New corpus</h4>
<form method="POST" enctype="multipart/form-data">
{{ create_corpus_form.hidden_tag() }}
<div class="row">
<div class="col s12 m4">
<div class="input-field">
<i class="material-icons prefix">title</i>
{{ create_corpus_form.title() }}
{{ create_corpus_form.title.label }}
{% for error in create_corpus_form.title.errors %}
<span class="helper-text red-text">{{ error }}</span>
{% endfor %}
2019-08-01 09:47:14 +00:00
</div>
2019-08-02 12:48:27 +00:00
</div>
<div class="col s12 m8">
<div class="input-field">
<i class="material-icons prefix">description</i>
{{ create_corpus_form.description() }}
{{ create_corpus_form.description.label }}
{% for error in create_corpus_form.description.errors %}
<span class="helper-text red-text">{{ error }}</span>
{% endfor %}
2019-08-01 09:47:14 +00:00
</div>
2019-08-02 12:48:27 +00:00
</div>
<div class="col s12">
<div class="file-field input-field">
<div class="btn">
<span>{{ create_corpus_form.files.label.text }}</span>
{{ create_corpus_form.files(accept='.vrt') }}
</div>
<div class="file-path-wrapper">
<input class="file-path validate" type="text">
2019-08-01 09:47:14 +00:00
</div>
2019-08-02 12:48:27 +00:00
{% for error in create_corpus_form.files.errors %}
<span class="helper-text red-text">{{ error }}</span>
{% endfor %}
2019-08-01 09:47:14 +00:00
</div>
2019-08-01 08:33:05 +00:00
</div>
2019-08-02 12:48:27 +00:00
</div>
<div class="modal-footer">
{{ create_corpus_form.submit(class='btn') }}
</div>
</form>
2019-08-01 08:33:05 +00:00
</div>
</div>
2019-08-02 12:48:27 +00:00
<ul id='new-job-dropdown' class='dropdown-content'>
2019-08-06 15:04:53 +00:00
<li><a href="{{ url_for('services.nlp') }}"><i class="material-icons">format_textdirection_l_to_r</i>NLP</a></li>
2019-08-02 12:48:27 +00:00
<li><a href="{{ url_for('services.ocr') }}"><i class="material-icons">find_in_page</i>OCR</a></li>
</ul>
2019-08-01 08:33:05 +00:00
{% endblock %}