-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #101 from sinfo/feature/company-infos
Feature: Deck2
- Loading branch information
Showing
8 changed files
with
10,427 additions
and
7,762 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,31 @@ | ||
export class Info { | ||
info?: MiscInfo; | ||
titles?: Titles; | ||
info?: MiscInfo; | ||
titles?: Titles; | ||
|
||
constructor(info?: MiscInfo, titles?: Titles) { | ||
this.info = info; | ||
this.titles = titles; | ||
} | ||
} | ||
|
||
class MiscInfo { | ||
numberOfPeople?: Number; | ||
licensePlates?: String[]; | ||
numberOfPeople?: Number; | ||
licensePlates?: String[]; | ||
|
||
constructor(numberOfPeople?: Number, licensePlates?: String[]) { | ||
this.numberOfPeople = numberOfPeople; | ||
this.licensePlates = licensePlates; | ||
} | ||
} | ||
|
||
class Titles { | ||
presentation?: String; | ||
lunchTalk?: String; | ||
workshop?: String; | ||
} | ||
presentation?: String; | ||
lunchTalk?: String; | ||
workshop?: String; | ||
|
||
constructor(presentation?: String, workshop?: String, lunchTalk?: String) { | ||
this.presentation = presentation; | ||
this.workshop = workshop; | ||
this.lunchTalk = lunchTalk; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
104 changes: 104 additions & 0 deletions
104
src/app/company/company-infos/company-infos.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<div class="container"> | ||
<div [hidden]="submitted"> | ||
<h1>Company Information Form</h1> | ||
<form (ngSubmit)="onSubmit()" #companyInfoForm="ngForm"> | ||
<div class="form-group"> | ||
<label for="numberOfPeople">Número de pessoas no stand</label> | ||
<select | ||
class="form-control" | ||
id="numberOfPeople" | ||
required | ||
[(ngModel)]="model.info.numberOfPeople" | ||
name="numberOfPeople" | ||
#numberOfPeople="ngModel" | ||
> | ||
<option *ngFor="let num of peopleStandOptions" [value]="num"> | ||
{{ num }} | ||
</option> | ||
</select> | ||
<div | ||
[hidden]="numberOfPeople.valid || numberOfPeople.pristine" | ||
class="alert alert-danger" | ||
> | ||
Número de pessoas no stand é obrigatório | ||
</div> | ||
</div> | ||
|
||
<!-- TODO: FINISH THIS FIELD --> | ||
<!-- <div class="form-group"> | ||
<label for="name">Matrícula do carro</label> | ||
<input type="text" class="form-control" id="name" | ||
required | ||
[(ngModel)]="model.name" name="name" | ||
#name="ngModel"> | ||
<div [hidden]="name.valid || name.pristine" | ||
class="alert alert-danger"> | ||
Matrícula do carro é obrigatório | ||
</div> | ||
</div> --> | ||
|
||
<!-- TODO: THIS FIELD SHOULD ONLY APPEAR DEPENDING ON THE COMPANY --> | ||
<div class="form-group"> | ||
<label for="name">Título da apresentação</label> | ||
<input | ||
type="text" | ||
class="form-control" | ||
id="name" | ||
required | ||
[(ngModel)]="model.titles.presentation" | ||
name="name" | ||
#name="ngModel" | ||
/> | ||
<div [hidden]="name.valid || name.pristine" class="alert alert-danger"> | ||
Título da apresentação é obrigatório | ||
</div> | ||
</div> | ||
|
||
<!-- TODO: THIS FIELD SHOULD ONLY APPEAR DEPENDING ON THE COMPANY --> | ||
<div class="form-group"> | ||
<label for="name">Título do workshop</label> | ||
<input | ||
type="text" | ||
class="form-control" | ||
id="name" | ||
required | ||
[(ngModel)]="model.titles.workshop" | ||
name="name" | ||
#name="ngModel" | ||
/> | ||
<div [hidden]="name.valid || name.pristine" class="alert alert-danger"> | ||
Título do workshop é obrigatório | ||
</div> | ||
</div> | ||
|
||
<!-- TODO: THIS FIELD SHOULD ONLY APPEAR DEPENDING ON THE COMPANY --> | ||
<div class="form-group"> | ||
<label for="name">Título da lunch talk</label> | ||
<input | ||
type="text" | ||
class="form-control" | ||
id="name" | ||
required | ||
[(ngModel)]="model.titles.lunchTalk" | ||
name="name" | ||
#name="ngModel" | ||
/> | ||
<div [hidden]="name.valid || name.pristine" class="alert alert-danger"> | ||
Título da lunch talk é obrigatório | ||
</div> | ||
</div> | ||
|
||
<button | ||
type="submit" | ||
class="btn btn-success" | ||
[disabled]="!companyInfoForm.form.valid" | ||
> | ||
Submit | ||
</button> | ||
</form> | ||
</div> | ||
|
||
<div [hidden]="!submitted"> | ||
{{ model }} | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Component } from "@angular/core"; | ||
|
||
import { Info } from "../../admin/infos/info"; | ||
|
||
@Component({ | ||
selector: "company-infos", | ||
templateUrl: "./company-infos.component.html", | ||
styleUrls: ["./company-infos.component.css"], | ||
}) | ||
export class CompanyInfosComponent { | ||
|
||
maxPeopleStand = 3; | ||
maxCars = 3; | ||
|
||
peopleStandOptions = Array.from({length:this.maxPeopleStand},(_,k)=>k+1); | ||
|
||
model = new Info(); | ||
|
||
submitted = false; | ||
|
||
onSubmit() { | ||
this.submitted = true; | ||
} | ||
|
||
newCompanyInfo() { | ||
this.model = new Info(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters