From c2cc72413f5b971a32ed4614050ddedacceee722 Mon Sep 17 00:00:00 2001
From: dcz <dcz@ipipan.waw.pl>
Date: Thu, 7 Jul 2022 19:40:17 +0200
Subject: [PATCH] Import big data slowal frames.

---
 .../entries/js/components/LexicalUnitEdit.js  | 26 ++++++++++---------
 syntax/management/commands/import_tei.py      |  4 +--
 2 files changed, 16 insertions(+), 14 deletions(-)

diff --git a/entries/static/entries/js/components/LexicalUnitEdit.js b/entries/static/entries/js/components/LexicalUnitEdit.js
index 12ef716..f0442ee 100644
--- a/entries/static/entries/js/components/LexicalUnitEdit.js
+++ b/entries/static/entries/js/components/LexicalUnitEdit.js
@@ -712,13 +712,17 @@ Object.assign(LexicalUnitEdit, {
           });
       if (this.active_slowal_frame === frame) {
         this.active_slowal_frame = null;
-        this.setup_notes_unified_frame();
-        this.changeStatusButtonTitleToDefault();
+        if(!this.readOnly) {
+          this.setup_notes_unified_frame();
+          this.changeStatusButtonTitleToDefault();
+        }
       } else {
         this.active_slowal_frame = frame;
-        this.setup_notes_slowal_frame()
-        if(this.isFrameVerified(frame)) {
-          this.statusButtonTitle = 'Przywróć';
+        if(!this.readOnly) {
+          this.setup_notes_slowal_frame()
+          if (this.isFrameVerified(frame)) {
+            this.statusButtonTitle = 'Przywróć';
+          }
         }
       }
     },
@@ -846,15 +850,14 @@ Object.assign(LexicalUnitEdit, {
           <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>
           <td style="padding: 10px 15px 10px 15px; color: #000000;" @click="addSelectivePreference">Dodaj prefer.</td>
-          <td id="merge" style="padding: 10px 15px 10px 15px; color: #000000;">Scal</td>
           <td style="padding: 10px 15px 10px 15px; color: #000000;" @click="changeUnifiedFrameStatusToReady">Gotowe</td>
+          <td id="duplicates" @click="duplicate" style="padding: 10px 15px 10px 15px; color: #000000;">Duplikuj</td>
         </tr>
         <tr style="background-color: white;">
           <td id="change-role" @click="changeRole" style="padding: 10px 15px 10px 15px; color: #000000;">Zmień rolę</td>
           <td id="remove-arg" @click="removeArgument" style="padding: 10px 15px 10px 15px; color: #000000;">Usuń argum.</td>
           <td id="change-windows" style="padding: 10px 15px 10px 15px; color: #000000;" @click="removeSelectionalPreference">Usuń prefer.</td>
           <td id="change-windows" style="padding: 10px 15px 10px 15px; color: #000000;" @click="swapUnifiedFrames">Zamień okna</td>
-          <td id="duplicates" @click="duplicate" style="padding: 10px 15px 10px 15px; color: #000000;">Duplikuj</td>
         </tr>
       </table>
       <spinner />
@@ -960,14 +963,13 @@ Object.assign(LexicalUnitEdit, {
             <td id="show-slowal-frame" style="padding: 10px 15px 10px 15px; color: #000000;" @click="changeShowVerifiedFrames(true)">
                 Pokaż wszystkie
             </td>
+            <td id="reollback-slowal-frame" style="padding: 10px 15px 10px 15px; color: #000000;">
+                Przywróć
+            </td>
             <td id="move-slowal-frame" style="padding: 10px 15px 10px 15px; color: #000000;"
                 @click="extract_frame_to_preview_frame()">
                 Przerzuć
             </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>
         <div id="semantics-frames">
@@ -1007,7 +1009,7 @@ Object.assign(LexicalUnitEdit, {
             </div>
           </div>
         </div>
-      <div class="col w-100 p-0 tab-pane overflow-auto" id="examples">
+      <div v-if="!readOnly" class="col w-100 p-0 tab-pane overflow-auto" id="examples">
             <table id="semantics-examples" class="table table-sm table-hover">
                 <thead>
                     <tr>
diff --git a/syntax/management/commands/import_tei.py b/syntax/management/commands/import_tei.py
index e030440..0f78622 100644
--- a/syntax/management/commands/import_tei.py
+++ b/syntax/management/commands/import_tei.py
@@ -34,9 +34,9 @@ def import_tei():
     logging.basicConfig(filename='import.log', level=logging.DEBUG)
 
     #xml_file = os.path.join(BASE_DIR, 'data', 'walenty', 'walenty_20200926_smaller.xml')
-    # xml_file = os.path.join(BASE_DIR, 'data', 'walenty', 'walenty_20210913_smaller.xml')
+    xml_file = os.path.join(BASE_DIR, 'data', 'walenty', 'walenty_20210913_smaller.xml')
     # xml_file = os.path.join(BASE_DIR, 'data', 'walenty', 'walenty_20210913_smallest.xml')
-    xml_file = os.path.join(BASE_DIR, 'data', 'walenty', 'walenty_20210913.xml')
+    # xml_file = os.path.join(BASE_DIR, 'data', 'walenty', 'walenty_20210913.xml')
 
 
     xml_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), xml_file)
-- 
GitLab