PageSourceSearch

https://uttarakhandtourism.gov.in/build/assets/Index-BxtYVCrw.js

js uttarakhandtourism.gov.in collected 2026-10-02 06:30:34 UTC 6,598 bytes, 1 lines download raw bytes

1import{X as y,r as n,j as e,S as v,x as k}from"./app-Ha4X7SlF.js";import{A as S}from"./AuthenticatedLayout-BZKUhDrh.js";import{d as o}from"./index-f3GnAQgI.js";import{s as A}from"./helpers-C3Ubf4D0.js";import{I as D}from"./InputError-Do4kQPnM.js";import"./transition-DszwGdUG.js";import"./Sidebar-BmBFQuN7.js";import"./SvgSwitcher-DH9r9e5c.js";import"./ToastNotification-BhTNdAie.js";import"./moment-C5S46NFB.js";function X({auth:d,session:r}){const{templates:x}=y().props,[a,m]=n.useState(A(x)),h=t=>{confirm("Are you sure you want to delete this template?")&&o.Inertia.delete(route("templates.destroy",t),{onSuccess:()=>{m(a.filter(s=>s.id!==t))},onError:s=>{console.error("Error deleting template:",s)}})},[l,i]=n.useState(new Set),p=a.length>0?l.size===a.length:!1,[u,c]=n.useState(""),[f,g]=n.useState(""),b=t=>{g(t.target.value)},j=t=>{t.target.checked?i(new Set(a.map(s=>s.id))):i(new Set)},w=t=>{const s=new Set(l);s.has(t)?s.delete(t):s.add(t),i(s)},N=t=>{if(t.preventDefault(),l.size===0){c("No records selected for deletion.");return}else f==="delete"?(c(""),confirm("Are you sure you want to delete?")&&o.Inertia.post("/userpanel/bulkDelete",{ids:Array.from(l),type:"templates"})):c("Please select a valid action.")};return e.jsxs(S,{user:d.user,header:e.jsx("h2",{className:"font-semibold text-xl text-gray-800 leading-tight",children:"Templates List"}),children:[e.jsx(v,{title:"templates List"}),e.jsx("div",{className:"py-4",children:e.jsxs("div",{className:"max-w-8xl mx-auto px-6 lg:px-8 space-y-5",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row  justify-between py-1 ",children:[e.jsx("h3",{className:"text-lg font-semibold",children:"templates List"}),e.jsxs(k,{className:"shadow inline-flex items-center hover:bgThemeDark focus:bgThemeDark focus:shadow-outline text-white font-semibold py-2 px-4 rounded-lg bgTheme",href:"/userpanel/templates/create",children:[e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"mr-2 w-5 h-5",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"0",y:"0",width:"24",height:"24",stroke:"none"}),e.jsx("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),e.jsx("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]}),"Create"]})]}),(r==null?void 0:r.success)&&e.jsxs("div",{className:"bg-green-100 border border-green-400 text-green-700 px-4 py-3 rounded relative",role:"alert",children:[e.jsx("strong",{className:"font-bold",children:"Success!"}),e.jsxs("span",{className:"block sm:inline",children:[" ",r.success]})]}),(r==null?void 0:r.error)&&e.jsxs("div",{className:"bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative",role:"alert",children:[e.jsx("strong",{className:"font-bold",children:"Error!"}),e.jsxs("span",{className:"block sm:inline",children:[" ",r.error]})]}),e.jsxs("div",{className:"flex flex-col",children:[e.jsx("div",{className:"table-top-filters flex justify-between md:flex-wrap sm:flex-wrap xs:flex-wrap table-top-block pt48",children:e.jsx("div",{className:"select-box w-full",children:e.jsxs("form",{className:"flex items-start",children:[e.jsxs("select",{id:"countries",onChange:b,className:"mt-1 mb-4 block focus:border-black rounded-sm bg-gray-100 border-gray-300",children:[e.jsx("option",{selected:!0,disabled:!0,children:"Bulk Action"}),e.jsx("option",{value:"delete",children:"Delete"})]}),e.jsx("button",{onClick:N,className:"inline-flex items-center px-4 py-3 mt-1 bg-gray-800 border border-transparent rounded-md font-semibold text-xs text-white uppercase tracking-widest hover:bg-gray-700 focus:bg-gray-700 active:bg-gray-900 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 transition ease-in-out duration-150 false ms-4 bgTheme",children:"Apply"}),e.jsx(D,{message:u,className:"m-2 p-2"})]})})}),e.jsx("div",{className:"overflow-x-auto pb-4",children:e.jsx("div",{className:"min-w-full inline-block align-middle",children:e.jsx("div",{className:"overflow-hidden border rounded-lg border-gray-300",children:e.jsxs("table",{className:"table-auto min-w-full rounded-xl",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"bg-slate-300",children:[e.jsx("th",{className:"p-2",children:e.jsx("div",{className:"flex items-center",children:e.jsx("input",{type:"checkbox",checked:p,onChange:j,value:"",className:"w-5 h-5 appearance-none border border-gray-300 rounded-md mr-2 checked:bg-no-repeat checked:bg-center focus:outline-none focus:shadow-none  focus:ring-0"})})}),e.jsx("th",{className:"p-2 text-left whitespace-nowrap text-sm leading-6 font-semibold text-gray-900 capitalize",children:"Title"}),e.jsx("th",{className:"p-2 text-left whitespace-nowrap text-sm leading-6 font-semibold text-gray-900 capitalize",children:"Short Description"}),e.jsx("th",{className:"p-2 text-left whitespace-nowrap text-sm leading-6 font-semibold text-gray-900 capitalize",children:"Status"}),e.jsx("th",{className:"p-2 text-left whitespace-nowrap text-sm leading-6 font-semibold text-gray-900 capitalize",children:"Actions"})]})}),e.jsxs("tbody",{className:"divide-y divide-gray-300",children:[a.map(t=>e.jsxs("tr",{className:"bg-white transition-all duration-500 hover:bg-gray-50",children:[e.jsx("td",{className:"p-5",children:e.jsx("div",{className:"flex items-center",children:e.jsx("input",{type:"checkbox",checked:l.has(t.id),onChange:()=>w(t.id),className:"w-5 h-5 appearance-none border border-gray-300 rounded-md mr-2 checked:bg-no-repeat checked:bg-center focus:outline-none focus:shadow-none  focus:ring-0"})})}),e.jsx("td",{className:"p-2 whitespace-nowrap text-sm leading-6 font-medium text-gray-900",children:t.title}),e.jsx("td",{className:"p-2 whitespace-nowrap text-sm leading-6 font-medium text-gray-900",children:t.short_description}),e.jsx("td",{className:"p-2 whitespace-nowrap text-sm leading-6 font-medium text-gray-900",children:t.status==1?"Publish":"Draft"}),e.jsxs("td",{className:"p-2 whitespace-nowrap text-sm leading-6 font-medium text-gray-900",children:[e.jsxs("span",{className:"edit text-blue-600",children:[e.jsx("a",{href:`/userpanel/templates/${t.id}/edit`,"aria-label":"Edit",className:"pr-1",children:"Edit"})," |"]}),e.jsx("span",{className:"delete",children:e.jsx("button",{className:"text-red-500 hover:text-red-700",onClick:()=>h(t.id),children:"  Delete"})})]})]},t.id)),a.length===0&&e.jsx("tr",{className:"bg-white transition-all duration-500 hover:bg-gray-50",children:e.jsx("td",{className:"p-2",colSpan:5,children:e.jsx("div",{className:"flex justify-center",children:"No data found"})})})]})]})})})})]})]})})]})}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.