PageSourceSearch

https://fonds.lv/build/assets/Form-DVKtTiPy.js

js fonds.lv collected 2026-10-01 12:27:23 UTC 9,197 bytes, 1 lines download raw bytes

1import{A as B}from"./AuthenticatedLayout-BgPi6SK7.js";import{Z as V,i as I,r as a,f as u,c as w,a as o,w as i,b as l,d as O,o as m,F as g,j as v,e as M,k as E,g as L,T as D}from"./app-BFBm0Bhp.js";import{T as j,A as F}from"./Attachment-ui7ykot5.js";import{_ as N}from"./InputLabel-COeR7jGs.js";import{_ as R}from"./TextInput-BleaLv5g.js";import{_ as H}from"./InputError-gS6WMAxM.js";import{_ as W,T as Z}from"./TagInput-B24tt8Te.js";import{a as q}from"./TextOutline-DJTNpM16.js";import{_ as z,a as G,C as J}from"./ContentManager-D8_wkhWp.js";import{P as K}from"./PrimaryButton-DQRXstZk.js";import{_ as Q}from"./TextBlock-BLReQj5p.js";import{S as X}from"./Switch-lcdVR_Lx.js";import{T as Y}from"./TagInputWithSections-ClLsNCgf.js";import{_ as $}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ApplicationLogo-BDZZhcqx.js";import"./NavLink-XJ1F9B8R.js";import"./DocumentTextOutline-CSPECrKp.js";import"./InformationCircleOutline-B09VKpeu.js";import"./ChevronDownOutline-I8s4miqi.js";import"./LinkOutline-BCvp66tw.js";import"./LogoYoutube-DPs_gR_f.js";import"./ArrowUpOutline-D4ILiFyi.js";import"./ArrowDownOutline-reU2X3OH.js";const tt={name:"ScholarshipsForm",components:{ContentManager:J,TagInputWithSections:Y,Switch:X,TagInput:Z,TextBlock:Q,PrimaryButton:K,AttachOutline:G,ChatbubbleEllipsesOutline:z,TextOutline:q,CloseOutline:W,InputError:H,TextInput:R,InputLabel:N,Attachment:F,TextBuilder:j,Link:I,AuthenticatedLayout:B,Head:V},props:{student:{type:Object,default:[]},categories:{type:Object,default:[]},forCategory:{type:Object,default:[]},scholarships:{type:Object,default:null}},data(){return{form:D({student_pid:this.student.student_pid??"",name:this.student.name??{lv:"",en:""},excerpt:this.student.excerpt??{lv:"",en:""},published:this.student.published??!1,contents:this.student.contents??[{type:"text",content:{lv:"",en:""},title:{lv:"",en:""},order:1,submit:!0,photoPreview:null}],scholarships:this.student.scholarships??[],categories:this.student.categories??[],image:{image_title:this.student.image_title??{lv:null,en:null},image:this.student.image??null,photoPreview:null},author:this.student.author??{lv:"",en:""},_method:"post"})}},mounted(){this.form.contents.forEach(t=>{t.submit=!0,t.title=t.title??{lv:"",en:""}})},methods:{handleToggle(t){this.form.published=t},updatePhotoPreview(t){this.form.image.image=t.content,this.form.image.photoPreview=t.photoPreview},updatePhotoTitle(t){this.form.image.image_title=t.title},updateContentAttachmentTitle(t){this.form.contents[t.content.id].title[t.locale]=t.content.title},updateContent(t){const e=this.form.contents[t.content.id];if(e.type==="attachment"||e.type==="file"){this.form.contents[t.content.id].content.lv=t.content.content,this.form.contents[t.content.id].content.en=t.content.content,this.form.contents[t.content.id].photoPreview=t.content.photoPreview;return}this.form.contents[t.content.id].content[t.locale]=t.content.content},moveUp(t){const e=this.form.contents[t.index];this.form.contents[t.index].order=e.order-1,this.form.contents[t.index-1].order=e.order+1,this.reorderContentByOrderAsc()},moveDown(t){const e=this.form.contents[t.index];this.form.contents[t.index].order=e.order+1,this.form.contents[t.index+1].order=e.order-1,this.reorderContentByOrderAsc()},reorderContentByOrderAsc(){this.form.contents.sort((t,e)=>t.order-e.order)},updateCategories(t){this.form.categories=t},updateScholarships(t){this.form.scholarships=t},addContent(t){this.form.contents.push({type:t.type,content:{lv:null,en:null},title:{lv:null,en:null},order:this.form.contents.length+1,submit:!0,photoPreview:null})},removeContentBlock(t){t.index>=0&&t.index<this.form.contents.length&&(this.form.contents[t.index].submit=!1)},submit(){var t;this.form.contents=this.form.contents.filter(e=>e.submit);for(let e=0;e<this.form.contents.length;e++)this.form.contents[e].order=e+1;(t=this.student)!=null&&t.id?(this.form._method="put",this.form.post(route("admin.students.update",{student:this.student.id}),{preserveState:"errors"})):this.form.post(route("admin.students.store"),{preserveState:"errors"})}}},et={class:"py-12"},ot={class:"bg-white overflow-hidden shadow-sm sm:rounded-lg"},nt={class:"space-y-2"},st={class:"flex items-center gap-4"},rt={key:0,class:"text-sm text-gray-600"};function lt(t,e,p,at,n,r){var U;
1const C=a("Head"),c=a("InputLabel"),y=a("Switch"),b=a("TagInput"),d=a("InputError"),_=a("TextInput"),x=a("TextBlock"),T=a("ContentManager"),A=a("TagInputWithSections"),P=a("Attachment"),S=a("PrimaryButton"),k=a("AuthenticatedLayout");return m(),u(g,null,[(U=p.student)!=null&&U.id?(m(),w(C,{key:0,title:"Edit Student"})):(m(),w(C,{key:1,title:"Add Students"})),o(k,null,{header:i(()=>[...e[2]||(e[2]=[l("h2",{class:"font-semibold text-xl text-gray-800 leading-tight"},"Add Student",-1)])]),default:i(()=>[l("div",et,[l("div",ot,[l("form",{class:"space-y-5 p-4",enctype:"multipart/form-data",onSubmit:e[1]||(e[1]=O(h=>r.submit(),["prevent"]))},[l("div",nt,[o(c,{for:"published",value:"Activate"}),o(y,{isOn:n.form.published,"onUpdate:isOn":r.handleToggle,id:"active"},null,8,["isOn","onUpdate:isOn"])]),l("div",null,[o(b,{onUpdateTags:r.updateCategories,"allow-creating-new-tags":!1,options:p.categories,selectedTags:p.student.categories??p.forCategory??[]},{label:i(()=>[...e[3]||(e[3]=[l("span",null,"Categories",-1)])]),placeholder:i(()=>[...e[4]||(e[4]=[l("h1",null,"Categories",-1)])]),_:1},8,["onUpdateTags","options","selectedTags"]),o(d,{class:"mt-2",message:n.form.errors.categories},null,8,["message"])]),(m(!0),u(g,null,v(n.form.name,(h,s)=>(m(),u("div",null,[o(c,{for:"name"+s.toUpperCase(),value:"Title "+s.toUpperCase()},null,8,["for","value"]),o(_,{id:"name"+s.toUpperCase(),type:"text",class:"mt-1 block w-full",modelValue:n.form.name[s],"onUpdate:modelValue":f=>n.form.name[s]=f,autofocus:"",autocomplete:"name"},null,8,["id","modelValue","onUpdate:modelValue"]),o(d,{class:"mt-2",message:n.form.errors["name."+s]},null,8,["message"])]))),256)),l("div",null,[o(c,{for:"student_pid",value:"Student PID"}),o(_,{id:"student_pid",type:"text",class:"mt-1 block w-full",modelValue:n.form.student_pid,"onUpdate:modelValue":e[0]||(e[0]=h=>n.form.student_pid=h),autocomplete:"student_pid"},null,8,["modelValue"]),o(d,{class:"mt-2",message:n.form.errors.student_pid},null,8,["message"])]),(m(!0),u(g,null,v(n.form.excerpt,(h,s)=>(m(),u("div",null,[o(c,{for:"excerpt"+s.toUpperCase(),value:"Excerpt "+s.toUpperCase()},null,8,["for","value"]),o(x,{id:"excerpt"+s.toUpperCase(),modelValue:n.form.excerpt[s],"onUpdate:modelValue":f=>n.form.excerpt[s]=f},null,8,["id","modelValue","onUpdate:modelValue"]),o(d,{class:"mt-2",message:n.form.errors["excerpt".index]},null,8,["message"])]))),256)),o(T,{contents:n.form.contents,locale:"lv",onAddContent:r.addContent,onRemoveContentBlock:r.removeContentBlock,onMoveUp:r.moveUp,onMoveDown:r.moveDown,onUpdateContent:r.updateContent,onUpdateContentAttachmentTitle:r.updateContentAttachmentTitle},{default:i(()=>[o(c,{value:"Content LV"})]),_:1},8,["contents","onAddContent","onRemoveContentBlock","onMoveUp","onMoveDown","onUpdateContent","onUpdateContentAttachmentTitle"]),o(T,{contents:n.form.contents,locale:"en",onAddContent:r.addContent,onRemoveContentBlock:r.removeContentBlock,onMoveUp:r.moveUp,onMoveDown:r.moveDown,onUpdateContent:r.updateContent,onUpdateContentAttachmentTitle:r.updateContentAttachmentTitle},{default:i(()=>[o(c,{value:"Content EN"})]),_:1},8,["contents","onAddContent","onRemoveContentBlock","onMoveUp","onMoveDown","onUpdateContent","onUpdateContentAttachmentTitle"]),l("div",null,[o(A,{onUpdateTags:r.updateScholarships,"allow-creating-new-tags":!1,options:p.scholarships,selectedTags:this.form.scholarships??[]},{label:i(()=>[...e[5]||(e[5]=[l("span",null,"Scholarships",-1)])]),placeholder:i(()=>[...e[6]||(e[6]=[l("h1",null,"Scholarships",-1)])]),_:1},8,["onUpdateTags","options","selectedTags"]),o(d,{class:"mt-2",message:n.form.errors.scholarships},null,8,["message"])]),l("div",null,[o(P,{attachments:n.form.image.image,attachmentTitle:n.form.image.image_title,photoPreview:n.form.image.photoPreview,onUpdatePhotoPreview:r.updatePhotoPreview,onUpdatePhotoTitle:r.updatePhotoTitle},{title:i(()=>[...e[7]||(e[7]=[l("span",{class:"pl-2"},"Featured image",-1)])]),_:1},8,["attachments","attachmentTitle","photoPreview","onUpdatePhotoPreview","onUpdatePhotoTitle"])]),(m(!0),u(g,null,v(n.form.author,(h,s)=>(m(),u("div",null,[o(c,{for:"author"+s.toUpperCase(),value:"Author "+s.toUpperCase()},null,8,["for","value"]),o(_,{id:"author"+s.toUpperCase(),type:"text",class:"mt-1 block w-full",modelValue:n.form.author[s],"onUpdate:modelValue":f=>n.form.author[s]=f},null,8,["id","modelValue","onUpdate:modelValue"]),o(d,{class:"mt-2",message:n.form.errors["author."+s]},null,8,["message"])]))),256)),l("div",st,[o(S,{disabled:n.form.processing},{default:i(()=>[...e[8]||(e[8]=[M("Save",-1)])]),_:1},8,["disabled"]),o(E,{"enter-active-class":"transition ease-in-out","enter-from-class":"opacity-0","leave-active-class":"transition ease-in-out","leave-to-class":"opacity-0"},{default:i(()=>[n.form.recentlySuccessful?(m(),u("p",rt,"Saved.")):L("",!0)]),_:1})])],32)])])]),_:1})],64)}const Vt=$(tt,[["render",lt]]);export{Vt 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.