From ad548b43a148fc65e256c6862853352351e668a1 Mon Sep 17 00:00:00 2001
From: dcz <dcz@ipipan.waw.pl>
Date: Fri, 5 May 2023 13:45:40 +0200
Subject: [PATCH] Final hierarchy window

---
 .../unification/hierarchy/HierarchyEdit.vue   |   2 +-
 .../hierarchy/HierarchyElement.vue            | 128 +++++++++---------
 2 files changed, 67 insertions(+), 63 deletions(-)

diff --git a/frontend/src/components/unification/hierarchy/HierarchyEdit.vue b/frontend/src/components/unification/hierarchy/HierarchyEdit.vue
index 80b326a..c19168d 100644
--- a/frontend/src/components/unification/hierarchy/HierarchyEdit.vue
+++ b/frontend/src/components/unification/hierarchy/HierarchyEdit.vue
@@ -559,7 +559,7 @@ export default HierarchyEdit;
             @change-frame="changePreviewedUnifiedFrameId"
             :forceRefresh="internalForceRefresh" />
       </div>
-      <div v-if="right_pane_tab === 'hierarchy'" class="overflow-hidden center" style="height: calc(100% - 43px); width: calc(80%)">
+      <div v-if="right_pane_tab === 'hierarchy'" class="px-0 pt-0 pb-0 overflow-auto">
           <hierarchy-element :node="createHierarchyTree()" :spacing_elem_type="'none'"/>
       </div>
       <div :class="right_pane_tab !== 'notes' && 'd-none'" id="notes-component"></div>
diff --git a/frontend/src/components/unification/hierarchy/HierarchyElement.vue b/frontend/src/components/unification/hierarchy/HierarchyElement.vue
index 4f19b8d..d9d00e9 100644
--- a/frontend/src/components/unification/hierarchy/HierarchyElement.vue
+++ b/frontend/src/components/unification/hierarchy/HierarchyElement.vue
@@ -38,11 +38,11 @@ export default {
         },
         getSpacingElem() {
             if(this.spacing_elem_type === "std") {
-                return "&#9500;&#8594;";
+                return "&#9474; &#9500;&#8594; &#9474;";
             } else if(this.spacing_elem_type === "top_corner") {
-                return "&#9484;&#8594;";
+                return "&#160; &#160; &#160; &#160; &#9484;&#8594; &#9474; &#9474;";
             } else if(this.spacing_elem_type === "down_corner") {
-                return "&#9492;&#8594;";
+                return "&#9474; &#9474; &#9492;&#8594;";
             } else {
                 return "";
             }
@@ -94,81 +94,85 @@ export default {
 
 
 <template>
-    <div :style="nodeMargin">
+    <div :style="nodeMargin" style="height: 100%">
         <div v-if="hasHypyronyms" v-show="showHypyronyms">
             <hierarchy-element
                     v-for="(child, index) in node.hypyronyms"
                     :key="child.id"
                     :node="child"
                     :spacing_elem_type='index === 0 ? "top_corner" : "std"'
-                    :spacing="spacing + 10"
+                    :spacing="spacing + 40"
             />
         </div>
         <div show class="d-flex justify-content-between mb-1">
             <div class="row">
-                <div class="col" v-html="getSpacingElem"/>
+                <div class="col" style="max-width: 10px" v-html="getSpacingElem"/>
                 <div class="col">
-
-                    <div align="left" style="display: table;">
-                        <div class="unifiedFrame mt-3" id="hierarchy-unified-frame-title" v-html="node.unified_frame.title"></div>
-                        <table id="hierarchy-unified-frame" class="m-0 table-borderless border border-secondary text-dark frame active">
-                            <tbody>
-                            <tr>
-                                <template v-for="argument in node.unified_frame.arguments">
-                                    <td
-                                            class="argument py-2 px-1 border-top border-left border-secondary role-column"
-                                            :class="argument.role ? argument.role.str + ' ' : ''"
-                                    >
-                                        {{ argument.role_type }}
-
-                                        <div
-                                                v-if="argument.role"
+                    <div class="row">
+                        <div class="col cursor-pointer" style="text-align: center; font-size: large"><span
+                                v-if="hasHypyronyms"
+                                :class="toggleChildrenIcon"
+                                @click="toggleHypyronyms"
+                                @keypress="toggleHypyronyms">&#9650;</span></div>
+                    </div>
+                    <div class="row">
+                        <div class="col" align="left" style="display: table;">
+                            <div class="unifiedFrame" id="hierarchy-unified-frame-title" v-html="node.unified_frame.title"></div>
+                            <table id="hierarchy-unified-frame" class="m-0 table-borderless border border-secondary text-dark frame active">
+                                <tbody>
+                                <tr>
+                                    <template v-for="argument in node.unified_frame.arguments">
+                                        <td
+                                                class="argument py-2 px-1 border-top border-left border-secondary role-column"
+                                                :class="argument.role ? argument.role.str + ' ' : ''"
                                         >
-                                            [{{ argument.role.str }}]
-                                        </div>
-                                        <div v-else>
-                                            <ul class="ul-role">
-                                                <li v-for="proposed_role in argument.proposed_roles">
-                                                    {{ proposed_role.str }}
-                                                </li>
-                                            </ul>
-                                        </div>
-                                    </td>
-                                </template>
-                            </tr>
-                            <tr>
-                                <td hidden class="preferences py-0 px-0 border-top border-left border-secondary role-column align-top"
-                                    v-for='argument in node.unified_frame.arguments'
-                                    :key='argument.id'
-                                >
-                                    <ul class="ul-preference" v-if="argument.preferences.length > 0">
-                                        <li v-for='preference in argument.preferences'>
+                                            {{ argument.role_type }}
+
                                             <div
-                                                    v-if="preference.url != null"
-                                                    class="preference py-2 px-1 preference-bold"
+                                                    v-if="argument.role"
                                             >
-                                                <a class="synset-plwn" v-bind:href="preference.url" target="_blank">{{ preference.str }}</a>
+                                                [{{ argument.role.str }}]
+                                            </div>
+                                            <div v-else>
+                                                <ul class="ul-role">
+                                                    <li v-for="proposed_role in argument.proposed_roles">
+                                                        {{ proposed_role.str }}
+                                                    </li>
+                                                </ul>
                                             </div>
-                                            <div v-else class="preference py-2 px-1 preference-bold">{{ preference.str }}</div>
-                                        </li>
-                                    </ul>
-                                </td>
-                            </tr>
-                            </tbody>
-                        </table>
+                                        </td>
+                                    </template>
+                                </tr>
+                                <tr>
+                                    <td hidden class="preferences py-0 px-0 border-top border-left border-secondary role-column align-top"
+                                        v-for='argument in node.unified_frame.arguments'
+                                        :key='argument.id'
+                                    >
+                                        <ul class="ul-preference" v-if="argument.preferences.length > 0">
+                                            <li v-for='preference in argument.preferences'>
+                                                <div
+                                                        v-if="preference.url != null"
+                                                        class="preference py-2 px-1 preference-bold"
+                                                >
+                                                    <a class="synset-plwn" v-bind:href="preference.url" target="_blank">{{ preference.str }}</a>
+                                                </div>
+                                                <div v-else class="preference py-2 px-1 preference-bold">{{ preference.str }}</div>
+                                            </li>
+                                        </ul>
+                                    </td>
+                                </tr>
+                                </tbody>
+                            </table>
+                        </div>
+                    </div>
+                    <div class="row align-content-center">
+                        <div class="col cursor-pointer" style="text-align: center; font-size: large"><span
+                                v-if="hasHyponyms"
+                                :class="toggleChildrenIcon"
+                                @click="toggleHyponyms"
+                                @keypress="toggleHyponyms">&#9660;</span></div>
                     </div>
-                    {{ node.label }}
                 </div>
-                <div class="col"><span
-                    v-if="hasHyponyms"
-                    :class="toggleChildrenIcon"
-                    @click="toggleHyponyms"
-                    @keypress="toggleHyponyms">V</span></div>
-                <div class="col"><span
-                    v-if="hasHypyronyms"
-                    :class="toggleChildrenIcon"
-                    @click="toggleHypyronyms"
-                    @keypress="toggleHypyronyms">A</span></div>
             </div>
         </div>
         <div v-if="hasHyponyms" v-show="showHyponyms">
@@ -177,7 +181,7 @@ export default {
                     :key="child.id"
                     :node="child"
                     :spacing_elem_type='index === node.hyponyms.length - 1 ? "down_corner" : "std"'
-                    :spacing="spacing + 10"
+                    :spacing="spacing + 40"
             />
         </div>
     </div>
-- 
GitLab