Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
list of generators and change to authentication
  • Loading branch information
rrc12004 committed Mar 8, 2019
1 parent abfe41d commit 64fae37
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 35 deletions.
54 changes: 29 additions & 25 deletions src/app/authentication/authentication.component.html
@@ -1,28 +1,32 @@
<div class="container ">
<div class="row">
<div class="col-md-6 mx-auto mt-4">
<h4 class="text-center mb-3">Log In</h4>
<form>

<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
<input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp"
placeholder="Enter email">
</div>

<div class="form-group">
<label for="exampleInputPassword1">Password</label>
<input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
</div>
<a routerLink="/generator-search"><button type="submit" class="btn btn-primary">Submit</button></a>
</form>
<p>
<br>
The Kinsley Group is a leading energy solutions supplier with a 50 plus year legacy of sales, rental and
service of quality energy systems. Our commercial businesses include Kinsley Power Systems, a top distributor
of industrial and residential KOHLER® generators for over 50 years and Kinsley Energy Systems, representing
prime movers for co-generation, biomass and landfill applications.
</p>
<div class="row">
<div class="col-md-6 mx-auto mt-4">
<h4 class="text-center mb-3">Log In</h4>
<form id="loginForm">

<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
<input #email_input type="email" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp"
placeholder="Enter email">
</div>

<div class="form-group">
<label for="exampleInputPassword1">Password</label>
<input #password_input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password">
</div>

<!-- <a routerLink="/generator-search"><button type="submit" class="btn btn-primary">Submit</button></a> -->
<a href="#" class="btn btn-primary" (click)="logOn()">Submit</a>
</form>
<p id='peep'></p>
<p>
<br>
The Kinsley Group is a leading energy solutions supplier with a 50 plus year legacy of sales, rental and
service of quality energy systems. Our commercial businesses include Kinsley Power Systems, a top distributor
of industrial and residential KOHLER® generators for over 50 years and Kinsley Energy Systems, representing
prime movers for co-generation, biomass and landfill applications.
</p>
</div>
</div>
</div>
</div>
4 changes: 2 additions & 2 deletions src/app/generator-search/generator-search.component.css
@@ -1,6 +1,6 @@
div {
/* div {
position: absolute;
top: 40%;
left: 50%;
transform: translate(-50%,-50%);
}
} */
31 changes: 24 additions & 7 deletions src/app/generator-search/generator-search.component.html
@@ -1,8 +1,25 @@
<div class="generator-main" id="findGenerator">
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="search" placeholder="Search for Generator" aria-label="Search">
<button class="btn btn-light my-2 my-sm-0" type="submit">Search</button>
</form>
<br>
<button type="button" class="btn btn-light my-2 my-sm-0"><a routerLink="/statistics">Generator 1</a></button>
</div>
<div class="col-md-6 mx-auto mt-4">
<h4 class="text-center mb-3">Search for a Generator</h4>
<form>
<div class="form-group">
<label for="exampleInputGenerator1"></label>
<input type="generator" class="form-control" id="exampleInputGenerator1" aria-describedby="emailHelp"
placeholder="Enter generator">
</div>
<a routerLink="/generator-search"><button type="submit" class="btn btn-primary">Search</button></a>
</form>
<ul>
<li *ngFor="let generator of generators$">
<a routerLink="/statistics/{{generator.gen_id}}">
{{ generator.gen_name }}
</a>
</li>
</ul>



</div>


</div>
16 changes: 15 additions & 1 deletion src/app/generator-search/generator-search.component.ts
Expand Up @@ -7,11 +7,25 @@ import { Router } from '@angular/router';
templateUrl: './generator-search.component.html',
styleUrls: ['./generator-search.component.css']
})

export class GeneratorSearchComponent implements OnInit {

constructor(private data: GeneratorService, private router: Router) { }
constructor(public data: GeneratorService, private router: Router) { }

public generators$: Object;

ngOnInit() {
const jsonToken = localStorage.getItem('auth_token');
try {
this.data.getGenerators(jsonToken).subscribe((data) => {
// console.log(data);
this.generators$ = data;
return this.generators$;
});
} catch (err) {
return err;
}
// this.generators$ = this.getGeneratorName();
}

}

0 comments on commit 64fae37

Please sign in to comment.