Browse Source

use textref header for textprod with title

Axolotle 2 years ago
parent
commit
cf441ecfab

+ 10 - 0
src/api/fragments/NodeInitial.gql

@@ -12,6 +12,16 @@ fragment NodeInitial on MapItemInterface {
   }
 
   ... on Textprod {
+    preTitle: field_titre_regular
+    italTitle: field_titre_italique
+
+    authors: auteurs {
+      id
+      name
+      first_name
+      last_name
+    }
+
     parents: text_de_depart {
       id
       variant: familles {

+ 2 - 2
src/components/nodes/NodeView.vue

@@ -7,7 +7,7 @@
     <div v-if="!loading" class="node-view-wrapper" :id="`node-${mode}-${node.id}`">
       <component
         ref="header"
-        :is="'node-view-header-' + nodeType"
+        :is="'node-view-header-' + (nodeType === 'prod' && (node.preTitle || node.italTitle) ? 'ref' : nodeType)"
         v-bind="{ node, mode, showOrigin }"
         class="node-view-header"
         :class="{ scrolling: scrollValue }"
@@ -108,7 +108,7 @@ export default {
           }
         }, 50)
       }
-    },
+    }
   },
 
   mounted () {

+ 1 - 1
src/pages/Introduction.vue

@@ -47,7 +47,7 @@ export default {
   },
 
   computed: {
-    ...mapGetters(['visited']),
+    ...mapGetters(['visited'])
   },
 
   methods: {

+ 1 - 1
src/pages/library/LibraryTree.vue

@@ -41,7 +41,7 @@
             active hovered
             @click="onNodeClick(activeNode.data)"
           >
-            <template v-if="activeNode.data.type === 'prod'">
+            <template v-if="activeNode.data.type === 'prod' && !(activeNode.data.preTitle || activeNode.data.italTitle)">
               {{ $t('variants.' + activeNode.data.variant) }}<br>
             </template>