-
-
Notifications
You must be signed in to change notification settings - Fork 10
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 #73 from SayakMukhopadhyay/wip
Added Admin Component
- Loading branch information
Showing
29 changed files
with
836 additions
and
26 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,6 +1,6 @@ | ||
{ | ||
"name": "elitebgs", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"license": "Apache-2.0", | ||
"scripts": { | ||
"ng": "ng", | ||
|
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { RouterModule, Routes } from '@angular/router'; | ||
import { AdminComponent } from './admin.component'; | ||
import { AdminOverviewComponent } from './overview/admin-overview.component'; | ||
import { AdminUsersListComponent } from './users/admin-users-list.component'; | ||
import { AdminUsersViewComponent } from './users/admin-users-view.component'; | ||
import { AdminSystemsComponent } from './systems/admin-systems.component'; | ||
import { AdminFactionsComponent } from './factions/admin-factions.component'; | ||
|
||
const adminRoutes: Routes = [ | ||
{ | ||
path: 'admin', | ||
component: AdminComponent, | ||
children: [ | ||
{ | ||
path: '', | ||
component: AdminOverviewComponent | ||
}, | ||
{ | ||
path: 'users', | ||
component: AdminUsersListComponent | ||
}, | ||
{ | ||
path: 'users/:userid', | ||
component: AdminUsersViewComponent | ||
}, | ||
{ | ||
path: 'systems', | ||
component: AdminSystemsComponent | ||
}, | ||
{ | ||
path: 'factions', | ||
component: AdminFactionsComponent | ||
} | ||
] | ||
} | ||
]; | ||
|
||
@NgModule({ | ||
imports: [ | ||
RouterModule.forChild(adminRoutes) | ||
], | ||
exports: [ | ||
RouterModule | ||
] | ||
}) | ||
export class AdminRoutingModule { } |
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,17 @@ | ||
<nav class="subnav"> | ||
<ul class="nav"> | ||
<li class="nav-item"> | ||
<button routerLink="/admin" routerLinkActive="active" [routerLinkActiveOptions]="{ exact: true }" class="btn btn-link nav-link nav-item">Overview</button> | ||
</li> | ||
<li class="nav-item"> | ||
<button routerLink="/admin/users" routerLinkActive="active" class="btn btn-link nav-link nav-item">Users</button> | ||
</li> | ||
<li class="nav-item"> | ||
<button routerLink="/admin/systems" routerLinkActive="active" class="btn btn-link nav-link nav-item">Systems</button> | ||
</li> | ||
<li class="nav-item"> | ||
<button routerLink="/admin/factions" routerLinkActive="active" class="btn btn-link nav-link nav-item">Factions</button> | ||
</li> | ||
</ul> | ||
</nav> | ||
<router-outlet></router-outlet> |
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,22 @@ | ||
.profile-header { | ||
height: 200px; | ||
flex: 0 0 auto; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: space-evenly; | ||
width: 100%; | ||
background-image: url('/assets/profile-background.png'); | ||
} | ||
|
||
.profile-image { | ||
align-self: center; | ||
} | ||
|
||
.profile-image img { | ||
border-radius: 50%; | ||
} | ||
|
||
.profile-name { | ||
align-self: center; | ||
color: #ffffff; | ||
} |
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,11 @@ | ||
import { Component, HostBinding } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-admin', | ||
templateUrl: './admin.component.html', | ||
styleUrls: ['./admin.component.scss'] | ||
}) | ||
export class AdminComponent { | ||
@HostBinding('class.u-main-container') mainContainer = true; | ||
constructor() { } | ||
} |
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,32 @@ | ||
import { CommonModule } from '@angular/common'; | ||
import { NgModule } from '@angular/core'; | ||
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; | ||
import { ClarityModule } from 'clarity-angular'; | ||
|
||
import { AdminComponent } from './admin.component'; | ||
import { AdminOverviewComponent } from './overview/admin-overview.component'; | ||
import { AdminUsersListComponent } from './users/admin-users-list.component'; | ||
import { AdminUsersViewComponent } from './users/admin-users-view.component'; | ||
import { AdminSystemsComponent } from './systems/admin-systems.component'; | ||
import { AdminFactionsComponent } from './factions/admin-factions.component'; | ||
import { AdminRoutingModule } from './admin-routing.module'; | ||
@NgModule({ | ||
declarations: [ | ||
AdminComponent, | ||
AdminOverviewComponent, | ||
AdminUsersListComponent, | ||
AdminUsersViewComponent, | ||
AdminSystemsComponent, | ||
AdminFactionsComponent | ||
], | ||
imports: [ | ||
CommonModule, | ||
FormsModule, | ||
ReactiveFormsModule, | ||
ClarityModule.forRoot(), | ||
AdminRoutingModule | ||
], | ||
providers: [], | ||
exports: [AdminComponent] | ||
}) | ||
export class AdminModule { } |
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,3 @@ | ||
<div class="content-area"> | ||
<h1>Factions</h1> | ||
</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,10 @@ | ||
import { Component, HostBinding } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'app-admin-factions', | ||
templateUrl: './admin-factions.component.html' | ||
}) | ||
export class AdminFactionsComponent { | ||
@HostBinding('class.content-container') contentContainer = true; | ||
constructor() { } | ||
} |
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,32 @@ | ||
<div class="content-area"> | ||
<h1>Overview</h1> | ||
<div class="card"> | ||
<div class="card-header"> | ||
User Overview | ||
</div> | ||
<div class="card-block"> | ||
<div class="card-title"> | ||
User Stats | ||
</div> | ||
<div class="card-text"> | ||
Total Number of Users: {{userCount}} | ||
<br> Latest User: {{latestUser}} | ||
</div> | ||
</div> | ||
<div class="card-block"> | ||
<div class="card-title"> | ||
Users with Edit Access to Factions | ||
</div> | ||
<div class="card-text"> | ||
<clr-tree-node *ngFor="let user of userEditFaction"> | ||
<a routerLink="/admin/users/{{user.id}}">{{user.username}}</a> | ||
<ng-template clrIfExpanded> | ||
<clr-tree-node *ngFor="let faction of user.editable_factions"> | ||
{{faction.name}} | ||
</clr-tree-node> | ||
</ng-template> | ||
</clr-tree-node> | ||
</div> | ||
</div> | ||
</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,24 @@ | ||
import { Component, HostBinding, OnInit } from '@angular/core'; | ||
import { ServerService } from '../../services/server.service'; | ||
import { EBGSUser } from '../../typings'; | ||
|
||
@Component({ | ||
selector: 'app-admin-overview', | ||
templateUrl: './admin-overview.component.html' | ||
}) | ||
export class AdminOverviewComponent implements OnInit { | ||
@HostBinding('class.content-container') contentContainer = true; | ||
userCount: number; | ||
latestUser: string; | ||
userEditFaction: EBGSUser | ||
constructor( | ||
private serverService: ServerService, | ||
) { | ||
this.userCount = 0; | ||
this.latestUser = ''; | ||
} | ||
|
||
ngOnInit() { | ||
|
||
} | ||
} |
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,3 @@ | ||
<div class="content-area"> | ||
<h1>Systems</h1> | ||
</div> |
Oops, something went wrong.