PageSourceSearch

https://fonds.lv/build/assets/Index-Dte1VTR0.js

js fonds.lv collected 2026-10-01 12:27:17 UTC 5,763 bytes, 7 lines download raw bytes

1import{T as m}from"./tabulator.min-NWc-ChHA.js";import{A as f}from"./AuthenticatedLayout-BgPi6SK7.js";import{i as v,Z as g,r as i,f as b,a as r,w as n,b as t,e as k,F as x,T as y,o as M}from"./app-BFBm0Bhp.js";import{_ as C}from"./Modal-BCYUwSCy.js";import{_ as D}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ApplicationLogo-BDZZhcqx.js";import"./NavLink-XJ1F9B8R.js";import"./TextOutline-DJTNpM16.js";import"./DocumentTextOutline-CSPECrKp.js";import"./InformationCircleOutline-B09VKpeu.js";const L={components:{AuthenticatedLayout:f,Head:g,Link:v,Modal:C},props:{schools:{type:Array,default:()=>[]}},data(){return{showDeleteModal:!1,schoolIdToDelete:null}},methods:{openDeleteModal(s){this.schoolIdToDelete=s,this.showDeleteModal=!0},closeDeleteModal(){this.showDeleteModal=!1,this.schoolIdToDelete=null},deleteSchool(s){y({}).delete(route("admin.schools.destroy",{school:s}),{onSuccess:()=>{this.closeDeleteModal()},preserveState:!1})}},mounted(){const s=this.schools.map(o=>({id:o.id,name:o.school_name,cwatvk:o.cwatvk?o.cwatvk.display_name:"",code:o.school_code,active:o.active})),e=[{title:"ID",field:"id",width:50},{title:"Name",field:"name",headerFilter:"input"},{title:"Location",field:"cwatvk",headerFilter:"list",headerFilterParams:{valuesLookup:!0,clearable:!0}},{title:"Code",field:"code",width:200,headerFilter:"input"},{title:"Active",field:"active",sorter:"boolean",align:"center",formatter:"tickCross",width:100,headerFilter:"list",headerFilterParams:{valuesLookup:!0,clearable:!0}},{width:150,title:"Actions",field:"actions",formatter:()=>`
2                <div class="flex space-x-2">
3                    <button class="view-btn text-blue-500"><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></button>
4                    <button class="edit-btn text-green-500"><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></button>
5                    <button class="delete-btn text-red-500"><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></button>
6                </div>
7            `,cellClick:(o,d)=>{const a=d.getRow().getData().id,l=o.target;l.classList.contains("view-btn")?window.location.href=route("admin.schools.show",{school:a}):l.classList.contains("edit-btn")?window.location.href=route("admin.schools.edit",{school:a}):l.classList.contains("delete-btn")&&window.openDeleteModal(a)}}];new m("#tabulator-table",{data:s,columns:e,layout:"fitColumns",responsiveLayout:"hide",pagination:"local",paginationSizeSelector:[30,50,100,500,1e3],paginationSize:30}),window.openDeleteModal=this.openDeleteModal}},_={class:"flex"},S={class:"space-y-5"},A={class:"p-4 space-y-5"},F={class:"flex space-x-4"};function T(s,e,o,d,a,l){const u=i("Head"),h=i("Link"),p=i("Modal"),w=i("AuthenticatedLayout");return M(),b(x,null,[r(u,{title:"Schools"}),r(w,null,{header:n(()=>[t("div",_,[e[3]||(e[3]=t("h2",{class:"font-semibold text-xl text-gray-800 leading-tight"},"Schools",-1)),e[4]||(e[4]=t("div",{class:"flex-grow"},null,-1)),r(h,{class:"btn btn-primary",href:s.route("admin.schools.create")},{default:n(()=>[...e[2]||(e[2]=[k(" Add School ",-1)])]),_:1},8,["href"])])]),default:n(()=>[e[8]||(e[8]=t("div",{class:"py-12 space-y-5"},[t("div",{class:"bg-white overflow-hidden shadow-sm sm:rounded-lg p-4 space-y-4"},[t("div",{id:"tabulator-table"})])],-1)),r(p,{show:a.showDeleteModal,onClose:l.closeDeleteModal},{default:n(()=>[t("div",S,[e[7]||(e[7]=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",A,[e[6]||(e[6]=t("h1",{class:"text-gray-700"},"Are you sure you want to delete this school?",-1)),t("div",F,[e[5]||(e[5]=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.deleteSchool(a.schoolIdToDelete))},"Delete")])])])]),_:1},8,["show","onClose"])]),_:1})],64)}const Z=D(L,[["render",T]]);export{Z 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.