PageSourceSearch

https://cplibercourt.netlify.app/_nuxt/DTQ1watg.js

js cplibercourt.netlify.app collected 2026-10-03 10:37:25 UTC 7,021 bytes, 1 lines download raw bytes

1import{e as q,Y as R,g as H,h as X,c as g,a as o,b as s,t as r,l as a,w as l,F as Y,r as G,v as A,p as _,s as J,i as K,o as v,d as u,N as Q,X as W}from"./D2Hnkc9S.js";import{_ as Z}from"./EEjSj7xy.js";import{_ as ee}from"./DaExbKat.js";import{_ as te}from"./ObbQzDFf.js";import{_ as oe}from"./lmkbXYmn.js";import{_ as se}from"./DPkehw2j.js";import{_ as ae}from"./CmpIn9CG.js";import{_ as ne}from"./CqC_y05J.js";import"./DBRAUMLO.js";import"./CPexA1Al.js";import"./Bc98RcvR.js";import"./DGqvKPlV.js";import"./CNHMMXBL.js";import"./D8tYGZFt.js";import"./CFhnu5ks.js";const le={class:"space-y-6"},ie={class:"flex items-center justify-between"},re={class:"text-sm text-gray-500 dark:text-gray-400"},de={class:"bg-white dark:bg-gray-800 rounded-xl shadow-sm border border-gray-200 dark:border-gray-700 overflow-hidden"},ce={key:0,class:"p-8 text-center text-gray-400"},ue={key:1,class:"p-8 text-center text-gray-400"},pe={key:2,class:"w-full text-sm"},me={class:"divide-y divide-gray-100 dark:divide-gray-700"},fe={class:"px-4 py-3 font-medium text-gray-900 dark:text-white"},ge={class:"px-4 py-3"},_e={class:"px-4 py-3 text-gray-500 dark:text-gray-400 text-xs"},ve={class:"px-4 py-3 text-center"},ye={class:"px-4 py-3 text-right"},xe={class:"flex items-center justify-end gap-2"},be={class:"p-6 space-y-4"},he={class:"text-lg font-semibold text-gray-900 dark:text-white"},we={class:"flex justify-end gap-3 pt-2"},ke={class:"p-6 space-y-4"},Ve={class:"text-lg font-semibold"},Ce={class:"flex justify-end gap-3"},Ie=q({name:"AdminSponsorsPage",__name:"sponsors",async setup($e){let x,C;R({title:"Admin — Sponsors",robots:"noindex,nofollow"});const y=H(),{data:h,pending:N,refresh:$}=([x,C]=X(()=>K("/api/admin/sponsors","$99aPhsgpoO")),x=await x,C(),x),E=[{label:"Partenaire",value:"partenaire"},{label:"Sponsor",value:"sponsor"},{label:"Institutionnel",value:"institutionnel"}];function j(i){return i==="partenaire"?"info":i==="institutionnel"?"secondary":"neutral"}const d=_(!1),w=_(!1),p=_(null),n=W({name:"",category:"sponsor",website:"",logo:"",description:"",active:!0});function D(){Object.assign(n,{name:"",category:"sponsor",website:"",logo:"",description:"",active:!0})}function F(){p.value=null,D(),d.value=!0}function O(i){p.value={id:i.id},Object.assign(n,{name:i.name,category:i.category??"bronze",website:i.website??"",logo:i.logo??"",description:i.description??"",active:i.active??!0}),d.value=!0}async function T(){w.value=!0;try{p.value?(await $fetch(`/api/admin/sponsors/${p.value.id}`,{method:"PATCH",body:n}),y.add({title:"Sponsor mis à jour",color:"success"})):(await $fetch("/api/admin/sponsors",{method:"POST",body:n}),y.add({title:"Sponsor créé",color:"success"})),d.value=!1,await $()}catch{y.add({title:"Erreur",color:"error"})}finally{w.value=!1}}const m=_(!1),k=_(!1),b=_(null);function z(i){b.value=i,m.value=!0}async function B(){if(b.value){k.value=!0;try{await $fetch(`/api/admin/sponsors/${b.value.id}`,{method:"DELETE"}),y.add({title:"Sponsor supprimé",color:"success"}),m.value=!1,await $()}catch{y.add({title:"Erreur",color:"error"})}finally{k.value=!1}}}return(i,e)=>{const c=J,U=Z,V=ee,f=te,M=oe,P=se,L=ae,S=ne;return v(),g("div",le,[o("div",ie,[o("p",re,r(a(h)?.data?.length??0)+" sponsor(s) ",1),s(c,{icon:"i-heroicons-plus",onClick:F},{default:l(()=>[...e[10]||(e[10]=[u(" Nouveau sponsor ",-1)])]),_:1})]),o("div",de,[a(N)?(v(),g("div",ce," Chargement... ")):a(h)?.data?.length?(v(),g("table",pe,[e[11
1]||(e[11]=o("thead",{class:"bg-gray-50 dark:bg-gray-900 text-gray-500 dark:text-gray-400 uppercase text-xs"},[o("tr",null,[o("th",{class:"px-4 py-3 text-left"},"Nom"),o("th",{class:"px-4 py-3 text-left"},"Catégorie"),o("th",{class:"px-4 py-3 text-left"},"Site web"),o("th",{class:"px-4 py-3 text-center"},"Actif"),o("th",{class:"px-4 py-3 text-right"},"Actions")])],-1)),o("tbody",me,[(v(!0),g(Y,null,G(a(h).data,t=>(v(),g("tr",{key:t.id,class:"hover:bg-gray-50 dark:hover:bg-gray-700/50"},[o("td",fe,r(t.name),1),o("td",ge,[s(U,{color:j(t.category),variant:"subtle",size:"sm"},{default:l(()=>[u(r(t.category),1)]),_:2},1032,["color"])]),o("td",_e,r(t.website??"—"),1),o("td",ve,[s(U,{color:t.active?"success":"neutral",variant:"subtle",size:"sm"},{default:l(()=>[u(r(t.active?"Actif":"Inactif"),1)]),_:2},1032,["color"])]),o("td",ye,[o("div",xe,[s(c,{size:"sm",variant:"ghost",icon:"i-heroicons-pencil",color:"neutral",onClick:I=>O(t)},null,8,["onClick"]),s(c,{size:"sm",variant:"ghost",color:"error",icon:"i-heroicons-trash",onClick:I=>z(t)},null,8,["onClick"])])])]))),128))])])):(v(),g("div",ue," Aucun sponsor. "))]),s(S,{open:a(d),"onUpdate:open":e[7]||(e[7]=t=>A(d)?d.value=t:null),ui:{content:"ring-0 outline-none focus:outline-none focus:ring-0 focus-visible:ring-0"}},{content:l(()=>[o("div",be,[o("h3",he,r(a(p)?"Modifier le sponsor":"Nouveau sponsor"),1),o("form",{class:"space-y-4",onSubmit:Q(T,["prevent"])},[s(f,{label:"Nom",name:"name",required:""},{default:l(()=>[s(V,{modelValue:a(n).name,"onUpdate:modelValue":e[0]||(e[0]=t=>a(n).name=t),placeholder:"Nom de l'entreprise",class:"w-full"},null,8,["modelValue"])]),_:1}),s(f,{label:"Catégorie",name:"category",required:""},{default:l(()=>[s(M,{modelValue:a(n).category,"onUpdate:modelValue":e[1]||(e[1]=t=>a(n).category=t),items:E},null,8,["modelValue"])]),_:1}),s(f,{label:"Site web",name:"website"},{default:l(()=>[s(V,{modelValue:a(n).website,"onUpdate:modelValue":e[2]||(e[2]=t=>a(n).website=t),placeholder:"https://...",class:"w-full"},null,8,["modelValue"])]),_:1}),s(f,{label:"Logo (URL ou chemin)",name:"logo"},{default:l(()=>[s(V,{modelValue:a(n).logo,"onUpdate:modelValue":e[3]||(e[3]=t=>a(n).logo=t),placeholder:"/sponsors/logo.webp",class:"w-full"},null,8,["modelValue"])]),_:1}),s(f,{label:"Description",name:"description"},{default:l(()=>[s(P,{modelValue:a(n).description,"onUpdate:modelValue":e[4]||(e[4]=t=>a(n).description=t),rows:2,class:"w-full"},null,8,["modelValue"])]),_:1}),s(f,{label:"Actif",name:"active"},{default:l(()=>[s(L,{modelValue:a(n).active,"onUpdate:modelValue":e[5]||(e[5]=t=>a(n).active=t),label:"Sponsor actif"},null,8,["modelValue"])]),_:1}),o("div",we,[s(c,{variant:"ghost",color:"neutral",onClick:e[6]||(e[6]=t=>d.value=!1)},{default:l(()=>[...e[12]||(e[12]=[u(" Annuler ",-1)])]),_:1}),s(c,{type:"submit",loading:a(w)},{default:l(()=>[u(r(a(p)?"Enregistrer":"Créer"),1)]),_:1},8,["loading"])])],32)])]),_:1},8,["open"]),s(S,{open:a(m),"onUpdate:open":e[9]||(e[9]=t=>A(m)?m.value=t:null),ui:{content:"ring-0 outline-none focus:outline-none focus:ring-0 focus-visible:ring-0"}},{content:l(()=>[o("div",ke,[o("h3",Ve,' Supprimer "'+r(a(b)?.name)+'" ? ',1),e[15]||(e[15]=o("p",{class:"text-sm text-red-600"},"Cette action est irréversible.",-1)),o("div",Ce,[s(c,{variant:"ghost",color:"neutral",onClick:e[8]||(e[8]=t=>m.value=!1)},{default:l(()=>[...e[13]||(e[13]=[u(" Annuler ",-1)])]),_:1}),s(c,{color:"error",loading:a(k),onClick:B},{default:l(()=>[...e[14]||(e[14]=[u(" Supprimer ",-1)])]),_:1},8,["loading"])])])]),_:1},8,["open"])])}}});export{Ie 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.