File: /var/www/vhost/disk-apps/pwa.sports-crowd.com/www/7091.fa82c6f1aab81612.js
"use strict";(self.webpackChunkapp=self.webpackChunkapp||[]).push([[7091],{87091:(U,_,r)=>{r.r(_),r.d(_,{AcademyNewsListPageModule:()=>G});var d=r(56610),u=r(37222),s=r(77897),m=r(36075),h=r(73308),g=r(86268),t=r(2978),E=r(54171),p=r(22882),S=r(57992);function f(a,c){if(1&a&&(t.j41(0,"h4"),t.EFF(1),t.k0s()),2&a){const e=t.XpG().$implicit,i=t.XpG();t.R7$(1),t.SpI(" ",i.getInitDateTitle(e.type_new)," ")}}function I(a,c){1&a&&(t.j41(0,"h4"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&a&&(t.R7$(1),t.SpI(" ",t.bMT(2,1,"END_DATE")," "))}function y(a,c){1&a&&(t.j41(0,"h4"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&a&&(t.R7$(1),t.SpI(" ",t.bMT(2,1,"REASON_LABEL")," "))}function A(a,c){1&a&&(t.j41(0,"h4"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&a&&(t.R7$(1),t.SpI(" ",t.bMT(2,1,"RECEIVER")," "))}function T(a,c){1&a&&(t.j41(0,"h4"),t.EFF(1),t.nI1(2,"translate"),t.k0s()),2&a&&(t.R7$(1),t.SpI(" ",t.bMT(2,1,"COMMENT")," "))}function N(a,c){if(1&a&&(t.j41(0,"h4"),t.EFF(1),t.k0s()),2&a){const e=t.XpG().$implicit;t.R7$(1),t.SpI(" ",e.init_date," ")}}function v(a,c){if(1&a&&(t.j41(0,"h4"),t.EFF(1),t.k0s()),2&a){const e=t.XpG().$implicit;t.R7$(1),t.SpI(" ",e.end_date," ")}}function R(a,c){if(1&a&&(t.j41(0,"h4"),t.EFF(1),t.k0s()),2&a){const e=t.XpG().$implicit;t.R7$(1),t.SpI(" ",e.reason," ")}}function F(a,c){if(1&a&&(t.j41(0,"h4"),t.EFF(1),t.k0s()),2&a){const e=t.XpG().$implicit;t.R7$(1),t.SpI(" ",e.receiver," ")}}function w(a,c){if(1&a&&(t.j41(0,"h4"),t.EFF(1),t.k0s()),2&a){const e=t.XpG().$implicit;t.R7$(1),t.SpI(" ",e.reason," ")}}function C(a,c){if(1&a&&(t.j41(0,"ion-card")(1,"p",5),t.EFF(2),t.k0s(),t.j41(3,"h2",6),t.EFF(4),t.k0s(),t.j41(5,"ion-grid")(6,"ion-row")(7,"ion-col",7),t.DNE(8,f,2,1,"h4",8),t.DNE(9,I,3,3,"h4",8),t.DNE(10,y,3,3,"h4",8),t.DNE(11,A,3,3,"h4",8),t.DNE(12,T,3,3,"h4",8),t.k0s(),t.j41(13,"ion-col",9),t.DNE(14,N,2,1,"h4",8),t.DNE(15,v,2,1,"h4",8),t.DNE(16,R,2,1,"h4",8),t.DNE(17,F,2,1,"h4",8),t.DNE(18,w,2,1,"h4",8),t.k0s()()()()),2&a){const e=c.$implicit,i=t.XpG();t.R7$(1),t.muq("z-index: 100; background-color: ",i.getStatusColor(e.status),""),t.R7$(1),t.SpI(" ",i.getStatusText(e.status)," "),t.R7$(2),t.SpI(" ",e.type_new," "),t.R7$(4),t.Y8G("ngIf",e.type_new!=i.translateService.instant("REQUEST_CERTIFICATE")),t.R7$(1),t.Y8G("ngIf",e.type_new==i.translateService.instant("MEDICAL_DISABILITY")||e.type_new==i.translateService.instant("FREEZING")),t.R7$(1),t.Y8G("ngIf",e.type_new==i.translateService.instant("BACKOUT")||e.type_new==i.translateService.instant("FREEZING")),t.R7$(1),t.Y8G("ngIf",e.type_new==i.translateService.instant("REQUEST_CERTIFICATE")),t.R7$(1),t.Y8G("ngIf",e.type_new==i.translateService.instant("REQUEST_CERTIFICATE")),t.R7$(2),t.Y8G("ngIf",e.type_new!=i.translateService.instant("REQUEST_CERTIFICATE")),t.R7$(1),t.Y8G("ngIf",e.type_new==i.translateService.instant("MEDICAL_DISABILITY")||e.type_new==i.translateService.instant("FREEZING")),t.R7$(1),t.Y8G("ngIf",e.type_new==i.translateService.instant("BACKOUT")||e.type_new==i.translateService.instant("FREEZING")),t.R7$(1),t.Y8G("ngIf",e.type_new==i.translateService.instant("REQUEST_CERTIFICATE")),t.R7$(1),t.Y8G("ngIf",e.type_new==i.translateService.instant("REQUEST_CERTIFICATE"))}}const D=[{path:"",component:(()=>{class a{constructor(e,i,n,o,l,P){this.route=e,this.utilsService=i,this.translateService=n,this.academyService=o,this.routerOutlet=l,this.modalCtrl=P,this.academyNews=[]}ngOnInit(){this.academy_user_id=this.route.snapshot.paramMap.get("academy_user_id"),this.title=this.translateService.instant("NEWS"),this.loadInit()}loadInit(e=0,i=!1){(!this.utilsService.loadingPage||i)&&(this.utilsService.loadingPage=!0,setTimeout(()=>new Promise((n,o)=>{this.utilsService.presentLoading(this.translateService.instant("all.loading")).then(()=>{Promise.all([this.getAcademyUser(),this.getAcademyNews()]).then(()=>{this.utilsService.closeAllAlerts(),this.utilsService.loadingPage=!1,n(!1)}).catch(l=>{this.utilsService.closeAllAlerts(),this.utilsService.loadingPage=!1,console.log("Error loadInit AcademyPage",l),o(l)})})}),e))}getAcademyUser(){var e=this;this.academyService.getFromAcademyUser(this.academy_user_id).then(function(){var i=(0,h.A)(function*(n){e.academyUser=n,e.title+=": "+e.academyUser.student_name+" "+e.academyUser.student_last_name});return function(n){return i.apply(this,arguments)}}(),i=>{console.log("error getAcademyUser: ",i)})}getAcademyNews(){var e=this;this.academyService.getAcademyNews(this.academy_user_id).then(function(){var i=(0,h.A)(function*(n){e.academyNews=n.data});return function(n){return i.apply(this,arguments)}}(),i=>{console.log("error getAcademyNews: ",i)})}getInitDateTitle(e){switch(e){case this.translateService.instant("BACKOUT"):return this.translateService.instant("BACKOUT_DATE");case this.translateService.instant("MEDICAL_DISABILITY"):case this.translateService.instant("FREEZING"):return this.translateService.instant("INIT_DATE")}}getStatusText(e){switch(e){case"IN_PROGRESS":return this.translateService.instant("ACADEMY_NEWS_STATUS.IN_PROGRESS");case"FINISHED":return this.translateService.instant("ACADEMY_NEWS_STATUS.FINISHED");default:return this.translateService.instant("ACADEMY_NEWS_STATUS.PENDING")}}getStatusColor(e){switch(e){case"IN_PROGRESS":return"#e5de00";case"FINISHED":return"#84c93c";default:return"#ff6666"}}modalAddNew(){var e=this;return(0,h.A)(function*(){var i={component:g.C,swipeToClose:!0,presentingElement:e.routerOutlet.nativeEl,componentProps:{academyUser:e.academyUser}};const n=yield e.modalCtrl.create(i);n.onDidDismiss().then(()=>{e.loadInit(100,!0)}),yield n.present()})()}static#t=this.\u0275fac=function(i){return new(i||a)(t.rXU(m.nX),t.rXU(E.T),t.rXU(p.c$),t.rXU(S.k),t.rXU(s.Rg),t.rXU(s.W3))};static#e=this.\u0275cmp=t.VBU({type:a,selectors:[["app-academy-news-list"]],decls:11,vars:5,consts:[[1,"ion-no-border"],["defaultHref","/academy","slot","start"],[2,"font-size","medium"],[4,"ngFor","ngForOf"],["expand","block","fill","solid","shape","round",1,"ion-padding-start","ion-padding-end","ion-margin-bottom","ion-margin-top",3,"click"],[1,"stateTag","responsive-text-title"],[1,"not-margin",2,"border-bottom","1px solid lightgray","padding-left","10px","color","black"],["size","6"],[4,"ngIf"],["size","6",2,"text-align","end"]],template:function(i,n){1&i&&(t.j41(0,"ion-header",0)(1,"ion-toolbar"),t.nrm(2,"ion-back-button",1),t.j41(3,"ion-title",2),t.EFF(4),t.k0s()()(),t.j41(5,"ion-content"),t.DNE(6,C,19,15,"ion-card",3),t.k0s(),t.j41(7,"ion-footer")(8,"ion-button",4),t.bIt("click",function(){return n.modalAddNew()}),t.EFF(9),t.nI1(10,"translate"),t.k0s()()),2&i&&(t.R7$(4),t.JRh(n.title),t.R7$(2),t.Y8G("ngForOf",n.academyNews),t.R7$(3),t.SpI(" ",t.bMT(10,3,"ADD_NEW")," "))},dependencies:[d.Sq,d.bT,s.el,s.Jm,s.b_,s.hU,s.W9,s.M0,s.lO,s.eU,s.ln,s.BC,s.ai,s.tY,p.D9],styles:[".stateTag[_ngcontent-%COMP%]{position:absolute;width:25%;color:#fff;font-weight:700;padding:0 5px;text-transform:uppercase;text-align:center;box-shadow:1px 2px 2px 1px gray;border-bottom-left-radius:5px;right:0;background:#ff6666}"]})}return a})()}];let $=(()=>{class a{static#t=this.\u0275fac=function(i){return new(i||a)};static#e=this.\u0275mod=t.$C({type:a});static#a=this.\u0275inj=t.G2t({imports:[m.iI.forChild(D),m.iI]})}return a})(),G=(()=>{class a{static#t=this.\u0275fac=function(i){return new(i||a)};static#e=this.\u0275mod=t.$C({type:a});static#a=this.\u0275inj=t.G2t({imports:[d.MD,u.YN,s.bv,$,p.h]})}return a})()}}]);