jeawin-astro 3.0.21 → 3.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +10 -10
- package/src/components/blocks/block1.astro +1 -1
- package/src/components/category_list.astro +138 -138
- package/src/components/comment_form.astro +126 -126
- package/src/components/default_image.astro +36 -36
- package/src/components/formitem/checkbox.astro +48 -48
- package/src/components/formitem/country.astro +37 -37
- package/src/components/formitem/input.astro +30 -30
- package/src/components/formitem/radio.astro +48 -48
- package/src/components/formitem/select.astro +21 -21
- package/src/components/formitem/textarea.astro +24 -24
- package/src/components/image.astro +36 -36
- package/src/components/nodes_list.astro +125 -125
- package/src/components/pagination.astro +205 -205
- package/src/components/product_category_list.astro +195 -195
- package/src/components/rel_nodes_list.astro +63 -63
- package/src/components/site_options.astro +39 -39
- package/src/components/stat.astro +76 -76
- package/src/integrations/jeawin-common-route/index.ts +13 -13
- package/src/integrations/jeawin-site-clearcache/index.ts +6 -0
- package/src/layouts/Footer.astro +190 -190
- package/src/layouts/Header.astro +65 -65
- package/src/layouts/channel.astro +168 -168
- package/src/layouts/page.astro +148 -148
- package/src/{pages → routes}/robots.txt.ts +10 -10
- package/src/{pages → routes}/site.webmanifest.ts +30 -30
- package/src/scripts/aos.d.ts +1 -1
- package/src/scripts/cms.d.ts +129 -129
- package/src/scripts/consts.d.ts +26 -26
- package/src/scripts/consts.js +1 -1
- package/src/scripts/lightbox.d.ts +1 -1
- package/src/scripts/magnify.d.ts +6 -6
- package/src/scripts/search-result-list.d.ts +1 -1
- package/src/scripts/smartmenus.d.ts +2 -2
- package/src/scripts/swiper.d.ts +1 -1
- package/src/scripts/util.d.ts +40 -40
- package/src/service/image-service.ts +18 -18
- package/src/service/jeawin.ts +162 -162
- /package/src/{pages → routes}/clear_cache.ts +0 -0
- /package/src/{pages → routes}/google644a0e8e598e1092.html.ts +0 -0
- /package/src/{pages → routes}/googlef1564b538eef5383.html.ts +0 -0
- /package/src/{pages → routes}/install_sw.html.ts +0 -0
- /package/src/{pages → routes}/manifest.json.ts +0 -0
- /package/src/{pages → routes}/opensearch.xml.ts +0 -0
- /package/src/{pages → routes}/rss.xml.ts +0 -0
- /package/src/{pages → routes}/sitemap.txt.ts +0 -0
- /package/src/{pages → routes}/sitemap.xml.ts +0 -0
- /package/src/{pages → routes}/sitemap.xsl.ts +0 -0
- /package/src/{pages → routes}/sw.js.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jeawin-astro",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.23",
|
|
4
4
|
"author": "chaegumi <chaegumi@qq.com>",
|
|
5
5
|
"description": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,21 +35,21 @@
|
|
|
35
35
|
"@rollup/plugin-strip": "^3.0.4",
|
|
36
36
|
"@rollup/plugin-terser": "^0.4.4",
|
|
37
37
|
"@rollup/plugin-typescript": "^12.1.2",
|
|
38
|
-
"@types/lodash": "^4.17.
|
|
38
|
+
"@types/lodash": "^4.17.16",
|
|
39
39
|
"@types/sprintf-js": "^1.1.4",
|
|
40
40
|
"autoprefixer": "^10.4.20",
|
|
41
41
|
"chai": "^5.2.0",
|
|
42
42
|
"mocha": "^10.8.2",
|
|
43
43
|
"postcss": "^8.5.3",
|
|
44
|
-
"rollup": "^4.34.
|
|
44
|
+
"rollup": "^4.34.9",
|
|
45
45
|
"rollup-plugin-node-externals": "^7.1.3",
|
|
46
46
|
"rollup-plugin-postcss": "^4.0.2",
|
|
47
|
-
"typescript": "^5.
|
|
47
|
+
"typescript": "^5.8.2"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"@astrojs/alpinejs": "^0.4.3",
|
|
51
51
|
"@astrojs/check": "^0.9.4",
|
|
52
|
-
"@astrojs/cloudflare": "^12.2.
|
|
52
|
+
"@astrojs/cloudflare": "^12.2.3",
|
|
53
53
|
"@astrojs/rss": "^4.0.11",
|
|
54
54
|
"@astrojs/sitemap": "3.2.1",
|
|
55
55
|
"@astrojs/ts-plugin": "^1.10.4",
|
|
@@ -61,11 +61,11 @@
|
|
|
61
61
|
"@pagefind/default-ui": "^1.3.0",
|
|
62
62
|
"@tailwindcss/forms": "^0.5.10",
|
|
63
63
|
"@tailwindcss/typography": "^0.5.16",
|
|
64
|
-
"@tailwindcss/vite": "^4.0.
|
|
64
|
+
"@tailwindcss/vite": "^4.0.9",
|
|
65
65
|
"@types/alpinejs": "^3.13.11",
|
|
66
66
|
"alpinejs": "^3.14.8",
|
|
67
67
|
"aos": "3.0.0-beta.6",
|
|
68
|
-
"astro": "^5.
|
|
68
|
+
"astro": "^5.4.1",
|
|
69
69
|
"astro-color-scheme": "^1.1.5",
|
|
70
70
|
"astro-embed": "^0.9.0",
|
|
71
71
|
"astro-icon": "^1.1.5",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"dayjs": "^1.11.13",
|
|
76
76
|
"fetch-jsonp": "^1.3.0",
|
|
77
77
|
"glob": "^11.0.1",
|
|
78
|
-
"keyv": "^5.
|
|
78
|
+
"keyv": "^5.3.1",
|
|
79
79
|
"keyv-lru": "^3.0.4",
|
|
80
80
|
"lodash": "^4.17.21",
|
|
81
81
|
"pagefind": "^1.3.0",
|
|
@@ -83,10 +83,10 @@
|
|
|
83
83
|
"sirv": "^3.0.1",
|
|
84
84
|
"smartmenus": "2.0.0-alpha.1",
|
|
85
85
|
"sprintf-js": "^1.1.3",
|
|
86
|
-
"string-strip-html": "^13.4.
|
|
86
|
+
"string-strip-html": "^13.4.12",
|
|
87
87
|
"swiper": "^11.2.4",
|
|
88
88
|
"tailwind-scrollbar": "^4.0.1",
|
|
89
|
-
"tailwindcss": "^4.0.
|
|
89
|
+
"tailwindcss": "^4.0.9",
|
|
90
90
|
"tslib": "^2.8.1",
|
|
91
91
|
"zod": "^3.24.2"
|
|
92
92
|
}
|
|
@@ -117,7 +117,7 @@ if (Astro.slots.has("default")) {
|
|
|
117
117
|
|
|
118
118
|
<custom-carousel-section>
|
|
119
119
|
<SectionContainer bgcolor={bgcolor} max_width_screen={max_width_screen}>
|
|
120
|
-
<div class:list={["flex", { "flex-
|
|
120
|
+
<div class:list={["flex", "flex-col", { "md:flex-row": layout == "two-column" }, "gap-4"]}>
|
|
121
121
|
<div
|
|
122
122
|
class:list={[
|
|
123
123
|
"flex items-center justify-evenly gap-2",
|
|
@@ -1,138 +1,138 @@
|
|
|
1
|
-
---
|
|
2
|
-
/**
|
|
3
|
-
* 内容类别列表展示组件
|
|
4
|
-
*
|
|
5
|
-
* jeawin-astro/src/components/category_list.astro
|
|
6
|
-
*
|
|
7
|
-
* @package jeawin-astro
|
|
8
|
-
* @author Chaegumi
|
|
9
|
-
* @copyright Copyright (c) 2024-2099 jeawin.com
|
|
10
|
-
* @email chaegumi@jeawin.com
|
|
11
|
-
* @filesource
|
|
12
|
-
*/
|
|
13
|
-
import _ from "lodash";
|
|
14
|
-
import { render_url } from "../scripts/util.js";
|
|
15
|
-
import CommonCard from "./common_card.astro";
|
|
16
|
-
import NodesList from "./nodes_list.astro";
|
|
17
|
-
interface Props {
|
|
18
|
-
channel_id: any;
|
|
19
|
-
category_id?: any;
|
|
20
|
-
uri?: any;
|
|
21
|
-
page?: any;
|
|
22
|
-
limit?: any;
|
|
23
|
-
include_children_category_nodes?: any;
|
|
24
|
-
no_fields?: any;
|
|
25
|
-
show_category_nodes?: boolean;
|
|
26
|
-
has_sider?: boolean;
|
|
27
|
-
layout?: any;
|
|
28
|
-
node_item_component?: any;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const {
|
|
32
|
-
channel_id,
|
|
33
|
-
category_id,
|
|
34
|
-
uri,
|
|
35
|
-
page,
|
|
36
|
-
limit,
|
|
37
|
-
include_children_category_nodes,
|
|
38
|
-
no_fields,
|
|
39
|
-
show_category_nodes = false,
|
|
40
|
-
has_sider = false,
|
|
41
|
-
layout = "grid gap-4 grid-cols-2 md:grid-cols-4",
|
|
42
|
-
node_item_component,
|
|
43
|
-
} = Astro.props;
|
|
44
|
-
|
|
45
|
-
const { btn_class, all_categories, base, url_suffix } = Astro.locals;
|
|
46
|
-
|
|
47
|
-
const categories: any[] = _.filter(all_categories, (o: any) => {
|
|
48
|
-
return (
|
|
49
|
-
Number(o.channel_id) === Number(channel_id) &&
|
|
50
|
-
Number(o.parent_id) === Number(category_id)
|
|
51
|
-
);
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
let Component = Fragment;
|
|
55
|
-
switch (node_item_component) {
|
|
56
|
-
default:
|
|
57
|
-
Component = CommonCard;
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
---
|
|
61
|
-
|
|
62
|
-
{
|
|
63
|
-
categories.length > 0 ? (
|
|
64
|
-
categories.map((category, idx) => (
|
|
65
|
-
<section
|
|
66
|
-
class:list={[
|
|
67
|
-
"py-12",
|
|
68
|
-
{ "bg-[#ffffff]": idx % 2 === 1, "bg-slate-50": idx % 2 === 0 },
|
|
69
|
-
]}
|
|
70
|
-
data-aos="fade-up"
|
|
71
|
-
data-aos-once="false"
|
|
72
|
-
>
|
|
73
|
-
<div class={has_sider ? "w-full" : "max-w-screen-2xl mx-auto"}>
|
|
74
|
-
<div class="px-4">
|
|
75
|
-
<h2 class="text-2xl mb-7 text-center font-bold text-neutral-800 md:text-4xl md:leading-tight">
|
|
76
|
-
{category.category_name}
|
|
77
|
-
</h2>
|
|
78
|
-
<div class="mx-auto text-center break-words mb-12 prose !max-w-none">
|
|
79
|
-
<Fragment set:html={category.category_content} />
|
|
80
|
-
</div>
|
|
81
|
-
{show_category_nodes ? (
|
|
82
|
-
<NodesList
|
|
83
|
-
channel_id={category.channel_id}
|
|
84
|
-
category_id={category.id}
|
|
85
|
-
limit_type="limit"
|
|
86
|
-
limit="4"
|
|
87
|
-
include_children_category_nodes={
|
|
88
|
-
include_children_category_nodes
|
|
89
|
-
}
|
|
90
|
-
no_fields={no_fields}
|
|
91
|
-
>
|
|
92
|
-
{(nodes: any[]) => (
|
|
93
|
-
<div class:list={[layout]}>
|
|
94
|
-
{nodes.map((node: any) => (
|
|
95
|
-
<Component node={node} title_tag="h3" />
|
|
96
|
-
))}
|
|
97
|
-
</div>
|
|
98
|
-
)}
|
|
99
|
-
</NodesList>
|
|
100
|
-
) : null}
|
|
101
|
-
|
|
102
|
-
<div class="text-center mt-6">
|
|
103
|
-
<a
|
|
104
|
-
href={render_url(category.category_url, base, null, url_suffix)}
|
|
105
|
-
class:list={btn_class}
|
|
106
|
-
title="SEE ALL "
|
|
107
|
-
>SEE ALL {category.category_name} ({category.nodecount})</a>
|
|
108
|
-
</div>
|
|
109
|
-
</div>
|
|
110
|
-
</div>
|
|
111
|
-
</section>
|
|
112
|
-
))
|
|
113
|
-
) : (
|
|
114
|
-
<section class="py-12 bg-slate-50" data-aos="fade-up" data-aos-once="false">
|
|
115
|
-
<div class={has_sider ? "w-full" : "max-w-screen-2xl mx-auto"}>
|
|
116
|
-
<div class="px-4">
|
|
117
|
-
<NodesList
|
|
118
|
-
channel_id={channel_id}
|
|
119
|
-
category_id={category_id}
|
|
120
|
-
uri={uri}
|
|
121
|
-
page={page}
|
|
122
|
-
limit={limit}
|
|
123
|
-
include_children_category_nodes={include_children_category_nodes}
|
|
124
|
-
no_fields={no_fields}
|
|
125
|
-
>
|
|
126
|
-
{(nodes: any[]) => (
|
|
127
|
-
<div class:list={[layout]}>
|
|
128
|
-
{nodes.map((node: any) => (
|
|
129
|
-
<Component node={node} title_tag="h2" />
|
|
130
|
-
))}
|
|
131
|
-
</div>
|
|
132
|
-
)}
|
|
133
|
-
</NodesList>
|
|
134
|
-
</div>
|
|
135
|
-
</div>
|
|
136
|
-
</section>
|
|
137
|
-
)
|
|
138
|
-
}
|
|
1
|
+
---
|
|
2
|
+
/**
|
|
3
|
+
* 内容类别列表展示组件
|
|
4
|
+
*
|
|
5
|
+
* jeawin-astro/src/components/category_list.astro
|
|
6
|
+
*
|
|
7
|
+
* @package jeawin-astro
|
|
8
|
+
* @author Chaegumi
|
|
9
|
+
* @copyright Copyright (c) 2024-2099 jeawin.com
|
|
10
|
+
* @email chaegumi@jeawin.com
|
|
11
|
+
* @filesource
|
|
12
|
+
*/
|
|
13
|
+
import _ from "lodash";
|
|
14
|
+
import { render_url } from "../scripts/util.js";
|
|
15
|
+
import CommonCard from "./common_card.astro";
|
|
16
|
+
import NodesList from "./nodes_list.astro";
|
|
17
|
+
interface Props {
|
|
18
|
+
channel_id: any;
|
|
19
|
+
category_id?: any;
|
|
20
|
+
uri?: any;
|
|
21
|
+
page?: any;
|
|
22
|
+
limit?: any;
|
|
23
|
+
include_children_category_nodes?: any;
|
|
24
|
+
no_fields?: any;
|
|
25
|
+
show_category_nodes?: boolean;
|
|
26
|
+
has_sider?: boolean;
|
|
27
|
+
layout?: any;
|
|
28
|
+
node_item_component?: any;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const {
|
|
32
|
+
channel_id,
|
|
33
|
+
category_id,
|
|
34
|
+
uri,
|
|
35
|
+
page,
|
|
36
|
+
limit,
|
|
37
|
+
include_children_category_nodes,
|
|
38
|
+
no_fields,
|
|
39
|
+
show_category_nodes = false,
|
|
40
|
+
has_sider = false,
|
|
41
|
+
layout = "grid gap-4 grid-cols-2 md:grid-cols-4",
|
|
42
|
+
node_item_component,
|
|
43
|
+
} = Astro.props;
|
|
44
|
+
|
|
45
|
+
const { btn_class, all_categories, base, url_suffix } = Astro.locals;
|
|
46
|
+
|
|
47
|
+
const categories: any[] = _.filter(all_categories, (o: any) => {
|
|
48
|
+
return (
|
|
49
|
+
Number(o.channel_id) === Number(channel_id) &&
|
|
50
|
+
Number(o.parent_id) === Number(category_id)
|
|
51
|
+
);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
let Component = Fragment;
|
|
55
|
+
switch (node_item_component) {
|
|
56
|
+
default:
|
|
57
|
+
Component = CommonCard;
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
{
|
|
63
|
+
categories.length > 0 ? (
|
|
64
|
+
categories.map((category, idx) => (
|
|
65
|
+
<section
|
|
66
|
+
class:list={[
|
|
67
|
+
"py-12",
|
|
68
|
+
{ "bg-[#ffffff]": idx % 2 === 1, "bg-slate-50": idx % 2 === 0 },
|
|
69
|
+
]}
|
|
70
|
+
data-aos="fade-up"
|
|
71
|
+
data-aos-once="false"
|
|
72
|
+
>
|
|
73
|
+
<div class={has_sider ? "w-full" : "max-w-screen-2xl mx-auto"}>
|
|
74
|
+
<div class="px-4">
|
|
75
|
+
<h2 class="text-2xl mb-7 text-center font-bold text-neutral-800 md:text-4xl md:leading-tight">
|
|
76
|
+
{category.category_name}
|
|
77
|
+
</h2>
|
|
78
|
+
<div class="mx-auto text-center break-words mb-12 prose !max-w-none">
|
|
79
|
+
<Fragment set:html={category.category_content} />
|
|
80
|
+
</div>
|
|
81
|
+
{show_category_nodes ? (
|
|
82
|
+
<NodesList
|
|
83
|
+
channel_id={category.channel_id}
|
|
84
|
+
category_id={category.id}
|
|
85
|
+
limit_type="limit"
|
|
86
|
+
limit="4"
|
|
87
|
+
include_children_category_nodes={
|
|
88
|
+
include_children_category_nodes
|
|
89
|
+
}
|
|
90
|
+
no_fields={no_fields}
|
|
91
|
+
>
|
|
92
|
+
{(nodes: any[]) => (
|
|
93
|
+
<div class:list={[layout]}>
|
|
94
|
+
{nodes.map((node: any) => (
|
|
95
|
+
<Component node={node} title_tag="h3" />
|
|
96
|
+
))}
|
|
97
|
+
</div>
|
|
98
|
+
)}
|
|
99
|
+
</NodesList>
|
|
100
|
+
) : null}
|
|
101
|
+
|
|
102
|
+
<div class="text-center mt-6">
|
|
103
|
+
<a
|
|
104
|
+
href={render_url(category.category_url, base, null, url_suffix)}
|
|
105
|
+
class:list={btn_class}
|
|
106
|
+
title="SEE ALL "
|
|
107
|
+
>SEE ALL {category.category_name} ({category.nodecount})</a>
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
</section>
|
|
112
|
+
))
|
|
113
|
+
) : (
|
|
114
|
+
<section class="py-12 bg-slate-50" data-aos="fade-up" data-aos-once="false">
|
|
115
|
+
<div class={has_sider ? "w-full" : "max-w-screen-2xl mx-auto"}>
|
|
116
|
+
<div class="px-4">
|
|
117
|
+
<NodesList
|
|
118
|
+
channel_id={channel_id}
|
|
119
|
+
category_id={category_id}
|
|
120
|
+
uri={uri}
|
|
121
|
+
page={page}
|
|
122
|
+
limit={limit}
|
|
123
|
+
include_children_category_nodes={include_children_category_nodes}
|
|
124
|
+
no_fields={no_fields}
|
|
125
|
+
>
|
|
126
|
+
{(nodes: any[]) => (
|
|
127
|
+
<div class:list={[layout]}>
|
|
128
|
+
{nodes.map((node: any) => (
|
|
129
|
+
<Component node={node} title_tag="h2" />
|
|
130
|
+
))}
|
|
131
|
+
</div>
|
|
132
|
+
)}
|
|
133
|
+
</NodesList>
|
|
134
|
+
</div>
|
|
135
|
+
</div>
|
|
136
|
+
</section>
|
|
137
|
+
)
|
|
138
|
+
}
|
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
---
|
|
2
|
-
/**
|
|
3
|
-
* 评论表单组件
|
|
4
|
-
*
|
|
5
|
-
* jeawin-astro/src/components/comment_form.astro
|
|
6
|
-
*
|
|
7
|
-
* @package jeawin-astro
|
|
8
|
-
* @author Chaegumi
|
|
9
|
-
* @copyright Copyright (c) 2024-2099 jeawin.com
|
|
10
|
-
* @email chaegumi@jeawin.com
|
|
11
|
-
* @filesource
|
|
12
|
-
*/
|
|
13
|
-
import { render_value } from "../scripts/util.js";
|
|
14
|
-
interface Props {
|
|
15
|
-
canonical: string;
|
|
16
|
-
channel_id: string;
|
|
17
|
-
category_id?: string;
|
|
18
|
-
node_id?: string;
|
|
19
|
-
}
|
|
20
|
-
const { canonical, channel_id, category_id, node_id } = Astro.props;
|
|
21
|
-
|
|
22
|
-
const { siteinfo, all_langs, jeawin_form_api_domain } = Astro.locals;
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
<style>
|
|
26
|
-
.error {
|
|
27
|
-
color: red;
|
|
28
|
-
}
|
|
29
|
-
</style>
|
|
30
|
-
<div style="padding:10px;clear:both;" data-aos="fade-up" data-aos-once="false">
|
|
31
|
-
<form
|
|
32
|
-
action={`${jeawin_form_api_domain}/api/comment/save_captcha`}
|
|
33
|
-
id="jeawin-comment-form"
|
|
34
|
-
>
|
|
35
|
-
<input type="hidden" name="captchaId" id="commentFormCaptchaId" value="" />
|
|
36
|
-
<input
|
|
37
|
-
type="hidden"
|
|
38
|
-
name="captcha_code"
|
|
39
|
-
id="commentFormCaptchaCode"
|
|
40
|
-
value=""
|
|
41
|
-
/>
|
|
42
|
-
|
|
43
|
-
<input type="hidden" name="site_id" value={siteinfo.id} />
|
|
44
|
-
<input type="hidden" name="channel_id" value={channel_id} />
|
|
45
|
-
<input type="hidden" name="category_id" value={category_id} />
|
|
46
|
-
<input type="hidden" name="node_id" value={node_id} />
|
|
47
|
-
<input type="hidden" name="fromurl" value={canonical} />
|
|
48
|
-
|
|
49
|
-
<div style="margin-top:10px;">
|
|
50
|
-
{render_value(all_langs, "Nickname")}<span style="color:red;">*</span>:
|
|
51
|
-
</div>
|
|
52
|
-
<div>
|
|
53
|
-
<input
|
|
54
|
-
type="text"
|
|
55
|
-
name="nickname"
|
|
56
|
-
id="comment_nickname"
|
|
57
|
-
autocomplete="off"
|
|
58
|
-
placeholder={render_value(all_langs, "Enter your nickname")}
|
|
59
|
-
required="required"
|
|
60
|
-
class="form-control"
|
|
61
|
-
style="width:100%;"
|
|
62
|
-
/>
|
|
63
|
-
</div>
|
|
64
|
-
|
|
65
|
-
<div style="margin-top:10px;">
|
|
66
|
-
{render_value(all_langs, "E-mail")}<span style="color:red;">*</span>:
|
|
67
|
-
</div>
|
|
68
|
-
<div>
|
|
69
|
-
<input
|
|
70
|
-
type="email"
|
|
71
|
-
name="email"
|
|
72
|
-
id="comment_email"
|
|
73
|
-
autocomplete="off"
|
|
74
|
-
placeholder={render_value(all_langs, "Enter your email")}
|
|
75
|
-
required="required"
|
|
76
|
-
class="form-control"
|
|
77
|
-
style="width:100%;"
|
|
78
|
-
/>
|
|
79
|
-
</div>
|
|
80
|
-
|
|
81
|
-
<div style="margin-top:10px;">
|
|
82
|
-
{render_value(all_langs, "Rate")}<span style="color:red;">*</span>:
|
|
83
|
-
</div>
|
|
84
|
-
<div>
|
|
85
|
-
<label><input type="radio" name="score" value="1" /> 1</label>
|
|
86
|
-
<label><input type="radio" name="score" value="2" /> 2</label>
|
|
87
|
-
<label><input type="radio" name="score" value="3" /> 3</label>
|
|
88
|
-
<label><input type="radio" name="score" value="4" /> 4</label>
|
|
89
|
-
<label
|
|
90
|
-
><input type="radio" name="score" value="5" checked="checked" /> 5</label
|
|
91
|
-
>
|
|
92
|
-
</div>
|
|
93
|
-
|
|
94
|
-
<div style="margin-top:10px;">
|
|
95
|
-
{render_value(all_langs, "Comments")}<span style="color:red;">*</span>:
|
|
96
|
-
</div>
|
|
97
|
-
<div>
|
|
98
|
-
<textarea
|
|
99
|
-
name="comment"
|
|
100
|
-
id="comment_content"
|
|
101
|
-
placeholder={render_value(all_langs, "Enter your comment")}
|
|
102
|
-
required="required"
|
|
103
|
-
style="width:100%;"
|
|
104
|
-
class="form-control"
|
|
105
|
-
rows="6"></textarea>
|
|
106
|
-
</div>
|
|
107
|
-
<div style="margin-top:10px;">
|
|
108
|
-
<button
|
|
109
|
-
type="submit"
|
|
110
|
-
class="btn btn-primary ampstart-btn"
|
|
111
|
-
id="commentFormSubmitBtn">{render_value(all_langs, "Send")}</button
|
|
112
|
-
>
|
|
113
|
-
</div>
|
|
114
|
-
</form>
|
|
115
|
-
</div>
|
|
116
|
-
<style is:inline>
|
|
117
|
-
.btn {
|
|
118
|
-
display: inline-block;
|
|
119
|
-
padding: 6px 12px;
|
|
120
|
-
}
|
|
121
|
-
.btn-primary {
|
|
122
|
-
color: white;
|
|
123
|
-
background-color: var(--themeColor);
|
|
124
|
-
border-color: var(--themeColor);
|
|
125
|
-
}
|
|
126
|
-
</style>
|
|
1
|
+
---
|
|
2
|
+
/**
|
|
3
|
+
* 评论表单组件
|
|
4
|
+
*
|
|
5
|
+
* jeawin-astro/src/components/comment_form.astro
|
|
6
|
+
*
|
|
7
|
+
* @package jeawin-astro
|
|
8
|
+
* @author Chaegumi
|
|
9
|
+
* @copyright Copyright (c) 2024-2099 jeawin.com
|
|
10
|
+
* @email chaegumi@jeawin.com
|
|
11
|
+
* @filesource
|
|
12
|
+
*/
|
|
13
|
+
import { render_value } from "../scripts/util.js";
|
|
14
|
+
interface Props {
|
|
15
|
+
canonical: string;
|
|
16
|
+
channel_id: string;
|
|
17
|
+
category_id?: string;
|
|
18
|
+
node_id?: string;
|
|
19
|
+
}
|
|
20
|
+
const { canonical, channel_id, category_id, node_id } = Astro.props;
|
|
21
|
+
|
|
22
|
+
const { siteinfo, all_langs, jeawin_form_api_domain } = Astro.locals;
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
<style>
|
|
26
|
+
.error {
|
|
27
|
+
color: red;
|
|
28
|
+
}
|
|
29
|
+
</style>
|
|
30
|
+
<div style="padding:10px;clear:both;" data-aos="fade-up" data-aos-once="false">
|
|
31
|
+
<form
|
|
32
|
+
action={`${jeawin_form_api_domain}/api/comment/save_captcha`}
|
|
33
|
+
id="jeawin-comment-form"
|
|
34
|
+
>
|
|
35
|
+
<input type="hidden" name="captchaId" id="commentFormCaptchaId" value="" />
|
|
36
|
+
<input
|
|
37
|
+
type="hidden"
|
|
38
|
+
name="captcha_code"
|
|
39
|
+
id="commentFormCaptchaCode"
|
|
40
|
+
value=""
|
|
41
|
+
/>
|
|
42
|
+
|
|
43
|
+
<input type="hidden" name="site_id" value={siteinfo.id} />
|
|
44
|
+
<input type="hidden" name="channel_id" value={channel_id} />
|
|
45
|
+
<input type="hidden" name="category_id" value={category_id} />
|
|
46
|
+
<input type="hidden" name="node_id" value={node_id} />
|
|
47
|
+
<input type="hidden" name="fromurl" value={canonical} />
|
|
48
|
+
|
|
49
|
+
<div style="margin-top:10px;">
|
|
50
|
+
{render_value(all_langs, "Nickname")}<span style="color:red;">*</span>:
|
|
51
|
+
</div>
|
|
52
|
+
<div>
|
|
53
|
+
<input
|
|
54
|
+
type="text"
|
|
55
|
+
name="nickname"
|
|
56
|
+
id="comment_nickname"
|
|
57
|
+
autocomplete="off"
|
|
58
|
+
placeholder={render_value(all_langs, "Enter your nickname")}
|
|
59
|
+
required="required"
|
|
60
|
+
class="form-control"
|
|
61
|
+
style="width:100%;"
|
|
62
|
+
/>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<div style="margin-top:10px;">
|
|
66
|
+
{render_value(all_langs, "E-mail")}<span style="color:red;">*</span>:
|
|
67
|
+
</div>
|
|
68
|
+
<div>
|
|
69
|
+
<input
|
|
70
|
+
type="email"
|
|
71
|
+
name="email"
|
|
72
|
+
id="comment_email"
|
|
73
|
+
autocomplete="off"
|
|
74
|
+
placeholder={render_value(all_langs, "Enter your email")}
|
|
75
|
+
required="required"
|
|
76
|
+
class="form-control"
|
|
77
|
+
style="width:100%;"
|
|
78
|
+
/>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
<div style="margin-top:10px;">
|
|
82
|
+
{render_value(all_langs, "Rate")}<span style="color:red;">*</span>:
|
|
83
|
+
</div>
|
|
84
|
+
<div>
|
|
85
|
+
<label><input type="radio" name="score" value="1" /> 1</label>
|
|
86
|
+
<label><input type="radio" name="score" value="2" /> 2</label>
|
|
87
|
+
<label><input type="radio" name="score" value="3" /> 3</label>
|
|
88
|
+
<label><input type="radio" name="score" value="4" /> 4</label>
|
|
89
|
+
<label
|
|
90
|
+
><input type="radio" name="score" value="5" checked="checked" /> 5</label
|
|
91
|
+
>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<div style="margin-top:10px;">
|
|
95
|
+
{render_value(all_langs, "Comments")}<span style="color:red;">*</span>:
|
|
96
|
+
</div>
|
|
97
|
+
<div>
|
|
98
|
+
<textarea
|
|
99
|
+
name="comment"
|
|
100
|
+
id="comment_content"
|
|
101
|
+
placeholder={render_value(all_langs, "Enter your comment")}
|
|
102
|
+
required="required"
|
|
103
|
+
style="width:100%;"
|
|
104
|
+
class="form-control"
|
|
105
|
+
rows="6"></textarea>
|
|
106
|
+
</div>
|
|
107
|
+
<div style="margin-top:10px;">
|
|
108
|
+
<button
|
|
109
|
+
type="submit"
|
|
110
|
+
class="btn btn-primary ampstart-btn"
|
|
111
|
+
id="commentFormSubmitBtn">{render_value(all_langs, "Send")}</button
|
|
112
|
+
>
|
|
113
|
+
</div>
|
|
114
|
+
</form>
|
|
115
|
+
</div>
|
|
116
|
+
<style is:inline>
|
|
117
|
+
.btn {
|
|
118
|
+
display: inline-block;
|
|
119
|
+
padding: 6px 12px;
|
|
120
|
+
}
|
|
121
|
+
.btn-primary {
|
|
122
|
+
color: white;
|
|
123
|
+
background-color: var(--themeColor);
|
|
124
|
+
border-color: var(--themeColor);
|
|
125
|
+
}
|
|
126
|
+
</style>
|