PageSourceSearch

https://dijital.mektebim.k12.tr/src_app_modules_tools_lesson_lesson_module_ts.84a4df0faf3e673aa1cb.js

js mektebim.k12.tr collected 2026-10-09 22:20:25 UTC 11,427 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkmagistum_pwa=self.webpackChunkmagistum_pwa||[]).push([["src_app_modules_tools_lesson_lesson_module_ts"],{55237:function(K,d,i){i.r(d),i.d(d,{LessonModule:function(){return V}});var c=i(61116),a=i(31041),f=i(6174),g=i(13841),h=i(84369),A=i(85078),_=i(77307),Z=i(63589),L=i(68003),p=i(5609),v=i(74915),t=i(35366),C=i(42693),T=function(){function e(o){this.http=o,this.apiUrl="api/v1/tools/super_admin_tools/lesson"}return e.prototype.getLessons=function(o,n){var s=(new C.LE).set("page",o.toString()).set("page_size",n.toString()).set("sort","id").set("sort_direction","desc");return this.http.get(this.apiUrl,{params:s})},e.prototype.getLesson=function(o){return this.http.get(this.apiUrl+"/"+o)},e.prototype.createLesson=function(o){return this.http.post(this.apiUrl,o)},e.prototype.updateLesson=function(o,n){return this.http.put(this.apiUrl+"/"+o,n)},e.prototype.deleteLesson=function(o){return this.http.delete(this.apiUrl+"/"+o)},e.\u0275fac=function(n){return new(n||e)(t.LFG(C.eN))},e.\u0275prov=t.Yz7({token:e,factory:e.\u0275fac,providedIn:"root"}),e}(),y=i(13070),q=i(87064),l=i(39199);function U(e,o){if(1&e&&(t.TgZ(0,"mat-option",7),t._uU(1),t.qZA()),2&e){var n=o.$implicit;t.Q6J("value",n.id),t.xp6(1),t.hij(" ",n.title," ")}}function N(e,o){if(1&e&&(t.TgZ(0,"mat-option",7),t._uU(1),t.qZA()),2&e){var n=o.$implicit;t.Q6J("value",n.id),t.xp6(1),t.hij(" ",n.title," ")}}function S(e,o){if(1&e){var n=t.EpF();t.TgZ(0,"button",29),t.NdJ("click",function(){return t.CHM(n),t.oxw().resetForm()}),t._uU(1,"Cancel"),t.qZA()}}function b(e,o){1&e&&(t.TgZ(0,"th",30),t._uU(1,"Title"),t.qZA())}function M(e,o){if(1&e&&(t.TgZ(0,"td",31),t._uU(1),t.qZA()),2&e){var n=o.$implicit;t.xp6(1),t.Oqu(n.title)}}function Y(e,o){1&e&&(t.TgZ(0,"th",30),t._uU(1,"Short Title"),t.qZA())}function F(e,o){if(1&e&&(t.TgZ(0,"td",31),t._uU(1),t.qZA()),2&e){var n=o.$implicit;t.xp6(1),t.Oqu(n.short_title)}}function Q(e,o){1&e&&(t.TgZ(0,"th",30),t._uU(1,"Parent Lesson"),t.qZA())}function k(e,o){if(1&e&&(t.TgZ(0,"td",31),t._uU(1),t.qZA()),2&e){var n=o.$implicit;t.xp6(1),t.Oqu(n.parent_title)}}function B(e,o){1&e&&(t.TgZ(0,"th",30),t._uU(1,"Group"),t.qZA())}function J(e,o){if(1&e&&(t.TgZ(0,"td",31),t._uU(1),t.qZA()),2&e){var n=o.$implicit;t.xp6(1),t.Oqu(n.group_title)}}function D(e,o){1&e&&(t.TgZ(0,"th",30),t._uU(1,"Description"),t.qZA())}function I(e,o){if(1&e&&(t.TgZ(0,"td",31),t._uU(1),t.qZA()),2&e){var n=o.$implicit;t.xp6(1),t.Oqu(n.desc)}}function O(e,o){1&e&&(t.TgZ(0,"th",30),t._uU(1,"Sequence"),t.qZA())}function z(e,o){if(1&e&&(t.TgZ(0,"td",31),t._uU(1),t.qZA()),2&e){var n=o.$implicit;t.xp6(1),t.Oqu(n.seq)}}function P(e,o){1&e&&(t.TgZ(0,"th",30),t._uU(1,"Status"),t.qZA())}function w(e,o){if(1&e&&(t.TgZ(0,"td",31),t._uU(1),t.qZA()),2&e){var n=o.$implicit;t.xp6(1),t.Oqu(1==n.status_id?"Active":"Inactive")}}function E(e,o){1&e&&(t.TgZ(0,"th",30),t._uU(1,"Actions"),t.qZA())}function $(e,o){if(1&e){var n=t.EpF();t.TgZ(0,"td",31),t.TgZ(1,"button",32),t.NdJ("click",function(){var u=t.CHM(n).$implicit;return t.oxw().editLesson(u)}),t.TgZ(2,"mat-icon"),t._uU(3,"edit"),t.qZA(),t.qZA(),t.TgZ(4,"button",32),t.NdJ("click",function(){var u=t.CHM(n).$implicit;return t.oxw().deleteLesson(u.id)}),t.TgZ(5,"mat-icon"),t._uU(6,"delete"),t.qZA(),t.qZA(),t.qZA()}}function G(e,o){1&e&&t._UZ(0,"tr",33)}function R(e,o){1&e&&t._UZ(0,"tr",34)}var x=function(){return["title","short_title","parent","group","desc","seq","status_id","actions"]},H=function(){return[5,10,25,100,200,500,1e3]},X=[{path:"",component:function(){function e(o,n,s,r){this.lessonService=o,this.fb=n,this.snackBar=s,this._shared=r,this.lessons=[],this.parentLessons=[],this.groups=[],this.editMode=!1,this.currentLessonId=null,this.totalLessons=0,this.pageSize=10,this.currentPage=0,this.displayedColumns=["title","short_title","parent","group","desc","seq","status_id","actions"],this.lessonForm=this.fb.group({title:["",[a.kI.required,a.kI.maxLength(255)]],short_title:["",[a.kI.maxLength(255)]],desc:["",[a.kI.maxLength(255)]],seq:[null,[a.kI.pattern(/^\d+$/)]],status_id:[1,[a.kI.required]],parent_id:[null],group_id:[null]})}return e.prototype.ngOnInit=function(){this.loadLessons(),this.loadParentLessons(),this.loadGroups()},e.prototype.loadLessons=function(){var o=this;this.lessonService.getLessons(this.currentPage,this.pageSize).subscribe(function(n){console.log(n),n.success?(o.lessons=n.data.items,o.totalLessons=n.data.item_count):o.snackBar.open("Error loading lessons","Close",{duration:3e3})},function(n){o.snackBar.open("Error loading lessons","Close",{duration:3e3})})},e.prototype.onSubmit=function(){this.lessonForm.valid&&(this.editMode?this.updateLesson():this.createLesson())},e.prototype.createLesson=function(){var o=this;this.lessonService.createLesson(this.lessonForm.value).subscribe(function(n){n.success?(o.snackBar.open("Lesson created successfully","Close",{duration:3e3}),o.loadLessons(),o.lessonForm.reset()):o.snackBar.open("Error creating lesson","Close",{duration:3e3})},function(n){o.snackBar.open("Error creating lesson","Close",{duration:3e3})})},e.prototype.updateLesson=function(){var o=this;this.currentLessonId&&this.lessonService.updateLesson(this.currentLessonId,this.lessonForm.value).subscribe(function(n){n.success?(o.snackBar.open("Lesson updated successfully","Close",{duration:3e3}),o.loadLessons(),o.resetForm()):o.snackBar.open("Error updating lesson","Close",{duration:3e3})},function(n){o.snackBar.open("Error updating lesson","Close",{duration:3e3})})},e.prototype.editLesson=function(o){this.editMode=!0,this.currentLessonId=o.id,this.lessonForm.patchValue(o)},e.prototype.deleteLesson=function(o){var n=this;confirm("Are you sure you want to delete this lesson?")&&this.lessonService.deleteLesson(o).subscribe(function(s){s.success?(n.snackBar.open("Lesson deleted successfully","Close",{duration:3e3}),n.loadLessons()):n.snackBar.open("Error deleting lesson","Close",{duration:3e3})},function(s){n.snackBar.open("Error deleting lesson","Close",{duration:3e3})})},e.prototype.resetForm=function(){this.editMode=!1,this.currentLessonId=null,this.lessonForm.reset()},e.prototype.onPageChange=function(o){this.currentPage=o.pageIndex,this.pageSize=o.pageSize,this.loadLessons()},e.prototype.loadParentLessons=function(){var o=this;this.lessonService.getLessons(0,1e3).subscribe(function(n){n.success&&(o.parentLessons=n.data.items)})},e.prototype.loadGroups=function(){var o=this;this._shared.get_list({name:"lesson_group",sort:"title",sort_direction:"asc"}).subscribe(function(n){n.success&&(o.groups=n.data.items)})},e.\u0275fac=function(n){return new(n||e)(t.Y36(T),t.Y36(a.qu),t.Y36(Z.ux),t.Y36(v.F1))},e.\u0275cmp=t.Xpm({type:e,selectors:[["app-lesson"]],viewQuery:function(n,s){var r;(1&n&&t.Gf(p.NW,5),2&n)&&(t.iGM(r=t.CRH())&&(s.paginator=r.first))},decls:60,vars:19,consts:[[1,"lesson-container"],[3,"formGroup","ngSubmit"],[1,"magistum-form-group"],["matInput","","placeholder","Title","formControlName","title"],["matInput","","placeholder","Short Title","formControlName","short_title"],["matInput","","type","number","placeholder","Sequence","formControlName","seq"],["placeholder","Status","formControlName","status_id"],[3,"value"],[1,"full-size"],["matInput","","placeholder","Description","formControlName","desc"],["placeholder","Parent Lesson","formControlName","parent_id"],[3,"value",4,"ngFor","ngForOf"],["placeholder","Group","formControlName","group_id"],["mat-raised-button","","color","primary","type","submit",3,"disabled"],["mat-button","","type","button",3,"click",4,"ngIf"],["mat-table","",1,"mat-elevation-z8",3,"dataSource"],["matColumnDef","title"],["mat-header-cell","",4,"matHeaderCellDef"],["mat-cell","",4,"matCellDef"],["matColumnDef","short_title"],["matColumnDef","parent"],["matColumnDef","group"],["matColumnDef","desc"],["matColumnDef","seq"],["matColumnDef","status_id"],["matColumnDef","actions"],["mat-header-row","",4,"matHeaderRowDef"],["mat-row","",4,"matRowDef","matRowDefColumns"],[3,"length","pageSize","pageSizeOptions","page"],["mat-button","","type","button",3,"click"],["mat-header-cell",""],["mat-cell",""],["mat-icon-button","",3,"click"],["mat-header-row",""],["mat-row",""]],template:function(n,s){1&n&&(t.TgZ(0,"div",0),t.TgZ(1,"h2"),t._uU(2,"Lesson Management"),t.qZA(),t.TgZ(3,"form",1),t.NdJ("ngSubmit",function(){return s.onSubmit()}),t.TgZ(4,"div",2),t.TgZ(5,"mat-form-field"),t._UZ(6,"input",3),t.qZA(),t.TgZ(7,"mat-form-field"),t._UZ(8,"input",4),t.qZA(),t.TgZ(9,"mat-form-field"),t._UZ(10,"input",5),t.qZA(),t.TgZ(11,"mat-form-field"),t.TgZ(12,"mat-select",6),t.TgZ(13,"mat-option",7),t._uU(14,"Active"),t.qZA(),t.TgZ(15,"mat-option",7),t._uU(16,"Inactive"),t.qZA(),t.qZA(),t.qZA(),t.TgZ(17,"mat-form-field",8),t._UZ(18,"textarea",9),t.qZA(),t.TgZ(19,"mat-form-field"),t.TgZ(20,"mat-select",10),t.TgZ(21,"mat-option",7),t._uU(22,"None"),t.qZA(),t.YNc(23,U,2,2,"mat-option",11),t.qZA(),t.qZA(),t.TgZ(24,"mat-form-field"),t.TgZ(25,"mat-select",12),t.TgZ(26,"mat-option",7),t._uU(27,"None"),t.qZA(),t.YNc(28,N,2,2,"mat-option",11),t.qZA(),t.qZA(),t.qZA(),t.TgZ(29,"button",13),t._uU(30),t.qZA(),t.YNc(31,S,2,0,"button",14),t.qZA(),t.TgZ(32,"table",15),t.ynx(33,16),t.YNc(34,b,2,0,"th",17),t.YNc(35,M,2,1,"td",18),t.BQk(),t.ynx(36,19),t.YNc(37,Y,2,0,"th",17),t.YNc(38,F,2,1,"td",18),t.BQk(),t.ynx(39,20),t.YNc(40,Q,2,0,"th",17),t.YNc(41,k,2,1,"td",18),t.BQk(),t.ynx(42,21),t.YNc(43,B,2,0,"th",17),t.YNc(44,J,2,1,"td",18),t.BQk(),t.ynx(45,22),t.YNc(46,D,2,0,"th",17),t.YNc(47,I,2,1,"td",18),t.BQk(),t.ynx(48,23),t.YNc(49,O,2,0,"th",17),t.YNc(50,z,2,1,"td",18),t.BQk(),t.ynx(51,24),t.YNc(52,P,2,0,"th",17),t.YNc(53,w,2,1,"td",18),t.BQk(),t.ynx(54,25),t.YNc(55,E,2,0,"th",17),t.YNc(56,$,7,0,"td",18),t.BQk(),t.YNc(57,G,1,0,"tr",26),t.YNc(58,R,1,0,"tr",27),t.qZA(),t.TgZ(59,"mat-paginator",28),t.NdJ("page",function(u){return s.onPageChange(u)}),t.qZA(),t.qZA()),2&n&&(t.xp6(3),t.Q6J("formGroup",s.lessonForm),t.xp6(10),t.Q6J("value","1"),t.xp6(2),t.Q6J("value","0"),t.xp6(6),t.Q6J("value",null),t.xp6(2),t.Q6J("ngForOf",s.parentLessons),t.xp6(3),t.Q6J("value",null),t.xp6(2),t.Q6J("ngForOf",s.groups),t.xp6(1),t.Q6J("disabled",s.lessonForm.invali
1d),t.xp6(1),t.hij(" ",s.editMode?"Update":"Create"," Lesson "),t.xp6(1),t.Q6J("ngIf",s.editMode),t.xp6(1),t.Q6J("dataSource",s.lessons),t.xp6(25),t.Q6J("matHeaderRowDef",t.DdM(16,x)),t.xp6(1),t.Q6J("matRowDefColumns",t.DdM(17,x)),t.xp6(1),t.Q6J("length",s.totalLessons)("pageSize",s.pageSize)("pageSizeOptions",t.DdM(18,H)))},directives:[a._Y,a.JL,a.sg,y.KE,f.Nt,a.Fj,a.JJ,a.u,a.wV,g.gD,q.ey,c.sg,h.lW,c.O5,l.BZ,l.w1,l.fO,l.Dz,l.as,l.nj,p.NW,l.ge,l.ev,_.Hw,l.XQ,l.Gk],styles:[".lesson-container[_ngcontent-%COMP%]{max-width:1000px;margin:0 auto;padding:20px}.lesson-container[_ngcontent-%COMP%]   form[_ngcontent-%COMP%]{display:flex;flex-direction:column;grid-gap:16px;gap:16px;margin-bottom:24px}.lesson-container[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]{width:100%;margin-top:24px}.lesson-container[_ngcontent-%COMP%]   .mat-column-actions[_ngcontent-%COMP%]{width:120px}"]}),e}()}],W=function(){function e(){}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=t.oAB({type:e}),e.\u0275inj=t.cJS({imports:[[L.Bz.forChild(X)],L.Bz]}),e}(),V=function(){function e(){}return e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=t.oAB({type:e}),e.\u0275inj=t.cJS({providers:[T,v.F1],imports:[[c.ez,a.UX,f.c,g.LD,h.ot,A.ie,_.Ps,Z.ZX,W,l.p0,p.TU]]}),e}()}}]);

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.