feat(home): ชั้นกรองที่ 1 — ประเภทโรงหนัง (ท้องถิ่น / อินดี้ / กลุ่มคนฉายหนัง)
- แถบกรองสองชั้นในแถวเดียว: ทั้งหมด → 3 ประเภท │ ยอดนิยม → หมวดภาพยนตร์เดิม
- เก็บประเภทที่ฟิลด์เดี่ยว cinema.venue_type (ค่าเดียว) + hasVenue()/filterCinemas({ venue })
- ย้าย "กลุ่มคนฉายหนัง" จาก categories ขึ้นชั้น 1 (ไม่ให้ปุ่มซ้ำ) · tag ยังอยู่และยังค้นหาเจอ
- เลือกได้ทีละชั้น: กดประเภทล้างหมวด / กดหมวดล้างประเภท / ทั้งหมดล้างทั้งคู่
- ปิด popularity path เมื่อกรองด้วยประเภท (กันจัดอันดับข้ามประเภท)
- หลังบ้าน: ช่อง "ประเภทโรงหนัง" ในหมวดข้อมูลหลัก + sanitize เฉพาะค่าใน VENUE_TYPES
- i18n: messages.venues (TH/EN) · override ได้ผ่าน site.terms
- scripts/set-venue-types.mjs จัดประเภท 29 โรง (15 ท้องถิ่น / 11 อินดี้ / 3 กลุ่มคนฉายหนัง) พร้อมสำรอง content.json
- tests: hasVenue + filterCinemas (165 ผ่าน) · sw v2.0.5 · DESIGN/AGENTS/README/admin-guide/api อัปเดต
This commit is contained in:
1 parent
2e794cd365
commit
1932098a1d
15 files changed
+362
-26
No files matched your search
+29
-1
@@ -14,7 +14,12 @@ import { SlugInput, suggestSlug } from "@/components/admin/SlugInput";
|
||||
import { TransportEditor } from "@/components/admin/TransportEditor";
|
||||
import { FOOTER_ICON_NAMES } from "@/components/site/footer-icons";
|
||||
import type { AnalyticsSummary } from "@/lib/analytics-types";
|
||||
import { ASSIGNABLE_CATEGORIES, type Cinema } from "@/lib/cinemas";
|
||||
import {
|
||||
ASSIGNABLE_CATEGORIES,
|
||||
VENUE_TYPES,
|
||||
type Cinema,
|
||||
type VenueType,
|
||||
} from "@/lib/cinemas";
|
||||
import {
|
||||
seedAbout,
|
||||
seedForCinemas,
|
||||
@@ -380,6 +385,29 @@ export default function AdminRoute() {
|
||||
}
|
||||
/>
|
||||
</label>
|
||||
<label className={labelClass}>
|
||||
ประเภทโรงหนัง (ตัวกรองชั้นแรกบนหน้าแรก)
|
||||
<select
|
||||
className={inputClass}
|
||||
value={cinema.venue_type ?? ""}
|
||||
onChange={(event) =>
|
||||
updateCinema({
|
||||
...cinema,
|
||||
venue_type:
|
||||
event.target.value === ""
|
||||
? null
|
||||
: (event.target.value as VenueType),
|
||||
})
|
||||
}
|
||||
>
|
||||
<option value="">— ยังไม่จัดประเภท —</option>
|
||||
{VENUE_TYPES.map((venue) => (
|
||||
<option key={venue} value={venue}>
|
||||
{venue}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
<label className={labelClass}>
|
||||
slug (ใช้ใน URL)
|
||||
<SlugInput
|
||||
|
||||
Reference in new issue
Block a user