mirror of
https://github.com/typemill/typemill.git
synced 2025-07-25 00:02:28 +02:00
Add default component for theme tabs
This commit is contained in:
@@ -11,3 +11,5 @@ meta:
|
||||
noindex: false
|
||||
contains: pages
|
||||
template: ''
|
||||
cyanine:
|
||||
template: standard
|
||||
|
@@ -50,7 +50,16 @@ const app = Vue.createApp({
|
||||
else
|
||||
{
|
||||
eventBus.$emit("showEditor", false);
|
||||
return 'tab-' + this.currentTab.toLowerCase()
|
||||
|
||||
const componentName = 'tab-' + this.currentTab.toLowerCase();
|
||||
|
||||
|
||||
if (this.$root.$options.components && this.$root.$options.components[componentName])
|
||||
{
|
||||
return componentName;
|
||||
}
|
||||
|
||||
return 'tab-defaulttab';
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -309,4 +318,58 @@ app.component('tab-meta', {
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
app.component('tab-defaulttab', {
|
||||
props: ['item', 'formData', 'formDefinitions', 'saved', 'errors', 'message', 'messageClass'],
|
||||
data: function () {
|
||||
return {
|
||||
disabled: true,
|
||||
}
|
||||
},
|
||||
template: `<section class="dark:bg-stone-700 dark:text-stone-200">
|
||||
<form>
|
||||
<div v-for="(fieldDefinition, fieldname) in formDefinitions.fields">
|
||||
<fieldset class="flex flex-wrap justify-between border-2 border-stone-200 p-4 my-8" v-if="fieldDefinition.type == 'fieldset'">
|
||||
<legend class="text-lg font-medium">{{ fieldDefinition.legend }}</legend>
|
||||
<component v-for="(subfieldDefinition, subfieldname) in fieldDefinition.fields"
|
||||
:key="subfieldname"
|
||||
:is="selectComponent(subfieldDefinition.type)"
|
||||
:errors="errors"
|
||||
:name="subfieldname"
|
||||
:userroles="userroles"
|
||||
:value="formData[subfieldname]"
|
||||
v-bind="subfieldDefinition">
|
||||
</component>
|
||||
</fieldset>
|
||||
<component v-else
|
||||
:key="fieldname"
|
||||
:is="selectComponent(fieldDefinition.type)"
|
||||
:errors="errors"
|
||||
:name="fieldname"
|
||||
:userroles="userroles"
|
||||
:value="formData[fieldname]"
|
||||
v-bind="fieldDefinition">
|
||||
</component>
|
||||
</div>
|
||||
<div class="my-5">
|
||||
<div class="block w-full h-8 my-1">
|
||||
<transition name="fade">
|
||||
<div v-if="message" :class="messageClass" class="text-white px-3 py-1 transition duration-100">{{ $filters.translate(message) }}</div>
|
||||
</transition>
|
||||
</div>
|
||||
<input type="submit" @click.prevent="saveInput()" :value="$filters.translate('save')" class="w-full p-3 my-1 bg-stone-700 dark:bg-stone-600 hover:bg-stone-900 hover:dark:bg-stone-900 text-white cursor-pointer transition duration-100">
|
||||
</div>
|
||||
</form>
|
||||
</section>`,
|
||||
methods: {
|
||||
selectComponent: function(type)
|
||||
{
|
||||
return 'component-' + type;
|
||||
},
|
||||
saveInput: function()
|
||||
{
|
||||
this.$emit('saveform');
|
||||
},
|
||||
}
|
||||
})
|
@@ -900,6 +900,8 @@ metatabs:
|
||||
type: checkbox
|
||||
label: 'Glossary List (cyanine theme)'
|
||||
checkboxlabel: 'List pages or posts of this folder as glossary (only for folders)'
|
||||
cyanine:
|
||||
fields:
|
||||
fieldsetTemplates:
|
||||
type: fieldset
|
||||
legend: 'Templates'
|
||||
|
Reference in New Issue
Block a user