app.component.html 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
  2. <!-- * * * * * * * * * * * The content below * * * * * * * * * * * -->
  3. <!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * -->
  4. <!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * -->
  5. <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
  6. <!-- * * * * * * * * * Delete the template below * * * * * * * * * -->
  7. <!-- * * * * * * * to get started with your project! * * * * * * * -->
  8. <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
  9. <style>
  10. </style>
  11. <mat-toolbar class="toolbar" color="primary">
  12. <div class="toolbar-container">
  13. <!--<button mat-icon-button aria-label="menu">
  14. <mat-icon>menu</mat-icon>
  15. </button>-->
  16. <button mat-icon-button [routerLink]="'/'">
  17. <mat-icon>home</mat-icon>
  18. </button>
  19. <h2 id="title"><i>{{pbTitle.getTitle()}}</i></h2>
  20. <div class="right-toolbar-panel">
  21. <ng-container *ngTemplateOutlet="toolbarItems"/>
  22. </div>
  23. </div>
  24. </mat-toolbar>
  25. <button mat-button id="installApp" hidden>{{'install_app'|tr:'Install APP'}}</button>
  26. <mat-toolbar class="mobile-toolbar" color="primary">
  27. <ng-container *ngTemplateOutlet="toolbarItems"/>
  28. </mat-toolbar>
  29. <ng-template #toolbarItems>
  30. @for (item of [
  31. {id:'home',icon:'home',link:'/',title:'Home',key:'home_page'},
  32. {id:'notifs',icon:'notifications',title:'Notifications',key:'notifs',menu:notifications},
  33. {id:'chat'},
  34. {id:'user',icon:'account_circle',menu:userMenu,title:'User & Settings',key:'#{user} & #{settings}'}
  35. ]; track $index) {
  36. @switch (true) {
  37. @case (item.link !== undefined) {
  38. <div id="{{item.id}}" class="toolbar-item" [routerLink]="item.link" replaceUrl="{{item.id==='home'?'true':'false'}}">
  39. <mat-icon>{{item.icon}}</mat-icon>
  40. <mat-label>{{(item.key|tr:item.title)}}</mat-label>
  41. </div>
  42. }
  43. @case (item.id === 'user') {
  44. <div id="{{item.id}}" class="toolbar-item" [matMenuTriggerFor]="item.menu">
  45. @if (loginService?.user?.pictures?.length > 0) {
  46. <img title="{{'profile_pic'|tr:'Profile Picture'}}" class="profile-pic" src="{{loginService?.user?.pictures[0]?.value}}">
  47. }
  48. @else {
  49. <mat-icon id="{{item.key}}-icon">{{item.icon}}</mat-icon>
  50. }
  51. <mat-label>{{(item.key|tr:item.title)}}</mat-label>
  52. </div>
  53. }
  54. @case (item.menu !== undefined) {
  55. <div id="{{item.id}}" class="toolbar-item" [matMenuTriggerFor]="item.menu">
  56. <mat-icon id="{{item.key}}-icon">{{item.icon}}</mat-icon>
  57. <mat-label>{{(item.key|tr:item.title)}}</mat-label>
  58. @if (item.key === 'notifs' && notificationCount > 0) {
  59. <div class="notif-count">{{notificationCount}}</div>
  60. }
  61. </div>
  62. }
  63. @case (item.id === 'chat') {
  64. <div id="{{item.id}}" class="toolbar-item" (click)="mobile.toggleChat()">
  65. <mat-icon>chat</mat-icon>
  66. <mat-label>{{('fis_ai_chat'|tr:'FIS A.I. Chat')}}</mat-label>
  67. </div>
  68. }
  69. @default {
  70. <div id="{{item.id}}" class="toolbar-item">
  71. <mat-icon>{{item.icon}}</mat-icon>
  72. <mat-label>{{(item.key|tr:item.title)}}</mat-label>
  73. </div>
  74. }
  75. }
  76. }
  77. </ng-template>
  78. <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
  79. <!-- * * * * * * * * * * * The content above * * * * * * * * * * * * -->
  80. <!-- * * * * * * * * * * is only a placeholder * * * * * * * * * * * -->
  81. <!-- * * * * * * * * * * and can be replaced. * * * * * * * * * * * -->
  82. <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
  83. <!-- * * * * * * * * * * End of Placeholder * * * * * * * * * * * * -->
  84. <!-- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -->
  85. <div [ngClass]="theme" class="container">
  86. <div class="main">
  87. <router-outlet></router-outlet>
  88. <!--
  89. <chat title="{{'fis_ai_chat'|tr:'FIS A.I. Chat'}}"></chat>
  90. -->
  91. <div class="mobile-buffer">&nbsp;</div>
  92. </div>
  93. </div>
  94. <footer>
  95. © {{currentDate.getFullYear()}}
  96. {{cs.info?.orgnProfile?.companyName}}&nbsp;
  97. ({{cs.info?.orgnProfile?.company_reg_no}})
  98. <a class="version-short">&nbsp;ver. {{cs.info?.version}}</a>
  99. </footer>
  100. <!--menus-->
  101. <mat-menu #userMenu="matMenu">
  102. <button mat-menu-item [matMenuTriggerFor]="account" id="account-menu-button">
  103. @if (loginService?.user?.pictures?.length > 0) {
  104. <img title="{{'profile_pic'|tr:'Profile Picture'}}" class="profile-pic" src="{{loginService?.user?.pictures[0]?.value}}">
  105. }
  106. @else {
  107. <mat-icon>account_circle</mat-icon>
  108. }
  109. {{'account'|tr:'Account'}}</button>
  110. <button mat-menu-item [matMenuTriggerFor]="settings"><mat-icon>settings</mat-icon>{{'settings'|tr:'Settings'}}</button>
  111. <button mat-menu-item (click)="loginService.logout()" [disabled]="!loginService.user">
  112. <mat-icon>logout</mat-icon>
  113. {{'logout'|tr:'Logout'}}</button>
  114. </mat-menu>
  115. <mat-menu #account="matMenu">
  116. <button mat-menu-item (click)="cs.navigate('/auth/change')" [disabled]="true">
  117. <mat-icon>lock_reset</mat-icon>
  118. {{'change_password'|tr:'Change Password'}}</button>
  119. </mat-menu>
  120. <mat-menu #settings="matMenu">
  121. <button mat-menu-item [matMenuTriggerFor]="themes">{{'theme'|tr:'Theme'}}</button>
  122. <button mat-menu-item [matMenuTriggerFor]="language">{{'language'|tr:'Language'}}</button>
  123. </mat-menu>
  124. <mat-menu #themes="matMenu">
  125. <button mat-menu-item [matMenuTriggerFor]="lightThemes">{{'light'|tr:'Light'}}</button>
  126. <button mat-menu-item [matMenuTriggerFor]="darkThemes">{{'dark'|tr:'Dark'}}</button>
  127. </mat-menu>
  128. <mat-menu #lightThemes="matMenu">
  129. @for(theme of [
  130. {name:'theme',label:'main'|tr:'Blue',color:"#3F51B6"},
  131. {name:'theme-pink',label:'pink'|tr:'Pink',color:"#e91e63"}
  132. ]; track $index) {
  133. <button mat-menu-item (click)="cs.theming.changeTheme(theme.name)">
  134. <mat-icon style="color:{{theme.color}}">fiber_manual_record</mat-icon>
  135. {{theme.label}}</button>
  136. }
  137. </mat-menu>
  138. <mat-menu #darkThemes="matMenu">
  139. @for(theme of [
  140. {name:'dark-theme',label:'main'|tr:'Blue',color:"#3F51B6"},
  141. {name:'dark-theme-pink',label:'pink'|tr:'Pink',color:"#e91e63"}
  142. ]; track $index) {
  143. <button mat-menu-item (click)="cs.theming.changeTheme(theme.name)">
  144. <mat-icon style="color:{{theme.color}}">fiber_manual_record</mat-icon>
  145. {{theme.label}}</button>
  146. }
  147. </mat-menu>
  148. <mat-menu #language="matMenu">
  149. @for(lang of [
  150. {name:'en',label:'English',picture:'https://cdn.swopt.com/media/images/flags/GBR.png'},
  151. {name:'zh',label:'简体中文',picture:'https://cdn.swopt.com/media/images/flags/CHN.png'},
  152. {name:'ms',label:'Melayu',picture:'https://cdn.swopt.com/media/images/flags/MAS.png'}
  153. ];track $index) {
  154. <button mat-menu-item (click)="changeLanguage(lang.name)">
  155. <div class="language-flag" [style.background-image]="'url('+lang.picture+')'">&nbsp;</div>
  156. {{lang.label}}
  157. </button>
  158. }
  159. </mat-menu>
  160. <mat-menu class="notification" #notifications="matMenu">
  161. <notification (click)="$event.stopPropagation()"/>
  162. </mat-menu>