Skip to content
Snippets Groups Projects
Commit 8be25336 authored by dcz's avatar dcz
Browse files

Merge branch 'lu_without_semantic_frames'

parents e981a1fe c5e584bd
No related branches found
No related tags found
No related merge requests found
......@@ -153,14 +153,19 @@
},
connect_lus_to_slowal_frame(frame_in_progress) {
const frame_in_progress_lus = frame_in_progress ? frames2lexical_units([frame_in_progress]).map(l => {
l.pk = l.id;
l.display = l.str;
l.id = l.id;
l.str = l.str;
return l;
}) : [];
const frame_in_progress_lus_ids = new Set(frame_in_progress_lus.map(l => l.pk));
const free_lus = this.free_lexical_units.map(l => {
l.id = l.pk;
l.str = l.display;
return l;
});
const frame_in_progress_lus_ids = new Set(frame_in_progress_lus.map(l => l.id));
const lusSelect = function () {
return this.lexical_units.concat(this.free_lexical_units).concat(frame_in_progress_lus).map(lu => {
return `<label><input type="checkbox" ${frame_in_progress_lus_ids.has(lu.pk) ? 'checked' : ''} name="lus" value="${lu.pk}" /> ${lu.display}</label><br />`;
return free_lus.concat(frame_in_progress_lus).map(lu => {
return `<label><input type="checkbox" ${frame_in_progress_lus_ids.has(lu.id) ? 'checked' : ''} name="lus" value="${lu.id}" /> ${lu.str}</label><br />`;
}).join("");
}.bind(this);
......@@ -207,7 +212,7 @@
},
attach_examples() {
if (this.frame_in_progress) {
if (this.selectedLus) {
if (this.selectedLus && this.selectedLus.length > 0) {
const examplesSelect = function () {
return '<div class="attach-examples-table-wrapper-scroll-y attach-examples-custom-scrollbar"><table id="attach-examples" class="table table-bordered table-striped mb-0"><thead><tr class="font-weight-bold"><th></th><th>Zdanie</th><th>Źródło</th><th>Opinia</th></tr></thead>' + this.examples.map(example => {
return `<tr><td><input type="checkbox" ${this.selectedLus && example.lu_ids.includes(this.selectedLus[0].id) ? 'checked' : ''} name="lus" value="${example.id}" /></td><td>${example.sentence}</td><td>${example.source}</td><td>${example.opinion}</td></tr>`;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment