From c06befa3436b09fc47f7ccf419ef7ced7d528bd8 Mon Sep 17 00:00:00 2001 From: dev sp Date: Fri, 16 Feb 2024 08:42:16 +0000 Subject: [PATCH] add dyanamic category pages --- src/components/ENCategory.vue | 130 +++++++++++++++++++++++++++ src/components/Modal.vue | 50 +++++++++++ src/pages/editor/add-file-list.astro | 3 + src/pages/editor/add-file.astro | 6 +- src/pages/en/[id].astro | 14 +-- src/pages/en/cat/index.astro | 21 +++++ src/pages/en/file.astro | 7 -- src/pages/en/index.astro | 11 ++- 8 files changed, 225 insertions(+), 17 deletions(-) create mode 100644 src/components/ENCategory.vue create mode 100644 src/components/Modal.vue create mode 100644 src/pages/en/cat/index.astro delete mode 100644 src/pages/en/file.astro diff --git a/src/components/ENCategory.vue b/src/components/ENCategory.vue new file mode 100644 index 0000000..9897cd9 --- /dev/null +++ b/src/components/ENCategory.vue @@ -0,0 +1,130 @@ + + + + + + \ No newline at end of file diff --git a/src/components/Modal.vue b/src/components/Modal.vue new file mode 100644 index 0000000..93f131e --- /dev/null +++ b/src/components/Modal.vue @@ -0,0 +1,50 @@ + + + + diff --git a/src/pages/editor/add-file-list.astro b/src/pages/editor/add-file-list.astro index e8265f5..eeaca16 100644 --- a/src/pages/editor/add-file-list.astro +++ b/src/pages/editor/add-file-list.astro @@ -107,3 +107,6 @@ import AdminHeader from "../../components/AdminHeader.astro"; }) } + \ No newline at end of file diff --git a/src/pages/editor/add-file.astro b/src/pages/editor/add-file.astro index eb995d8..4eda7b6 100644 --- a/src/pages/editor/add-file.astro +++ b/src/pages/editor/add-file.astro @@ -9,6 +9,7 @@ import AdminHeader from "../../components/AdminHeader.astro";

Add File

+
@@ -97,7 +98,10 @@ import AdminHeader from "../../components/AdminHeader.astro"; }) .then(response => response.json()) // Convert response to text .then(data => { - console.log(data); + console.log(data); + if(data.success === true){ + document.getElementById('uploadConfirm').style.display = 'block'; + } }) .catch(error => { console.error('Error occurred:', error); diff --git a/src/pages/en/[id].astro b/src/pages/en/[id].astro index e5d8839..2bfffed 100644 --- a/src/pages/en/[id].astro +++ b/src/pages/en/[id].astro @@ -27,13 +27,13 @@ const items = data[idx]; tiwtterImage={items.img} tiwtterTitle={items.meta_title} tiwtterDesc={items.meta_description} - tiwtterURL=`https://barta-india.in/bn/${items.slug}` + tiwtterURL=`https://barta-india.in/en/${items.slug}` artPubTime={items.date_created} - ogSiteName=`https://barta-india.in/bn/${items.slug}` + ogSiteName=`https://barta-india.in/en/${items.slug}` ogType='News' ogTitle={items.meta_title} ogDesc={items.meta_description} - ogURL=`https://barta-india.in/bn/${items.slug}`> + ogURL=`https://barta-india.in/en/${items.slug}`>
@@ -46,10 +46,10 @@ const items = data[idx];

Share on:

- WhatsApp Logo - Facebook Logo - Twitter/X Logo - Linkdin Logo + WhatsApp Logo + Facebook Logo + Twitter/X Logo + Linkdin Logo

{items.content}

diff --git a/src/pages/en/cat/index.astro b/src/pages/en/cat/index.astro new file mode 100644 index 0000000..95ee13b --- /dev/null +++ b/src/pages/en/cat/index.astro @@ -0,0 +1,21 @@ +--- +import Layout from "../../../layouts/Layout.astro" +import ENCategory from "../../../components/ENCategory.vue"; +const postData = { key1: 'value1', key2: 'value2'}; +const options = { method: 'POST', headers: { 'Content-Type': 'application/json', 'Origin': 'https://2024.dev2-cs.siliconpin.com' }, body: JSON.stringify(postData)}; +const response = await fetch('https://apisp.dev2.cicdhosting.com/_dedicated/dwd/get-news/?action=news_en', options); +const data = await response.json(); +const news = data; +// console.log(news); +--- + +
+
+
+

Page > Name

+ + +
+
+
+
\ No newline at end of file diff --git a/src/pages/en/file.astro b/src/pages/en/file.astro deleted file mode 100644 index 03e93fb..0000000 --- a/src/pages/en/file.astro +++ /dev/null @@ -1,7 +0,0 @@ -
-
-
sqjns - -
-
-
\ No newline at end of file diff --git a/src/pages/en/index.astro b/src/pages/en/index.astro index 4b06413..5ca8383 100644 --- a/src/pages/en/index.astro +++ b/src/pages/en/index.astro @@ -5,7 +5,7 @@ const options = { method: 'POST', headers: { 'Content-Type': 'application/json', const response = await fetch('https://apisp.dev2.cicdhosting.com/_dedicated/dwd/get-news/?action=news_en', options); const data = await response.json(); const news = data; -console.log(news); +// console.log(news); ---
@@ -14,6 +14,13 @@ console.log(news);

Latest News

+
{news.map((items: {id: string | undefined; heading: string | undefined; img: string | undefined; title : string | undefined; content : string | undefined; slug : string | undefined; date_created : string | undefined; in_brief: string | undefined;}) =>
@@ -36,7 +43,7 @@ console.log(news);
WhatsApp Logo - Facebook Logo + Facebook Logo Twitter/X Logo Linkdin Logo