From f690757fcb3724b6f67cd3efb25107e974cec556 Mon Sep 17 00:00:00 2001 From: dcz2 <dcz@ipipan.waw.pl> Date: Wed, 29 Jun 2022 22:44:52 +0200 Subject: [PATCH] Switchable lists pt. 1 --- common/static/common/js/init.js | 4 - common/templates/base.html | 1 + .../entries/js/components/LexicalUnitEdit.js | 17 ++- .../js/components/UnificationEntriesList.js | 30 +++++ .../js/components/UnificationFramesList.js | 30 +++++ .../js/components/UnificationRightPane.js | 67 ++++++++++ .../components/UnificationSwitchableList.js | 26 ++++ entries/static/entries/js/components/main.js | 79 ++++------- entries/static/entries/js/entries.js | 5 +- entries/static/entries/js/entries_list.js | 2 + .../entries/js/unification_entries_list.js | 15 ++- .../entries/js/unification_frames_list.js | 14 +- .../static/entries/js/unification_index.js | 8 +- entries/templates/entries_base.html | 1 - entries/templates/unification.html | 18 ++- .../templates/unification_edit_display.html | 126 ------------------ .../templates/unification_entries_list.html | 18 --- entries/templates/unification_frames.html | 31 ----- .../templates/unification_frames_list.html | 18 --- .../unification_lexical_unit_display.html | 5 - entries/urls.py | 1 - entries/views.py | 11 -- 22 files changed, 223 insertions(+), 304 deletions(-) create mode 100644 entries/static/entries/js/components/UnificationEntriesList.js create mode 100644 entries/static/entries/js/components/UnificationFramesList.js create mode 100644 entries/static/entries/js/components/UnificationRightPane.js create mode 100644 entries/static/entries/js/components/UnificationSwitchableList.js delete mode 100644 entries/templates/unification_edit_display.html delete mode 100644 entries/templates/unification_entries_list.html delete mode 100644 entries/templates/unification_frames.html delete mode 100644 entries/templates/unification_frames_list.html diff --git a/common/static/common/js/init.js b/common/static/common/js/init.js index 1e3acdf..4ac1bc3 100644 --- a/common/static/common/js/init.js +++ b/common/static/common/js/init.js @@ -1,13 +1,9 @@ "use strict"; -var lang; - $(document).ready(function() { $('.nav-item > a[href$="' + window.location.pathname + '"]').removeClass('text-light active').addClass('disabled'); - lang = $('html').attr('lang'); - check_import_status(); }); diff --git a/common/templates/base.html b/common/templates/base.html index 93efcc3..d24643d 100644 --- a/common/templates/base.html +++ b/common/templates/base.html @@ -25,6 +25,7 @@ <script type="text/javascript"> window.STATIC_URL = '{% static '' %}'; window.USER_USERNAME = '{{ request.user.username }}'; + window.lang = '{{ LANGUAGE_CODE }}'; </script> {{ request.user.get_all_permissions|dictsort:0|json_script:"user-permissions" }} <script type="text/javascript" src="{% static 'common/js/utils.js' %}"></script> diff --git a/entries/static/entries/js/components/LexicalUnitEdit.js b/entries/static/entries/js/components/LexicalUnitEdit.js index b955f7a..c7e26ff 100644 --- a/entries/static/entries/js/components/LexicalUnitEdit.js +++ b/entries/static/entries/js/components/LexicalUnitEdit.js @@ -1,5 +1,6 @@ import InfoTooltip from "./InfoTooltip.js"; import Spinner from "./Spinner.js"; +import UnificationSwitchableList from "./UnificationSwitchableList.js"; let LexicalUnitEdit = {}; @@ -13,11 +14,14 @@ const FramePreview = { unifiedFrameId: this.initialUnifiedFrameId }; }, - components: {LexicalUnitEdit}, + components: {LexicalUnitEdit, UnificationSwitchableList}, emits: ['changeFrame', 'changePreviewToEdit'], methods: { - changePreviewToEditLocal(unifiedFrameId) { + changePreviewToEditLocal (unifiedFrameId) { this.$emit('changePreviewToEdit', unifiedFrameId); + }, + unifiedFrameSelected (unifiedFrameId) { + this.$emit('changeFrame', unifiedFrameId); } }, mounted () { @@ -33,8 +37,8 @@ const FramePreview = { }); }, template: ` - <div :key="unifiedFrameId" class="row h-100"> - <div class="col h-100 pr-0 pt-0 pb-0 overflow-auto" id="frame-preview-left-pane"> + <div class="row h-100"> + <div :key="unifiedFrameId" class="col h-100 pr-0 pt-0 pb-0 overflow-auto" id="frame-preview-left-pane"> <lexical-unit-edit v-if="unifiedFrameId !== -1" :readOnly="true" @@ -47,8 +51,9 @@ const FramePreview = { </div> </div> <div class="col h-100 px-1 pt-0 pb-0 overflow-auto" id="frame-preview-right-pane"> - TODO list - <span @click="$emit('changeFrame', 1)">change frame</span> + <unification-switchable-list + @unified-frame-selected="unifiedFrameSelected" + /> </div> </div> ` diff --git a/entries/static/entries/js/components/UnificationEntriesList.js b/entries/static/entries/js/components/UnificationEntriesList.js new file mode 100644 index 0000000..598ceca --- /dev/null +++ b/entries/static/entries/js/components/UnificationEntriesList.js @@ -0,0 +1,30 @@ +export default { + data () { + return { + gettext: window.gettext, + canViewAssignment: has_permission("users.view_assignment") + } + }, + emits: ['lexicalUnitSelected'], + mounted () { + setup_entries_list({ + table: this.$refs.table, + lexicalUnitSelected: (entryId, lexicalUnitId) => { this.$emit('lexicalUnitSelected', entryId, lexicalUnitId); } + }); + }, + template: ` + <table ref="table" class="table table-sm table-hover text-dark"> + <thead> + <tr> + <th class="p-1">{{ gettext('Lemat') }}</th> + <th class="p-1">{{ gettext('Część mowy') }}</th> + <th class="p-1">{{ gettext('Do pobrania') }}</th> + <th v-if="canViewAssignment" class="p-1">{{ gettext('Semantyk') }}</th> + <th v-else class="p-1">{{ gettext('Moje (w opracowaniu)') }}</th> + </tr> + </thead> + <tbody id="entries"> + </tbody> + </table> + ` +}; diff --git a/entries/static/entries/js/components/UnificationFramesList.js b/entries/static/entries/js/components/UnificationFramesList.js new file mode 100644 index 0000000..0ed0502 --- /dev/null +++ b/entries/static/entries/js/components/UnificationFramesList.js @@ -0,0 +1,30 @@ +export default { + data () { + return { + gettext: window.gettext, + canViewUser: has_permission("users.view_user") + } + }, + emits: ['unifiedFrameSelected'], + mounted () { + setup_frames_list({ + table: this.$refs.table, + unifiedFrameSelected: (unifiedFrameId) => { this.$emit('unifiedFrameSelected', unifiedFrameId); } + }); + }, + template: ` + <table ref="table" class="table table-sm table-hover text-dark"> + <thead> + <tr> + <th class="p-1">{{ gettext('Rama') }}</th> + <th class="p-1">{{ gettext('Status') }}</th> + <th v-if="canViewUser" class="p-1">{{ gettext('Leksykograf') }}</th> + <th v-else class="p-1">{{ gettext('Moje (w opracowaniu)') }}</th> + <th class="p-1" hidden="true">{{ gettext('Id') }}</th> + </tr> + </thead> + <tbody id="entries"> + </tbody> + </table> + ` +}; diff --git a/entries/static/entries/js/components/UnificationRightPane.js b/entries/static/entries/js/components/UnificationRightPane.js new file mode 100644 index 0000000..0b3a52d --- /dev/null +++ b/entries/static/entries/js/components/UnificationRightPane.js @@ -0,0 +1,67 @@ +import LexicalUnitDisplay from './LexicalUnitDisplay.js'; +import LexicalUnitEdit from './LexicalUnitEdit.js'; + +export default { + components: {LexicalUnitDisplay, LexicalUnitEdit}, + props: { + entryId: Number, + lexicalUnitId: Number, + }, + data () { + return this.getInitialData(); + }, + methods: { + getInitialData () { + return { + isEdit: false, + key: this.lexicalUnitId, + unifiedFrameId: null, + previewedUnifiedFrameId: null + }; + }, + goToEdit (unifiedFrameId) { + this.isEdit = true; + this.unifiedFrameId = unifiedFrameId; + this.previewedUnifiedFrameId = -1; + }, + goToDisplay () { + this.isEdit = false; + this.unifiedFrameId = null; + }, + refresh () { + this.key = null; + setTimeout(() => { this.key = this.lexicalUnitId; }, 0); + update_entries(); // TODO + }, + swapFrames (previewedUnifiedFrameId) { + this.previewedUnifiedFrameId = this.unifiedFrameId; + this.unifiedFrameId = previewedUnifiedFrameId; + this.refresh(); + } + }, + watch: { + lexicalUnitId () { + Object.assign(this, this.getInitialData()); + } + }, + template: ` + <div v-if="key" :key="key" class="row h-100 m-0 p-0 overflow-auto" id="semantics-top-pane"> + <lexical-unit-display + v-if="lexicalUnitId && !isEdit" + :entryId="entryId" + :lexicalUnitId="lexicalUnitId" + @go-to-edit="goToEdit" + @refresh="refresh" + /> + <lexical-unit-edit + v-if="isEdit" + :readOnly="false" + :unifiedFrameId="unifiedFrameId" + :previewedUnifiedFrameId="previewedUnifiedFrameId" + :initialRightPaneTab="unifiedFrameId !== previewedUnifiedFrameId ? 'frame_preview' : null" + @go-to-display="goToDisplay" + @swap-frames="swapFrames" + /> + </div> + ` +} diff --git a/entries/static/entries/js/components/UnificationSwitchableList.js b/entries/static/entries/js/components/UnificationSwitchableList.js new file mode 100644 index 0000000..d5601ad --- /dev/null +++ b/entries/static/entries/js/components/UnificationSwitchableList.js @@ -0,0 +1,26 @@ +import UnificationEntriesList from "./UnificationEntriesList.js"; +import UnificationFramesList from "./UnificationFramesList.js"; + +export default { + data () { + return { + gettext: window.gettext, + isFrameView: false + } + }, + emits: ['lexicalUnitSelected', 'unifiedFrameSelected'], + methods: { + lexicalUnitSelected (entryId, lexicalUnitId) { + this.$emit('lexicalUnitSelected', entryId, lexicalUnitId); + }, + unifiedFrameSelected (unifiedFrameId) { + this.$emit('unifiedFrameSelected', unifiedFrameId); + } + }, + components: {UnificationEntriesList, UnificationFramesList}, + template: ` + <label class="float-left mt-2"><input type="checkbox" v-model="isFrameView" /> {{ gettext('RAMY') }}</label> + <div v-if="!isFrameView"><unification-entries-list @lexical-unit-selected="lexicalUnitSelected" /></div> + <div v-else><unification-frames-list @unified-frame-selected="unifiedFrameSelected" /></div> + ` +}; diff --git a/entries/static/entries/js/components/main.js b/entries/static/entries/js/components/main.js index 21aafcf..5804914 100644 --- a/entries/static/entries/js/components/main.js +++ b/entries/static/entries/js/components/main.js @@ -1,67 +1,34 @@ -import LexicalUnitDisplay from './LexicalUnitDisplay.js'; -import LexicalUnitEdit from './LexicalUnitEdit.js'; +import UnificationSwitchableList from "./UnificationSwitchableList.js"; +import UnificationRightPane from "./UnificationRightPane.js"; export default { - components: {LexicalUnitDisplay, LexicalUnitEdit}, - props: { - entryId: Number, - lexicalUnitId: Number, - }, data () { - return this.getInitialData(); + return { + entryId: null, + lexicalUnitId: null, + }; }, + components: {UnificationSwitchableList, UnificationRightPane}, methods: { - getInitialData () { - return { - isEdit: false, - key: this.lexicalUnitId, - unifiedFrameId: null, - previewedUnifiedFrameId: null - }; - }, - goToEdit (unifiedFrameId) { - this.isEdit = true; - this.unifiedFrameId = unifiedFrameId; - this.previewedUnifiedFrameId = -1; - }, - goToDisplay () { - this.isEdit = false; - this.unifiedFrameId = null; - }, - refresh () { - this.key = null; - setTimeout(() => { this.key = this.lexicalUnitId; }, 0); - update_entries(); + lexicalUnitSelected (entryId, lexicalUnitId) { + this.entryId = entryId; + this.lexicalUnitId = lexicalUnitId; }, - swapFrames (previewedUnifiedFrameId) { - this.previewedUnifiedFrameId = this.unifiedFrameId; - this.unifiedFrameId = previewedUnifiedFrameId; - this.refresh(); - } - }, - watch: { - lexicalUnitId () { - Object.assign(this, this.getInitialData()); + unifiedFrameSelected (unifiedFrameId) { + alert("Wybrano ramę " + unifiedFrameId); } }, template: ` - <div v-if="key" :key="key" class="row h-100 m-0 p-0 overflow-auto" id="semantics-top-pane"> - <lexical-unit-display - v-if="lexicalUnitId && !isEdit" - :entryId="entryId" - :lexicalUnitId="lexicalUnitId" - @go-to-edit="goToEdit" - @refresh="refresh" - /> - <lexical-unit-edit - v-if="isEdit" - :readOnly="false" - :unifiedFrameId="unifiedFrameId" - :previewedUnifiedFrameId="previewedUnifiedFrameId" - :initialRightPaneTab="unifiedFrameId !== previewedUnifiedFrameId ? 'frame_preview' : null" - @go-to-display="goToDisplay" - @swap-frames="swapFrames" - /> + <div id="entries-list" class="col h-100 w-100 px-0"> + <div id="entries-list-div" class="col p-0 h-100 w-100 overflow-auto"> + <unification-switchable-list + @lexical-unit-selected="lexicalUnitSelected" + @unified-frame-selected="unifiedFrameSelected" + /> + </div> + </div> + <div id="entry-display" class="col h-100 p-0"> + <unification-right-pane :entryId="entryId" :lexicalUnitId="lexicalUnitId" /> </div> ` -} +}; diff --git a/entries/static/entries/js/entries.js b/entries/static/entries/js/entries.js index 71b1304..d0110b3 100644 --- a/entries/static/entries/js/entries.js +++ b/entries/static/entries/js/entries.js @@ -932,8 +932,7 @@ function get_show_reals_desc() { } function setup_datatable(options) { - - var datatable = $('#entries-table').DataTable({ + var datatable = $(options.element).DataTable({ // https://datatables.net/manual/tech-notes/3 destroy: true, //paging: false, @@ -987,7 +986,7 @@ function setup_datatable(options) { }, initComplete: function(settings, json) { // display the first entry once it’s loaded - $('.entry').first().click(); + options.selectFirst && $('.entry', options.element).first().click(); }, language: { thousands: lang === 'pl' ? ' ' : ',', diff --git a/entries/static/entries/js/entries_list.js b/entries/static/entries/js/entries_list.js index d5e8579..4d9b59a 100644 --- a/entries/static/entries/js/entries_list.js +++ b/entries/static/entries/js/entries_list.js @@ -1,5 +1,7 @@ function update_entries() { var datatable = setup_datatable({ + element: $("#entries-table"), + selectFirst: true, url: '/' + lang + '/entries/get_entries/', columns: [ { data: 'lemma' }, diff --git a/entries/static/entries/js/unification_entries_list.js b/entries/static/entries/js/unification_entries_list.js index 109a600..710824d 100644 --- a/entries/static/entries/js/unification_entries_list.js +++ b/entries/static/entries/js/unification_entries_list.js @@ -1,4 +1,4 @@ -function update_entries() { +function setup_entries_list(options) { const can_see_assignees = has_permission("users.view_assignment"); function is_assigned_to_user_renderer (data) { @@ -10,7 +10,9 @@ function update_entries() { } var datatable = setup_datatable({ - url: '/' + lang + '/entries/get_entries/?with_lexical_units=true', + element: options.table, + selectFirst: true, + url: '/' + window.lang + '/entries/get_entries/?with_lexical_units=true', columns: [ { data: 'lemma' }, { data: 'POS' }, @@ -21,18 +23,18 @@ function update_entries() { datatable.on('click', 'tr.entry', function () { var row = datatable.row(this); var has_drilldown = row.child.isShown(); - $('.drilldown:visible').each(function () { datatable.row($(this).data("row")).child.hide(); }); + $('.drilldown:visible', options.table).each(function () { datatable.row($(this).data("row")).child.hide(); }); if (!has_drilldown) { if (!row.data()) return; var drilldown = $("<div>").addClass("drilldown").data("row", this); row.child(drilldown).show(); - setup_lexical_units_table(drilldown, row.data().lexical_units, can_see_assignees); + setup_lexical_units_table(drilldown, row.data().lexical_units, can_see_assignees, options); drilldown.closest("td").addClass("p-0 pl-4"); } }); } -function setup_lexical_units_table(drilldown, lexical_units, can_see_assignees) { +function setup_lexical_units_table(drilldown, lexical_units, can_see_assignees, options) { if (!lexical_units.length) { return ''; } @@ -51,8 +53,7 @@ function setup_lexical_units_table(drilldown, lexical_units, can_see_assignees) </tr> `).click(function () { $(this).addClass('table-primary').siblings().removeClass("table-primary"); - window.unificationApp.$.props.entryId = $(drilldown.data("row")).data("entry"); - window.unificationApp.$.props.lexicalUnitId = lexical_unit.pk; + options.lexicalUnitSelected($(drilldown.data("row")).data("entry"), lexical_unit.pk); }); } var table = $(` diff --git a/entries/static/entries/js/unification_frames_list.js b/entries/static/entries/js/unification_frames_list.js index 8a7c55e..8a31ff6 100644 --- a/entries/static/entries/js/unification_frames_list.js +++ b/entries/static/entries/js/unification_frames_list.js @@ -1,4 +1,4 @@ -function update_entries() { +function setup_frames_list(options) { const can_see_assignees = has_permission("users.view_assignment"); function is_assigned_to_user_renderer (data) { @@ -9,6 +9,7 @@ function update_entries() { } var datatable = setup_datatable({ + element: options.table, url: '/' + lang + '/unifier/get_unified_frames/', columns: [ { data: 'title' }, @@ -19,16 +20,11 @@ function update_entries() { hidden_columns: [3] }); datatable.on('click', 'tr.entry', function () { - var selected_entry = $(this).data('entry'); var data = datatable.row(this).data(); if (!data) return; var related = data.related === true; - if (selected_entry !== curr_entry) { - $('.entry[data-entry="' + curr_entry + '"]').removeClass('table-primary'); - //TODO: zastapic etoda pobierajaca rame za po jej id - get_unified_frame(data.id) - // get_entry(selected_entry, related); - $(this).addClass('table-primary'); - } + $('.entry', options.table).removeClass('table-primary'); + options.unifiedFrameSelected(Number(data.id)); + $(this).addClass('table-primary'); }); } diff --git a/entries/static/entries/js/unification_index.js b/entries/static/entries/js/unification_index.js index 227b3b6..180572f 100644 --- a/entries/static/entries/js/unification_index.js +++ b/entries/static/entries/js/unification_index.js @@ -1,4 +1,6 @@ - import Main from './components/main.js'; - const { createApp } = Vue; +import Main from './components/main.js'; +const { createApp } = Vue; -window.unificationApp = createApp(Main).mount('#semantics-top-pane'); +window.update_entries = function () {} + +window.unificationLeftPaneApp = createApp(Main).mount('#vue-app'); diff --git a/entries/templates/entries_base.html b/entries/templates/entries_base.html index 8561a7b..2553030 100644 --- a/entries/templates/entries_base.html +++ b/entries/templates/entries_base.html @@ -31,7 +31,6 @@ {% block additional-nav-items %} {% if request.user.is_authenticated %} <li class="nav-item"><a href="{% url 'entries:unification' %}" class="nav-link">{% trans "Unifikacja" %}</a></li> - <li class="nav-item"><a href="{% url 'entries:unification_frames' %}" class="nav-link">{% trans "Unifikacja - ramy" %}</a></li> {% endif %} <li class="nav-item dropdown"> <a class="nav-link dropdown-toggle" href="#" id="nav-filters" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> diff --git a/entries/templates/unification.html b/entries/templates/unification.html index ab9dfe0..b8d024e 100644 --- a/entries/templates/unification.html +++ b/entries/templates/unification.html @@ -9,12 +9,20 @@ {{ block.super }} <link rel="stylesheet" type="text/css" href="{% static 'entries/css/unification_frames.css' %}"> <script src="{% static 'entries/js/unification_entries_list.js' %}"></script> -<script src="{% static 'entries/js/unification.js' %}"></script> -<!--<script src="{% static 'entries/js/unification_frames_list.js' %}"></script>--> -<script src="{% static 'entries/js/selectional_preference.js' %}"></script> -<script src="{% static 'entries/js/jquery-impromptu.min.js' %}"></script> + <script src="{% static 'entries/js/unification_frames_list.js' %}"></script> + <script src="{% static 'entries/js/unification.js' %}"></script> + <script src="{% static 'entries/js/selectional_preference.js' %}"></script> + <script src="{% static 'entries/js/jquery-impromptu.min.js' %}"></script> + <script src="https://unpkg.com/vue@3"></script> + <script type="module" src="{% static 'entries/js/unification_index.js' %}"></script> {% endblock %} -{% block left_pane %}{% include "unification_entries_list.html" %}{% endblock %} +{% block left_pane %}<div id="unification-left-pane"></div>{% endblock %} {% block right_pane %}{% include "unification_lexical_unit_display.html" %}{% endblock %} + + +{% block content %} + <div id="lexical-unit-notes-template" class="d-none">{% include 'notes.html' %}</div> + <div id="vue-app" class="row h-100 m-0 p-0 bg-secondary"></div> +{% endblock %} diff --git a/entries/templates/unification_edit_display.html b/entries/templates/unification_edit_display.html deleted file mode 100644 index 37d1944..0000000 --- a/entries/templates/unification_edit_display.html +++ /dev/null @@ -1,126 +0,0 @@ -{% load i18n %} - -<div class="tab-content h-100 w-100 p-0" id="entryTabsContent"> - <div class="col h-100 w-100 p-0 tab-pane show active" id="semantics" role="tabpanel" aria-labelledby="semantics-tab"> - <div class="row m-0 p-0" id="semantics-top-pane"> - <div class="col h-100 px-1 pt-0 pb-0 overflow-auto" id="semantics-frames-pane"> - <table class="table-button-menu" cellspacing="1"> - <tr style="background-color: white;"> - <td id="change-title" style="padding: 10px 15px 10px 15px; color: #000000;"> - Zmień nazwę - </td> - <td id="add-arg" style="padding: 10px 15px 10px 15px; color: #000000;"> - Dodaj argum. - </td> - <td id="add-pref" style="padding: 10px 15px 10px 15px; color: #000000;" - onclick="addSelectivePreference()"> - Dodaj prefer. - </td> - <td id="merge" style="padding: 10px 15px 10px 15px; color: #000000;"> - Scal - </td> - <td id="ready" style="padding: 10px 15px 10px 15px; color: #000000;"> - Gotowe - </td> - </tr> - <tr style="background-color: white;"> - <td id="change-role" style="padding: 10px 15px 10px 15px; color: #000000;"> - Zmień rolę - </td> - <td id="remove-arg" style="padding: 10px 15px 10px 15px; color: #000000;"> - Usuń argum. - </td> - <td id="change-windows" style="padding: 10px 15px 10px 15px; color: #000000;"> - Zamień okna - </td> - <td id="duplicates" style="padding: 10px 15px 10px 15px; color: #000000;"> - Duplikuj - </td> - <td id="save-changes" style="padding: 10px 15px 10px 15px; color: #000000;"> - Zapisz - </td> - </tr> - </table> - <br> - <div id="unified-frame"></div> - <div id="unified-frame-lexical-units"></div> - <br> - <table class="table-button-menu" cellspacing="1"> - <tr style="background-color: white;"> - <td id="wrong-frame" style="padding: 10px 15px 10px 15px; color: #000000;"> - Błędna - </td> - <td id="extract-frame" style="padding: 10px 15px 10px 15px; color: #000000;" - onclick="extract_frames_to_new_frame(1, [104274,104238], null)"> - Rozdziel - </td> - <td id="hide-slowal-frame" style="padding: 10px 15px 10px 15px; color: #000000;"> - Ukryj - </td> - <td id="ready-slowal-frame" style="padding: 10px 15px 10px 15px; color: #000000;"> - Gotowe - </td> - <td id="filter-slowal-frames" style="padding: 10px 15px 10px 15px; color: #000000;"> - Filtruj - </td> - </tr> - <tr style="background-color: white;"> - <td id="inccorect-slowal-frame" style="padding: 10px 15px 10px 15px; color: #000000;"> - Niepasująca - </td> - <td id="move-slowal-frame" style="padding: 10px 15px 10px 15px; color: #000000;" - onclick="extract_frames_to_new_frame(3, [104274], 1)"> - Przerzuć - </td> - <td id="show-slowal-frame" style="padding: 10px 15px 10px 15px; color: #000000;"> - Pokaż - </td> - <td id="reollback-slowal-frame" style="padding: 10px 15px 10px 15px; color: #000000;"> - Przywróć - </td> - <td id="empty" style="padding: 10px 15px 10px 15px; color: #000000;"> - - </td> - </tr> - </table> - <br> - <div id="semantics-frames"></div> - </div> - <div class="col h-100 px-1 pt-0 pb-0 overflow-auto" id="semantics-schemata-pane"> - <ul class="nav nav-pills nav-justified p-1" id="entryTabs" role="tablist"> - <li class="nav-item mr-1"> - <a class="btn btn-sm btn-outline-dark nav-link active" id="unified-frame-semantics-tab" data-toggle="tab" href="#semantics" role="tab" aria-controls="semantics" aria-selected="true"> - {% trans "Schematy" %} - </a> - </li> - <li class="nav-item mr-1"> - <a class="btn btn-sm btn-outline-dark nav-link" id="unified-frame-view2-tab" data-toggle="tab" href="#syntax" role="tab" aria-controls="syntax" aria-selected="false"> - {% trans "Podgląd ram" %} - </a> - </li> - <li class="nav-item mr-0"> - <a class="btn btn-sm btn-outline-dark nav-link" id="unified-frame-notes-tab" data-toggle="tab" href="#examples" role="tab" aria-controls="examples" aria-selected="false"> - {% trans "Notatki" %} - </a> - </li> - </ul> - <div id="semantics-schemata"></div> - </div> - </div> - <div class="row m-0 p-0 overflow-auto" id="semantics-examples-pane"> - <table id="semantics-examples" class="table table-sm table-hover"> - <thead> - <tr> - <th scope="col">{% trans "Przykład" %}<i id="examples-argument"></i><i id="examples-lu"></i><i id="examples-schema"></i></th> - <th scope="col">{% trans "Źródło" %}</th> - <th scope="col">{% trans "Opinia" %}</th> - </tr> - </thead> - <tbody id="semantics-examples-list"> - </tbody> - </table> - <p class="mx-1 my-1"id="semantics-no-examples">{% trans "Brak przykładów" %}</p> - </div> - </div> - -</div> diff --git a/entries/templates/unification_entries_list.html b/entries/templates/unification_entries_list.html deleted file mode 100644 index 7768aff..0000000 --- a/entries/templates/unification_entries_list.html +++ /dev/null @@ -1,18 +0,0 @@ -{% load i18n %} - -<table id="entries-table" class="table table-sm table-hover text-dark"> - <thead> - <tr> - <th class="p-1">{% trans "Lemat" %}</th> - <th class="p-1">{% trans "Część mowy" %}</th> - <th class="p-1">{% trans "Do pobrania" %}</th> - {% if perms.users.view_assignment %} - <th class="p-1">{% trans "Semantyk" %}</th> - {% else %} - <th class="p-1">{% trans "Moje (w opracowaniu)" %}</th> - {% endif %} - </tr> - </thead> - <tbody id="entries"> - </tbody> -</table> diff --git a/entries/templates/unification_frames.html b/entries/templates/unification_frames.html deleted file mode 100644 index d6d8313..0000000 --- a/entries/templates/unification_frames.html +++ /dev/null @@ -1,31 +0,0 @@ -{% extends "entries_base.html" %} - -{% load i18n %} -{% load static %} - -{% block title %}{% trans "Hasła" %}{% endblock %} - - -{% block styles %} -<!-- for autocomplete --> -<link rel="stylesheet" type="text/css" href="//code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css"> -<!-- https://datatables.net/ --> -<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/bs4/dt-1.10.22/sc-2.0.3/datatables.min.css"/> -<!--link rel="stylesheet" type="text/css" href="{% static 'entries/css/panels.css' %}"--> -<link rel="stylesheet" type="text/css" href="{% static 'entries/css/entries.css' %}"> -<link rel="stylesheet" type="text/css" href="{% static 'entries/css/unification_frames.css' %}"> -<link rel="stylesheet" type="text/css" href="{% static 'common/css/role_colours.css' %}"> -<link rel="stylesheet" href="{% static 'entries/css/jquery-impromptu.min.css' %}" type="text/css" media="screen" charset="utf-8" /> -{% endblock %} - -{% block scripts %} - {{ block.super }} - <script src="{% static 'entries/js/unification.js' %}"></script> - <script src="{% static 'entries/js/unification_frames_list.js' %}"></script> - <script src="{% static 'entries/js/selectional_preference.js' %}"></script> - <script src="{% static 'entries/js/jquery-impromptu.min.js' %}"></script> -{% endblock %} - -{% block left_pane %}{% include "unification_frames_list.html" %}{% endblock %} - -{% block right_pane %}{% include "unification_edit_display.html" %}{% endblock %} diff --git a/entries/templates/unification_frames_list.html b/entries/templates/unification_frames_list.html deleted file mode 100644 index 87b3b4a..0000000 --- a/entries/templates/unification_frames_list.html +++ /dev/null @@ -1,18 +0,0 @@ -{% load i18n %} - -<table id="entries-table" class="table table-sm table-hover text-dark"> - <thead> - <tr> - <th class="p-1">{% trans "Rama" %}</th> - <th class="p-1">{% trans "Status" %}</th> - {% if perms.users.view_user %} - <th class="p-1">{% trans "Leksykograf" %}</th> - {% else %} - <th class="p-1">{% trans "Moje (w opracowaniu)" %}</th> - {% endif %} - <th class="p-1" hidden="true">{% trans "Id" %}</th> - </tr> - </thead> - <tbody id="entries"> - </tbody> -</table> diff --git a/entries/templates/unification_lexical_unit_display.html b/entries/templates/unification_lexical_unit_display.html index 1a4ebf3..96beac9 100644 --- a/entries/templates/unification_lexical_unit_display.html +++ b/entries/templates/unification_lexical_unit_display.html @@ -1,14 +1,9 @@ {% load i18n static %} -<div id="lexical-unit-notes-template" class="d-none">{% include 'notes.html' %}</div> <div class="tab-content h-100 w-100 p-0" id="entryTabsContent"> <div class="col h-100 w-100 p-0 tab-pane show active" id="semantics" role="tabpanel" aria-labelledby="semantics-tab"> - <!-- Vue.js app --> - <script src="https://unpkg.com/vue@3"></script> <div id="semantics-top-pane" class="overflow-auto"></div> - <script type="module" src="{% static 'entries/js/unification_index.js' %}"></script> - <!-- Vue.js app --> <div class="row m-0 p-0 overflow-auto" id="semantics-examples-pane"> <table id="semantics-examples" class="table table-sm table-hover"> diff --git a/entries/urls.py b/entries/urls.py index b728674..1735b62 100644 --- a/entries/urls.py +++ b/entries/urls.py @@ -17,7 +17,6 @@ urlpatterns = [ path('change_show_reals_desc/', views.change_show_reals_desc, name='change_show_reals_desc'), path('change_show_linked_entries/', views.change_show_linked_entries, name='change_show_linked_entries'), path('unification', views.unification, name='unification'), - path('unification_frames', views.unification_frames, name='unification_frames'), path('autocomplete/', autocompletes.autocomplete, name='autocomplete'), path('plWN_context_lookup/', ajax_plWN_context_lookup, name='plWN_context_lookup'), diff --git a/entries/views.py b/entries/views.py index 39df259..5495459 100644 --- a/entries/views.py +++ b/entries/views.py @@ -82,17 +82,6 @@ def unification(request): }, ) -@login_required -def unification_frames(request): - return render( - request, - 'unification_frames.html', - { - 'entries_form' : EntryForm(), - 'frames_form': FrameFormFactory.get_form(as_subform=False), - 'schemata_form': SchemaFormFactory.get_form(as_subform=False) - }, - ) FORM_TYPES = { 'entry' : EntryForm, -- GitLab