PageSourceSearch

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

js fonds.lv collected 2026-09-24 10:03:39 UTC 9,170 bytes, 1 lines download raw bytes

1import{A as O}from"./AuthenticatedLayout-DcpqZk2r.js";import{Z as V,i as I,r as m,f as i,c as x,a as n,w as c,b as l,d as D,g as _,o as a,F as g,j as v,e as M,k as S,T as E}from"./app-B9KORyBa.js";import{T as L,A as H}from"./Attachment-CDfGTxyk.js";import{_ as j}from"./InputLabel-C-zTQq7X.js";import{_ as F}from"./TextInput-C7OaZZNQ.js";import{_ as N}from"./InputError-BH5ciAU3.js";import{_ as R,T as Z}from"./TagInput-z-N_H-Oj.js";import{a as q}from"./TextOutline-CGLkonHp.js";import{_ as z,a as G,C as J}from"./ContentManager-BeT97HXG.js";import{P as K}from"./PrimaryButton-vaEit9c1.js";import{_ as Q}from"./TextBlock-CnuGUd5s.js";import{S as W}from"./Switch-CjgwlyRI.js";import{_ as X}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ApplicationLogo-DrAX-EpC.js";import"./NavLink-BiVKPBr8.js";import"./DocumentTextOutline-B7A647Cs.js";import"./InformationCircleOutline-DCl6slX2.js";import"./ChevronDownOutline-DkbFw82G.js";import"./LinkOutline-D_8hjSSX.js";import"./LogoYoutube-C-1pvmVy.js";import"./ArrowUpOutline-BhcV9wP_.js";import"./ArrowDownOutline-DJK0Og38.js";const Y={name:"ScholarshipsForm",components:{ContentManager:J,Switch:W,TagInput:Z,TextBlock:Q,PrimaryButton:K,AttachOutline:G,ChatbubbleEllipsesOutline:z,TextOutline:q,CloseOutline:R,InputError:N,TextInput:F,InputLabel:j,Attachment:H,TextBuilder:L,Link:I,AuthenticatedLayout:O,Head:V},props:{patron:{type:Object,default:[]},categories:{type:Object,default:[]},forCategory:{type:Object,default:[]},tags:{type:Object,default:[]}},data(){return{form:E({has_details:this.patron.has_details??!0,name:this.patron.name??{lv:"",en:""},excerpt:this.patron.excerpt??{lv:"",en:""},published:this.patron.published??!1,contents:this.patron.contents??[{type:"text",content:{lv:"",en:""},title:{lv:"",en:""},order:1,submit:!0,photoPreview:null}],tags:this.patron.tags??[],categories:this.patron.categories??[],image:{image_title:this.patron.image_title??{lv:null,en:null},image:this.patron.image??null,photoPreview:null},author:this.patron.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},handleToggleHasDetails(t){this.form.has_details=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},updateTags(t){this.form.tags=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.patron)!=null&&t.id?(this.form._method="put",this.form.post(route("admin.patrons.update",{patron:this.patron.id}),{preserveState:"errors"})):this.form.post(route("admin.patrons.store"),{preserveState:"errors"})}}},$={key:0,class:"font-semibold text-xl text-gray-800 leading-tight"},tt={key:1,class:"font-semibold text-xl text-gray-800 leading-tight"},et={class:"py-12"},ot={class:"bg-white overflow-hidden shadow-sm sm:rounded-lg"},nt={class:"space-y-2"},st={class:"space-y-2"},rt={key:0},at={key:1,class:"space-y-5"},lt={class:"flex items-center gap-4"},it={key:0,class:"text-sm text-gray-600"};function mt(t,e,p,ct,o,s){var b;const C=m("Head"),d=m("InputLabel"),T=m("Switch"),y=m("TagInput"),h=m("InputError"),U=m("TextInput"),P=m("TextBlock"),w=m("ContentManager"),A=m("Attachment"),k=m("PrimaryButton"),B=m("AuthenticatedLayout");return a(),i(g,null,[(b=p.patron)!=null&&b.id?(a(),x(C,{key:0,title:"Edit Patron"})):(a(),x(C,{key:1,title:"Add Patron"})),n(B,null,{header:c(()=>{var u;return[(u=p.patron)!=null&&u.id?(a(),i("h2",$,"Edit Patron")):(a(),i("h2",tt,"Add Patron"))]}),default:c(()=>[l("div",et,[l("div",ot,[l("form",{class:"space-y-5 p-4",enctype:"multipart/form-data",onSubmit:e[0]||(e[0]=D(u=>s.submit(),["prevent"]))},[l("div",nt,[n(d,{for:"published",value:"Activate"}),n(T,{isOn:o.form.published,"onUpdate:isOn":s.handleToggle,id:"active"},null,8,["isOn","onUpdate:isOn"])]),l("div",st,[n(d,{for:"hasDetail
1s",value:"Has Details"}),n(T,{isOn:o.form.has_details,"onUpdate:isOn":s.handleToggleHasDetails,id:"hasDetails"},null,8,["isOn","onUpdate:isOn"])]),l("div",null,[n(y,{onUpdateTags:s.updateCategories,"allow-creating-new-tags":!1,options:p.categories,selectedTags:p.patron.categories??p.forCategory??[]},{label:c(()=>[...e[1]||(e[1]=[l("span",null,"Categories",-1)])]),placeholder:c(()=>[...e[2]||(e[2]=[l("h1",null,"Categories",-1)])]),_:1},8,["onUpdateTags","options","selectedTags"]),n(h,{class:"mt-2",message:o.form.errors.categories},null,8,["message"])]),o.form.has_details?(a(),i("div",rt,[n(y,{onUpdateTags:s.updateTags,"allow-creating-new-tags":!1,options:p.tags,selectedTags:p.patron.tags??[]},{label:c(()=>[...e[3]||(e[3]=[l("span",null,"Display on landing",-1)])]),placeholder:c(()=>[...e[4]||(e[4]=[l("h1",null,"Display Tags",-1)])]),_:1},8,["onUpdateTags","options","selectedTags"]),n(h,{class:"mt-2",message:o.form.errors.tags},null,8,["message"])])):_("",!0),(a(!0),i(g,null,v(o.form.name,(u,r)=>(a(),i("div",null,[n(d,{for:"name"+r.toUpperCase(),value:"Title "+r.toUpperCase()},null,8,["for","value"]),n(U,{id:"name"+r.toUpperCase(),type:"text",class:"mt-1 block w-full",modelValue:o.form.name[r],"onUpdate:modelValue":f=>o.form.name[r]=f,autofocus:"",autocomplete:"name"},null,8,["id","modelValue","onUpdate:modelValue"]),n(h,{class:"mt-2",message:o.form.errors["name."+r]},null,8,["message"])]))),256)),o.form.has_details?(a(),i("div",at,[(a(!0),i(g,null,v(o.form.excerpt,(u,r)=>(a(),i("div",null,[n(d,{for:"excerpt"+r.toUpperCase(),value:"Excerpt "+r.toUpperCase()},null,8,["for","value"]),n(P,{id:"excerpt"+r.toUpperCase(),modelValue:o.form.excerpt[r],"onUpdate:modelValue":f=>o.form.excerpt[r]=f},null,8,["id","modelValue","onUpdate:modelValue"]),n(h,{class:"mt-2",message:o.form.errors["excerpt".index]},null,8,["message"])]))),256)),n(w,{contents:o.form.contents,locale:"lv",onAddContent:s.addContent,onRemoveContentBlock:s.removeContentBlock,onMoveUp:s.moveUp,onMoveDown:s.moveDown,onUpdateContent:s.updateContent,onUpdateContentAttachmentTitle:s.updateContentAttachmentTitle},{default:c(()=>[n(d,{value:"Content LV"})]),_:1},8,["contents","onAddContent","onRemoveContentBlock","onMoveUp","onMoveDown","onUpdateContent","onUpdateContentAttachmentTitle"]),n(w,{contents:o.form.contents,locale:"en",onAddContent:s.addContent,onRemoveContentBlock:s.removeContentBlock,onMoveUp:s.moveUp,onMoveDown:s.moveDown,onUpdateContent:s.updateContent,onUpdateContentAttachmentTitle:s.updateContentAttachmentTitle},{default:c(()=>[n(d,{value:"Content EN"})]),_:1},8,["contents","onAddContent","onRemoveContentBlock","onMoveUp","onMoveDown","onUpdateContent","onUpdateContentAttachmentTitle"]),l("div",null,[n(A,{attachments:o.form.image.image,attachmentTitle:o.form.image.image_title,photoPreview:o.form.image.photoPreview,onUpdatePhotoPreview:s.updatePhotoPreview,onUpdatePhotoTitle:s.updatePhotoTitle},{title:c(()=>[...e[5]||(e[5]=[l("span",{class:"pl-2"},"Featured image",-1)])]),_:1},8,["attachments","attachmentTitle","photoPreview","onUpdatePhotoPreview","onUpdatePhotoTitle"])]),(a(!0),i(g,null,v(o.form.author,(u,r)=>(a(),i("div",null,[n(d,{for:"author"+r.toUpperCase(),value:"Author "+r.toUpperCase()},null,8,["for","value"]),n(U,{id:"author"+r.toUpperCase(),type:"text",class:"mt-1 block w-full",modelValue:o.form.author[r],"onUpdate:modelValue":f=>o.form.author[r]=f},null,8,["id","modelValue","onUpdate:modelValue"]),n(h,{class:"mt-2",message:o.form.errors["author."+r]},null,8,["message"])]))),256))])):_("",!0),l("div",lt,[n(k,{disabled:o.form.processing},{default:c(()=>[...e[6]||(e[6]=[M("Save",-1)])]),_:1},8,["disabled"]),n(S,{"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:c(()=>[o.form.recentlySuccessful?(a(),i("p",it,"Saved.")):_("",!0)]),_:1})])],32)])])]),_:1})],64)}const Dt=X(Y,[["render",mt]]);export{Dt 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.