From 5b0f59076355dacb20143fdde3eb404a24675e14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlia=20Nogales?= Date: Fri, 13 Dec 2024 18:27:35 +0100 Subject: [PATCH 01/10] feat: add bootstrap js --- angular.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/angular.json b/angular.json index 72d9c83..65435f1 100644 --- a/angular.json +++ b/angular.json @@ -34,7 +34,9 @@ "node_modules/@fortawesome/fontawesome-free/css/all.css", "src/styles.css" ], - "scripts": [] + "scripts": [ + "node_modules/bootstrap/dist/js/bootstrap.bundle.min.js" + ] }, "configurations": { "production": { From 34c357adabb211c5fa347df078f034cda25c5c32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlia=20Nogales?= Date: Fri, 13 Dec 2024 18:28:02 +0100 Subject: [PATCH 02/10] feat: apartment detail path --- src/app/app-routing.module.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 95e547f..c062b5a 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -10,6 +10,7 @@ import { UserEditComponent } from './user/user-edit/user-edit.component'; import { UserDeleteComponent } from './user/user-delete/user-delete.component'; import {ApartmentListComponent} from './apartment/apartment-list/apartment-list.component'; import {ApartmentCreateComponent} from './apartment/apartment-create/apartment-create.component'; +import {ApartmentDetailComponent} from './apartment/apartment-detail/apartment-detail.component'; const routes: Routes = [ { path: 'users/create', component: UserRegisterComponent}, @@ -18,8 +19,9 @@ const routes: Routes = [ { path: 'users/:id', component: UserDetailComponent, canActivate: [LoggedInGuard]}, { path: 'users', component: UserListComponent, canActivate: [LoggedInGuard]}, { path: 'about', component: AboutComponent}, - {path: 'apartments', component: ApartmentListComponent}, - {path: 'apartment/create', component: ApartmentCreateComponent}, + { path: 'apartments', component: ApartmentListComponent}, + { path: 'apartment/create', component: ApartmentCreateComponent}, + { path: 'apartment/:id', component: ApartmentDetailComponent}, { path: '404', component: NotFoundComponent}, { path: '', redirectTo: 'about', pathMatch: 'full'}, ]; From 0dbcbb14f6685d6df6e9490266b89c717a3a6235 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlia=20Nogales?= Date: Fri, 13 Dec 2024 18:31:36 +0100 Subject: [PATCH 03/10] feat: mock apartment details --- .../apartment-detail.component.ts | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/app/apartment/apartment-detail/apartment-detail.component.ts diff --git a/src/app/apartment/apartment-detail/apartment-detail.component.ts b/src/app/apartment/apartment-detail/apartment-detail.component.ts new file mode 100644 index 0000000..e7fa9aa --- /dev/null +++ b/src/app/apartment/apartment-detail/apartment-detail.component.ts @@ -0,0 +1,54 @@ +import { Component } from '@angular/core'; +import { Apartment } from '../apartment'; +import {ApartmentService} from '../apartment.service'; +import {User} from '../../login-basic/user'; +import {Room} from '../../room/room'; +import {NgbCarouselModule} from '@ng-bootstrap/ng-bootstrap'; + +@Component({ + selector: 'app-apartment-detail', + standalone: true, + imports: [ + NgbCarouselModule + ], + templateUrl: './apartment-detail.component.html', + styleUrl: './apartment-detail.component.css' +}) +export class ApartmentDetailComponent { + apartment: Apartment = new Apartment(); + owner: User = new User(); + room: Room = new Room(); + images: string[] = [ + 'https://images.habimg.com/imgh/21706-3651997/apartamento-en-alquiler-lleida-alquiler-lleida_720437e9-1267-41bf-890a-67acbf490cc5G.jpg', + 'https://images.habimg.com/imgh/21706-3651997/apartamento-en-alquiler-lleida-alquiler-lleida_720437e9-1267-41bf-890a-67acbf490cc5G.jpg', + 'https://images.habimg.com/imgh/21706-3651997/apartamento-en-alquiler-lleida-alquiler-lleida_720437e9-1267-41bf-890a-67acbf490cc5G.jpg' + ]; + date: string = ''; + + constructor(private apartmentService: ApartmentService) { + } + + + ngOnInit(): void { + // Mock Apartment + this.apartment.id = "1"; + this.apartment.name = "Pisito Nuevo"; + this.apartment.address = "Carrer President, 4, 3r A"; + this.apartment.floor = 2; + this.apartment.postalCode = "25005"; + this.apartment.city = "Lleida"; + this.apartment.country = "Catalunya"; + this.apartment.description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."; + this.apartment.registrationDate = new Date(); + + // Mock Owner (TODO: add more fields) + this.owner.username = "owner01"; + this.owner.email = "owner01@gmail.com"; + + // Mock Room (TODO: add more fields) + this.room.isOccupied = false; + + //Formatted Date + this.date = this.apartment.registrationDate.toLocaleDateString('es-ES'); + } +} From 10bbf9246272ff588168c6cb0ec41e3683d55c1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlia=20Nogales?= Date: Fri, 13 Dec 2024 18:32:06 +0100 Subject: [PATCH 04/10] feat: init html apartment details --- .../apartment-detail.component.html | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/app/apartment/apartment-detail/apartment-detail.component.html diff --git a/src/app/apartment/apartment-detail/apartment-detail.component.html b/src/app/apartment/apartment-detail/apartment-detail.component.html new file mode 100644 index 0000000..d48a1fc --- /dev/null +++ b/src/app/apartment/apartment-detail/apartment-detail.component.html @@ -0,0 +1,56 @@ +
+
+
+

{{ apartment.name }}

+

Data de creació: {{ date }}

+
+

{{ apartment.address }}, {{ apartment.postalCode }} {{ apartment.city }}, {{ apartment.country }}

+
+
+ +
+
+
+

{{ apartment.description }}

+

{{ apartment.floor }}

+

{{ room.isOccupied }}

+

...

+
+ +
+ @if (images) { + + +
+ Random first slide +
+ +
+ +
+ Random second slide +
+
+ +
+ Random third slide +
+
+
+ } +
+
+
+ +
+

Contact

+
+

{{ owner.username }}

+

{{ owner.email }}

+
+
+
From 70185e6662b0e1a3e023418f14e8e2e434254145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlia=20Nogales?= Date: Fri, 13 Dec 2024 18:32:18 +0100 Subject: [PATCH 05/10] feat: apartment details general css --- .../apartment-detail/apartment-detail.component.css | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/app/apartment/apartment-detail/apartment-detail.component.css diff --git a/src/app/apartment/apartment-detail/apartment-detail.component.css b/src/app/apartment/apartment-detail/apartment-detail.component.css new file mode 100644 index 0000000..38872ad --- /dev/null +++ b/src/app/apartment/apartment-detail/apartment-detail.component.css @@ -0,0 +1,7 @@ +p { + text-align: justify; +} + +img { + border-radius: 5px; +} From 09ed4064879dd46ec534cb93eaa623cfb680f2f5 Mon Sep 17 00:00:00 2001 From: abelpesa03 Date: Fri, 13 Dec 2024 20:21:42 +0100 Subject: [PATCH 06/10] feat: info elements (for now just the floor) --- .../apartment-detail/apartment-detail.component.css | 12 ++++++++++++ .../apartment-detail/apartment-detail.component.html | 9 ++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/app/apartment/apartment-detail/apartment-detail.component.css b/src/app/apartment/apartment-detail/apartment-detail.component.css index 38872ad..128f7b6 100644 --- a/src/app/apartment/apartment-detail/apartment-detail.component.css +++ b/src/app/apartment/apartment-detail/apartment-detail.component.css @@ -5,3 +5,15 @@ p { img { border-radius: 5px; } + +.btn-dark { + border-radius: 20px; + padding: 7px 19px; + margin-right: 15px; + margin-bottom: 7px; +} + +.btn-dark:hover { + cursor: auto; + background-color: #212529; +} diff --git a/src/app/apartment/apartment-detail/apartment-detail.component.html b/src/app/apartment/apartment-detail/apartment-detail.component.html index d48a1fc..8fb6251 100644 --- a/src/app/apartment/apartment-detail/apartment-detail.component.html +++ b/src/app/apartment/apartment-detail/apartment-detail.component.html @@ -12,9 +12,16 @@

{{ apartment.name }}

{{ apartment.description }}

-

{{ apartment.floor }}

+ + +
+ Planta {{ apartment.floor }} +
+ +
From 82cefa1bdf38a8994b7e87fd93d3e8989315d290 Mon Sep 17 00:00:00 2001 From: abelpesa03 Date: Fri, 13 Dec 2024 20:22:09 +0100 Subject: [PATCH 07/10] bug: date margin --- .../apartment/apartment-detail/apartment-detail.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/apartment/apartment-detail/apartment-detail.component.html b/src/app/apartment/apartment-detail/apartment-detail.component.html index 8fb6251..4e3930b 100644 --- a/src/app/apartment/apartment-detail/apartment-detail.component.html +++ b/src/app/apartment/apartment-detail/apartment-detail.component.html @@ -2,7 +2,7 @@

{{ apartment.name }}

-

Data de creació: {{ date }}

+

Data de creació: {{ date }}

{{ apartment.address }}, {{ apartment.postalCode }} {{ apartment.city }}, {{ apartment.country }}


From 5294f49bdd764be30559288fdaf61ddc15dc434c Mon Sep 17 00:00:00 2001 From: julianogales Date: Sun, 15 Dec 2024 23:46:12 +0100 Subject: [PATCH 08/10] feat: contact "footer" --- .../apartment-detail.component.css | 12 ++++++++++ .../apartment-detail.component.html | 24 +++++++------------ 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/src/app/apartment/apartment-detail/apartment-detail.component.css b/src/app/apartment/apartment-detail/apartment-detail.component.css index 128f7b6..20f884d 100644 --- a/src/app/apartment/apartment-detail/apartment-detail.component.css +++ b/src/app/apartment/apartment-detail/apartment-detail.component.css @@ -17,3 +17,15 @@ img { cursor: auto; background-color: #212529; } + +.contact-box { + background-color: #c7c8c9; + color: black; + padding: 15px 25px 0 25px; + border-radius: 4px; +} + +.hr-bottom { + margin-bottom: 40px; + margin-top: 16vh; +} diff --git a/src/app/apartment/apartment-detail/apartment-detail.component.html b/src/app/apartment/apartment-detail/apartment-detail.component.html index 4e3930b..c08c1f7 100644 --- a/src/app/apartment/apartment-detail/apartment-detail.component.html +++ b/src/app/apartment/apartment-detail/apartment-detail.component.html @@ -13,15 +13,9 @@

{{ apartment.name }}

{{ apartment.description }}

-
Planta {{ apartment.floor }}
- -
@@ -31,11 +25,6 @@

{{ apartment.name }}

Random first slide
-
@@ -53,11 +42,16 @@

First slide label

-
+ + +
+

Contact

-
-

{{ owner.username }}

-

{{ owner.email }}

+

Envia'm un correu electrònic si tens alguna pregunta sobre el pis o vols ficar-te en contacte amb mi per acordar una visita :)

+ +
+

Username: {{ owner.username }}

+

Email: {{ owner.email }}

From cfc209b379d652f0e2082b4cef2092ff01e4259e Mon Sep 17 00:00:00 2001 From: julianogales Date: Sun, 15 Dec 2024 23:57:49 +0100 Subject: [PATCH 09/10] fix: OnInit --- .../apartment/apartment-detail/apartment-detail.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/apartment/apartment-detail/apartment-detail.component.ts b/src/app/apartment/apartment-detail/apartment-detail.component.ts index e7fa9aa..0cfb790 100644 --- a/src/app/apartment/apartment-detail/apartment-detail.component.ts +++ b/src/app/apartment/apartment-detail/apartment-detail.component.ts @@ -1,4 +1,4 @@ -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; import { Apartment } from '../apartment'; import {ApartmentService} from '../apartment.service'; import {User} from '../../login-basic/user'; @@ -14,7 +14,7 @@ import {NgbCarouselModule} from '@ng-bootstrap/ng-bootstrap'; templateUrl: './apartment-detail.component.html', styleUrl: './apartment-detail.component.css' }) -export class ApartmentDetailComponent { +export class ApartmentDetailComponent implements OnInit { apartment: Apartment = new Apartment(); owner: User = new User(); room: Room = new Room(); From 0dcdbfbdf7c05927f168542d3affd837223037a1 Mon Sep 17 00:00:00 2001 From: julianogales Date: Mon, 16 Dec 2024 00:06:06 +0100 Subject: [PATCH 10/10] fix: max budget config --- angular.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/angular.json b/angular.json index 65435f1..ddb7465 100644 --- a/angular.json +++ b/angular.json @@ -43,8 +43,8 @@ "budgets": [ { "type": "initial", - "maximumWarning": "500kB", - "maximumError": "1MB" + "maximumWarning": "1MB", + "maximumError": "3MB" }, { "type": "anyComponentStyle",