Changeset bdd6491 for trip-planner-front/src/app/homepage
- Timestamp:
- 12/28/21 08:56:55 (3 years ago)
- Branches:
- master
- Children:
- b738035
- Parents:
- 84d0fbb
- Location:
- trip-planner-front/src/app/homepage
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trip-planner-front/src/app/homepage/homepage.component.html
r84d0fbb rbdd6491 13 13 <header> 14 14 <nav class="navbar navbar-expand-sm bg-light"> 15 <img src={{myLogo}} />16 15 <strong class="navbar-brand">Trivia Trip</strong> 17 16 … … 30 29 <img src={{imageURI}} /> 31 30 <h4></h4> 32 <!-- 33 <div class="content-section implementation carousel-demo" style="padding-top: 2em;">31 32 <div class="content-section implementation carousel-demo" style="padding-top: 2em;"> 34 33 <div class="card"> 35 34 <p-carousel [value]="locations" [numVisible]="3" [numScroll]="3" [circular]="false" … … 91 90 </div> 92 91 </div> 93 --> 94 92 95 93 </main> 96 <br>94 <br> 97 95 98 96 <footer class="bg-dark text-center text-white"> … … 102 100 <section class="mb-4"> 103 101 <!-- Facebook --> 104 <a class="btn btn-outline-light btn-floating m-1" href="#!" role="button" 105 ><i class="fab fa-facebook-f"></i 106 ></a> 107 102 <a class="btn btn-outline-light btn-floating m-1" href="#!" role="button"><i class="fab fa-facebook-f"></i></a> 103 108 104 <!-- Twitter --> 109 <a class="btn btn-outline-light btn-floating m-1" href="#!" role="button" 110 ><i class="fab fa-twitter"></i 111 ></a> 112 105 <a class="btn btn-outline-light btn-floating m-1" href="#!" role="button"><i class="fab fa-twitter"></i></a> 106 113 107 <!-- Google --> 114 <a class="btn btn-outline-light btn-floating m-1" href="#!" role="button" 115 ><i class="fab fa-google"></i 116 ></a> 117 108 <a class="btn btn-outline-light btn-floating m-1" href="#!" role="button"><i class="fab fa-google"></i></a> 109 118 110 <!-- Instagram --> 119 <a class="btn btn-outline-light btn-floating m-1" href="#!" role="button" 120 ><i class="fab fa-instagram"></i 121 ></a> 122 111 <a class="btn btn-outline-light btn-floating m-1" href="#!" role="button"><i class="fab fa-instagram"></i></a> 112 123 113 <!-- Linkedin --> 124 <a class="btn btn-outline-light btn-floating m-1" href="#!" role="button" 125 ><i class="fab fa-linkedin-in"></i 126 ></a> 127 114 <a class="btn btn-outline-light btn-floating m-1" href="#!" role="button"><i class="fab fa-linkedin-in"></i></a> 115 128 116 <!-- Github --> 129 <a class="btn btn-outline-light btn-floating m-1" href="#!" role="button" 130 ><i class="fab fa-github"></i 131 ></a> 117 <a class="btn btn-outline-light btn-floating m-1" href="#!" role="button"><i class="fab fa-github"></i></a> 132 118 </section> 133 119 <!-- Section: Social media --> 134 120 135 121 <!-- Section: Form --> 136 122 <section class=""> … … 145 131 </div> 146 132 <!--Grid column--> 147 133 148 134 <!--Grid column--> 149 135 <div class="col-md-5 col-12"> … … 155 141 </div> 156 142 <!--Grid column--> 157 143 158 144 <!--Grid column--> 159 145 <div class="col-auto"> … … 169 155 </section> 170 156 <!-- Section: Form --> 171 157 172 158 <!-- Section: Text --> 173 159 <section class="mb-4"> … … 179 165 </section> 180 166 <!-- Section: Text --> 181 167 182 168 <!-- Section: Links --> 183 169 <section class=""> … … 187 173 <div class="col-lg-3 col-md-6 mb-4 mb-md-0"> 188 174 <h5 class="text-uppercase">Links</h5> 189 190 <ul class="list-unstyled mb-0"> 191 <li> 192 <a href="#!" class="text-white">Link 1</a> 193 </li> 194 <li> 195 <a href="#!" class="text-white">Link 2</a> 196 </li> 197 <li> 198 <a href="#!" class="text-white">Link 3</a> 199 </li> 200 <li> 201 <a href="#!" class="text-white">Link 4</a> 202 </li> 203 </ul> 204 </div> 205 <!--Grid column--> 206 207 <!--Grid column--> 208 <div class="col-lg-3 col-md-6 mb-4 mb-md-0"> 209 <h5 class="text-uppercase">Links</h5> 210 211 <ul class="list-unstyled mb-0"> 212 <li> 213 <a href="#!" class="text-white">Link 1</a> 214 </li> 215 <li> 216 <a href="#!" class="text-white">Link 2</a> 217 </li> 218 <li> 219 <a href="#!" class="text-white">Link 3</a> 220 </li> 221 <li> 222 <a href="#!" class="text-white">Link 4</a> 223 </li> 224 </ul> 225 </div> 226 <!--Grid column--> 227 228 <!--Grid column--> 229 <div class="col-lg-3 col-md-6 mb-4 mb-md-0"> 230 <h5 class="text-uppercase">Links</h5> 231 232 <ul class="list-unstyled mb-0"> 233 <li> 234 <a href="#!" class="text-white">Link 1</a> 235 </li> 236 <li> 237 <a href="#!" class="text-white">Link 2</a> 238 </li> 239 <li> 240 <a href="#!" class="text-white">Link 3</a> 241 </li> 242 <li> 243 <a href="#!" class="text-white">Link 4</a> 244 </li> 245 </ul> 246 </div> 247 <!--Grid column--> 248 249 <!--Grid column--> 250 <div class="col-lg-3 col-md-6 mb-4 mb-md-0"> 251 <h5 class="text-uppercase">Links</h5> 252 175 176 <ul class="list-unstyled mb-0"> 177 <li> 178 <a href="#!" class="text-white">Link 1</a> 179 </li> 180 <li> 181 <a href="#!" class="text-white">Link 2</a> 182 </li> 183 <li> 184 <a href="#!" class="text-white">Link 3</a> 185 </li> 186 <li> 187 <a href="#!" class="text-white">Link 4</a> 188 </li> 189 </ul> 190 </div> 191 <!--Grid column--> 192 193 <!--Grid column--> 194 <div class="col-lg-3 col-md-6 mb-4 mb-md-0"> 195 <h5 class="text-uppercase">Links</h5> 196 197 <ul class="list-unstyled mb-0"> 198 <li> 199 <a href="#!" class="text-white">Link 1</a> 200 </li> 201 <li> 202 <a href="#!" class="text-white">Link 2</a> 203 </li> 204 <li> 205 <a href="#!" class="text-white">Link 3</a> 206 </li> 207 <li> 208 <a href="#!" class="text-white">Link 4</a> 209 </li> 210 </ul> 211 </div> 212 <!--Grid column--> 213 214 <!--Grid column--> 215 <div class="col-lg-3 col-md-6 mb-4 mb-md-0"> 216 <h5 class="text-uppercase">Links</h5> 217 218 <ul class="list-unstyled mb-0"> 219 <li> 220 <a href="#!" class="text-white">Link 1</a> 221 </li> 222 <li> 223 <a href="#!" class="text-white">Link 2</a> 224 </li> 225 <li> 226 <a href="#!" class="text-white">Link 3</a> 227 </li> 228 <li> 229 <a href="#!" class="text-white">Link 4</a> 230 </li> 231 </ul> 232 </div> 233 <!--Grid column--> 234 235 <!--Grid column--> 236 <div class="col-lg-3 col-md-6 mb-4 mb-md-0"> 237 <h5 class="text-uppercase">Links</h5> 238 253 239 <ul class="list-unstyled mb-0"> 254 240 <li> … … 273 259 </div> 274 260 <!-- Grid container --> 275 261 276 262 <!-- Copyright --> 277 263 <div class="text-center p-3" style="background-color: rgba(0, 0, 0, 0.2);"> -
trip-planner-front/src/app/homepage/homepage.component.ts
r84d0fbb rbdd6491 1 import { HttpErrorResponse } from '@angular/common/http'; 1 2 import { Component, OnInit } from '@angular/core'; 2 3 import { Router } from '@angular/router'; … … 50 51 51 52 ngOnInit(): void { 52 /*53 53 this.locationService.getWeekendGetaways().subscribe( 54 54 data => { … … 61 61 } 62 62 ); 63 */ 63 64 64 } 65 65 … … 73 73 74 74 this.ref.onClose.subscribe((user: UserDto) => { 75 this.userService.registerUser(user).subscribe( 76 data => { 77 console.log(data); 78 79 } 80 ); 81 }); 75 if (user) { 76 this.userService.registerUser(user).subscribe( 77 data => { 78 console.log(data); 79 } 80 ); 81 } 82 }, 83 err => { 84 85 }); 82 86 } 83 87 84 88 85 89 onClickLogIn() { 86 90 this.ref = this.dialogService.open(LoginComponent, { … … 90 94 baseZIndex: 10000 91 95 }); 92 this.ref.onClose.subscribe((loginRequest : LoginRequest) => { 93 this.userService.authenticateUser(loginRequest).subscribe( 94 (data : any) => { 95 console.log(data); 96 if(this.userService.isUserLoggedIn()){ 97 this.router.navigate(['planners']); 96 this.ref.onClose.subscribe((loginRequest: LoginRequest) => { 97 if (loginRequest) { 98 this.userService.authenticateUser(loginRequest).subscribe( 99 (data: any) => { 100 console.log(data); 101 if (this.userService.isUserLoggedIn()) { 102 this.router.navigate(['planners']); 103 } 98 104 } 99 }100 );105 ); 106 } 101 107 }); 102 108 } 109 110 ngOnDestroy() { 111 if (this.ref) { 112 this.ref.close(); 113 } 114 } 103 115 } -
trip-planner-front/src/app/homepage/register/register.component.html
r84d0fbb rbdd6491 1 <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" rel="stylesheet" 2 integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous"> 1 3 2 3 4 5 6 7 >8 </div> 4 <div class="p-grid p-fluid"> 5 <div class="p-col-12 p-md-4"> 6 <div class="p-inputgroup"> 7 <span class="p-inputgroup-addon"><i class="pi pi-user"></i></span> 8 <input type="text" pInputText placeholder="Full name" [(ngModel)]="user.fullName" name="fullName" 9 class="form-control"> 10 9 11 </div> 10 11 <div class="p-col-12 p-md-4"> 12 <div class="p-inputgroup">13 <span class="p-inputgroup-addon"><i class="pi pi-user"></i></span>14 <input type="text" pInputText placeholder="Email address (Username)" [(ngModel)]="user.username" name="username"15 >16 </div>12 </div> 13 14 <div class="p-col-12 p-md-4"> 15 <div class="p-inputgroup"> 16 <span class="p-inputgroup-addon"><i class="pi pi-user"></i></span> 17 <input type="text" pInputText placeholder="Email address (Username)" [(ngModel)]="user.username" 18 name="username"> 17 19 </div> 18 <div class="p-col-12 p-md-4">19 <div class="p-inputgroup"> 20 <span class="p-inputgroup-addon"><i class="pi pi-password"></i></span>21 <input type="password" pInputText placeholder="Password" [(ngModel)]="user.password" name="password"22 >23 < /div>20 </div> 21 22 <div class="p-col-12 p-md-4"> 23 <div class="p-inputgroup"> 24 <span class="p-inputgroup-addon"><i class="pi pi-password"></i></span> 25 <input type="password" pInputText placeholder="Password" [(ngModel)]="user.password" name="password"> 24 26 </div> 25 <div class="p-col-12 p-md-4"> 26 <div class="p-inputgroup"> 27 <span class="p-inputgroup-addon"><i class="pi pi-password"></i></span> 28 <input type="password" pInputText placeholder="Repeat password" [(ngModel)]="user.confirmPassword" name="confirmPassword" 29 > 30 </div> 27 </div> 28 29 <div class="p-col-12 p-md-4"> 30 <div class="p-inputgroup"> 31 <span class="p-inputgroup-addon"><i class="pi pi-password"></i></span> 32 <input type="password" pInputText placeholder="Repeat password" [(ngModel)]="user.confirmPassword" 33 name="confirmPassword"> 31 34 </div> 32 33 <div class="p-col-12 p-md-4"> 34 <button pButton pRipple label="Submit" class="p-button-secondary" type="submit" (click)="onFormSubmitSignUp(user)"></button> 35 </div> 36 </div> 35 </div> 36 37 <div class="p-col-12 p-md-4"> 38 <button pButton pRipple label="Submit" class="p-button-secondary" type="button" 39 (click)="onFormSubmitSignUp(user)"></button> 40 </div> 41 </div> 42 43 -
trip-planner-front/src/app/homepage/register/register.component.ts
r84d0fbb rbdd6491 1 1 import { Component, OnInit } from '@angular/core'; 2 import { FormBuilder, FormGroup, Validators } from '@angular/forms'; 2 3 import { DynamicDialogRef } from 'primeng/dynamicdialog'; 3 4 import { UserDto } from 'src/app/_models/dto/userDto'; … … 10 11 export class RegisterComponent implements OnInit { 11 12 12 user : UserDto; 13 user: UserDto; 14 myForm: FormGroup; 13 15 14 constructor(private ref: DynamicDialogRef ) {16 constructor(private ref: DynamicDialogRef, private fb: FormBuilder) { 15 17 this.user = new UserDto(); 16 } 18 this.myForm = fb.group({ 19 title: fb.control('initial value', Validators.required) 20 }); 21 } 17 22 18 23 ngOnInit(): void { 24 this.myForm = this.fb.group({ 25 fullName: this.fb.control('', Validators.required), 26 username: this.fb.control('', Validators.required), 27 password: this.fb.control('', Validators.required), 28 confirmPassword: this.fb.control('', Validators.required) 29 }); 19 30 } 20 21 onFormSubmitSignUp(user) {31 32 onFormSubmitSignUp(user) { 22 33 this.ref.close(user); 23 34 //window.location.reload(); 35 24 36 } 37 25 38 }
Note:
See TracChangeset
for help on using the changeset viewer.