1import{T as h}from"./tabulator.min-NWc-ChHA.js";import{i as g,Z as w,r as a,f as b,a as i,w as n,b as t,e as v,F as x,T as k,o as y}from"./app-B9KORyBa.js";import{A as _}from"./AuthenticatedLayout-DcpqZk2r.js";import{_ as M}from"./Modal-Bzvoe6wK.js";import{_ as C,a as D,b as L,c as T}from"./EyeOutline-BJItCWaF.js";import{_ as A}from"./CheckmarkCircleOutline-D-9-1wJh.js";import{P as F}from"./PrimaryButton-vaEit9c1.js";import{h as B}from"./moment-BLMuvzoS.js";import{_ as I}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ApplicationLogo-DrAX-EpC.js";import"./NavLink-BiVKPBr8.js";import"./TextOutline-CGLkonHp.js";import"./DocumentTextOutline-B7A647Cs.js";import"./InformationCircleOutline-DCl6slX2.js";const N={components:{AuthenticatedLayout:_,Head:w,Link:g,Modal:M,EyeOutline:T,TrashOutline:L,CheckmarkCircleOutline:A,EditOutline:D,CloseCircleOutline:C,PrimaryButton:F},props:{templates:{type:Array,required:!0}},data(){return{showDeleteModal:!1,templateIdToDelete:null}},mounted(){const s=this.templates.map(o=>({id:o.id,title:o.title,active:o.active,created_at:B(o.created_at).format("DD.MM.YYYY"),scholarship:JSON.parse(o.scholarship.name).lv})),e=[{title:"ID",field:"id",width:50},{title:"Scholarship Name",field:"scholarship",headerFilter:"list",headerFilterParams:{valuesLookup:!0,clearable:!0}},{title:"Title",field:"title",headerFilter:"list",headerFilterParams:{valuesLookup:!0,clearable:!0}},{title:"Active",field:"active",formatter:"tickCross",sorter:"boolean",align:"center",headerFilter:"list",headerFilterParams:{valuesLookup:!0,clearable:!0}},{title:"Created At",field:"created_at",sorter:"datetime",headerFilter:"input"},{width:150,title:"Actions",field:"actions",formatter:()=>` 2 <div class="flex space-x-2"> 3<button 4 class="view-btn text-blue-500 flex items-center space-x-2 p-2 rounded hover:bg-blue-100 focus:outline-none focus:ring-2 focus:ring-blue-500 relative z-10" 5 type="button" 6 aria-label="View" 7 @click="handleClick"> 8 <svg class="view-btn" style="height:20px" xmlns="http://www.w3.org/2000/svg" :class="styleClasses" viewBox="0 0 512 512"><path d="M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 00-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 000-17.47C428.89 172.28 347.8 112 255.66 112z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/><circle cx="256" cy="256" r="80" fill="none" stroke="currentColor" stroke-miterlimit="10" stroke-width="32"/></svg> 9</button> 10 <button class="edit-btn text-green-500"> 11 <svg class="edit-btn" style="height:20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M384 224v184a40 40 0 01-40 40H104a40 40 0 01-40-40V168a40 40 0 0140-40h167.48" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/><path d="M459.94 53.25a16.06 16.06 0 00-23.22-.56L424.35 65a8 8 0 000 11.31l11.34 11.32a8 8 0 0011.34 0l12.06-12c6.1-6.09 6.67-16.01.85-22.38zM399.34 90L218.82 270.2a9 9 0 00-2.31 3.93L208.16 299a3.91 3.91 0 004.86 4.86l24.85-8.35a9 9 0 003.93-2.31L422 112.66a9 9 0 000-12.66l-9.95-10a9 9 0 00-12.71 0z"/></svg> 12 </svg></button> 13 <button class="delete-btn text-red-500"> 14 <svg class="delete-btn" style="height:20px" xmlns="http://www.w3.org/2000/svg" :class="styleClasses" viewBox="0 0 512 512"><path d="M112 112l20 320c.95 18.49 14.4 32 32 32h184c17.67 0 30.87-13.51 32-32l20-320" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="32" d="M80 112h352"/><path d="M192 112V72h0a23.93 23.93 0 0124-24h80a23.93 23.93 0 0124 24h0v40M256 176v224M184 176l8 224M328 176l-8 224" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/></svg> 15 </button> 16 </div> 17 `,cellClick:(o,d)=>{const r=d.getRow().getData().id,l=o.target;l.classList.contains("view-btn")?window.location.href=route("admin.regformtemplates.show",{regformtemplate:r}):l.classList.contains("edit-btn")?window.location.href=route("admin.regformtemplates.edit",{regformtemplate:r}):l.classList.contains("delete-btn")&&window.openDeleteModal(r)}}];new h("#regform-table",{data:s,columns:e,layout:"fitColumns",responsiveLayout:"hide",pagination:"local",paginationSize:5}),window.openDeleteModal=this.openDeleteModal},methods:{openDeleteModal(s){this.templateIdToDelete=s,this.showDeleteModal=!0},closeDeleteModal(){this.showDeleteModal=!1,this.templateIdToDelete=null},deleteRegformtemplate(s){k({}).delete(route("admin.regformtemplates.destroy",{regformtemplate:s}),{onSuccess:()=>{this.closeDeleteModal()},preserveState:!1})}}},O={class:"flex items-center justify-between"},V={class:"space-y-5"},j={class:"p-4 space-y-5"},z={class:"flex space-x-4"};function P(s,e,o,d,r,l){const m=a("Head"),p=a("Link"),u=a("Modal"),f=a("AuthenticatedLayout");return y(),b(x,null,[i(m,{title:"Regform Templates"}),i(f,null,{header:n(()=>[t("div",O,[e[3]||(e[3]=t("h2",{class:"font-semibold text-xl text-gray-800 leading-tight"},"Regform Templates",-1)),i(p,{class:"btn btn-primary",href:s.route("admin.regformtemplates.create")},{default:n(()=>[...e[2]||(e[2]=[v(" Add New Template ",-1)])]),_:1},8,["href"])])]),default:n(()=>[e[7]||(e[7]=t("div",{class:"py-12"}
17,[t("div",{class:"max-w-7xl mx-auto sm:px-6 lg:px-8"},[t("div",{class:"bg-white shadow-sm sm:rounded-lg p-6"},[t("div",{id:"regform-table"})])])],-1)),i(u,{show:r.showDeleteModal,onClose:l.closeDeleteModal},{default:n(()=>[t("div",V,[e[6]||(e[6]=t("div",{class:"w-full bg-gray-200 py-2 px-4"},[t("p",{class:"text-gray-700 font-bold"},"Delete confirmation")],-1)),t("div",j,[e[5]||(e[5]=t("h1",{class:"text-gray-700"},"Are you sure you want to delete this regform template?",-1)),t("div",z,[e[4]||(e[4]=t("div",{class:"flex-grow"},null,-1)),t("div",{class:"border border-gray-900 font-semibold text-white bg-gray-900 rounded-lg py-1 px-3 cursor-pointer",onClick:e[0]||(e[0]=(...c)=>l.closeDeleteModal&&l.closeDeleteModal(...c))},"Cancel"),t("div",{class:"border border-red-600 font-semibold text-white bg-red-600 rounded-lg py-1 px-3 cursor-pointer",onClick:e[1]||(e[1]=c=>l.deleteRegformtemplate(r.templateIdToDelete))},"Delete")])])])]),_:1},8,["show","onClose"])]),_:1})],64)}const X=I(N,[["render",P]]);export{X 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.