Skip to content

Commit 6cc0072

Browse files
committed
Complete user area on the sidebar.
1 parent 99dc1cc commit 6cc0072

File tree

7 files changed

+96
-66
lines changed

7 files changed

+96
-66
lines changed

angular/.editorconfig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
# Editor configuration, see http://editorconfig.org
1+
# Editor configuration, see http://editorconfig.org
22
root = true
33

44
[*]
55
charset = utf-8
66
indent_style = space
7-
indent_size = 2
87
insert_final_newline = true
98
trim_trailing_whitespace = true
109

angular/src/app/app.component.html

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<!-- Overlay For Sidebars -->
22
<div class="overlay"></div>
33
<!-- #END# Overlay For Sidebars -->
4+
45
<!-- Search Bar -->
56
<div class="search-bar">
67
<div class="search-icon">
@@ -12,6 +13,7 @@
1213
</div>
1314
</div>
1415
<!-- #END# Search Bar -->
16+
1517
<!-- Top Bar -->
1618
<nav class="navbar">
1719
<div class="container-fluid">
@@ -31,32 +33,11 @@
3133
</nav>
3234
<!-- #Top Bar -->
3335

34-
3536
<section>
3637
<!-- Left Sidebar -->
3738
<aside id="leftsidebar" class="sidebar">
3839
<!-- User Info -->
39-
<div class="user-info">
40-
<div class="image">
41-
<img src="/assets/images/user.png" width="48" height="48" alt="User" />
42-
</div>
43-
<div class="info-container">
44-
<div class="name" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">John Doe</div>
45-
<div class="email">[email protected]</div>
46-
<div class="btn-group user-helper-dropdown">
47-
<i class="material-icons" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">keyboard_arrow_down</i>
48-
<ul class="dropdown-menu pull-right">
49-
<li><a href="javascript:void(0);"><i class="material-icons">person</i>Profile</a></li>
50-
<li role="seperator" class="divider"></li>
51-
<li><a href="javascript:void(0);"><i class="material-icons">group</i>Followers</a></li>
52-
<li><a href="javascript:void(0);"><i class="material-icons">shopping_cart</i>Sales</a></li>
53-
<li><a href="javascript:void(0);"><i class="material-icons">favorite</i>Likes</a></li>
54-
<li role="seperator" class="divider"></li>
55-
<li><a href="javascript:void(0);"><i class="material-icons">input</i>Sign Out</a></li>
56-
</ul>
57-
</div>
58-
</div>
59-
</div>
40+
<sidebar-user-area></sidebar-user-area>
6041
<!-- #User Info -->
6142
<!-- Menu -->
6243
<div class="menu">

angular/src/app/app.module.ts

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -8,46 +8,45 @@ import { ModalModule } from 'ngx-bootstrap';
88
import { AppRoutingModule } from './app-routing.module';
99
import { AppComponent } from './app.component';
1010

11-
import { AbpModule, ABP_HTTP_PROVIDER } from '@abp/abp.module';
11+
import { AbpModule } from '@abp/abp.module';
1212

1313
import { ServiceProxyModule } from '@shared/service-proxies/service-proxy.module';
1414
import { SharedModule } from '@shared/shared.module';
1515

16-
import { API_BASE_URL } from '@shared/service-proxies/service-proxies';
17-
import { AppConsts } from '@shared/AppConsts';
18-
1916
import { HomeComponent } from '@app/home/home.component';
2017
import { AboutComponent } from '@app/about/about.component';
2118
import { UsersComponent } from '@app/users/users.component';
2219
import { CreateUserModalComponent } from '@app/users/create-user-modal.component';
2320
import { TenantsComponent } from '@app/tenants/tenants.component';
2421
import { CreateTenantModalComponent } from '@app/tenants/create-tenant-modal.component';
25-
import { TopBarLanguageSwitchComponent } from 'app/layout/topbar-languageswitch.component';
22+
import { TopBarLanguageSwitchComponent } from '@app/layout/topbar-languageswitch.component';
23+
import { SideBarUserAreaComponent } from '@app/layout/sidebar-user-area.component';
2624

2725
@NgModule({
28-
declarations: [
29-
AppComponent,
30-
HomeComponent,
31-
AboutComponent,
32-
UsersComponent,
33-
CreateUserModalComponent,
34-
TenantsComponent,
35-
CreateTenantModalComponent,
36-
TopBarLanguageSwitchComponent
37-
],
38-
imports: [
39-
CommonModule,
40-
FormsModule,
41-
HttpModule,
42-
JsonpModule,
43-
ModalModule.forRoot(),
44-
AbpModule,
45-
AppRoutingModule,
46-
ServiceProxyModule,
47-
SharedModule
48-
],
49-
providers: [
50-
51-
]
26+
declarations: [
27+
AppComponent,
28+
HomeComponent,
29+
AboutComponent,
30+
UsersComponent,
31+
CreateUserModalComponent,
32+
TenantsComponent,
33+
CreateTenantModalComponent,
34+
TopBarLanguageSwitchComponent,
35+
SideBarUserAreaComponent
36+
],
37+
imports: [
38+
CommonModule,
39+
FormsModule,
40+
HttpModule,
41+
JsonpModule,
42+
ModalModule.forRoot(),
43+
AbpModule,
44+
AppRoutingModule,
45+
ServiceProxyModule,
46+
SharedModule
47+
],
48+
providers: [
49+
50+
]
5251
})
5352
export class AppModule { }
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
 <div class="user-info">
2+
<div class="image">
3+
<img src="/assets/images/user.png" width="48" height="48" alt="User" />
4+
</div>
5+
<div class="info-container">
6+
<div class="name" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">{{shownLoginName}}</div>
7+
<div class="email">{{appSession.user.emailAddress}}</div>
8+
<div class="btn-group user-helper-dropdown">
9+
<i class="material-icons" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">keyboard_arrow_down</i>
10+
<ul class="dropdown-menu pull-right">
11+
<li><a (click)="logout()"><i class="material-icons">input</i>{{l('Logout')}}</a></li>
12+
</ul>
13+
</div>
14+
</div>
15+
</div>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { Component, OnInit, Injector, ViewEncapsulation } from '@angular/core';
2+
import { AppComponentBase } from '@shared/app-component-base';
3+
import { AppAuthService } from '@shared/auth/app-auth.service';
4+
5+
@Component({
6+
templateUrl: './sidebar-user-area.component.html',
7+
selector: 'sidebar-user-area',
8+
encapsulation: ViewEncapsulation.None
9+
})
10+
export class SideBarUserAreaComponent extends AppComponentBase implements OnInit {
11+
12+
shownLoginName: string = "";
13+
14+
constructor(
15+
injector: Injector,
16+
private _authService: AppAuthService
17+
) {
18+
super(injector);
19+
}
20+
21+
ngOnInit() {
22+
this.shownLoginName = this.appSession.getShownLoginName();
23+
}
24+
25+
getCurrentLoginInformations(): void {
26+
27+
}
28+
29+
logout(): void {
30+
this._authService.logout();
31+
}
32+
}

angular/src/shared/core.less

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,35 @@
11
/* General */
22

33
.clickable-item {
4-
cursor: pointer;
4+
cursor: pointer;
55
}
66

77
.text-bold {
8-
font-weight: bold;
8+
font-weight: bold;
99
}
1010

1111
/* Portlet */
1212
.portlet.light > .portlet-title .inputs.inputs-full-width {
13-
display: block;
14-
float: none;
13+
display: block;
14+
float: none;
1515
}
1616

1717
.famfamfam-flags {
18-
display: inline-block;
18+
display: inline-block;
1919
}
2020

2121
topbar-languageswitch {
22-
float: left;
23-
margin-top: 25px;
24-
margin-left: 10px;
22+
float: left;
23+
margin-top: 25px;
24+
margin-left: 10px;
2525

26-
a {
27-
text-decoration: none;
28-
color: #fff;
29-
}
26+
a {
27+
text-decoration: none;
28+
color: #fff;
29+
30+
&:hover {
31+
text-decoration: none;
32+
color: #fff;
33+
}
34+
}
3035
}

angular/src/shared/layout/topbar.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Component, OnInit, Injector, ViewEncapsulation, ViewChild } from '@angular/core';
22
import { Router } from '@angular/router';
3-
import { LocalizationService } from '@abp/localization/localization.service';
43
import { AbpSessionService } from '@abp/session/abp-session.service';
54
import { AppComponentBase } from '../app-component-base';
65
import { AppAuthService } from '../auth/app-auth.service';

0 commit comments

Comments
 (0)