PageSourceSearch

https://www.ccvt.fr/build/assets/Edit-VjcA5eQS.js

js ccvt.fr collected 2026-10-09 17:05:50 UTC 7,508 bytes, 1 lines download raw bytes

1import{u as M,r as V,o,c as i,a as c,b as r,h as C,w as x,d as e,l as _,e as m,f as j,g as b,n as p,v as y,t as a,i as u,F,j as U}from"./app-CFYReQIT.js";import{_ as D}from"./AdminLayout-CkT6GqRm.js";/* empty css            */const B={class:"container mx-auto px-4 py-8"},z={class:"mb-6"},L={class:"flex gap-6 items-start"},N={class:"flex-1 min-w-0 space-y-5"},P={class:"bg-white rounded-lg shadow p-6 space-y-5"},R={class:"grid grid-cols-1 md:grid-cols-2 gap-6"},$={class:"md:col-span-2"},q={key:0,class:"text-red-600 text-sm mt-1"},E={class:"md:col-span-2"},H={key:0,class:"text-red-600 text-sm mt-1"},I={key:0,class:"text-red-600 text-sm mt-1"},T={class:"md:col-span-2"},A=["href"],O={class:"md:col-span-2"},S={key:0,class:"text-red-600 text-sm mt-1"},G={class:"w-80 flex-shrink-0 space-y-5 sticky top-6"},J={class:"bg-white rounded-lg shadow p-5"},K={class:"space-y-2"},Q=["disabled"],W={key:0,class:"w-4 h-4 animate-spin",fill:"none",viewBox:"0 0 24 24"},X={class:"bg-white rounded-lg shadow p-5"},Y={class:"flex items-center justify-between"},Z={class:"text-xs text-gray-500 mt-0.5"},ee={class:"bg-white rounded-lg shadow p-5 space-y-3"},te={class:"w-full h-32 rounded-lg border border-gray-200 bg-gray-50 overflow-hidden flex items-center justify-center"},re=["src"],se={key:1,class:"w-10 h-10 text-gray-300",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},oe={key:0,class:"text-red-500 text-xs"},ne={__name:"Edit",props:{report:Object},setup(v){const f=U(),l=v,s=M({is_visible:l.report.is_visible,name:l.report.name,description:l.report.description||"",date:l.report.date?l.report.date.substring(0,10):"",pdf_file:null,cover_image:null}),g=V(l.report.cover_image?`/storage/${l.report.cover_image}`:null),h=n=>{s.pdf_file=n.target.files[0]},w=n=>{const t=n.target.files[0];t&&(s.cover_image=t,g.value=URL.createObjectURL(t))},k=()=>{s.transform(n=>({...n,_method:"PUT"})).post(f("admin.waste-reports.update",l.report.id))};return(n,t)=>(o(),i(F,null,[c(r(C),{title:"Modifier un rapport sur les déchets"}),c(D,null,{default:x(()=>[e("div",B,[e("div",z,[c(r(_),{href:r(f)("admin.waste-reports.index"),class:"text-primary hover:text-primary-dark"},{default:x(()=>[...t[4]||(t[4]=[m(" ← Retour à la liste ",-1)])]),_:1},8,["href"])]),t[17]||(t[17]=e("h1",{class:"text-3xl font-bold mb-6"},"Modifier le rapport sur les déchets",-1)),e("form",{onSubmit:j(k,["prevent"])},[e("div",L,[e("div",N,[e("div",P,[e("div",R,[e("div",$,[t[5]||(t[5]=e("label",{class:"block text-sm font-medium text-gray-700 mb-2"}," Nom du rapport * ",-1)),b(e("input",{"onUpdate:modelValue":t[0]||(t[0]=d=>r(s).name=d),type:"text",required:"",class:p(["w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent",{"border-red-500":r(s).errors.name,"border-gray-300":!r(s).errors.name}])},null,2),[[y,r(s).name]]),r(s).errors.name?(o(),i("div",q,a(r(s).errors.name),1)):u("",!0)]),e("div",E,[t[6]||(t[6]=e("label",{class:"block text-sm font-medium text-gray-700 mb-2"}," Description (optionnel) ",-1)),b(e("textarea",{"onUpdate:modelValue":t[1]||(t[1]=d=>r(s).description=d),rows:"3",class:p(["w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent",{"border-red-500":r(s).errors.description,"border-gray-300":!r(s).errors.description}])},null,2),[[y,r(s).description]]),r(s).errors.description?(o(),i("div",H,a(r(s).errors.description),1)):u("",!0)]),e("div",null,[t[7]||(t[7]=e("label",{class:"block text-sm font-medium text-gray-700 mb-2"}," Date * ",-1)),b(e("input",{"onUpdate:modelValue":t[2]||(t[2]=d=>r(s).date=d),type:"date",required:"",class:p(["w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent",{"border-red-500":r(s).errors.date,"border-gray-300":!r(s).errors.date}])},null,2),[[y,r(s).date]]),r(s).errors.date?(o(),i("div",I,a(r(s).errors.date),1)):u("",!0)]),e("div",T,[t[9]||(t[9]=e("label",{class:"block text-sm font-medium text-gray-700 mb-2"}," Fichier PDF actuel ",-1)),e("a",{href:`/storage/${v.report.pdf_file}`,target:"_blank",class:"text-primary hover:text-primary-dark flex items-center gap-2"},[...t[8]||(t[8]=[e("svg",{class:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})],-1),m(" Voir le PDF actuel ",-1)])],8,A)]),e("div",O,[t[10]||(t[10]=e("label",{class:"block text-sm font-medium text-gray-700 mb-2"}," Remplacer le fichier PDF (optionnel) ",-1)),e("input",{onChange:h,type:"file",accept:"application/pdf",class:p(["w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-primary focus:border-transparent",{"border-red-500":r(s).errors.pdf_file,"border-gray-300":!r(s).errors.pdf_file}])},null,34),t[11]||(t[11]=e("p",{class:"text-xs text-gray-500 mt-1"},"Maximum 40 Mo. Laissez vide pour conserver le fichier actuel.",-1)),r(s).errors.pdf_file?(o(),i("div",S,a(r(s).errors.pdf_file),1)):u("",!0)])])])]),e("div",G,[e("div",J,[e("div",K,[e("button",{type:"submit",disabled:r(s).processing,class:"w-full px-4 py-2 text-sm bg-primary-dark hover:bg-primary-darker text-white rounded-lg font-medium transition disabled:opacity-50 flex items-center justify-center gap-2"},[r(s).processing?(o(),i("svg",W,[...t[12]||(t[12]=[e("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"},null,-1),e("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8H4z"},null,-1)])])):u("",!0),m(" "+a(r(s).processing?"Enregistrement...":"Mettre à jour"),1)],8,Q),c(r(_),{href:r(f)("admin.waste-reports.index"),class:"block text-center px-4 py-2 text-sm text-gray-500 hover:text-gray-700 transition"},{default:x(()=>[...t[13]||(t[13]=[m(" Annuler ",-1)])]),_:1},8,["href"])])]),e("div",X,[e("div",Y,[e("div",null,[t[14]||(t[14]=e("p",{class:"text-sm font-semibold text-gray-800"},"Visibilité",-1)),e("p",Z,a(r(s).is_visible?"Visible sur le site":"Masqué du public"),1)]),e("button",{type:"button",onClick:t[3]||(t[3]=d=>r(s).is_visible=!r(s).is_visible),class:p([r(s).is_visible?"bg-green-700":"bg-gray-300","relative inline-flex h-7 w-12 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-green-700 focus:ring-offset-2"])},[e("span",{class:p([r(s).is_visible?"translate-x-5":"translate-x-0","pointer-events-none inline-block h-6 w-6 transform rounded-full bg-white shadow ring-0 transition duration-200"])},null,2)],2)])]),e("div",ee,[t[16]||(t[16]=e("h2",{class:"text-sm font-semibold text-gray-700 uppercase tracking-wide"},"Image de couverture",-1)),e("div",te,[g.value?(o(),i("img",{key:0,src:g.value,class:"w-full h-full object-cover"},null,8,re)):(o(),i("svg",se,[...t[15]||(t[15]=[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"},null,-1)])]))]),e("input",{onChange:w,type:"file",accept:"image/*",class:"w-full text-sm text-gray-500 file:mr-3 file:py-1.5 file:px-3 file:rounded-md file:border-0 file:text-sm file:font-medium file:bg-primary/5 file:text-primary hover:file:bg-primary/10 transition"},null,32),r(s).errors.cover_image?(o(),i("p",oe,a(r(s).errors.cover_image),1)):u("",!0)])])])],32)])]),_:1})],64))}};export{ne 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.