Adding the single media component on page view

parent 42c50c3e
url: https://github.com/AsgardCms/Platform url: https://github.com/AsgardCms/Platform
versions: versions:
"3.1.0@unreleased": "3.1.0@unreleased":
added:
- Carbon format set globally in <code>AppServiceProvider</code>
- Creating a string helpers mixing file
changed: changed:
- Registering the TranslationHelper mixin globally to access it from anywhere - Registering the TranslationHelper mixin globally to access it from anywhere
"3.0.0": "3.0.0":
......
...@@ -138,6 +138,9 @@ ...@@ -138,6 +138,9 @@
v-text="form.errors.first('template')"></div> v-text="form.errors.first('template')"></div>
</el-form-item> </el-form-item>
<tags-input namespace="asgardcms/page" @input="setTags" :current-tags="tags"></tags-input> <tags-input namespace="asgardcms/page" @input="setTags" :current-tags="tags"></tags-input>
<single-media zone="image" @singleFileSelected="selectSingleFile"
entity="Modules\Page\Entities\Page" :entity-id="page.id"></single-media>
</div> </div>
</div> </div>
</div> </div>
...@@ -174,7 +177,7 @@ ...@@ -174,7 +177,7 @@
og_type: '', og_type: '',
}]) }])
.fromPairs() .fromPairs()
.merge({template: 'default', is_home: 0}) .merge({template: 'default', is_home: 0, medias_single: []})
.value(), .value(),
templates: { templates: {
...@@ -244,6 +247,11 @@ ...@@ -244,6 +247,11 @@
} }
return route('api.page.page.store'); return route('api.page.page.store');
}, },
selectSingleFile(event) {
this.page.medias_single = {
[event.zone]: event.id,
};
}
}, },
mounted() { mounted() {
this.fetchTemplates(); this.fetchTemplates();
......
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