Skip to content

Commit

Permalink
feat: fixed translations etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
Artem Smotrych committed Jun 3, 2024
1 parent be1ce86 commit c8397e7
Show file tree
Hide file tree
Showing 13 changed files with 211 additions and 319 deletions.
2 changes: 1 addition & 1 deletion src/app/account/login/login.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class LoginComponent {
this.authService.login(username, password).subscribe({
next: (authResponse) => {
// Handle successful login
this.router.navigate(['/']); // Navigate to the home page or dashboard
this.router.navigate(['/tickets/list']); // Navigate to the home page or dashboard
},
error: (error) => {
// Handle login error
Expand Down
10 changes: 5 additions & 5 deletions src/app/core/data/ticket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface SupportTicket {
icon: 'ri-arrow-right-up-line',
num: '',
count: 0,
title: 'Open Tickets'
title: 'Відкриті задачі'
},
{
id: 2,
Expand All @@ -28,7 +28,7 @@ export interface SupportTicket {
icon: 'ri-arrow-right-down-line',
num: '',
count: 0,
title: 'Tickets in Progess'
title: 'Задачі в роботі'
},
{
id: 3,
Expand All @@ -38,7 +38,7 @@ export interface SupportTicket {
icon: 'ri-arrow-right-down-line',
num: '',
count: 0,
title: 'Tickets in Review'
title: 'Задач на перевірці'
},
{
id: 4,
Expand All @@ -48,7 +48,7 @@ export interface SupportTicket {
icon: 'ri-arrow-right-down-line',
num: '',
count: 0,
title: 'Tickets in Resubmit'
title: 'Задач на доперевірці'
},
{
id: 5,
Expand All @@ -58,7 +58,7 @@ export interface SupportTicket {
icon: 'ri-arrow-right-up-line',
num: '',
count: 0,
title: 'Tickets Done'
title: 'Задач зроблено'
},

];
Expand Down
6 changes: 3 additions & 3 deletions src/app/layouts/sidebar/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { MenuItem } from "./menu.model";
export const MENU: MenuItem[] = [
{
id: 0,
label: 'ПАНЕЛЬ ЗАВІДУВАЧА КАФЕДРОЮ',
label: 'ПАНЕЛЬ СТУДЕНТА',
isTitle: true
},
{
Expand All @@ -13,9 +13,9 @@ export const MENU: MenuItem[] = [
},
{
id: 2,
label: 'Список Інструкторів',
label: 'Список Задач',
icon: 'bx bx-list-ul',
link: '/learning/list-of-instructors',
link: '/tickets/list',
parentId: 34
},
{
Expand Down
73 changes: 37 additions & 36 deletions src/app/layouts/topbar/topbar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
</a>
</div>

<button type="button" class="btn btn-sm px-3 fs-16 header-item vertical-menu-btn topnav-hamburger shadow-none" id="topnav-hamburger-icon" (click)="toggleMobileMenu($event)">
<button type="button"
class="btn btn-sm px-3 fs-16 header-item vertical-menu-btn topnav-hamburger shadow-none"
id="topnav-hamburger-icon" (click)="toggleMobileMenu($event)">
<span class="hamburger-icon">
<span></span>
<span></span>
Expand All @@ -25,56 +27,49 @@
</button>
</div>

<div class="d-flex justify-content-center align-items-center" style="flex: 1;">
<h1 style="font-size: 24px; font-weight: bold;">Студент</h1>
</div>

<div class="d-flex align-items-center">
<div dropdown class="dropdown ms-1 topbar-head-dropdown header-item">
<button dropdownToggle type="button" class="btn btn-icon btn-topbar btn-ghost-secondary rounded-circle">
@if (flagvalue == undefined) {
<img id="header-lang-img" src="{{valueset}}" alt="Header Language" height="20" class="rounded">
}@else {
<img id="header-lang-img" src="{{flagvalue}}" alt="Header Language" height="20" class="rounded">
}
</button>
<div *dropdownMenu class="dropdown-menu dropdown-menu-end">

<!-- item-->
@for (item of listLang; track $index) {
<a href="javascript:void(0);" class="dropdown-item notify-item language py-2" (click)="setLanguage(item.text, item.lang, item.flag)">
<img src="{{item.flag}}" alt="user-image" class="me-2 rounded" height="18">
<span class="align-middle">{{item.text}}</span>
</a>
}
</div>
</div>
<div class="ms-1 header-item d-none d-sm-flex">
<button type="button" class="btn btn-icon btn-topbar btn-ghost-dark rounded-circle" data-toggle="fullscreen" (click)="fullscreen()">
<button type="button" class="btn btn-icon btn-topbar btn-ghost-dark rounded-circle"
data-toggle="fullscreen" (click)="fullscreen()">
<i class="bi bi-arrows-fullscreen fs-lg"></i>
</button>
</div>

<div dropdown container="body" class="dropdown topbar-head-dropdown ms-1 header-item">
<button dropdownToggle type="button" class="btn btn-icon btn-topbar btn-ghost-dark rounded-circle mode-layout">
<button dropdownToggle type="button"
class="btn btn-icon btn-topbar btn-ghost-dark rounded-circle mode-layout">
<i class="bi bi-sun align-middle fs-3xl"></i>
</button>
<div *dropdownMenu class="dropdown-menu p-2 dropdown-menu-end" id="light-dark-mode">
<a href="javascript:void(0);" class="dropdown-item" (click)="changeMode('light')"><i class="bi bi-sun align-middle me-2"></i> Defualt (light mode)</a>
<a href="javascript:void(0);" class="dropdown-item" (click)="changeMode('dark')"><i class="bi bi-moon align-middle me-2"></i> Dark</a>
<a href="javascript:void(0);" class="dropdown-item" (click)="changeMode('auto')"><i class="bi bi-moon-stars align-middle me-2"></i> Auto (system defualt)</a>
<a href="javascript:void(0);" class="dropdown-item" (click)="changeMode('light')"><i
class="bi bi-sun align-middle me-2"></i> Звичайна (Світла тема)</a>
<a href="javascript:void(0);" class="dropdown-item" (click)="changeMode('dark')"><i
class="bi bi-moon align-middle me-2"></i> Темна тема</a>
</div>
</div>

<div dropdown class="dropdown ms-sm-3 header-item topbar-user">
<button dropdownToggle type="button" class="btn shadow-none" id="page-header-user-dropdown" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<button dropdownToggle type="button" class="btn shadow-none" id="page-header-user-dropdown"
data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="d-flex align-items-center">
<span class="d-none d-xl-block ms-1 fs-sm user-name-sub-text">Викладач</span>
<span class="d-none d-xl-block ms-1 fs-sm user-name-sub-text">Студент</span>
</span>
</button>
<div *dropdownMenu class="dropdown-menu dropdown-menu-end">
<!-- item-->
<a class="dropdown-item" routerLink="/pages/profile"><i class="mdi mdi-account-circle text-muted fs-lg align-middle me-1"></i> <span class="align-middle"> Профіль</span></a>
<a class="dropdown-item" routerLink="/apps/chat"><i class="mdi mdi-message-text-outline text-muted fs-lg align-middle me-1"></i> <span class="align-middle"> Чат</span></a>

<a class="dropdown-item" routerLink="/apps/chat"><i
class="mdi mdi-message-text-outline text-muted fs-lg align-middle me-1"></i> <span
class="align-middle"> Чат</span></a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" routerLink="/pages/profile-settings"><i class="mdi mdi-cog-outline text-muted fs-lg align-middle me-1"></i> <span class="align-middle"> Налаштування</span></a>
<a class="dropdown-item" href="javascript: void(0);" (click)="logout()"><i class="mdi mdi-logout text-muted fs-lg align-middle me-1"></i> <span class="align-middle" data-key="t-logout"> Вийти</span></a>
<a class="dropdown-item" href="javascript: void(0);" (click)="logout()"><i
class="mdi mdi-logout text-muted fs-lg align-middle me-1"></i> <span
class="align-middle" data-key="t-logout"> Вийти</span></a>
</div>
</div>
</div>
Expand All @@ -83,7 +78,8 @@
</header>

<!-- removeNotificationModal -->
<div bsModal #removeNotificationModal="bs-modal" id="removeNotificationModal" class="modal fade zoomIn" tabindex="-1" aria-hidden="true">
<div bsModal #removeNotificationModal="bs-modal" id="removeNotificationModal" class="modal fade zoomIn" tabindex="-1"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
Expand All @@ -100,8 +96,10 @@ <h4 class="mb-1">Are you sure ?</h4>
</div>
</div>
<div class="d-flex gap-2 justify-content-center mt-4 mb-2">
<button type="button" class="btn w-sm btn-light" (click)="removeNotificationModal.hide()">Close</button>
<button type="button" class="btn w-sm btn-danger" id="delete-notification" (click)="notificationDelete()">Yes, Delete It!</button>
<button type="button" class="btn w-sm btn-light"
(click)="removeNotificationModal.hide()">Close</button>
<button type="button" class="btn w-sm btn-danger" id="delete-notification"
(click)="notificationDelete()">Yes, Delete It!</button>
</div>
</div>

Expand All @@ -110,11 +108,13 @@ <h4 class="mb-1">Are you sure ?</h4>
</div><!-- /.modal -->

<!-- removeCartModal -->
<div bsModal #removeCartModal="bs-modal" id="removeCartModal" class="modal fade zoomIn" tabindex="-1" aria-hidden="true">
<div bsModal #removeCartModal="bs-modal" id="removeCartModal" class="modal fade zoomIn" tabindex="-1"
aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" id="close-cartmodal"></button>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"
id="close-cartmodal"></button>
</div>
<div class="modal-body p-md-5">
<div class="text-center">
Expand All @@ -128,7 +128,8 @@ <h4>Are you sure ?</h4>
</div>
<div class="d-flex gap-2 justify-content-center mt-4 mb-2">
<button type="button" class="btn w-sm btn-light" (click)="removeCartModal.hide()">Close</button>
<button type="button" class="btn w-sm btn-danger" id="remove-cartproduct" (click)="confirmDelete()">Yes, Delete It!</button>
<button type="button" class="btn w-sm btn-danger" id="remove-cartproduct"
(click)="confirmDelete()">Yes, Delete It!</button>
</div>
</div>

Expand Down
32 changes: 20 additions & 12 deletions src/app/layouts/topbar/topbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ export class TopbarComponent {
this.readNotify = element.items.length
}
});


const savedMode = localStorage.getItem('selectedMode');
if (savedMode) {
this.changeMode(savedMode);
}
}

windowScroll() {
Expand Down Expand Up @@ -152,21 +158,23 @@ export class TopbarComponent {
/**
* Topbar Light-Dark Mode Change
*/
changeMode(mode: string) {
this.mode = mode;
if (mode == 'auto') {
document.documentElement.setAttribute('data-bs-theme', 'light')
document.documentElement.setAttribute('data-topbar', 'light');
document.documentElement.classList.add('mode-auto')
} else {
this.store.dispatch(changeMode({ mode }));
changeMode(mode: string) {
this.mode = mode;
localStorage.setItem('selectedMode', mode); // Save mode to localStorage

if (mode == 'auto') {
document.documentElement.setAttribute('data-bs-theme', 'light');
document.documentElement.setAttribute('data-topbar', 'light');
document.documentElement.classList.add('mode-auto');
} else {
this.store.dispatch(changeMode({ mode }));
this.store.select(getLayoutmode).subscribe((mode) => {
document.documentElement.setAttribute('data-bs-theme', mode);
})
document.documentElement.classList.remove('mode-auto')
document.documentElement.setAttribute('data-topbar', mode);
}
});
document.documentElement.classList.remove('mode-auto');
document.documentElement.setAttribute('data-topbar', mode);
}
}

/***
* Language Listing
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/ecommerce/ecommerce.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { NgSelectModule } from '@ng-select/ng-select';
import { CountUpModule } from 'ngx-countup';

// Range Slider
import { NgxSliderModule } from '@angular-slider/ngx-slider';
import { NgxSliderModule } from 'ngx-slider-v2';

// Swiper Slider
import { SlickCarouselModule } from 'ngx-slick-carousel';
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/forms/forms.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { UiSwitchModule } from 'ngx-ui-switch';
import { TimepickerModule } from 'ngx-bootstrap/timepicker';
import { BsDatepickerModule } from 'ngx-bootstrap/datepicker';
import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
import { NgxSliderModule } from '@angular-slider/ngx-slider';
import { NgxSliderModule } from 'ngx-slider-v2';

// Color Picker
import { ColorPickerModule } from 'ngx-color-picker';
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/learning/courses/courses.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { SharedModule } from 'src/app/shared/shared.module';
import { NgSelectModule } from '@ng-select/ng-select';

// Range Slider
import { NgxSliderModule } from '@angular-slider/ngx-slider';
import { NgxSliderModule } from 'ngx-slider-v2';

//Wizard
import { CdkStepperModule } from '@angular/cdk/stepper';
Expand Down
2 changes: 1 addition & 1 deletion src/app/pages/real-estate/real-estate.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { FlatpickrModule } from 'angularx-flatpickr';
import { NgApexchartsModule } from 'ng-apexcharts';

// Range Slider
import { NgxSliderModule } from '@angular-slider/ngx-slider';
import { NgxSliderModule } from 'ngx-slider-v2';

// Swiper Slider
import { SlickCarouselModule } from 'ngx-slick-carousel';
Expand Down
Loading

0 comments on commit c8397e7

Please sign in to comment.