Revision 48974
Added by Argiro Kokogiannaki over 6 years ago
user.component.ts | ||
---|---|---|
10 | 10 |
|
11 | 11 |
@Component({ |
12 | 12 |
selector: 'user', |
13 |
template: ` |
|
14 |
<div id="tm-main" class=" uk-section uk-margin-small-top tm-middle" > |
|
15 |
<div uk-grid uk-grid> |
|
16 |
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first "> |
|
13 |
templateUrl: 'user.component.html' |
|
14 |
}) |
|
17 | 15 |
|
18 |
<div *ngIf="!server" class="uk-margin-top uk-container uk-container-small uk-position-relative"> |
|
19 |
|
|
20 |
|
|
21 |
<!--form *ngIf="!loggedIn" class=" "> |
|
22 |
|
|
23 |
<h3>Welcome to OpenAIRE's Discover Portal</h3> |
|
24 |
|
|
25 |
<p>This service uses the same ldap sign-in as the OpenAIRE services so you can use the same |
|
26 |
credentials.</p> |
|
27 |
|
|
28 |
<p>Login in. To see it in action.</p> |
|
29 |
<div class="uk-margin"> |
|
30 |
<input class="uk-input uk-form-width-medium" placeholder="Username" type="text" name="username" [(ngModel)]="username"> |
|
31 |
</div> |
|
32 |
|
|
33 |
<div class="uk-margin"> |
|
34 |
<input placeholder="Password" class="uk-input uk-form-width-medium" type="password" name="password" [(ngModel)]="password"> |
|
35 |
</div> |
|
36 |
<div class="uk-margin"> |
|
37 |
<button (click)="login()" class=" uk-button uk-button-primary">Login</button> |
|
38 |
</div> |
|
39 |
</form--> |
|
40 |
<div *ngIf="errorCode == '1'" class="uk-alert uk-alert-warning"> |
|
41 |
The requested page requires authentication. Please sign in. |
|
42 |
<span *ngIf="!loggedIn"> |
|
43 |
<a class="loginLink" [href]="loginUrl" >Sign in</a> |
|
44 |
</span> |
|
45 |
</div> |
|
46 |
<div *ngIf="errorCode == '2'" class="uk-alert uk-alert-warning"> |
|
47 |
You are not authorized to use the requested page |
|
48 |
</div> |
|
49 |
<div *ngIf="errorCode == '3'" class="uk-alert uk-alert-warning"> |
|
50 |
The session has expired. Please sign in again or continue <a (click)="redirect();">browsing as a guest</a>. |
|
51 |
<span *ngIf="!loggedIn"> |
|
52 |
<a class="loginLink" [href]="loginUrl" >Sign in</a> |
|
53 |
</span> |
|
54 |
</div> |
|
55 |
<div *ngIf="!loggedIn && errorMessage.length > 0" class="uk-alert uk-alert-danger">{{errorMessage}}</div> |
|
56 |
|
|
57 |
<div *ngIf="loggedIn"> |
|
58 |
<div class="uk-alert uk-alert-success"> |
|
59 |
Hello {{user.fullname}}! |
|
60 |
</div> |
|
61 |
<button (click)="logout()" class=" uk-button uk-button-default">Log out</button> |
|
62 |
</div> |
|
63 |
</div> |
|
64 |
</div> |
|
65 |
</div> |
|
66 |
</div> |
|
67 |
` |
|
68 |
}) |
|
69 |
|
|
70 | 16 |
export class UserComponent { |
71 | 17 |
public user: User; |
72 | 18 |
public loggedIn: boolean = false; |
Also available in: Unified diff
Add *.component.html files for components with big html template