PageSourceSearch

https://www.bergesinstitutespanish.com/build/assets/StudyGroupEdit-JcGzQ1wV.js

js bergesinstitutespanish.com collected 2026-09-24 17:38:54 UTC 3,943 bytes, 1 lines download raw bytes

1import{L as b}from"./Loader-l3cSYZQu.js";import{M as v}from"./Modal-CdTST-ss.js";import{r as u,o as n,c as l,f as d,g as p,a as t,t as i,b as h,w as m,v as c,d as y}from"./vue-router-Cc0Ijf1R.js";import{_ as w}from"./_plugin-vue_export-helper-DlAUqK2U.js";const _={components:{Loader:b,Modal:v},data(){return{group:null,ready:!1,name:"",description:"",imageFile:null,status:"",confirmClose:!1}},computed:{groupId(){return this.$route.params.group_id},groupUrl(){return this.$path("study-groups")+"/"+this.groupId}},mounted(){axios.get("/get-study-group/"+this.groupId).then(s=>{if(this.group=s.data.data,!this.group.is_owner){this.$router.push(this.groupUrl);return}this.name=this.group.name,this.description=this.group.description||"",this.ready=!0,this.addTitleAndDescription(this.$t("editGroup"),"")}).catch(s=>{Snackbar.show(this.getErrorMessage(s)),this.$router.push(this.$path("study-groups"))})},methods:{onImageSelected(s){this.imageFile=s.target.files[0]||null},async saveChanges(){if(this.status)return;if(!this.name.trim()){Snackbar.show(this.$t("groupNameRequired"));return}this.status="saving",Snackbar.show(this.$t("processing"));const s=new FormData;s.append("name",this.name),s.append("description",this.description),this.imageFile&&s.append("image",await this.downscaleImage(this.imageFile),"image.jpg"),axios.post("/update-study-group/"+this.groupId,s).then(()=>{Snackbar.show(this.$t("success")),this.$router.push(this.groupUrl)}).catch(e=>{Snackbar.show(this.getErrorMessage(e))}).finally(()=>{this.status=""})},cancel(){this.$router.push(this.groupUrl)},closeGroup(){this.status||(this.status="closing",Snackbar.show(this.$t("processing")),axios.post("/archive-study-group/"+this.groupId).then(()=>{Snackbar.show(this.$t("success")),this.$router.push(this.$path("study-groups"))}).catch(s=>{Snackbar.show(this.getErrorMessage(s))}).finally(()=>{this.status=""}))}}},C={type:"button",class:"btn btn-sm btn-dark","data-bs-dismiss":"modal"},k={key:0},$={class:"p-4 border-bottom d-flex align-items-center"},S=["src"],I={class:"h3 mb-0"},G={class:"p-4"},D={class:"mb-2"},M={class:"form-label"},U={class:"mb-2"},E={class:"form-label"},F={class:"mb-3"},N={class:"form-label"},V={class:"p-4 border-top"};function x(s,e,B,L,o,a){const g=u("modal"),f=u("loader");return n(),l("div",null,[d(g,{title:s.$t("pleaseConfirm"),shown:o.confirmClose,onClosed:e[1]||(e[1]=r=>o.confirmClose=!1)},{body:p(()=>[t("div",null,i(s.$t("closeGroupConfirm")),1)]),footer:p(()=>[t("button",C,i(s.$t("dontDoIt")),1),t("button",{type:"button",class:"ms-2 btn btn-sm btn-danger","data-bs-dismiss":"modal",onClick:e[0]||(e[0]=(...r)=>a.closeGroup&&a.closeGroup(...r))},i(s.$t("confirm")),1)]),_:1},8,["title","shown"]),d(f,{show:!o.ready},null,8,["show"]),o.ready?(n(),l("div",k,[t("div",$,[o.group.image_url?(n(),l("img",{key:0,src:o.group.image_url,class:"rounded-circle me-3 group-image",alt:""},null,8,S)):h("",!0),t("h1",I,i(s.$t("editGroup")),1)]),t("div",G,[t("div",D,[t("label",M,i(s.$t("groupName")),1),m(t("input",{"onUpdate:modelValue":e[2]||(e[2]=r=>o.name=r),type:"text",class:"form-control",maxlength:"100"},null,512),[[c,o.name]])]),t("div",U,[t("label",E,i(s.$t("groupDescription")),1),m(t("textarea",{"onUpdate:modelValue":e[3]||(e[3]=r=>o.description=r),class:"form-control",rows:"2",maxlength:"1000"},null,512),[[c,o.description]])]),t("div",F,[t("label",N,i(s.$t("groupImage")),1),t("input",{type:"file",accept:"image/*",class:"form-control",onChange:e[4]||(e[4]=(...r)=>a.onImageSelected&&a.onImageSelected(...r))},null,32)]),t("button",{class:"btn btn-primary",onClick:e[5]||(e[5]=(...r)=>a.saveChanges&&a.saveChanges(...r))},i(s.$t("saveChanges")),1)]),t("div",V,[t("a",{href:"",class:"text-danger small",onClick:e[6]||(e[6]=y(r=>o.confirmClose=!0,["prevent"]))},i(s.$t("closeGroup")),1)])])):h("",!0),e[7]||(e[7]=t("div",{class:"py-5"},null,-1))])}const R=w(_,[["render",x],["__scopeId","data-v-83fbddca"]]);export{R 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.