diff --git a/frontend/src/app/admin/admin-routing.module.ts b/frontend/src/app/admin/admin-routing.module.ts
index 155b057..6f15d15 100644
--- a/frontend/src/app/admin/admin-routing.module.ts
+++ b/frontend/src/app/admin/admin-routing.module.ts
@@ -5,6 +5,7 @@ import { LocationsComponent } from './pages/locations/locations.component';
import { DashboardComponent } from './pages/dashboard/dashboard.component';
import { SettingsComponent } from './pages/settings/settings.component';
import { authGuard } from '../shared/guards/auth.guard';
+import { UsersComponent } from './pages/users/users.component';
const routes: Routes = [
{ path: '', component: DashboardLayoutComponent,
@@ -13,6 +14,7 @@ const routes: Routes = [
{ path: '', redirectTo: 'home', pathMatch: 'full' }, // Redirect to dashboard
{ path: 'home', component: DashboardComponent },
{ path: 'lokacije', component: LocationsComponent },
+ { path: 'korisnici', component: UsersComponent },
{ path: 'postavke', component: SettingsComponent },
]},
{ path: '**', redirectTo: '/dashboard/home' } // Redirect unknown routes to home
diff --git a/frontend/src/app/components/sidebar/sidebar.component.html b/frontend/src/app/admin/components/sidebar/sidebar.component.html
similarity index 100%
rename from frontend/src/app/components/sidebar/sidebar.component.html
rename to frontend/src/app/admin/components/sidebar/sidebar.component.html
diff --git a/frontend/src/app/components/sidebar/sidebar.component.scss b/frontend/src/app/admin/components/sidebar/sidebar.component.scss
similarity index 100%
rename from frontend/src/app/components/sidebar/sidebar.component.scss
rename to frontend/src/app/admin/components/sidebar/sidebar.component.scss
diff --git a/frontend/src/app/components/sidebar/sidebar.component.spec.ts b/frontend/src/app/admin/components/sidebar/sidebar.component.spec.ts
similarity index 100%
rename from frontend/src/app/components/sidebar/sidebar.component.spec.ts
rename to frontend/src/app/admin/components/sidebar/sidebar.component.spec.ts
diff --git a/frontend/src/app/components/sidebar/sidebar.component.ts b/frontend/src/app/admin/components/sidebar/sidebar.component.ts
similarity index 100%
rename from frontend/src/app/components/sidebar/sidebar.component.ts
rename to frontend/src/app/admin/components/sidebar/sidebar.component.ts
diff --git a/frontend/src/app/admin/components/table/table.component.html b/frontend/src/app/admin/components/table/table.component.html
new file mode 100644
index 0000000..a646ff7
--- /dev/null
+++ b/frontend/src/app/admin/components/table/table.component.html
@@ -0,0 +1,49 @@
+
+
+
+
+
+ {{column.label}}
+ |
+
+
+
+
+
+
+
+ {{ row[column.key] }}
+
+
+
+
+
+
+
+
+
+ |
+
+
+
+
+
\ No newline at end of file
diff --git a/frontend/src/app/components/contact/contact-form/contact-form.component.scss b/frontend/src/app/admin/components/table/table.component.scss
similarity index 100%
rename from frontend/src/app/components/contact/contact-form/contact-form.component.scss
rename to frontend/src/app/admin/components/table/table.component.scss
diff --git a/frontend/src/app/admin/components/table/table.component.spec.ts b/frontend/src/app/admin/components/table/table.component.spec.ts
new file mode 100644
index 0000000..3c9a5e4
--- /dev/null
+++ b/frontend/src/app/admin/components/table/table.component.spec.ts
@@ -0,0 +1,23 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { TableComponent } from './table.component';
+
+describe('TableComponent', () => {
+ let component: TableComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ imports: [TableComponent]
+ })
+ .compileComponents();
+
+ fixture = TestBed.createComponent(TableComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/frontend/src/app/admin/components/table/table.component.ts b/frontend/src/app/admin/components/table/table.component.ts
new file mode 100644
index 0000000..db28175
--- /dev/null
+++ b/frontend/src/app/admin/components/table/table.component.ts
@@ -0,0 +1,20 @@
+import { NgFor, NgIf } from '@angular/common';
+import { Component, Input, OnInit } from '@angular/core';
+
+@Component({
+ selector: 'app-table',
+ standalone: true,
+ imports: [NgFor, NgIf],
+ templateUrl: './table.component.html',
+ styleUrls: ['./table.component.scss']
+})
+export class TableComponent implements OnInit {
+ @Input() columns: any;
+ @Input() data: any;
+ @Input() viewAction: boolean = false;
+
+ ngOnInit(): void {
+ console.log(this.data);
+ console.log(this.columns);
+ }
+}
diff --git a/frontend/src/app/admin/layout/dashboard-layout/dashboard-layout.component.html b/frontend/src/app/admin/layout/dashboard-layout/dashboard-layout.component.html
index 359c5cc..813aef3 100644
--- a/frontend/src/app/admin/layout/dashboard-layout/dashboard-layout.component.html
+++ b/frontend/src/app/admin/layout/dashboard-layout/dashboard-layout.component.html
@@ -30,6 +30,16 @@
Lokacije
+
+
+ Korisnici
+
diff --git a/frontend/src/app/admin/pages/dashboard/dashboard.component.ts b/frontend/src/app/admin/pages/dashboard/dashboard.component.ts
index 45292f4..3342068 100644
--- a/frontend/src/app/admin/pages/dashboard/dashboard.component.ts
+++ b/frontend/src/app/admin/pages/dashboard/dashboard.component.ts
@@ -1,5 +1,5 @@
import { Component } from '@angular/core';
-import { SidebarComponent } from 'src/app/components/sidebar/sidebar.component';
+import { SidebarComponent } from 'src/app/admin/components/sidebar/sidebar.component';
@Component({
selector: 'app-dashboard',
diff --git a/frontend/src/app/admin/pages/users/users.component.html b/frontend/src/app/admin/pages/users/users.component.html
new file mode 100644
index 0000000..b4a264b
--- /dev/null
+++ b/frontend/src/app/admin/pages/users/users.component.html
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/frontend/src/app/components/footer/footer.component.scss b/frontend/src/app/admin/pages/users/users.component.scss
similarity index 100%
rename from frontend/src/app/components/footer/footer.component.scss
rename to frontend/src/app/admin/pages/users/users.component.scss
diff --git a/frontend/src/app/admin/pages/users/users.component.spec.ts b/frontend/src/app/admin/pages/users/users.component.spec.ts
new file mode 100644
index 0000000..241dbac
--- /dev/null
+++ b/frontend/src/app/admin/pages/users/users.component.spec.ts
@@ -0,0 +1,23 @@
+import { ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { UsersComponent } from './users.component';
+
+describe('UsersComponent', () => {
+ let component: UsersComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async () => {
+ await TestBed.configureTestingModule({
+ imports: [UsersComponent]
+ })
+ .compileComponents();
+
+ fixture = TestBed.createComponent(UsersComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/frontend/src/app/admin/pages/users/users.component.ts b/frontend/src/app/admin/pages/users/users.component.ts
new file mode 100644
index 0000000..c20329b
--- /dev/null
+++ b/frontend/src/app/admin/pages/users/users.component.ts
@@ -0,0 +1,37 @@
+import { Component, OnInit } from '@angular/core';
+import { TableComponent } from '../../components/table/table.component';
+import { UserService } from 'src/app/shared/services/user.service';
+import { User } from 'src/app/shared/models/user.model';
+
+@Component({
+ selector: 'app-users',
+ standalone: true,
+ imports: [TableComponent],
+ templateUrl: './users.component.html',
+ styleUrls: ['./users.component.scss']
+})
+export class UsersComponent implements OnInit {
+ users: User[] = [];
+ columns = [
+ { key: 'id', label: 'ID' },
+ { key: 'email', label: 'Email' },
+ { key: 'username', label: 'Korisničko ime' },
+ { key: 'actions', label: 'Akcije' }
+ ];
+ constructor(private userService: UserService) {}
+
+ ngOnInit(): void {
+ this.getUsers();
+ }
+
+ getUsers() {
+ this.userService.getUsers().subscribe({
+ next: (users: User[]) => {
+ this.users = users;
+ console.log(users);
+ },
+ error: err => console.error('Observable emitted an error: ' + err),
+ complete: () => console.log('Observable emitted the complete notification')
+ });
+ }
+}
diff --git a/frontend/src/app/app.component.ts b/frontend/src/app/app.component.ts
index 494c864..f87a832 100644
--- a/frontend/src/app/app.component.ts
+++ b/frontend/src/app/app.component.ts
@@ -1,7 +1,7 @@
import { Component } from '@angular/core';
import { RouterOutlet } from '@angular/router';
-import { NavbarComponent } from './components/navbar/navbar.component';
-import { FooterComponent } from './components/footer/footer.component';
+import { NavbarComponent } from './home/components/navbar/navbar.component';
+import { FooterComponent } from './home/components/footer/footer.component';
@Component({
selector: 'app-root',
diff --git a/frontend/src/app/components/contact/contact-form/contact-form.component.html b/frontend/src/app/home/components/contact/contact-form/contact-form.component.html
similarity index 100%
rename from frontend/src/app/components/contact/contact-form/contact-form.component.html
rename to frontend/src/app/home/components/contact/contact-form/contact-form.component.html
diff --git a/frontend/src/app/components/item-list/item-list.component.scss b/frontend/src/app/home/components/contact/contact-form/contact-form.component.scss
similarity index 100%
rename from frontend/src/app/components/item-list/item-list.component.scss
rename to frontend/src/app/home/components/contact/contact-form/contact-form.component.scss
diff --git a/frontend/src/app/components/contact/contact-form/contact-form.component.spec.ts b/frontend/src/app/home/components/contact/contact-form/contact-form.component.spec.ts
similarity index 100%
rename from frontend/src/app/components/contact/contact-form/contact-form.component.spec.ts
rename to frontend/src/app/home/components/contact/contact-form/contact-form.component.spec.ts
diff --git a/frontend/src/app/components/contact/contact-form/contact-form.component.ts b/frontend/src/app/home/components/contact/contact-form/contact-form.component.ts
similarity index 97%
rename from frontend/src/app/components/contact/contact-form/contact-form.component.ts
rename to frontend/src/app/home/components/contact/contact-form/contact-form.component.ts
index 7fa11c8..234a3b5 100644
--- a/frontend/src/app/components/contact/contact-form/contact-form.component.ts
+++ b/frontend/src/app/home/components/contact/contact-form/contact-form.component.ts
@@ -2,7 +2,7 @@ import { Component } from '@angular/core';
import {
ContactFormModel,
ContactFormErrors,
-} from '../../../shared/models/contact-form.model';
+} from '../../../../shared/models/contact-form.model';
import { FormsModule, NgForm } from '@angular/forms';
import { CommonModule } from '@angular/common';
import { ContactService } from 'src/app/shared/services/contact.service';
diff --git a/frontend/src/app/components/footer/footer.component.html b/frontend/src/app/home/components/footer/footer.component.html
similarity index 100%
rename from frontend/src/app/components/footer/footer.component.html
rename to frontend/src/app/home/components/footer/footer.component.html
diff --git a/frontend/src/app/home/components/footer/footer.component.scss b/frontend/src/app/home/components/footer/footer.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/frontend/src/app/components/footer/footer.component.spec.ts b/frontend/src/app/home/components/footer/footer.component.spec.ts
similarity index 100%
rename from frontend/src/app/components/footer/footer.component.spec.ts
rename to frontend/src/app/home/components/footer/footer.component.spec.ts
diff --git a/frontend/src/app/components/footer/footer.component.ts b/frontend/src/app/home/components/footer/footer.component.ts
similarity index 100%
rename from frontend/src/app/components/footer/footer.component.ts
rename to frontend/src/app/home/components/footer/footer.component.ts
diff --git a/frontend/src/app/components/item-list/item-list.component.html b/frontend/src/app/home/components/item-list/item-list.component.html
similarity index 100%
rename from frontend/src/app/components/item-list/item-list.component.html
rename to frontend/src/app/home/components/item-list/item-list.component.html
diff --git a/frontend/src/app/home/components/item-list/item-list.component.scss b/frontend/src/app/home/components/item-list/item-list.component.scss
new file mode 100644
index 0000000..e69de29
diff --git a/frontend/src/app/components/item-list/item-list.component.spec.ts b/frontend/src/app/home/components/item-list/item-list.component.spec.ts
similarity index 100%
rename from frontend/src/app/components/item-list/item-list.component.spec.ts
rename to frontend/src/app/home/components/item-list/item-list.component.spec.ts
diff --git a/frontend/src/app/components/item-list/item-list.component.ts b/frontend/src/app/home/components/item-list/item-list.component.ts
similarity index 100%
rename from frontend/src/app/components/item-list/item-list.component.ts
rename to frontend/src/app/home/components/item-list/item-list.component.ts
diff --git a/frontend/src/app/components/location-card/location-card.component.html b/frontend/src/app/home/components/location-card/location-card.component.html
similarity index 100%
rename from frontend/src/app/components/location-card/location-card.component.html
rename to frontend/src/app/home/components/location-card/location-card.component.html
diff --git a/frontend/src/app/components/location-card/location-card.component.scss b/frontend/src/app/home/components/location-card/location-card.component.scss
similarity index 100%
rename from frontend/src/app/components/location-card/location-card.component.scss
rename to frontend/src/app/home/components/location-card/location-card.component.scss
diff --git a/frontend/src/app/components/location-card/location-card.component.spec.ts b/frontend/src/app/home/components/location-card/location-card.component.spec.ts
similarity index 100%
rename from frontend/src/app/components/location-card/location-card.component.spec.ts
rename to frontend/src/app/home/components/location-card/location-card.component.spec.ts
diff --git a/frontend/src/app/components/location-card/location-card.component.ts b/frontend/src/app/home/components/location-card/location-card.component.ts
similarity index 100%
rename from frontend/src/app/components/location-card/location-card.component.ts
rename to frontend/src/app/home/components/location-card/location-card.component.ts
diff --git a/frontend/src/app/components/navbar/navbar.component.html b/frontend/src/app/home/components/navbar/navbar.component.html
similarity index 100%
rename from frontend/src/app/components/navbar/navbar.component.html
rename to frontend/src/app/home/components/navbar/navbar.component.html
diff --git a/frontend/src/app/components/navbar/navbar.component.scss b/frontend/src/app/home/components/navbar/navbar.component.scss
similarity index 100%
rename from frontend/src/app/components/navbar/navbar.component.scss
rename to frontend/src/app/home/components/navbar/navbar.component.scss
diff --git a/frontend/src/app/components/navbar/navbar.component.spec.ts b/frontend/src/app/home/components/navbar/navbar.component.spec.ts
similarity index 100%
rename from frontend/src/app/components/navbar/navbar.component.spec.ts
rename to frontend/src/app/home/components/navbar/navbar.component.spec.ts
diff --git a/frontend/src/app/components/navbar/navbar.component.ts b/frontend/src/app/home/components/navbar/navbar.component.ts
similarity index 100%
rename from frontend/src/app/components/navbar/navbar.component.ts
rename to frontend/src/app/home/components/navbar/navbar.component.ts
diff --git a/frontend/src/app/components/weather-widget/weather-widget.component.html b/frontend/src/app/home/components/weather-widget/weather-widget.component.html
similarity index 100%
rename from frontend/src/app/components/weather-widget/weather-widget.component.html
rename to frontend/src/app/home/components/weather-widget/weather-widget.component.html
diff --git a/frontend/src/app/components/weather-widget/weather-widget.component.scss b/frontend/src/app/home/components/weather-widget/weather-widget.component.scss
similarity index 91%
rename from frontend/src/app/components/weather-widget/weather-widget.component.scss
rename to frontend/src/app/home/components/weather-widget/weather-widget.component.scss
index 9f26f75..52f9fe4 100644
--- a/frontend/src/app/components/weather-widget/weather-widget.component.scss
+++ b/frontend/src/app/home/components/weather-widget/weather-widget.component.scss
@@ -2,7 +2,6 @@
display: flex;
align-items: center;
position: relative;
- bottom: 5px;
}
.weather-icon {
@@ -13,7 +12,6 @@
.temperature {
font-size: 20px; /* Adjust font size as needed */
position: relative;
- top: 3px;
}
.mr-2 {
diff --git a/frontend/src/app/components/weather-widget/weather-widget.component.spec.ts b/frontend/src/app/home/components/weather-widget/weather-widget.component.spec.ts
similarity index 100%
rename from frontend/src/app/components/weather-widget/weather-widget.component.spec.ts
rename to frontend/src/app/home/components/weather-widget/weather-widget.component.spec.ts
diff --git a/frontend/src/app/components/weather-widget/weather-widget.component.ts b/frontend/src/app/home/components/weather-widget/weather-widget.component.ts
similarity index 60%
rename from frontend/src/app/components/weather-widget/weather-widget.component.ts
rename to frontend/src/app/home/components/weather-widget/weather-widget.component.ts
index 4060967..000bb50 100644
--- a/frontend/src/app/components/weather-widget/weather-widget.component.ts
+++ b/frontend/src/app/home/components/weather-widget/weather-widget.component.ts
@@ -17,13 +17,14 @@ export class WeatherWidget implements OnInit {
constructor(private weatherService: WeatherService) {}
ngOnInit(): void {
+ const basePath = 'https://openweathermap.org/img/wn/'; // Path to your PNG icons
// Start weather updates with a default interval of 15 minutes (can change dynamically)
this.weatherService.startWeatherUpdates(15 * 60 * 1000);
// Subscribe to the weather data observable
this.weatherService.weather$.subscribe(data => {
this.weatherData = data;
- this.setWeatherIcon(data?.weather[0].main);
+ this.weatherIcon = basePath + data?.weather[0].icon + '.png';
});
}
@@ -32,25 +33,4 @@ export class WeatherWidget implements OnInit {
this.weatherService.stopWeatherUpdates();
}
- setWeatherIcon(condition: string) {
- // Set the icon path based on the weather condition
- const basePath = 'assets/images/weather/'; // Path to your PNG icons
- switch (condition) {
- case 'Clear':
- this.weatherIcon = `${basePath}sun.png`;
- break;
- case 'Clouds':
- this.weatherIcon = `${basePath}cloud.png`;
- break;
- case 'Rain':
- this.weatherIcon = `${basePath}cloud_rain.png`;
- break;
- case 'Snow':
- this.weatherIcon = `${basePath}snow.png`;
- break;
- default:
- this.weatherIcon = `${basePath}default.png`; // Default icon for unknown conditions
- }
- console.log(this.weatherIcon);
- }
}
diff --git a/frontend/src/app/home/pages/contact/contact.component.ts b/frontend/src/app/home/pages/contact/contact.component.ts
index a642117..07c4256 100644
--- a/frontend/src/app/home/pages/contact/contact.component.ts
+++ b/frontend/src/app/home/pages/contact/contact.component.ts
@@ -1,5 +1,5 @@
import { Component } from '@angular/core';
-import { ContactFormComponent } from 'src/app/components/contact/contact-form/contact-form.component';
+import { ContactFormComponent } from 'src/app/home/components/contact/contact-form/contact-form.component';
@Component({
selector: 'app-contact',
diff --git a/frontend/src/app/home/pages/home/home.component.html b/frontend/src/app/home/pages/home/home.component.html
index 3dcdd78..a58ecf5 100644
--- a/frontend/src/app/home/pages/home/home.component.html
+++ b/frontend/src/app/home/pages/home/home.component.html
@@ -1,7 +1,7 @@
-
+
Dobro došli na Smetovi.ba