PageSourceSearch

https://www.eria.org/build/assets/CreateArticle-16ynrcBw.js

js eria.org collected 2026-09-24 17:14:03 UTC 5,387 bytes, 1 lines download raw bytes

1import{X as w,r as g,j as e,A as b}from"./app-C7IlInSe.js";import{S as j}from"./sweetalert2.esm.all-Bj_ZQUAw.js";import{R as C}from"./RichEditor-DP1DP5Ki.js";import S from"./HeaderMain-B9ICaXAU.js";import E from"./FooterMain-ixFuQOXa.js";import A from"./LeftNavbarMain-B4CZCkI9.js";import k from"./HeaderNavbarMain-LL1w3kYi.js";import"./Editor-ClgE2bCz.js";import"./index-DZq9ZGYf.js";import"./Combination-B2O05mu8.js";import"./InputBase-hn7HK4ER.js";import"./floating-ui.react-dom-C6CG5rhy.js";import"./clsx-B-dksMZM.js";import"./Helmet-BBnivOm7.js";function X(){var f,x;const p=(f=window.appConfig)==null?void 0:f.spaceCdnEndpoint,v=(x=window.appConfig)==null?void 0:x.urlAdmin,{csrf_token:u,slider_data:s,url_post:N}=w().props,[a,d]=g.useState({id:"",image_name:"",photo:null,heading:"",banner_url:"",banner_target:"",content:"",order_id:"",published:!1});g.useEffect(()=>{s&&d({id:s.slide_id||"",image_name:s.image_name||"",photo:null,heading:s.heading||"",banner_url:s.banner_url||"",banner_target:s.banner_target||"",content:s.content||"",order_id:s.order_id||"",published:!!s.published})},[s]);const o=i=>{const{name:r,value:m,type:l,checked:t,files:n,multiple:c}=i.target;if(l==="checkbox"){d(h=>({...h,[r]:t}));return}if(l==="file"){d(h=>({...h,[r]:c?Array.from(n):n[0]}));return}d(h=>({...h,[r]:m}))},_=(i,r)=>{d(m=>({...m,[i]:r}))},y=i=>{i.preventDefault();const r=i.target.querySelector('button[type="submit"]'),m=r.innerHTML;r.disabled=!0,r.innerHTML='<i class="fa fa-spinner fa-spin"></i> Processing submit...';const l=new FormData;Object.entries(a).forEach(([t,n])=>{Array.isArray(n)?n.forEach(c=>l.append(`${t}[]`,c)):l.append(t,n??"")}),l.append("_token",u),b.post(`${v}${N}`,l,{preserveScroll:!0,forceFormData:!0,onSuccess:t=>{var c;const n=t.props.redirect||((c=t.props.flash)==null?void 0:c.redirect);j.fire({icon:"success",title:"Success",text:"Article has been saved successfully!"}).then(()=>{n&&b.visit(n)})},onError:()=>{j.fire({icon:"error",title:"Error",text:"There was an error saving the article. Please try again."})},onFinish:()=>{r.disabled=!1,r.innerHTML=m}})};return e.jsxs("div",{style:{minHeight:"100vh",backgroundColor:"#0F3979"},children:[e.jsx(S,{}),e.jsxs("div",{id:"wrapper",children:[e.jsx(A,{}),e.jsx("div",{id:"content-wrapper",className:"d-flex flex-column",children:e.jsxs("div",{id:"content",children:[e.jsx(k,{}),e.jsx("div",{className:"container-fluid",children:e.jsx("div",{className:"row",children:e.jsx("div",{className:"col-xl-12 col-lg-12",children:e.jsx("div",{className:"card shadow mb-4",children:e.jsx("div",{className:"card-header py-3",children:e.jsxs("form",{method:"POST",encType:"multipart/form-data",onSubmit:y,children:[e.jsx("input",{type:"hidden",name:"_token",value:u}),e.jsx("input",{type:"hidden",name:"id",value:a.id}),e.jsx("div",{className:"row",children:e.jsx("div",{className:"col-md-12",children:e.jsx("div",{className:"form-group",children:e.jsx("div",{style:{backgroundColor:"rgb(15, 57, 121)"},children:e.jsx("img",{id:"placeholder",className:"w-1/4 h-100 pt-5 pb-5",src:a.image_name?`${p}${a.image_name}`:`${p}/thumbnail-default-eria/ERIA-article-default-thumbnail.svg`,alt:"Preview",style:{margin:"auto"}})})})})}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{className:"form-label",children:"Image"}),e.jsxs("div",{className:"controls",children:[e.jsx("input",{type:"hidden",name:"image_name",value:a.image_name}),e.jsx("input",{className:"input-file form-control",id:"photo",name:"photo",type:"file",accept:"image/*",onChange:o})]}),e.jsx("span",{className:"text-danger text-sm",style:{fontStyle:"italic"},children:"(Please use 800 x 467 px)"})]}),e.jsx("div",{className:"row",children:e.jsx("div",{className:"col-md-12",children:e.jsxs("div",{className:"form-group",children:[e.jsx("label",{className:"form-label",children:"Heading"}),e.jsx("textarea",{className:"form-control",name:"heading",style:{height:35},value:a.heading,onChange:o})]})})}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{className:"form-label",children:"Content"}),e.jsx(C,{name:"content",value:a.content,onChange:i=>_("content",i)})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{className:"form-label",children:"URL"}),e.jsx("input",{type:"text",name:"banner_url",className:"form-control",value:a.banner_url,onChange:o})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{className:"form-label",children:"Target"}),e.jsxs("select",{className:"form-control",name:"banner_target",value:a.banner_target,onCh
1ange:o,children:[e.jsx("option",{value:"",children:"Choose Target"}),e.jsx("option",{value:"_self",children:"Current Window"}),e.jsx("option",{value:"_blank",children:"New Window"})]})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{className:"form-label",children:"Sort"}),e.jsx("input",{type:"number",name:"order_id",className:"form-control",value:a.order_id,onChange:o})]}),e.jsxs("div",{className:"form-group",children:[e.jsx("label",{className:"form-label",children:"Published"}),e.jsx("input",{type:"checkbox",className:"form-control",name:"published",checked:a.published,onChange:o,style:{width:30}})]}),e.jsx("div",{className:"form-group text-right",children:e.jsxs("button",{type:"submit",className:"btn btn-success",children:[e.jsx("i",{className:"fa fa-save"})," Save"]})})]})})})})})})]})})]}),e.jsx(E,{})]})}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.