chore: replace footer columns with a single copyright line
- footer is now '© hobbypj 2026' centred on one row; brand/note/contact columns removed - site-level contact_email retired end to end (schema, payload, server validation, admin field, footer link logic); project-level contact_email untouched - content-only change: service worker version unchanged (network-first)
This commit is contained in:
1 parent
ebaefc8fb7
commit
f9dffbd132
9 files changed
+11
-70
No files matched your search
@@ -25,13 +25,11 @@ const ctx = {
|
||||
setData(data) {
|
||||
state.data = normalizeData(data);
|
||||
state.source = "server";
|
||||
updateChrome();
|
||||
},
|
||||
async reload() {
|
||||
const result = await loadProjects();
|
||||
state.data = result.data;
|
||||
state.source = result.source;
|
||||
updateChrome();
|
||||
return result;
|
||||
},
|
||||
};
|
||||
@@ -56,20 +54,6 @@ function renderRoute({ path, view }) {
|
||||
countUpInside(main);
|
||||
}
|
||||
|
||||
function updateChrome() {
|
||||
const site = state.data.site || {};
|
||||
const contact = document.querySelector("[data-contact-link]");
|
||||
if (contact) {
|
||||
if (site.contact_email) {
|
||||
contact.href = `mailto:${site.contact_email}`;
|
||||
contact.textContent = site.contact_email;
|
||||
} else {
|
||||
contact.href = "#/admin";
|
||||
contact.textContent = "เพิ่มอีเมลติดต่อได้ในหน้าจัดการ";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function skeleton() {
|
||||
main.innerHTML = `
|
||||
<div class="wrap">
|
||||
@@ -88,7 +72,6 @@ async function boot() {
|
||||
const result = await loadProjects();
|
||||
state.data = result.data;
|
||||
state.source = result.source;
|
||||
updateChrome();
|
||||
|
||||
defineRoutes({ "/": homeView, "/admin": adminView }, "/");
|
||||
onRouteChange(renderRoute);
|
||||
|
||||
@@ -10,7 +10,6 @@ export const DEFAULT_SITE = {
|
||||
site_title: "โปรเจคอดิเรกของเรา",
|
||||
welcome_message:
|
||||
"สวัสดี คนที่เข้ามาดูโปรเจคอดิเรกของเรา เลือกโปรเจคที่อยากดู ขอบคุณครับ",
|
||||
contact_email: "",
|
||||
};
|
||||
|
||||
const DEFAULT_PROJECT = {
|
||||
@@ -60,7 +59,6 @@ export function toPublishPayload(data) {
|
||||
site: {
|
||||
site_title: data.site.site_title,
|
||||
welcome_message: data.site.welcome_message,
|
||||
contact_email: data.site.contact_email,
|
||||
},
|
||||
projects: data.projects.map((p) => ({
|
||||
project_id: p.project_id,
|
||||
|
||||
@@ -110,13 +110,6 @@ export function adminView(ctx) {
|
||||
draft.site.site_title,
|
||||
)}" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="field__label" for="site-email">อีเมลติดต่อ (ส่วนท้ายเว็บ)</label>
|
||||
<input id="site-email" type="email" data-site="contact_email" value="${escapeHtml(
|
||||
draft.site.contact_email,
|
||||
)}" placeholder="[email protected]" />
|
||||
<p class="field__error" data-error="site-email"></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -194,12 +187,6 @@ export function adminView(ctx) {
|
||||
field.addEventListener("input", () => {
|
||||
const key = field.getAttribute("data-site");
|
||||
draft.site[key] = field.value;
|
||||
if (key === "contact_email") {
|
||||
const errorEl = root.querySelector('[data-error="site-email"]');
|
||||
const valid = !field.value.trim() || isEmail(field.value);
|
||||
errorEl.textContent = valid ? "" : "รูปแบบอีเมลไม่ถูกต้อง";
|
||||
field.closest(".field").classList.toggle("field--error", !valid);
|
||||
}
|
||||
saveDraft();
|
||||
refreshDirty();
|
||||
});
|
||||
@@ -456,7 +443,6 @@ export function adminView(ctx) {
|
||||
clearDraft();
|
||||
root.querySelector('[data-site="welcome_message"]').value = draft.site.welcome_message;
|
||||
root.querySelector('[data-site="site_title"]').value = draft.site.site_title;
|
||||
root.querySelector('[data-site="contact_email"]').value = draft.site.contact_email;
|
||||
renderList();
|
||||
refreshDirty();
|
||||
toast("ดึงข้อมูลล่าสุดแล้ว");
|
||||
@@ -522,12 +508,6 @@ export function adminView(ctx) {
|
||||
firstError?.focus();
|
||||
return;
|
||||
}
|
||||
const emailValid = !draft.site.contact_email.trim() || isEmail(draft.site.contact_email);
|
||||
if (!emailValid) {
|
||||
toast("อีเมลติดต่อของเว็บไม่ถูกต้อง", "error");
|
||||
root.querySelector("#site-email")?.focus();
|
||||
return;
|
||||
}
|
||||
const label = trigger.querySelector("span");
|
||||
const original = label ? label.textContent : "";
|
||||
if (label) label.textContent = "กำลังเผยแพร่…";
|
||||
|
||||
Reference in new issue
Block a user