diff --git a/entries/static/entries/js/components/LexicalUnitEdit.js b/entries/static/entries/js/components/LexicalUnitEdit.js index 86d0f74ab0ca9a83ceb1b122b6eb68fc7abab56e..3c782e7029d615d6d8b68e7ec620d047c90b4d53 100644 --- a/entries/static/entries/js/components/LexicalUnitEdit.js +++ b/entries/static/entries/js/components/LexicalUnitEdit.js @@ -100,7 +100,8 @@ Object.assign(LexicalUnitEdit, { examples: null, selectedFrameArguments: null, selectedLus: null, - selectedSchemas: null + selectedSchemas: null, + hidden_frames: [], } }, components: {InfoTooltip, Spinner, FramePreview, SlowalFrameComponent, ExamplesComponent, SemanticsSchemataComponent}, @@ -808,6 +809,7 @@ Object.assign(LexicalUnitEdit, { }, changeShowVerifiedFrames (val) { this.showVerifiedFrames = val; + this.hidden_frames = []; }, getArgumentCSS(argument) { return (argument.role ? argument.role.str + ' ' : '') + (argument == this.active_unified_frame_argument ? 'active' : ''); @@ -838,6 +840,9 @@ Object.assign(LexicalUnitEdit, { }, isReadOnlyForSuperLeksykograf () { return this.isSuperLeksykograf() && this.unified_frame.status === 'O'; + }, + hideFrame (frame) { + this.hidden_frames.push(frame); } }, mounted() { @@ -876,7 +881,7 @@ Object.assign(LexicalUnitEdit, { template: ` <div class="col h-100 px-0 pt-0 pb-0 overflow-auto" id="semantics-frames-pane"> <div :id="'semantics-unified-frame-pane' + (readOnly ? '-preview' : '')" class="col w-100 p-0 overflow-auto"> - <table v-if="!readOnly && !isReadOnlyForSuperLeksykograf" class="table-button-menu sticky-top" cellspacing="1"> + <table v-if="!readOnly && !isReadOnlyForSuperLeksykograf()" class="table-button-menu sticky-top" cellspacing="1"> <tr style="background-color: white;"> <td id="change-title" @click="changeTitle" style="padding: 10px 15px 10px 15px; color: #000000;">ZmieÅ„ nazwÄ™</td> <td id="add-arg" @click="addArgument" style="padding: 10px 15px 10px 15px; color: #000000;">Dodaj argum.</td> @@ -984,7 +989,7 @@ Object.assign(LexicalUnitEdit, { </div> </div> <div :id="'semantics-slowal-frames-pane' + (readOnly ? '-preview' : '')" class="col w-100 p-0 overflow-auto"> - <table v-if="!readOnly && unified_frame.id && !isReadOnlyForSuperLeksykograf" class="table-button-menu sticky-top" cellspacing="1"> + <table v-if="!readOnly && unified_frame.id && !isReadOnlyForSuperLeksykograf()" class="table-button-menu sticky-top" cellspacing="1"> <tr style="background-color: white;"> <td id="wrong-frame" style="padding: 10px 15px 10px 15px; color: #000000;" @click="change_slowal_frame_status('B')">Błędna</td> <td id="hide-slowal-frame" style="padding: 10px 15px 10px 15px; color: #000000;" @click="changeShowVerifiedFrames(false)">Ukryj gotowe</td> @@ -996,7 +1001,7 @@ Object.assign(LexicalUnitEdit, { NiepasujÄ…ca </td> <td id="show-slowal-frame" style="padding: 10px 15px 10px 15px; color: #000000;" @click="changeShowVerifiedFrames(true)"> - Pokaż wszystkie + Pokaż wszystkie {{this.hidden_frames.length > 0 ? '(ukrytych: ' + this.hidden_frames.length + ')' : ''}} </td> <td id="move-slowal-frame" style="padding: 10px 15px 10px 15px; color: #000000;" @click="extract_frame_to_preview_frame"> @@ -1005,51 +1010,60 @@ Object.assign(LexicalUnitEdit, { </tr> </table> <div id="semantics-frames"> - <div v-for="frame in frames"> - <table class="table m-0 table-borderless border border-secondary text-dark" - v-if="(!isFrameVerified(frame) || showVerifiedFrames) && isFrameVisible(frame.status)" - > - <tbody> - <tr> - <td scope="row"> - <div - @mouseenter="frame.hover=true" - @mouseleave="frame.hover=false" - @click="slowalFrameSelected(frame)" - :class="frame === active_slowal_frame ? 'active-frame' : frame.hover ? 'bg-highlight' : ''" - > -<!-- <div --> -<!-- v-html="slowal_frame_html(frame)" --> -<!-- :class="isSelectedFrame(frame) ? 'active-frame' : ''"--> -<!-- >--> - <slowal-frame-component - :frame="frame" :key="frame" - @frame-selection-changed="insideFrameSelectionChanged" - /> - </div> - </td> - <th scope="row"> - <div v-if="!readOnly && !isReadOnlyForSuperLeksykograf"> - <div v-if="isFrameVerified(frame)"> - <input - type="checkbox" - :checked="isFrameVerified(frame)" - class="custom-control custom-checkbox" - disabled="disabled" + <template v-for="frame in frames"> + <div v-if="!hidden_frames.includes(frame)"> + <table class="table m-0 table-borderless border border-secondary text-dark" + v-if="(!isFrameVerified(frame) || showVerifiedFrames) && isFrameVisible(frame.status)" + > + <tbody> + <tr> + <td> + <div class="row"> + <div class="col close" style=" + cursor: pointer; + display: flex; + justify-content: flex-end;" + @click="hideFrame(frame)" + >×</div> + </div> + <div class="row"> + <div + class="col" + @mouseenter="frame.hover=true" + @mouseleave="frame.hover=false" + @click="slowalFrameSelected(frame)" + :class="frame === active_slowal_frame ? 'active-frame' : frame.hover ? 'bg-highlight' : ''" > - </div> - <br><br> - <button v-if="!isFrameVerified(frame)" - class="btn btn-sm btn-dark" role="button" - @click="change_slowal2unified_frame_argument_mapping(frame)" - >Z</button> + <slowal-frame-component + :frame="frame" :key="frame" + @frame-selection-changed="insideFrameSelectionChanged" + /> + </div> </div> - </th> - </tr> - </tbody> - </table> - </div> - </div> + </td> + <th scope="row"> + <div v-if="!readOnly && !isReadOnlyForSuperLeksykograf()"> + <div v-if="isFrameVerified(frame)"> + <input + type="checkbox" + :checked="isFrameVerified(frame)" + class="custom-control custom-checkbox" + disabled="disabled" + > + </div> + <br><br> + <button v-if="!isFrameVerified(frame)" + class="btn btn-sm btn-dark" role="button" + @click="change_slowal2unified_frame_argument_mapping(frame)" + >Z</button> + </div> + </th> + </tr> + </tbody> + </table> + </div> + </template> + </div> </div> <div :id="'examples' + (readOnly ? '-preview' : '')" class="col w-100 p-0 tab-pane overflow-auto"> <examples-component v-if="examples" diff --git a/entries/static/entries/js/components/frame-components/SlowalFrameComponent.js b/entries/static/entries/js/components/frame-components/SlowalFrameComponent.js index f9885c322db6b7fd95110af8441f601194facd02..71e985b4b34016de848d98cdb059f45181f8f933 100644 --- a/entries/static/entries/js/components/frame-components/SlowalFrameComponent.js +++ b/entries/static/entries/js/components/frame-components/SlowalFrameComponent.js @@ -42,7 +42,7 @@ export default { }, template: ` <div class="frame mb-3 active"> - <div class="frame mt-3" id="lexical-unit"> + <div class="frame mt-0" id="lexical-unit"> <meaning-component :lexicalUnits="frame.lexical_units" @meaning-lu-selected="meaningLuSelected"