PageSourceSearch

https://fonds.lv/build/assets/Index-T-lFrynG.js

js fonds.lv collected 2026-10-01 12:26:56 UTC 9,529 bytes, 1 lines download raw bytes

1import{A as H}from"./AuthenticatedLayout-BgPi6SK7.js";import{i as j,Z as z,r as d,f as p,a as n,w as h,b as t,e as f,o as c,F as x,j as E,n as y,t as w,c as O,g as v,T as k}from"./app-BFBm0Bhp.js";import{P as R}from"./PrimaryButton-DQRXstZk.js";import{_ as Z,a as q,b as G,c as J}from"./EyeOutline-oziHFuqu.js";import{_ as K}from"./CheckmarkCircleOutline-5KTJuc7H.js";import{_ as Q}from"./Modal-BCYUwSCy.js";import{_ as W}from"./ArrowDownOutline-reU2X3OH.js";import{_ as X}from"./ArrowUpOutline-D4ILiFyi.js";import{_ as Y}from"./ChevronDownOutline-I8s4miqi.js";import{_ as I}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 $={components:{ChevronDownOutline:Y,ArrowUpOutline:X,ArrowDownOutline:W,Modal:Q,EyeOutline:J,TrashOutline:G,CheckmarkCircleOutline:K,EditOutline:q,CloseCircleOutline:Z,PrimaryButton:R,AuthenticatedLayout:H,Head:z,Link:j},props:{categories:{type:Object,default:[]}},data(){return{showCategoryContent:[],orderChanged:!1,itemOrderChanged:!1,showDeleteModal:!1,deleteModal:{type:null,name:null,id:null},categoryOrderForm:k({changes:[]}),itemOrderForm:k({changes:[]})}},methods:{showCategoriesContentToggle(r){const e=this.showCategoryContent.indexOf(r);e>-1?this.showCategoryContent.splice(e,1):this.showCategoryContent.push(r)},moveCategoryUp(r){const e=this.categories[r],o=r,l=r-1;this.categories[o].order=e.order+1,this.categories[l].order=e.order-1,this.updateCategoryOrderForm(o,l),this.reorderCategoriesByOrderAsc()},moveCategoryDown(r){const e=this.categories[r],o=r,l=r+1;this.categories[o].order=e.order-1,this.categories[l].order=e.order+1,this.updateCategoryOrderForm(o,l),this.reorderCategoriesByOrderAsc()},updateCategoryOrderForm(r,e){const o=this.categories[r],l=this.categories[e];this.categoryOrderForm.changes=this.categoryOrderForm.changes.filter(i=>i.id!==o.id&&i.id!==l.id),this.categoryOrderForm.changes.push({id:o.id,order:o.order},{id:l.id,order:l.order})},reorderCategoriesByOrderAsc(){this.categories.sort((r,e)=>e.order-r.order),this.orderChanged=!0},submitCategoryChangeForm(){this.categoryOrderForm.post(route("admin.categories.order",{type:"researchers"}),{preserveState:"errors"})},moveItemUp(r,e,o){if(!o)return;const l=this.categories[r].researchers[e],i=e,s=e-1;this.categories[r].researchers[i].pivot.order=l.pivot.order-1,this.categories[r].researchers[s].pivot.order=l.pivot.order+1,this.updateItemOrderForm(r,i,s),this.reorderItemsByOrderAsc(r)},moveItemDown(r,e,o){if(!o)return;const l=this.categories[r].researchers[e],i=e,s=e+1;this.categories[r].researchers[i].pivot.order=l.pivot.order+1,this.categories[r].researchers[s].pivot.order=l.pivot.order-1,this.updateItemOrderForm(r,i,s),this.reorderItemsByOrderAsc(r)},updateItemOrderForm(r,e,o){const l=this.categories[r],i=this.categories[r].researchers[e],s=this.categories[r].researchers[o];this.itemOrderForm.changes=this.itemOrderForm.changes.filter(_=>!(_.id===i.id&&_.categoryIndex===r)&&!(_.id===s.id&&_.categoryIndex===r)),this.itemOrderForm.changes.push({id:i.id,categoryIndex:r,categoryId:l.id,order:i.pivot.order},{id:s.id,categoryIndex:r,categoryId:l.id,order:s.pivot.order})},reorderItemsByOrderAsc(r){this.categories[r].researchers.sort((e,o)=>e.pivot.order-o.pivot.order),this.itemOrderChanged=!0},submitItemChangeForm(){this.itemOrderForm.post(route("admin.posts.order",{type:"researchers"}),{preserveState:"errors"})},openDeleteModal(r,e,o){this.deleteModal={type:r,name:e,id:o},this.showDeleteModal=!0},closeDeleteModal(){this.showDeleteModal=!1,this.deleteModal={type:null,name:null,id:null}},destroyCategory(r){k({}).delete(route("admin.categories.destroy",{category:r,type:"researchers"}),{preserveState:!1})},destroy(r){k({}).delete(route("admin.researchers.destroy",{researcher:r}),{preserveState:!1})}}},ee={class:"flex"},re={class:"flex space-x-2"},te={class:"py-12 space-y-5"},se={class:"flex"},oe={class:"bg-white overflow-hidden shadow-sm sm:rounded-lg p-4 space-y-12"},ie={class:"flex border-b-2 px-4 py-5 bg-gray-100"},le=["onClick"],ne=["onClick"],ae={class:"font-semibold"},de={class:"flex space-x-2"},ce={class:"flex space-x-1"},me=["onClick"],he={key:0},ue={class:"border-b-2"},pe={class:"col-span-2 xl:col-span-1"},ge={key:0},_e={key:1},Ce={class:"col-span-8 xl:col-span-9"},fe={class:"col-span-2 text-right flex"},ve={class:"flex space-x-2"},ye={class:"flex space-x-1"},we=["onClick"],Oe={class:"flex w-full p-4 border-b-2"},ke={key:1},be={class:"space-y-5"},xe={class:"p-4 space-y-5"},De={class:"text-gray-700"},Fe={class:"flex space-x-4"};function Me(r,e,o,l,i,s){const _=d("Head"),b=d("PrimaryButton"),C=d("Link"),L=d("ChevronDownOutline"),D=d("ArrowUpOutline"),F=d("ArrowDownOutline"),M=d("EditOutline"),A=d("TrashOutline"),S=d("CheckmarkCircleOutline"),U=d("CloseCircleOutline"),N=d("EyeOutline"),P=d("Modal"),V=d("AuthenticatedLayout");return c(),p(x,null,[n(_,{title:"researchers"}),n(V,null,{header:h(()=>[t("div",ee,[e[4]||(e[4]=t("h2",{class:"font-semibold text-xl text-gray-800 leading-tight"},"Researchers",-1)),e[5]||(e[5]=t("div",{class:"flex-grow"},null,-1)),t("div",re,[i.orderChanged?(c(),O(b,{key:0,onClick:s.submitCategoryChangeForm},{default:h(()=>[...e[2]||(e[2]=[f("Save categories order",-1)])]),_:1},8,["onClick"])):v("",!0),i.itemOrderChanged?(c(),O(b,{key:1,onClick:s.submitItemChangeForm},{default:h(()=>[...e[3]||(e[3]=[f("Save posts order",-1)])]),_:1},8,["onClick"])):v("",!0)])])]),default:h(()=>[t("div",te,[t("div",se,[e[7]||(e[7]=t("div",{class:"flex-grow"},null,-1)),n(C,{href:r.route("admin.categories.create",{type:"researchers"})},{default:h(()=>[n(b,null,{default:h(()=>[...e[6]||(e[6]=[f("Add Category",-1)])]),_:1})]),_:1},8,["href"])]),t("div",oe,[o.categories.length?(c(!0),p(x,{key:0},E(o.categories,(a,u)=>{var B;return c(),p("div",null,[t("div",ie,[t("div",{class:"mr-4",onClick:m=>s.showCategoriesContentToggle(u)},[n(L,{class:y(["w-6 transition-all duration-300",{"rotate-180":i.showCategoryContent.includes(u)}])},null,8,["class"])],8,le),t("div",{class:"flex-grow",onClick:m=>s.showCategoriesContentToggle(u)}
1,[t("span",ae,w(a.name.lv),1)],8,ne),t("div",de,[t("div",ce,[u>0?(c(),O(D,{key:0,class:"w-5 cursor-pointer",onClick:m=>s.moveCategoryUp(u)},null,8,["onClick"])):v("",!0),u<o.categories.length-1?(c(),O(F,{key:1,class:"w-5 cursor-pointer",onClick:m=>s.moveCategoryDown(u)},null,8,["onClick"])):v("",!0)]),n(C,{class:"cursor-pointer my-auto",href:r.route("admin.categories.edit",{category:a.id,type:"researchers"})},{default:h(()=>[n(M,{class:"w-6"})]),_:1},8,["href"]),t("div",{class:"cursor-pointer my-auto",onClick:m=>s.openDeleteModal("category",a.name.lv,a.id)},[n(A,{class:"w-6 fill-red-600 text-red-600"})],8,me)])]),t("div",null,[(B=a.researchers)!=null&&B.length&&i.showCategoryContent.includes(u)?(c(),p("div",he,[e[9]||(e[9]=t("div",{class:"grid grid-cols-12 p-4 border-b-2"},[t("div",{class:"col-span-2 xl:col-span-1"},"Published"),t("div",{class:"col-span-8 xl:col-span-9"},"Name"),t("div",{class:"col-span-2 text-right"},"Actions")],-1)),t("div",ue,[(c(!0),p(x,null,E(a.researchers,(m,g)=>(c(),p("div",{class:y(["py-2 px-4 grid grid-cols-12",{"border-b-2":a.researchers.length!==g+1}])},[t("div",pe,[m.published?(c(),p("div",ge,[n(S,{class:"w-6 text-green-600"})])):(c(),p("div",_e,[n(U,{class:"w-6 text-red-600"})]))]),t("div",Ce,w(m.name.lv),1),t("div",fe,[e[8]||(e[8]=t("div",{class:"flex-grow"},null,-1)),t("div",ve,[t("div",ye,[n(D,{class:y(["w-5",g>0?"cursor-pointer":"cursor-not-allowed text-gray-300"]),onClick:T=>s.moveItemUp(u,g,g>0)},null,8,["class","onClick"]),n(F,{class:y(["w-5",g<a.researchers.length-1?"cursor-pointer":"cursor-not-allowed text-gray-300"]),onClick:T=>s.moveItemDown(u,g,g<a.researchers.length-1)},null,8,["class","onClick"])]),n(C,{class:"cursor-pointer my-auto",href:r.route("admin.researchers.show",{researcher:m.id})},{default:h(()=>[n(N,{class:"w-6"})]),_:1},8,["href"]),n(C,{class:"cursor-pointer my-auto",href:r.route("admin.researchers.edit",{researcher:m.id})},{default:h(()=>[n(M,{class:"w-6"})]),_:1},8,["href"]),t("div",{class:"cursor-pointer my-auto",onClick:T=>s.openDeleteModal("post",m.name.lv,m.id)},[n(A,{class:"w-6 fill-red-600 text-red-600"})],8,we)])])],2))),256))])])):v("",!0),t("div",Oe,[n(C,{href:r.route("admin.researchers.create",{category:a.id}),class:"mx-auto"},{default:h(()=>[...e[10]||(e[10]=[f("Create researcher",-1)])]),_:1},8,["href"])])])])}),256)):(c(),p("div",ke," No categories created "))])]),n(P,{show:i.showDeleteModal,onClose:s.closeDeleteModal},{default:h(()=>[t("div",be,[e[12]||(e[12]=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",xe,[t("h1",De,[f("Are you sure you want to delete "+w(i.deleteModal.type)+": ",1),t("strong",null,w(i.deleteModal.name),1)]),t("div",Fe,[e[11]||(e[11]=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]=(...a)=>s.closeDeleteModal&&s.closeDeleteModal(...a))},"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]=a=>i.deleteModal.type==="category"?s.destroyCategory(i.deleteModal.id):s.destroy(i.deleteModal.id))},"Delete")])])])]),_:1},8,["show","onClose"])]),_:1})],64)}const qe=I($,[["render",Me]]);export{qe 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.