PageSourceSearch

https://mbstu.ac.bd/build/assets/BasicInfo-vG9YSv3C.js

js mbstu.ac.bd collected 2026-09-24 21:25:23 UTC 13,906 bytes, 1 lines download raw bytes

1import{d as X,r as k,h as z,a,i as $,b as R,f as e,m as G,u as m,s as W,c as s,t as d,e as n,j as p,x as H,v as b,F as K,g as J,n as U}from"./app-CKAcpjBV.js";import{F as Q}from"./FileManagerModal-f1My9mV1.js";import{u as Y}from"./HeaderArea.vue_vue_type_script_setup_true_lang-D1RHVwo1.js";import{u as Z}from"./useFileManager-DxDatXCE.js";import{u as ee}from"./useToast-l3VtWTrw.js";import{T as te}from"./TeacherProfileLayout-Dm5RN_6_.js";import{S as re}from"./save-DoJycc8S.js";/* empty css            */import"./createLucideIcon-Df3IFRix.js";import"./file-text-BLNM0-0V.js";import"./x-B7zhStCE.js";import"./search-Belar87F.js";import"./trash-2-BypubTO-.js";import"./eye-BmTjTwP1.js";import"./download-Dv48hGc0.js";import"./folder-open-BFUxBil7.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./index-BLRDgKr4.js";import"./useDefaultImages-Ci2HP7qX.js";import"./user-BN8E6mi1.js";import"./graduation-cap-1WfxMUTs.js";import"./award-blUtIIlk.js";import"./menu-BWAwRH-X.js";const oe={class:"shadow-default rounded-sm border border-stroke bg-white dark:border-strokedark dark:bg-boxdark"},ae={class:"p-6.5"},se={class:"flex flex-col items-center gap-4 sm:flex-row"},le={class:"flex-shrink-0"},ie={class:"relative h-32 w-32 overflow-hidden rounded-full bg-gray-200"},de=["src"],ne={key:1,class:"flex h-full w-full items-center justify-center text-4xl font-bold text-gray-500"},ue={class:"flex-1"},ce={class:"flex flex-col gap-2"},me={class:"flex flex-wrap items-center gap-2"},pe=["disabled"],be=["disabled"],fe={key:0,class:"flex items-center gap-2"},ke=["value"],ve={key:1,class:"mt-2 text-sm text-primary"},ge={key:0,class:"relative mb-3 h-40 w-full overflow-hidden rounded-lg border border-stroke dark:border-strokedark"},ye=["src"],xe={class:"flex flex-wrap items-center gap-2"},he={class:"grid grid-cols-1 gap-4 md:grid-cols-2"},we=["readonly"],_e={key:0,class:"mt-1 text-xs text-gray-500"},Ce={class:"grid grid-cols-1 gap-4 md:grid-cols-2"},Se={class:"mb-2.5 flex items-center justify-between gap-3"},Pe={class:"text-sm text-bodydark2"},Re={key:0,class:"grid grid-cols-1 gap-3 md:grid-cols-2 xl:grid-cols-3"},Ue=["onClick","title"],Fe={class:"flex items-start gap-3"},je={class:"flex h-12 w-12 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-gray-50 dark:bg-meta-4"},Me=["src","alt"],Te={key:1,class:"text-xs font-semibold text-bodydark2"},Ve={class:"min-w-0 flex-1"},Be={class:"flex items-center justify-between gap-2"},De={class:"font-semibold text-black dark:text-white"},Ie={key:0,class:"mt-1 text-xs font-medium tracking-wide text-primary uppercase"},Ne={class:"mt-2 line-clamp-3 text-sm text-bodydark2"},Le={key:1,class:"rounded border border-dashed border-stroke px-4 py-5 text-sm text-bodydark2 dark:border-strokedark"},qe={class:"flex justify-end gap-4"},Ae=["disabled"],ct=X({__name:"BasicInfo",props:{teacher:{},availableSdgs:{}},setup(F){const i=ee(),{adminRoute:C,siteType:v}=Y(),u=F,o=k({...u.teacher}),y=k(!1),c=k(!1),g=k(u.teacher.profile_image||null),f=k(u.teacher.cover_photo||null),S=k(null),{isModalVisible:j,modalOptions:M,selectImage:T,handleFileSelect:V,closeModal:B}=Z(),D=async l=>{const r=l.target.files?.[0];if(!r)return;const x=new FileReader;x.onload=h=>{g.value=h.target?.result},x.readAsDataURL(r),c.value=!0;const w=new FormData;w.append("image",r);try{const h=v.value==="faculty"?"profile":"teacher/profile",O=C(`${h}/upload-image`),_=await(await fetch(O,{method:"POST",body:w,credentials:"include",headers:{"X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]')?.getAttribute("content")||"","X-Requested-With":"XMLHttpRequest"}})).json();_.success?(o.value.profile_image=_.url,g.value=_.url,i.success("Profile image uploaded successfully!")):i.error("Failed to upload image")}catch{i.error("Error uploading image")}finally{c.value=!1}},I=()=>{S.value?.click()},N=()=>{T(l=>{const r=`/file-manager/view?path=${encodeURIComponent(l.path)}`;o.value.cover_photo=r,f.value=r,i.success("Cover photo selected successfully!")})},P=()=>{o.value.cover_photo="",f.value=null},L=async()=>{try{if(!o.value.profile_image)return;await navigator.clipboard.writeText(o.value.profile_image),i.success("Image URL copied")}catch{i.error("Failed to copy URL")}},q=l=>{const t=o.value.sdg_ids||[];if(t.includes(l)){o.value.sdg_ids=t.filter(r=>r!==l);return}o.value.sdg_ids=[...t,l]},A=()=>{o.value.profile_image="",g.value=null},E=async()=>{y.value=!0;try{const l=v.value==="faculty"?"profile":"teacher/profile",t=C(`${l}/basic-info`),r={...o.value};v.value==="faculty"&&delete r.department,(await(await fetch(t,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":document.querySelector('meta[name="csrf-token"]')?.getAttribute("content")||"","X-Requested-With":"XMLHttpRequest"},body:JSON.stringify(r)})).json()).success?i.success("Basic information updated successfully!"):i.error("Failed to update basic information")}catch{i.error("Error saving basic information")}finally{y.value=!1}};return(l,t)=>(a(),z(te,{teacher:{id:u.teacher.id,name:u.teacher.name}},{default:$(()=>[R(Q,G({"is-visible":m(j)},m(M),{onClose:m(B),onSelect:m(V)}),null,16,["is-visible","onClose","onSelect"]),e("div",oe,[t[20]||(t[20]=e("div",{class:"border-b border-stroke px-6.5 py-4 dark:border-strokedark"},[e("h3",{class:"font-semibold text-black dark:text-white"},"Basic Information")],-1)),e("div",ae,[e("form",{onSubmit:W(E,["prevent"]),class:"space-y-6"},[e("div",se,[e("div",le,[e("div",ie,[g.value?(a(),s("img",{key:0,src:g.value,alt:"Profile",class:"h-full w-full object-cover"},null,8,de)):(a(),s("div",ne,d(o.value.name?.charAt(0)||"?"),1))])]),e("div",ue,[t[8]||(t[8]=e("label",{class:"mb-2 block text-sm font-medium text-black dark:text-white"},"Profile Image",-1)),e("div",ce,[e("div",me,[e("input",{ref_key:"fileInputRef",ref:S,type:"file",accept:"image/*",class:"hidden",disabled:c.value,onChange:D},null,40,pe),e("button",{type:"button",onClick:I,disabled:c.value,class:"inline-flex items-center rounded bg-gray-600 px-4 py-2 text-sm font-medium text-white hover:bg-gray-700 disabled:cursor-not-allowed disabled:opacity-60"},d(c.value?"Uploading…":"Upload New Image"),9,be),o.value.profile_image?(a(),s("button",{key:0,t
1ype:"button",onClick:L,class:"hover:shadow-1 inline-flex items-center rounded border border-stroke px-3 py-2 text-sm font-medium text-black dark:border-strokedark dark:text-white"}," Copy URL ")):n("",!0),o.value.profile_image?(a(),s("button",{key:1,type:"button",onClick:A,class:"inline-flex items-center rounded bg-danger px-3 py-2 text-sm font-medium text-white hover:opacity-90"}," Remove ")):n("",!0)]),o.value.profile_image?(a(),s("div",fe,[e("input",{value:o.value.profile_image,readonly:"",class:"w-full rounded border-[1.5px] border-stroke bg-transparent px-3 py-2 text-sm font-medium outline-none focus:border-primary active:border-primary dark:border-form-strokedark dark:bg-form-input"},null,8,ke)])):n("",!0),t[7]||(t[7]=e("p",{class:"mt-1 text-xs text-gray-500"},"Recommended size: 400x400px. Max file size: 2MB",-1)),c.value?(a(),s("p",ve,"Uploading...")):n("",!0)])])]),e("div",null,[t[10]||(t[10]=e("label",{class:"mb-2.5 block font-medium text-black dark:text-white"},"Cover Photo",-1)),t[11]||(t[11]=e("p",{class:"mb-3 text-xs text-gray-500"}," This image will be displayed as the banner on your profile page. Recommended size: 1200x300px. ",-1)),f.value?(a(),s("div",ge,[e("img",{src:f.value,alt:"Cover photo",class:"h-full w-full object-cover"},null,8,ye),e("button",{type:"button",onClick:P,class:"absolute top-2 right-2 rounded-full bg-danger p-1.5 text-white shadow hover:opacity-90"},[...t[9]||(t[9]=[e("svg",{class:"h-4 w-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])])):n("",!0),e("div",xe,[e("button",{type:"button",onClick:N,class:"inline-flex items-center rounded bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700"},d(f.value?"Change Cover Photo":"Select Cover Photo"),1),f.value?(a(),s("button",{key:0,type:"button",onClick:P,class:"inline-flex items-center rounded bg-danger px-3 py-2 text-sm font-medium text-white hover:opacity-90"}," Remove ")):n("",!0)])]),e("div",null,[t[12]||(t[12]=e("label",{class:"mb-2.5 block font-medium text-black dark:text-white"},[H(" Name "),e("span",{class:"text-meta-1"},"*")],-1)),p(e("input",{"onUpdate:modelValue":t[0]||(t[0]=r=>o.value.name=r),type:"text",required:"",placeholder:"Enter your full name",class:"w-full rounded border-[1.5px] border-stroke bg-transparent px-5 py-3 font-medium transition outline-none focus:border-primary active:border-primary disabled:cursor-default disabled:bg-whiter dark:border-form-strokedark dark:bg-form-input dark:focus:border-primary"},null,512),[[b,o.value.name]])]),e("div",he,[e("div",null,[t[13]||(t[13]=e("label",{class:"mb-2.5 block font-medium text-black dark:text-white"},"Designation",-1)),p(e("input",{"onUpdate:modelValue":t[1]||(t[1]=r=>o.value.designation=r),type:"text",placeholder:"e.g., Professor, Associate Professor",class:"w-full rounded border-[1.5px] border-stroke bg-transparent px-5 py-3 font-medium transition outline-none focus:border-primary active:border-primary disabled:cursor-default disabled:bg-whiter dark:border-form-strokedark dark:bg-form-input dark:focus:border-primary"},null,512),[[b,o.value.designation]])]),e("div",null,[t[14]||(t[14]=e("label",{class:"mb-2.5 block font-medium text-black dark:text-white"},"Department",-1)),p(e("input",{"onUpdate:modelValue":t[2]||(t[2]=r=>o.value.department=r),type:"text",placeholder:"e.g., Computer Science",readonly:m(v)==="faculty",class:"w-full rounded border-[1.5px] border-stroke bg-transparent px-5 py-3 font-medium transition outline-none focus:border-primary active:border-primary disabled:cursor-default disabled:bg-whiter dark:border-form-strokedark dark:bg-form-input dark:focus:border-primary"},null,8,we),[[b,o.value.department]]),m(v)==="faculty"?(a(),s("p",_e,"Department is managed by admin.")):n("",!0)])]),e("div",Ce,[e("div",null,[t[15]||(t[15]=e("label",{class:"mb-2.5 block font-medium text-black dark:text-white"},"Email",-1)),p(e("input",{"onUpdate:modelValue":t[3]||(t[3]=r=>o.value.email=r),type:"email",placeholder:"[email protected]",class:"w-full rounded border-[1.5px] border-stroke bg-transparent px-5 py-3 font-medium transition outline-none focus:border-primary active:border-primary disabled:cursor-default disabled:bg-whiter dark:border-form-strokedark dark:bg-form-input dark:focus:border-primary"},null,512),[[b,o.value.email]])]),e("div",null,[t[16]||(t[16]=e("label",{class:"mb-2.5 block font-medium text-black dark:text-white"},"Phone Number",-1)),p(e("input",{"onUpdate:modelValue":t[4]||(t[4]=r=>o.value.phone_number=r),type:"text",placeholder:"+1 (555) 123-4567",class:"w-full rounded border-[1.5px] border-stroke bg-transparent px-5 py-3 font-medium transition outline-none focus:border-primary active:border-primary disabled:cursor-default disabled:bg-whiter dark:border-form-strokedark dark:bg-form-input dark:focus:border-primary"},null,512),[[b,o.value.phone_number]])])]),e("div",null,[t[17]||(t[17]=e("label",{class:"mb-2.5 block font-medium text-black dark:text-white"},"Office Location",-1)),p(e("input",{"onUpdate:modelValue":t[5]||(t[5]=r=>o.value.office_location=r),type:"text",placeholder:"e.g., Building A, Room 301",class:"w-full rounded border-[1.5px] border-stroke bg-transparent px-5 py-3 font-medium transition outline-none focus:border-primary active:border-primary disabled:cursor-default disabled:bg-whiter dark:border-form-strokedark dark:bg-form-input dark:focus:border-primary"},null,512),[[b,o.value.office_location]])]),e("div",null,[t[18]||(t[18]=e("label",{class:"mb-2.5 block font-medium text-black dark:text-white"},"Personal Website",-1)),p(e("input",{"onUpdate:modelValue":t[6]||(t[6]=r=>o.value.website_url=r),type:"url",placeholder:"https://your-website.com",class:"w-full rounded border-[1.5px] border-stroke bg-transparent px-5 py-3 font-medium transition outline-none focus:border-primary active:border-primary disabled:cursor-default disabled:bg-whiter dark:border-form-strokedark dark:bg-form-input dark:focus:border-primary"},null,512),[[b,o.value.website_url]])]),e("div",null,[e("div",Se,[t[19]||(t[19]=e("label",{class:"block font-medium text-black dark:text-white"},"Sustainable Development Goals",-1)),e("span",Pe,d(o.value.sdg_ids?.length||0)+" selected",1)]),u.availableSdgs.length>0?(a(),s("div",Re,[(a(!0),s(K,null,J(u.availableSdgs,r=>(a(),s("button",{key:r.id,type:"button",onClick:x=>q(r.id),class:U([(o.value.sdg_ids||[]).includes(r.id)?"border-primary bg-primary/5 ring-1 ring-primary/30":"border-stroke bg-white hover:border-primary/50 dark:border-strokedark dark:bg-boxdark","rounded-lg border p-4 text-left transition"]),title:r.description},[e("div",Fe,[e("div",je,[r.icon?(a(),s("img",{key:0,src:r.icon,alt:r.title,class:"h-9 w-9 object-contain"},null,8,Me)):(a(),s("span",Te,"SDG"))]),e("div",Ve,[e("div",Be,[e("h4",De,d(r.title),
11),e("span",{class:U([(o.value.sdg_ids||[]).includes(r.id)?"bg-primary text-white":"bg-gray-100 text-bodydark2 dark:bg-meta-4","rounded-full px-2 py-1 text-xs font-medium"])},d((o.value.sdg_ids||[]).includes(r.id)?"Selected":"Select"),3)]),r.keyword?(a(),s("p",Ie,d(r.keyword),1)):n("",!0),e("p",Ne,d(r.description),1)])])],10,Ue))),128))])):(a(),s("div",Le," No SDGs are configured for this department yet. "))]),e("div",qe,[e("button",{type:"submit",disabled:y.value||c.value,class:"hover:bg-opacity-90 inline-flex items-center justify-center gap-2 rounded bg-primary px-6 py-3 font-medium text-white transition disabled:cursor-not-allowed disabled:opacity-50"},[R(m(re),{class:"h-5 w-5"}),e("span",null,d(y.value?"Saving...":"Save Changes"),1)],8,Ae)])],32)])])]),_:1},8,["teacher"]))}});export{ct 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.