Add stats list sidebar collapse
parent
b1cd7a9c19
commit
24f6b2a156
|
@ -0,0 +1,21 @@
|
||||||
|
.side-bar {
|
||||||
|
width: 20%;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collapsed {
|
||||||
|
width: 70px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-container {
|
||||||
|
position: relative;
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-container > button {
|
||||||
|
position: fixed;
|
||||||
|
top: calc(100vh - 35px);
|
||||||
|
left: -10px;
|
||||||
|
background: white;
|
||||||
|
border: 1px solid #dadada;
|
||||||
|
}
|
|
@ -5,18 +5,22 @@
|
||||||
</campaign-navigation>
|
</campaign-navigation>
|
||||||
|
|
||||||
<div *ngIf="selectedCampaign._id !== 'all'"
|
<div *ngIf="selectedCampaign._id !== 'all'"
|
||||||
style="width: 20%; float:left;">
|
class="side-bar"
|
||||||
<!--<button mat-icon-button-->
|
[ngClass]="{collapsed: collapsed}">
|
||||||
<!--class="sidebar-toggle-btn"-->
|
|
||||||
<!--(click)="toggleSidebar()"-->
|
|
||||||
<!--<mat-icon svgIcon="chevron-left" *ngIf="sidebarOpen">-->
|
|
||||||
<!--</mat-icon>-->
|
|
||||||
<!--<mat-icon svgIcon="chevron-right" *ngIf="!sidebarOpen">-->
|
|
||||||
<!--</mat-icon>-->
|
|
||||||
<!--</button>-->
|
|
||||||
<war-list
|
<war-list
|
||||||
|
[collapsed]="collapsed"
|
||||||
[campaign]="selectedCampaign">
|
[campaign]="selectedCampaign">
|
||||||
</war-list>
|
</war-list>
|
||||||
|
<div class="button-container">
|
||||||
|
<button mat-icon-button
|
||||||
|
class="sidebar-toggle-btn"
|
||||||
|
(click)="toggleCollapse()">
|
||||||
|
<mat-icon svgIcon="chevron-left" *ngIf="!collapsed">
|
||||||
|
</mat-icon>
|
||||||
|
<mat-icon svgIcon="chevron-right" *ngIf="collapsed">
|
||||||
|
</mat-icon>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<router-outlet></router-outlet>
|
<router-outlet></router-outlet>
|
||||||
|
|
|
@ -14,6 +14,8 @@ export class StatisticComponent implements OnInit {
|
||||||
|
|
||||||
campaigns: Campaign[] = [];
|
campaigns: Campaign[] = [];
|
||||||
|
|
||||||
|
collapsed: boolean = false;
|
||||||
|
|
||||||
constructor(private campaignService: CampaignService,
|
constructor(private campaignService: CampaignService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private route: ActivatedRoute) {
|
private route: ActivatedRoute) {
|
||||||
|
@ -36,4 +38,11 @@ export class StatisticComponent implements OnInit {
|
||||||
}
|
}
|
||||||
this.router.navigate([{outlets: {'right': ['overview', campaign._id]}}], {relativeTo: this.route});
|
this.router.navigate([{outlets: {'right': ['overview', campaign._id]}}], {relativeTo: this.route});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toggleCollapse() {
|
||||||
|
this.collapsed = !this.collapsed;
|
||||||
|
setTimeout(_ => {
|
||||||
|
window.dispatchEvent(new Event('resize'));
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,3 +40,7 @@
|
||||||
.selected div.select-indicator-battle {
|
.selected div.select-indicator-battle {
|
||||||
display: block !important;
|
display: block !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.collapsed {
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
|
@ -1,12 +1,17 @@
|
||||||
<div class='war-item' [ngClass]="{selected : selected}" (click)="select()">
|
<div class='war-item' [ngClass]="{selected : selected}" (click)="select()">
|
||||||
<div class="war-item-box">
|
<div class="war-item-box"
|
||||||
|
[matTooltip]="collapsed ? war.title : ''"
|
||||||
|
matTooltipPosition="right">
|
||||||
<div style="position:relative; z-index:10;">
|
<div style="position:relative; z-index:10;">
|
||||||
<div class="select-indicator-battle"></div>
|
<div class="select-indicator-battle"></div>
|
||||||
</div>
|
</div>
|
||||||
<span class="war-title">
|
<span class="war-title"
|
||||||
|
[ngClass]="{collapsed: collapsed}">
|
||||||
◦ {{war.title}}
|
◦ {{war.title}}
|
||||||
</span>
|
</span>
|
||||||
<div class="war-detail">vom {{war.date | date: 'dd.MM.yyyy'}}</div>
|
<div class="war-detail"
|
||||||
|
[ngClass]="{collapsed: collapsed}">vom {{war.date | date: 'dd.MM.yyyy'}}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="loginService.hasPermission(3)"
|
<div *ngIf="loginService.hasPermission(3)"
|
||||||
|
|
|
@ -10,6 +10,8 @@ import {LoginService} from '../../../services/app-user-service/login-service';
|
||||||
})
|
})
|
||||||
export class WarItemComponent implements OnInit {
|
export class WarItemComponent implements OnInit {
|
||||||
|
|
||||||
|
@Input() collapsed: boolean;
|
||||||
|
|
||||||
@Input() selected: boolean;
|
@Input() selected: boolean;
|
||||||
|
|
||||||
@Input() war: War;
|
@Input() war: War;
|
||||||
|
|
|
@ -14,12 +14,17 @@
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.select-indicator {
|
.select-indicator-container {
|
||||||
display: none;
|
display: none;
|
||||||
|
position: relative;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
.select-indicator {
|
||||||
width: 30px;
|
width: 30px;
|
||||||
height: 30px;
|
height: 30px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: calc(20% - 15px);
|
left: calc(100% + 11px);
|
||||||
background: -moz-linear-gradient(45deg, white 50%, transparent 50%);
|
background: -moz-linear-gradient(45deg, white 50%, transparent 50%);
|
||||||
background: -webkit-linear-gradient(45deg, white 50%, transparent 50%);
|
background: -webkit-linear-gradient(45deg, white 50%, transparent 50%);
|
||||||
background: linear-gradient(45deg, white 50%, transparent 50%);
|
background: linear-gradient(45deg, white 50%, transparent 50%);
|
||||||
|
@ -46,7 +51,7 @@
|
||||||
direction: ltr;
|
direction: ltr;
|
||||||
}
|
}
|
||||||
|
|
||||||
.selected > div.select-indicator {
|
.selected > div.select-indicator-container {
|
||||||
display: block !important;
|
display: block !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +71,7 @@
|
||||||
.fill-vertical-border {
|
.fill-vertical-border {
|
||||||
width: 20%;
|
width: 20%;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
border-right: 1px solid #dadada;
|
border-right: 1px solid #dadada;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,3 +90,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Table Scrollbar END */
|
/* Table Scrollbar END */
|
||||||
|
|
||||||
|
.collapsed {
|
||||||
|
width: 70px;
|
||||||
|
}
|
||||||
|
|
|
@ -10,21 +10,31 @@
|
||||||
|
|
||||||
<div class="list-header"
|
<div class="list-header"
|
||||||
[ngClass]="{selected : selectedWarId == campaign._id}" (click)="selectOverview(campaign._id)">
|
[ngClass]="{selected : selectedWarId == campaign._id}" (click)="selectOverview(campaign._id)">
|
||||||
<div class="select-indicator"></div>
|
<div class="select-indicator-container">
|
||||||
<mat-icon svgIcon="stats-chart"></mat-icon>
|
<div class="select-indicator"></div>
|
||||||
Übersicht
|
</div>
|
||||||
|
<mat-icon [matTooltip]="collapsed ? 'Übersicht' : ''"
|
||||||
|
matTooltipPosition="right"
|
||||||
|
svgIcon="stats-chart"></mat-icon>
|
||||||
|
<span *ngIf="!collapsed">Übersicht</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="list-header"
|
<div class="list-header"
|
||||||
[ngClass]="{selected : selectedWarId == campaign._id + highscore}" (click)="selectHighscore(campaign._id)">
|
[ngClass]="{selected : selectedWarId == campaign._id + highscore}" (click)="selectHighscore(campaign._id)">
|
||||||
<div class="select-indicator"></div>
|
<div class="select-indicator-container">
|
||||||
<mat-icon svgIcon="highscore"></mat-icon>
|
<div class="select-indicator"></div>
|
||||||
Highscore
|
</div>
|
||||||
|
<mat-icon [matTooltip]="collapsed ? 'Highscore' : ''"
|
||||||
|
matTooltipPosition="right"
|
||||||
|
svgIcon="highscore"></mat-icon>
|
||||||
|
<span *ngIf="!collapsed">Highscore</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="list-header" style="cursor: default; border-bottom: 1px solid #f1f1f1;">
|
<div class="list-header" style="cursor: default; border-bottom: 1px solid #f1f1f1;">
|
||||||
<mat-icon svgIcon="battle"></mat-icon>
|
<mat-icon [matTooltip]="collapsed ? 'Schlachten' : ''"
|
||||||
Schlachten
|
matTooltipPosition="right"
|
||||||
|
svgIcon="battle"></mat-icon>
|
||||||
|
<span *ngIf="!collapsed">Schlachten</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="battle-list">
|
<div class="battle-list">
|
||||||
|
@ -34,9 +44,12 @@
|
||||||
(warEdit)="editWar($event)"
|
(warEdit)="editWar($event)"
|
||||||
(warDelete)="deleteWar(war)"
|
(warDelete)="deleteWar(war)"
|
||||||
(warSelected)="selectWar($event)"
|
(warSelected)="selectWar($event)"
|
||||||
|
[collapsed]="collapsed"
|
||||||
[selected]="war._id == selectedWarId">
|
[selected]="war._id == selectedWarId">
|
||||||
</cc-war-item>
|
</cc-war-item>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="fill-vertical-border"></div>
|
<div class="fill-vertical-border"
|
||||||
|
[ngClass]="{collapsed: collapsed}">
|
||||||
|
</div>
|
||||||
|
|
|
@ -15,6 +15,8 @@ export class WarListComponent implements OnInit, OnChanges {
|
||||||
|
|
||||||
@Input() campaign: Campaign;
|
@Input() campaign: Campaign;
|
||||||
|
|
||||||
|
@Input() collapsed: boolean;
|
||||||
|
|
||||||
selectedWarId: string | number;
|
selectedWarId: string | number;
|
||||||
|
|
||||||
campaigns: Campaign[] = [];
|
campaigns: Campaign[] = [];
|
||||||
|
@ -29,7 +31,7 @@ export class WarListComponent implements OnInit, OnChanges {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnChanges(changes: SimpleChanges) {
|
ngOnChanges(changes: SimpleChanges) {
|
||||||
this.selectedWarId = this.campaign._id;
|
if (changes.campaign) this.selectedWarId = this.campaign._id;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
Loading…
Reference in New Issue