Skip to content

Commit 9292fa5

Browse files
committed
account's layout done
1 parent cd70f4b commit 9292fa5

12 files changed

+141
-118
lines changed
Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11
<div class="login-box">
2-
<div class="logo">
3-
<a href="javascript:void(0);">AbpProjectName</a>
2+
<account-header></account-header>
3+
<div class="card">
4+
<div *ngIf="showTenantChange()" class="card-header">
5+
<tenant-change></tenant-change>
46
</div>
5-
6-
<div *ngIf="showTenantChange()" class="tenant-change-box">
7-
<tenant-change></tenant-change>
7+
<div class="card-body login-card-body">
8+
<router-outlet></router-outlet>
89
</div>
9-
10-
<router-outlet></router-outlet>
11-
12-
<account-languages></account-languages>
13-
14-
<div class="row">
15-
<div class="col-xs-12 text-center" style="color: #e9e9e9">
16-
<small>&copy; {{currentYear}} AbpProjectName. <b>{{ "Version" | localize }} </b> {{versionText}}</small>
17-
</div>
10+
<div class="card-footer">
11+
<account-languages></account-languages>
1812
</div>
19-
20-
</div>
13+
</div>
14+
<account-footer></account-footer>
15+
</div>

angular/src/account/account.component.less

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,26 @@
1-
import { Component, ViewContainerRef, OnInit, ViewEncapsulation, Injector } from '@angular/core';
2-
import { LoginService } from './login/login.service';
1+
import {
2+
Component,
3+
OnInit,
4+
ViewEncapsulation,
5+
Injector,
6+
Renderer2
7+
} from '@angular/core';
38
import { AppComponentBase } from '@shared/app-component-base';
49

510
@Component({
6-
templateUrl: './account.component.html',
7-
styleUrls: [
8-
'./account.component.less'
9-
],
10-
encapsulation: ViewEncapsulation.None
11+
templateUrl: './account.component.html',
12+
encapsulation: ViewEncapsulation.None
1113
})
1214
export class AccountComponent extends AppComponentBase implements OnInit {
15+
constructor(injector: Injector, private renderer: Renderer2) {
16+
super(injector);
17+
}
1318

14-
versionText: string;
15-
currentYear: number;
19+
showTenantChange(): boolean {
20+
return abp.multiTenancy.isEnabled;
21+
}
1622

17-
private viewContainerRef: ViewContainerRef;
18-
19-
public constructor(
20-
injector: Injector,
21-
private _loginService: LoginService
22-
) {
23-
super(injector);
24-
25-
this.currentYear = new Date().getFullYear();
26-
this.versionText = this.appSession.application.version + ' [' + this.appSession.application.releaseDate.format('YYYYDDMM') + ']';
27-
}
28-
29-
showTenantChange(): boolean {
30-
return abp.multiTenancy.isEnabled;
31-
}
32-
33-
ngOnInit(): void {
34-
$('body').addClass('login-page');
35-
}
23+
ngOnInit(): void {
24+
this.renderer.addClass(document.body, 'login-page');
25+
}
3626
}

angular/src/account/account.module.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import { AccountComponent } from './account.component';
1818
import { LoginComponent } from './login/login.component';
1919
import { RegisterComponent } from './register/register.component';
2020
import { AccountLanguagesComponent } from './layout/account-languages.component';
21+
import { AccountHeaderComponent } from './layout/account-header.component';
22+
import { AccountFooterComponent } from './layout/account-footer.component';
2123

2224
import { LoginService } from './login/login.service';
2325

@@ -42,6 +44,8 @@ import { TenantChangeDialogComponent } from './tenant/tenant-change-dialog.compo
4244
LoginComponent,
4345
RegisterComponent,
4446
AccountLanguagesComponent,
47+
AccountHeaderComponent,
48+
AccountFooterComponent,
4549
// tenant
4650
TenantChangeComponent,
4751
TenantChangeDialogComponent,
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<div class="row">
2+
<div class="col-md-12 text-center">
3+
<small>
4+
Copyright &copy; {{ currentYear }}
5+
<b class="ml-2">{{ "Version" | localize }}</b>
6+
{{ versionText }}
7+
</small>
8+
</div>
9+
</div>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { Component, Injector, ChangeDetectionStrategy } from '@angular/core';
2+
import { AppComponentBase } from '@shared/app-component-base';
3+
4+
@Component({
5+
selector: 'account-footer',
6+
templateUrl: './account-footer.component.html',
7+
changeDetection: ChangeDetectionStrategy.OnPush
8+
})
9+
export class AccountFooterComponent extends AppComponentBase {
10+
currentYear: number;
11+
versionText: string;
12+
13+
constructor(injector: Injector) {
14+
super(injector);
15+
16+
this.currentYear = new Date().getFullYear();
17+
this.versionText =
18+
this.appSession.application.version +
19+
' [' +
20+
this.appSession.application.releaseDate.format('YYYYDDMM') +
21+
']';
22+
}
23+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div class="login-logo">
2+
<a href="/"><b>AbpProjectName</b></a>
3+
</div>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { Component, ChangeDetectionStrategy } from '@angular/core';
2+
3+
@Component({
4+
selector: 'account-header',
5+
templateUrl: './account-header.component.html',
6+
changeDetection: ChangeDetectionStrategy.OnPush
7+
})
8+
export class AccountHeaderComponent {}
Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
1-
<ul class="account-language-switch-list text-center">
2-
<li *ngFor="let language of languages">
3-
<a *ngIf="language.name != currentLanguage.name" href="javascript:void();" title="{{language.displayName}}" (click)="changeLanguage(language.name)"><i class="{{language.icon}}"></i></a>
4-
</li>
5-
</ul>
1+
<div class="text-center">
2+
<ng-container *ngFor="let language of languages">
3+
<a
4+
*ngIf="language.name != currentLanguage.name"
5+
href="javascript:void(0);"
6+
(click)="changeLanguage(language.name)"
7+
>
8+
<span
9+
title="{{ language.displayName }}"
10+
[attr.class.current-language-icon]="
11+
language.name != currentLanguage.name
12+
"
13+
>
14+
<i class="d-inline-block mx-1 {{ language.icon }}"></i>
15+
</span>
16+
</a>
17+
</ng-container>
18+
</div>

angular/src/account/layout/account-languages.component.less

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)