Browse Source

added picture setting & template with blog

master
Aleksandr Bautin 11 months ago
parent
commit
2fa6006913
No known key found for this signature in database
GPG Key ID: 9B3364A12DFE9211
  1. 12
      src/api.ts
  2. 11
      src/components/TemplatesList.vue
  3. 12
      src/result.ts
  4. 13
      src/views/Explore.vue

12
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",
// },
])
);
}

11
src/components/TemplatesList.vue

@ -24,6 +24,17 @@
v-model="constructor_params.description"
></contenteditable>
</div>
<div style="display: flex; width: 100%">
<p style="width: 9rem">Picture:</p>
<contenteditable
class="record-inp"
tag="div"
:no-hl="true"
:no-html="true"
spellcheck="false"
v-model="constructor_params.picture"
></contenteditable>
</div>
<div style="display: flex; width: 100%">
<p style="width: 9rem">Add link:</p>
<div

12
src/result.ts

@ -229,19 +229,25 @@ export class SiteConstructorParams {
description: string;
contacts: Map<string, string> = new Map<string, string>();
template_id: string;
picture: string;
blog: string[];
constructor(
domain: string,
title: string = "",
description: string = "",
contacts: Map<string, string> = new Map<string, string>(),
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
);
}

13
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();
},

Loading…
Cancel
Save