Adding ckeditor field. Fixing checkbox structure.

Fetching page templates dynamically
parent 4d0de589
...@@ -14,7 +14,10 @@ ...@@ -14,7 +14,10 @@
<el-input v-model="page[locale].slug"></el-input> <el-input v-model="page[locale].slug"></el-input>
</el-form-item> </el-form-item>
// Textarea <el-form-item :label="translate('page', 'body')">
<ckeditor v-model="page[locale].body">
</ckeditor>
</el-form-item>
<div class="panel box box-primary"> <div class="panel box box-primary">
<div class="box-header"> <div class="box-header">
...@@ -77,12 +80,10 @@ ...@@ -77,12 +80,10 @@
<div class="box box-primary"> <div class="box box-primary">
<div class="box-body"> <div class="box-body">
<el-form-item label=""> <el-form-item label="">
<el-checkbox-group v-model="page.is_home"> <el-checkbox v-model="page.is_home" :true-label="1" :false-label="0" name="is_home" :label="translate('page', 'is homepage')"></el-checkbox>
<el-checkbox :label="translate('page', 'is homepage')" name="is_home"></el-checkbox>
</el-checkbox-group>
</el-form-item> </el-form-item>
<el-form-item :label="translate('page', 'template')"> <el-form-item :label="translate('page', 'template')">
<el-select v-model="template" > <el-select v-model="template" filterable>
<el-option v-for="(template, key) in templates" :key="template" <el-option v-for="(template, key) in templates" :key="template"
:label="template" :value="key"></el-option> :label="template" :value="key"></el-option>
</el-select> </el-select>
...@@ -109,7 +110,7 @@ ...@@ -109,7 +110,7 @@
}, },
template: function () { template: function () {
this.page.template = this.template; this.page.template = this.template;
} },
}, },
data() { data() {
return { return {
...@@ -117,8 +118,8 @@ ...@@ -117,8 +118,8 @@
ogType: '', ogType: '',
template: '', template: '',
templates: { templates: {
'blog.index': 'blog/index', 'index': 'index',
'blog.show': 'blog/show', 'home': 'home',
}, },
} }
}, },
...@@ -128,7 +129,16 @@ ...@@ -128,7 +129,16 @@
.then(response => { .then(response => {
console.log(response); console.log(response);
}) })
},
setPageTypes() {
axios.get(route('api.page.page-templates.index'))
.then(response => {
this.templates = response.data;
});
} }
}, },
mounted() {
this.setPageTypes();
}
} }
</script> </script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment