From 2fa6006913751893f54d8a6400e3d4f131931ae3 Mon Sep 17 00:00:00 2001 From: Aleksandr Bautin Date: Tue, 12 Dec 2023 20:55:11 +0300 Subject: [PATCH] added picture setting & template with blog --- src/api.ts | 12 ++++++------ src/components/TemplatesList.vue | 11 +++++++++++ src/result.ts | 12 ++++++++++-- src/views/Explore.vue | 13 ++++++++++++- 4 files changed, 39 insertions(+), 9 deletions(-) diff --git a/src/api.ts b/src/api.ts index 647ad30..5d674cf 100644 --- a/src/api.ts +++ b/src/api.ts @@ -60,12 +60,12 @@ export async function get_templates(url: string) { links: [{ telegram: "", mail: "", site: "" }], preview: "https://api.agorata.io/static/mountain.jpg", }, - { - title: "", - description: "", - links: [{ telegram: "", mail: "", site: "" }], - preview: "https://api.agorata.io/static/mountain.jpg", - }, + // { + // title: "", + // description: "", + // links: [{ telegram: "", mail: "", site: "" }], + // preview: "https://api.agorata.io/static/mountain.jpg", + // }, ]) ); } diff --git a/src/components/TemplatesList.vue b/src/components/TemplatesList.vue index a20cfa5..02ba34b 100644 --- a/src/components/TemplatesList.vue +++ b/src/components/TemplatesList.vue @@ -24,6 +24,17 @@ v-model="constructor_params.description" > +
+

Picture:

+ +

Add link:

= new Map(); template_id: string; + picture: string; + blog: string[]; constructor( domain: string, title: string = "", description: string = "", contacts: Map = new Map(), - template_id: string = "" + template_id: string = "", + picture: string = "", + blog = [] ) { this.domain = domain; this.title = title; this.description = description; this.contacts = contacts; this.template_id = template_id; + this.picture = picture; + this.blog = blog; } copy(): SiteConstructorParams { @@ -256,6 +262,8 @@ export async function get_constr_params(domain: string) { res.title, res.description, res.contacts, - res.template_id + res.template_id, + res.picture, + res.blog ); } diff --git a/src/views/Explore.vue b/src/views/Explore.vue index 1c2f8f5..f90b2f5 100644 --- a/src/views/Explore.vue +++ b/src/views/Explore.vue @@ -308,7 +308,18 @@ export default { await this.saveSite(); } this.constructor_params.domain = this.domain; - await call_api_post("set-site-data", this.constructor_params); + console.log("this.constructor_params", this.constructor_params); + await call_api_post("set-site-data", { + ...this.constructor_params, + blog: + this.constructor_params.template_id === "Template #3" + ? [ + "Ipsum dolor sit amet", + "Consectetur adipiscing elit", + "Sed do eiusmod tempor", + ] + : undefined, + }); this.saved_constructor_params = this.constructor_params; this.updSettingsComponent(); },