feat(admin): editable contact fields in sections and larger logos

Allow address, phone, map, and related site chrome to be edited from contact/settings for all editors, and enlarge brand marks on login, header, and preloader.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
S. Esmaeili
2026-11-12 18:42:59 +03:30
co-authored by Cursor
parent cad1a8652e
commit 9ad88af20f
26 changed files with 285 additions and 108 deletions
+1 -4
View File
@@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
var __param = (this && this.__param) || function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
import { BadRequestException, Body, Controller, ForbiddenException, Get, Injectable, Module, NotFoundException, Param, Patch, Put, ServiceUnavailableException, } from "@nestjs/common";
import { BadRequestException, Body, Controller, Get, Injectable, Module, NotFoundException, Param, Patch, Put, ServiceUnavailableException, } from "@nestjs/common";
import { isSectionKey, SECTION_KEYS, sectionSchemas, toIssues, } from "@imen/shared";
import { AdminAuth, CurrentUser } from "../common/auth.js";
import { AuditService, RevalidateService } from "../common/common.module.js";
@@ -44,9 +44,6 @@ let SectionsService = class SectionsService {
async update(key, body, user) {
if (!isSectionKey(key))
throw new NotFoundException("بخش پیدا نشد");
if (key === "settings" && user.role !== "ADMIN") {
throw new ForbiddenException("فقط مدیر کل می‌تواند تنظیمات سایت را تغییر دهد");
}
const parsed = sectionSchemas[key].safeParse(body);
if (!parsed.success) {
throw new BadRequestException({
File diff suppressed because one or more lines are too long
+7
View File
@@ -12,6 +12,7 @@ export const SECTIONS = {
locality: "تهران",
country: "IR",
},
mapUrl: "",
workingHours: "شنبه تا پنجشنبه — ۸:۰۰ تا ۱۷:۰۰",
openingHours: {
days: ["Saturday", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday"],
@@ -19,6 +20,7 @@ export const SECTIONS = {
closes: "17:00",
},
foundingDate: "2007",
headerCta: { label: "درخواست مشاوره", href: "/#contact" },
socials: [
{ type: "website", url: "/" },
{ type: "email", url: "mailto:info@imenpishgaman.ir" },
@@ -246,6 +248,8 @@ export const SECTIONS = {
formTitle: "در کمتر از ۲۴ ساعت\nبا شما تماس می‌گیریم",
successTitle: "درخواست شما ثبت شد",
successText: "کارشناسان ما تا ۲۴ ساعت آینده برای هماهنگی جلسه بازدید با شما تماس می‌گیرند.",
submitLabel: "ارسال درخواست مشاوره",
resetLabel: "ثبت درخواست جدید",
},
footer: {
enabled: true,
@@ -253,6 +257,9 @@ export const SECTIONS = {
copyright: "© ۱۴۰۴ ایمن پیشگامان — تمامی حقوق محفوظ است.",
certLine: "ISO 9001:2015 — CE CERTIFIED PPE SUPPLIER",
emergencyNote: "پشتیبانی اضطراری: ۲۴/۷",
linksTitle: "دسترسی",
productsTitle: "محصولات",
contactTitle: "ارتباط",
},
};
export const CATEGORY_COVERS = {
File diff suppressed because one or more lines are too long
-5
View File
@@ -2,7 +2,6 @@ import {
BadRequestException,
Body,
Controller,
ForbiddenException,
Get,
Injectable,
Module,
@@ -55,10 +54,6 @@ export class SectionsService {
async update(key: string, body: unknown, user: AuthUser) {
if (!isSectionKey(key)) throw new NotFoundException("بخش پیدا نشد");
// site-wide settings (contact info, SEO defaults) are limited to admins
if (key === "settings" && user.role !== "ADMIN") {
throw new ForbiddenException("فقط مدیر کل می‌تواند تنظیمات سایت را تغییر دهد");
}
const parsed = sectionSchemas[key].safeParse(body);
if (!parsed.success) {
throw new BadRequestException({
+7
View File
@@ -19,6 +19,7 @@ export const SECTIONS: SiteSections = {
locality: "تهران",
country: "IR",
},
mapUrl: "",
workingHours: "شنبه تا پنجشنبه — ۸:۰۰ تا ۱۷:۰۰",
openingHours: {
days: ["Saturday", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday"],
@@ -26,6 +27,7 @@ export const SECTIONS: SiteSections = {
closes: "17:00",
},
foundingDate: "2007",
headerCta: { label: "درخواست مشاوره", href: "/#contact" },
socials: [
{ type: "website", url: "/" },
{ type: "email", url: "mailto:info@imenpishgaman.ir" },
@@ -265,6 +267,8 @@ export const SECTIONS: SiteSections = {
formTitle: "در کمتر از ۲۴ ساعت\nبا شما تماس می‌گیریم",
successTitle: "درخواست شما ثبت شد",
successText: "کارشناسان ما تا ۲۴ ساعت آینده برای هماهنگی جلسه بازدید با شما تماس می‌گیرند.",
submitLabel: "ارسال درخواست مشاوره",
resetLabel: "ثبت درخواست جدید",
},
footer: {
@@ -274,6 +278,9 @@ export const SECTIONS: SiteSections = {
copyright: "© ۱۴۰۴ ایمن پیشگامان — تمامی حقوق محفوظ است.",
certLine: "ISO 9001:2015 — CE CERTIFIED PPE SUPPLIER",
emergencyNote: "پشتیبانی اضطراری: ۲۴/۷",
linksTitle: "دسترسی",
productsTitle: "محصولات",
contactTitle: "ارتباط",
},
};