PageSourceSearch

https://sksswoolwich.org/_nuxt/mr-wgoO7.js

js sksswoolwich.org collected 2026-10-04 04:31:32 UTC 4,456 bytes, 1 lines download raw bytes

1import{y as B,t as S,q as z,v as L,D as T,E}from"./FgXA1iZr.js";import{u as I,h as M,_ as $}from"./CkorBq3M.js";import{_ as F}from"./BgPUscgk.js";import{_ as N}from"./Cm_U9M8p.js";import{d as D,x as G,C as P,H as p,I as r,b as y,r as R,G as c,a7 as n,ae as o,u as l,ak as j,ah as h}from"./DV8arG15.js";import{u as q,h as g}from"./fXjCmqag.js";import{n as J}from"./Eyc0TqfR.js";import"./C_Tp8jVC.js";const K={class:"max-w-3xl space-y-8"},O={class:"flex items-center gap-4"},Q={class:"flex items-center justify-center py-12"},W={class:"flex gap-4 pt-4"},se=D({__name:"home",setup(X){const f=B(),V=q(),b=I(),e=R({hero_image_url:"",hero_image_alt:"",hero_title:"",hero_description:"",alert_message:"",live_stream_url:""}),m=y(!0),d=y(!1);async function w(){m.value=!0;try{const a=await V.getHome();if(a?.data){const t=M(a.data);e.hero_image_url=t.hero_image_url,e.hero_image_alt=t.hero_image_alt,e.hero_title=t.hero_title,e.hero_description=t.hero_description,e.alert_message=t.alert_message,e.live_stream_url=t.live_stream_url}}finally{m.value=!1}}function U(){const a=[];return a.push({slice_type:"hero_section",primary:{image:{url:e.hero_image_url||"",alt:e.hero_image_alt||""},title:g(e.hero_title),description:g(e.hero_description)}}),e.alert_message?.trim()&&a.push({slice_type:"alert",slice_label:"alert",primary:{alert_message:g(e.alert_message)}}),e.live_stream_url?.trim()&&a.push({slice_type:"video",primary:{live_stream_enabled:!0,live_stream_link:{url:e.live_stream_url.trim()}}}),a}async function H(){d.value=!0;try{const a=J(e.live_stream_url||"");if((e.live_stream_url||"").trim()&&a.error)throw new Error(a.error);e.live_stream_url=a.url;const t=U();await b.saveHome({body:t,live_stream_url:(a.url||"").trim()}),f.add({title:"Home page saved",color:"green"})}catch(a){f.add({title:a?.message||"Failed to save",color:"red"})}finally{d.value=!1}}return G(w),P({title:"Home Page | CMS | Admin"}),(a,t)=>{const _=S,C=L,v=z,k=$,i=T,x=E,u=F,A=N;return c(),p(A,null,{default:r(()=>[n("div",K,[n("div",O,[o(_,{to:"/admin/cms",variant:"ghost",color:"gray",icon:"i-heroicons-arrow-left",class:"rounded-full"}),t[6]||(t[6]=n("div",null,[n("h1",{class:"text-2xl font-serif font-bold text-gray-900 dark:text-white"}," Home Page "),n("p",{class:"text-sm text-gray-500"},"Hero, alert and live stream. Changes appear on the homepage.")],-1))]),l(m)?(c(),p(v,{key:0,class:"rounded-2xl"},{default:r(()=>[n("div",Q,[o(C,{name:"i-heroicons-arrow-path",class:"w-8 h-8 animate-spin text-golden-500"})])]),_:1})):(c(),p(v,{key:1,class:"rounded-2xl"},{default:r(()=>[n("form",{class:"space-y-6",onSubmit:j(H,["prevent"])},[o(i,{label:"Hero image"},{default:r(()=>[o(k,{modelValue:l(e).hero_image_url,"onUpdate:modelValue":t[0]||(t[0]=s=>l(e).hero_image_url=s),"storage-folder":"cms_home","storage-doc-id":"home","field-name":"hero"},null,8,["modelValue"])]),_:1}),o(i,{label:"Hero image alt text"},{default:r(()=>[o(x,{modelValue:l(e).hero_image_alt,"onUpdate:modelValue":t[1]||(t[1]=s=>l(e).hero_image_alt=s),placeholder:"Alt text for hero image",size:"lg",class:"rounded-xl"},null,8,["modelValue"])]),_:1}),o(i,{label:"Hero title"},{default:r(()=>[o(u,{modelValue:l(e).hero_title,"onUpdate:modelValue":t[2]||(t[2]=s=>l(e).hero_title=s),placeholder:"Main heading on the hero"},null,8,["modelValue"])]),_:1}),o(i,{label:"Hero description"},{default:r(()=>[o(u,{modelValue:l(e).hero_description,"onUpdate:modelValue":t[3]||(t[3]=s=>l(e).hero_description=s),placeholder:"Short text under the hero"},null,8,["modelValue"])]),_:1}),o(i,{label:"Alert message (optional)"},{default:r(()=>[o(u,{modelValue:l(e).alert_message,"onUpdate:modelValue":t[4]||(t[4]=s=>l(e).alert_message=s),placeholder:"Site-wide alert shown above content. Leave empty to hide."},null,8,["modelValue"])]),_:1}),o(i,{label:"Live stream URL (optional)"},{hint:r(()=>[...t[7]||(t[7]=[h(" Shown on the homepage when provided. ",-1)])]),default:r(()=>[o(x,{modelValue:l(e).live_stream_url,"onUpdate:modelValue":t[5]||(t[5]=s=>l(e).live_stream_url=s),placeholder:"https://youtube.com/...",size:"lg",class:"rounded-xl"},null,8,["modelValue"])]),_:1}),n("div",W,[o(_,{type:"submit",color:"golden",size:"lg",loading:l(d),class:"rounded-full"},{default:r(()=>[...t[8]||(t[8]=[h(" Save Changes ",-1)])]),_:1},8,["loading"]),o(_,{to:"/admin/cms",variant:"ghost",color:"gray",class:"rounded-full"},{default:r(()=>[...t[9]||(t[9]=[h(" Cancel ",-1)])]),_:1})])],32)]),_:1}))])]),_:1})}}});
1export{se as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.