Selaa lähdekoodia

update card views

axolotle 3 vuotta sitten
vanhempi
commit
b9db79988c

+ 4 - 4
src/components/NodeMap.vue

@@ -20,7 +20,7 @@
         :cx="node.x"
         :cy="node.y"
         class="svg-dot-btn"
-        :class="['svg-dot-btn-' + node.data.variant, { 'origin': node.data.isOrigin }]"
+        :class="['svg-dot-btn-' + node.data.variant, { 'origin': node.parent === null }]"
         tabindex="0"
         @click="onNodeClick(node.data)"
         @keyup.enter="onNodeClick(node.data)"
@@ -45,11 +45,11 @@
             @mouseleave="activeNode = null"
           >
             <template v-if="activeNode.data.variant !== 'depart'">
-              {{ activeNode.data.families[0].name }}<br>
+              {{ $t('variants.' + activeNode.data.variant) }}<br>
             </template>
             {{ toCommaList(activeNode.data.authors) }},<br>
-            <span v-if="activeNode.data.field_titre_regular" v-html="activeNode.data.field_titre_regular + ','" />
-            <span v-html="activeNode.data.field_titre_italique || '<em>pas de titre ital</em>'" />
+            <span v-if="activeNode.data.preTitle" v-html="activeNode.data.preTitle + ','" />
+            <span v-html="activeNode.data.title || '<em>pas de titre ital</em>'" />
           </dot-button>
         </foreignObject>
       </g>

+ 1 - 1
src/components/text/TextCard.vue

@@ -9,7 +9,7 @@
                 @click="onChildOpen($event, text.id, child.id)"
                 :active="children.includes(child.id)" :variant="child.variant"
               >
-                {{ child.families[0].name }}
+                {{ $t('variants.' + child.variant) }}
               </dot-button>
             </li>
           </template>

+ 4 - 10
src/components/text/TextCardBase.vue

@@ -15,7 +15,7 @@
                 </div>
               </template>
               <template v-else>
-                {{ text.families[0].name }}
+                {{ $t('variants.' + text.variant) }}
               </template>
             </h4>
             <slot name="header-extra" :text="text" />
@@ -23,8 +23,8 @@
 
           <div v-if="text.type === 'Textref'">
             <div class="text-title font-weight-normal">
-              <span v-if="text.field_titre_regular" v-html="text.field_titre_regular + ','" />
-              <span v-html="(text.field_titre_italique || '<em>pas de titre ital</em>') + ','" />
+              <span v-if="text.preTitle" v-html="text.field_titre_regular + ','" />
+              <span v-html="(text.title || '<em>pas de titre ital</em>') + ','" />
             </div>
             <div class="text-edition">
               {{ text.edition ? text.edition.name : text.edition }}
@@ -36,12 +36,6 @@
           <div class="text-content" v-html="text.content" />
 
           <div v-if="text.type === 'Textref'" class="debug">
-            <div class="">
-              'titre_regular': {{ text.field_titre_regular }}
-            </div>
-            <div class="">
-              'titre_italique: {{ text.field_titre_italique }}
-            </div>
             <div class="">
               'lien_reference': {{ text.lien_reference }}
             </div>
@@ -126,7 +120,7 @@ export default {
 
   created () {
     if (this.text !== null) return
-    this.$store.dispatch('GET_TEXT', { id: this.id }).then((text) => {
+    this.$store.dispatch('GET_NODE', { id: this.id }).then((text) => {
       this.text = text
       this.loading = false
     })