Add page titles (#4775)

* restructure template rendering

* add useTitle composable

* Split up render-string-template from getFieldsFromTemplate

Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
This commit is contained in:
Nitwel
2021-03-31 16:53:57 +02:00
committed by GitHub
parent 8df659325c
commit 6f9b2cafcd
13 changed files with 81 additions and 50 deletions

View File

@@ -28,26 +28,11 @@
<template #append v-if="!disabled">
<template v-if="currentItem">
<v-icon
name="open_in_new"
class="edit"
v-tooltip="$t('edit')"
@click.stop="editModalActive = true"
/>
<v-icon
name="close"
class="deselect"
@click.stop="$emit('input', null)"
v-tooltip="$t('deselect')"
/>
<v-icon name="open_in_new" class="edit" v-tooltip="$t('edit')" @click.stop="editModalActive = true" />
<v-icon name="close" class="deselect" @click.stop="$emit('input', null)" v-tooltip="$t('deselect')" />
</template>
<template v-else>
<v-icon
class="add"
name="add"
v-tooltip="$t('create_item')"
@click.stop="editModalActive = true"
/>
<v-icon class="add" name="add" v-tooltip="$t('create_item')" @click.stop="editModalActive = true" />
<v-icon class="expand" :class="{ active }" name="expand_more" />
</template>
</template>
@@ -71,11 +56,7 @@
@click="setCurrent(item)"
>
<v-list-item-content>
<render-template
:collection="relatedCollection.collection"
:template="displayTemplate"
:item="item"
/>
<render-template :collection="relatedCollection.collection" :template="displayTemplate" :item="item" />
</v-list-item-content>
</v-list-item>
</template>
@@ -105,7 +86,7 @@
import { defineComponent, computed, ref, toRefs, watch, PropType } from '@vue/composition-api';
import { useCollectionsStore, useRelationsStore } from '@/stores/';
import useCollection from '@/composables/use-collection';
import getFieldsFromTemplate from '@/utils/get-fields-from-template';
import { getFieldsFromTemplate } from '@/utils/get-fields-from-template';
import api from '@/api';
import DrawerItem from '@/views/private/components/drawer-item';
import DrawerCollection from '@/views/private/components/drawer-collection';

View File

@@ -10,8 +10,7 @@
<script lang="ts">
import { defineComponent, computed } from '@vue/composition-api';
import { render } from 'micromustache';
import i18n from '@/lang';
import getFieldsFromTemplate from '@/utils/get-fields-from-template';
import { getFieldsFromTemplate } from '@/utils/get-fields-from-template';
export default defineComponent({
props: {

View File

@@ -33,7 +33,7 @@ import { defineComponent, PropType, computed, ref, watch } from '@vue/compositio
import { useRelationsStore } from '@/stores/';
import api from '@/api';
import { Relation } from '@/types';
import getFieldsFromTemplate from '@/utils/get-fields-from-template';
import { getFieldsFromTemplate } from '@/utils/get-fields-from-template';
import DrawerItem from '@/views/private/components/drawer-item/drawer-item.vue';
import { useCollection } from '@/composables/use-collection';
import { unexpectedError } from '@/utils/unexpected-error';

View File

@@ -50,7 +50,7 @@ import { defineComponent, ref, computed, PropType, onMounted, watch } from '@vue
import { useCollection } from '@/composables/use-collection';
import { useRelationsStore } from '@/stores';
import api from '@/api';
import getFieldsFromTemplate from '@/utils/get-fields-from-template';
import { getFieldsFromTemplate } from '@/utils/get-fields-from-template';
import draggable from 'vuedraggable';
import hideDragImage from '@/utils/hide-drag-image';
import NestedDraggable from './nested-draggable.vue';