Added dedicated transport

Added mobile support for unit-army detail view
This commit is contained in:
mitch 2022-03-13 10:11:43 -04:00
parent 0e9e145715
commit a154b220eb
10 changed files with 366 additions and 192 deletions

View File

@ -6,6 +6,7 @@ public enum UnitKeywordEnum {
ELITE("Elite"), ELITE("Elite"),
FASTATTACK("Fast Attack"), FASTATTACK("Fast Attack"),
HEAVYSUPPORT("Heavy Support"), HEAVYSUPPORT("Heavy Support"),
DEDICATEDTRANSPORT("Dedicated Transport"),
FORTIFICATION("Fortification"), FORTIFICATION("Fortification"),
FLYER("Flyer"); FLYER("Flyer");

View File

@ -20,6 +20,9 @@ import {ArmyDetailComponent} from "./army-detail.component";
ArmyDetailDesktopComponent, ArmyDetailDesktopComponent,
ArmyUpdateComponent, ArmyUpdateComponent,
ArmyDeleteDialogComponent], ArmyDeleteDialogComponent],
exports: [
ArmyDetailDesktopComponent
],
entryComponents: [ArmyDeleteDialogComponent] entryComponents: [ArmyDeleteDialogComponent]
}) })
export class CrusadetrackerArmyModule {} export class CrusadetrackerArmyModule {}

View File

@ -0,0 +1,23 @@
import {Component} from "@angular/core";
import {UnitArmyDetailComponent} from "./unit-army-detail.component";
import {JhiDataUtils, JhiEventManager} from "ng-jhipster";
import {ActivatedRoute} from "@angular/router";
import {UnitArmyService} from "./unit-army.service";
import {ArmyService} from "../army/army.service";
import {FormBuilder} from "@angular/forms";
@Component({
selector: 'jhi-unit-army-detail-desktop',
templateUrl: './unit-army-detail.component-desktop.html'
})
export class UnitArmyDetailDesktopComponent extends UnitArmyDetailComponent {
constructor(protected dataUtils: JhiDataUtils,
protected activatedRoute: ActivatedRoute,
protected eventManager: JhiEventManager,
protected unitArmyService: UnitArmyService,
protected armyService: ArmyService,
protected fb: FormBuilder) {
// super(dataUtils, activatedRoute);
super(dataUtils, activatedRoute, eventManager, unitArmyService, armyService, fb);
}
}

View File

@ -0,0 +1,24 @@
import {Component} from "@angular/core";
import {UnitArmyDetailComponent} from "./unit-army-detail.component";
import {JhiDataUtils, JhiEventManager} from "ng-jhipster";
import {ActivatedRoute} from "@angular/router";
import {UnitArmyService} from "./unit-army.service";
import {ArmyService} from "../army/army.service";
import {FormBuilder} from "@angular/forms";
import {EventManager} from "@angular/platform-browser";
@Component({
selector: 'jhi-unit-army-detail-mobile',
templateUrl: './unit-army-detail.component-mobile.html'
})
export class UnitArmyDetailMobileComponent extends UnitArmyDetailComponent {
constructor(protected dataUtils: JhiDataUtils,
protected activatedRoute: ActivatedRoute,
protected eventManager: JhiEventManager,
protected unitArmyService: UnitArmyService,
protected armyService: ArmyService,
protected fb: FormBuilder) {
// super(dataUtils, activatedRoute);
super(dataUtils, activatedRoute, eventManager, unitArmyService, armyService, fb);
}
}

View File

@ -0,0 +1,147 @@
<div *ngIf="unitArmy">
<div class="row justify-content-center">
<div class="col-10" align="center">
<div *ngIf="unitArmy.army">
<h2><a [routerLink]="['/army', unitArmy.army.id, 'view']">{{ unitArmy.army.armyName }}</a> {{ unitArmy.unitName }}</h2>
</div>
<jhi-alert-error></jhi-alert-error>
</div>
</div>
<div class="unit">
<div class="row">
<div class="col-md-3">
UNIT NAME:
</div>
<div class="col-md-6">
<span>{{ unitArmy.unitName }}</span>
</div>
</div>
<div class="row">
<div class="col-md-3">
BATTLEFIELD ROLE:
</div>
<div class="col-md-6">
{{unitArmy.battlefieldRole}}
</div>
</div>
<div class="row">
<div class="col-md-3">
CRUSADE FACTION:
</div>
<div class="col-md-6">
{{unitArmy.army}}
</div>
</div>
</div>
<div class="unit" padding-top="20px">
<div class="row">
<div class="col-md-3">
UNIT TYPE:
</div>
<div class="col-md-6">
<span>{{unitArmy.unitBookName}}</span>
</div>
</div>
<div class="row">
<div class="col-md-3">
EQUIPMENT:
</div>
<div class="col-md-6">
<span>{{ unitArmy.equipment }}</span>
</div>
</div>
<div class="row">
<div class="col-md-3">
PSYCHIC POWERS:
</div>
<div class="col-md-6">
<span>{{ unitArmy.psychicPowersTaken }}</span>
</div>
</div>
<div class="row">
<div class="col-md-3">
WARLORD TRAITS:
</div>
<div class="col-md-6">
<span>{{ unitArmy.warlordTraits }}</span>
</div>
</div>
<div class="row">
<div class="col-md-3">
RELICS:
</div>
<div class="col-md-6">
<span>{{ unitArmy.relics }}</span>
</div>
</div>
</div>
<p> Entries below should remain blank when the unit is first added to your Order of Battle. Fill these entries out as you play with the unit and when it has earned any Battle Honours or Battle Scars.</p>
<div class="unit-header" align="center">
COMBAT TALLIES
</div>
<div class="row">
<div class="col-md-2">
<strong>BATTLES PLAYED:</strong>
</div>
<div class="col-3">
<span>{{ unitArmy.battlesPlayed }}</span>
</div>
<div class="col-md-2">
<strong>BATTLES SURVIVED:</strong>
</div>
<div class="col-3">
<span>{{ unitArmy.battlesSurvived }}</span>
</div>
</div>
<div class="unit">
<div class="row">
<div class="col-md-2" style="border: 1px solid black"></div>
<div class="col-md-4" style="border: 1px solid black">
<strong>...During this battle:</strong>
</div>
<div class="col-md-4" style="border: 1px solid black">
<strong>...In total:</strong>
</div>
</div>
<div class="row">
<div class="col-md-2" style="border: 1px solid black">
Enemy units destroyed:
</div>
<div class="col-md-4" style="border: 1px solid black">
<!-- <input type="number" class="form-control" name="enemyUnitsDestroyed"-->
<!-- formControlName="enemyUnitsDestroyed"/>-->
</div>
<div class="col-md-4" style="border: 1px solid black">
{{ unitArmy.enemyUnitsDestroyed }}
</div>
</div>
</div>
<div class="unit-header" align="center" >
RANK
</div>
<div class="unit-information">
<div class="row">
<div class="col-md-5" style="color: #2d2d2d; font-size: 150%; width: 10%">{{ unitArmy.experiencePoints }} Experience Points</div>
<div class="col-md-5" style="color:#ff2b31; font-size: 150%; width: 90%">{{ unitArmy.rank }}</div>
</div>
<div class="row" style="border: 1px solid black" align="center">
Unit background and other information
</div>
<div class="row" style="border: 1px solid black">
<span>{{ unitArmy.unitDescription }}</span>
</div>
<button type="submit"
(click)="previousState()"
class="btn btn-info">
<fa-icon icon="arrow-left"></fa-icon>&nbsp;<span>Back</span>
</button>
<button type="button"
[routerLink]="['/unit-army', unitArmy.id, 'edit']"
class="btn btn-primary">
<fa-icon icon="pencil-alt"></fa-icon>&nbsp;<span>Edit</span>
</button>

View File

@ -0,0 +1,147 @@
<div *ngIf="unitArmy">
<div class="row justify-content-center">
<div class="col-10" align="center">
<div *ngIf="unitArmy.army">
<h2><a [routerLink]="['/army', unitArmy.army.id, 'view']">{{ unitArmy.army.armyName }}</a> {{ unitArmy.unitName }}</h2>
</div>
<jhi-alert-error></jhi-alert-error>
</div>
</div>
<div class="unit">
<div class="row">
<div class="col-md-3">
UNIT NAME:
</div>
<div class="col-md-6">
<span>{{ unitArmy.unitName }}</span>
</div>
</div>
<div class="row">
<div class="col-md-3">
BATTLEFIELD ROLE:
</div>
<div class="col-md-6">
{{unitArmy.battlefieldRole}}
</div>
</div>
<div class="row">
<div class="col-md-3">
CRUSADE FACTION:
</div>
<div class="col-md-6">
{{unitArmy.army}}
</div>
</div>
</div>
<div class="unit" padding-top="20px">
<div class="row">
<div class="col-md-3">
UNIT TYPE:
</div>
<div class="col-md-6">
<span>{{unitArmy.unitBookName}}</span>
</div>
</div>
<div class="row">
<div class="col-md-3">
EQUIPMENT:
</div>
<div class="col-md-6">
<span>{{ unitArmy.equipment }}</span>
</div>
</div>
<div class="row">
<div class="col-md-3">
PSYCHIC POWERS:
</div>
<div class="col-md-6">
<span>{{ unitArmy.psychicPowersTaken }}</span>
</div>
</div>
<div class="row">
<div class="col-md-3">
WARLORD TRAITS:
</div>
<div class="col-md-6">
<span>{{ unitArmy.warlordTraits }}</span>
</div>
</div>
<div class="row">
<div class="col-md-3">
RELICS:
</div>
<div class="col-md-6">
<span>{{ unitArmy.relics }}</span>
</div>
</div>
</div>
<p> Entries below should remain blank when the unit is first added to your Order of Battle. Fill these entries out as you play with the unit and when it has earned any Battle Honours or Battle Scars.</p>
<div class="unit-header" align="center">
COMBAT TALLIES
</div>
<div class="row">
<div class="col-md-2">
<strong>BATTLES PLAYED:</strong>
</div>
<div class="col-3">
<span>{{ unitArmy.battlesPlayed }}</span>
</div>
<div class="col-md-2">
<strong>BATTLES SURVIVED:</strong>
</div>
<div class="col-3">
<span>{{ unitArmy.battlesSurvived }}</span>
</div>
</div>
<div class="unit">
<div class="row">
<div class="col-md-2" style="border: 1px solid black"></div>
<div class="col-md-4" style="border: 1px solid black">
<strong>...During this battle:</strong>
</div>
<div class="col-md-4" style="border: 1px solid black">
<strong>...In total:</strong>
</div>
</div>
<div class="row">
<div class="col-md-2" style="border: 1px solid black">
Enemy units destroyed:
</div>
<div class="col-md-4" style="border: 1px solid black">
<!-- <input type="number" class="form-control" name="enemyUnitsDestroyed"-->
<!-- formControlName="enemyUnitsDestroyed"/>-->
</div>
<div class="col-md-4" style="border: 1px solid black">
{{ unitArmy.enemyUnitsDestroyed }}
</div>
</div>
</div>
<div class="unit-header" align="center" >
RANK
</div>
<div class="unit-information">
<div class="row">
<div class="col-md-5" style="color: #2d2d2d; font-size: 150%; width: 30%">{{ unitArmy.experiencePoints }} EXP</div>
<div class="col-md-5" style="color:#ff2b31; font-size: 150%; width: 90%">{{ unitArmy.rank }}</div>
</div>
<div class="row" style="border: 1px solid black" align="center">
Unit background and other information
</div>
<div class="row" style="border: 1px solid black">
<span>{{ unitArmy.unitDescription }}</span>
</div>
<button type="submit"
(click)="previousState()"
class="btn btn-info">
<fa-icon icon="arrow-left"></fa-icon>&nbsp;<span>Back</span>
</button>
<button type="button"
[routerLink]="['/unit-army', unitArmy.id, 'edit']"
class="btn btn-primary">
<fa-icon icon="pencil-alt"></fa-icon>&nbsp;<span>Edit</span>
</button>

View File

@ -1,191 +1,7 @@
<div *ngIf="unitArmy"> <div class="desktop-container" *ngIf="!isMobileResolution; else mobileContainer">
<div class="row justify-content-center"> <jhi-unit-army-detail-desktop></jhi-unit-army-detail-desktop>
<div class="col-10" align="center"> </div>
<div *ngIf="unitArmy.army">
<h2><a [routerLink]="['/army', unitArmy.army.id, 'view']">{{ unitArmy.army.armyName }}</a> {{ unitArmy.unitName }}</h2>
</div>
<jhi-alert-error></jhi-alert-error>
</div>
</div>
<div class="unit">
<div class="row">
<div class="col-md-3">
UNIT NAME:
</div>
<div class="col-md-6">
<span>{{ unitArmy.unitName }}</span>
</div>
</div>
<div class="row">
<div class="col-md-3">
BATTLEFIELD ROLE:
</div>
<div class="col-md-6">
{{unitArmy.battlefieldRole}}
</div>
</div>
<div class="row">
<div class="col-md-3">
CRUSADE FACTION:
</div>
<div class="col-md-6">
more information
</div>
</div>
<div class="row">
<div class="col-md-3">
SELECTABLE KEYWORDS:
</div>
<div class="col-md-6">
some more information
</div>
</div>
</div>
<div class="unit" padding-top="20px"> <ng-template #mobileContainer>
<div class="row"> <jhi-unit-army-detail-mobile></jhi-unit-army-detail-mobile>
<div class="col-md-3"> </ng-template>
UNIT TYPE:
</div>
<div class="col-md-6">
<span>{{unitArmy.unitBookName}}</span>
</div>
</div>
<div class="row">
<div class="col-md-3">
EQUIPMENT:
</div>
<div class="col-md-6">
<span>{{ unitArmy.equipment }}</span>
</div>
</div>
<div class="row">
<div class="col-md-3">
PSYCHIC POWERS:
</div>
<div class="col-md-6">
<span>{{ unitArmy.psychicPowersTaken }}</span>
</div>
</div>
<div class="row">
<div class="col-md-3">
WARLORD TRAITS:
</div>
<div class="col-md-6">
<span>{{ unitArmy.warlordTraits }}</span>
</div>
</div>
<div class="row">
<div class="col-md-3">
RELICS:
</div>
<div class="col-md-6">
<span>{{ unitArmy.relics }}</span>
</div>
</div>
</div>
<p> Entries below should remain blank when the unit is first added to your Order of Battle. Fill these entries out as you play with the unit and when it has earned any Battle Honours or Battle Scars.</p>
<div class="unit-header" align="center">
COMBAT TALLIES
</div>
<div class="row">
<div class="col-md-2">
<strong>BATTLES PLAYED:</strong>
</div>
<div class="col-3">
<span>{{ unitArmy.battlesPlayed }}</span>
</div>
<div class="col-md-2">
<strong>BATTLES SURVIVED:</strong>
</div>
<div class="col-3">
<span>{{ unitArmy.battlesSurvived }}</span>
</div>
</div>
<div class="unit">
<div class="row">
<div class="col-md-2" style="border: 1px solid black"></div>
<div class="col-md-4" style="border: 1px solid black">
<strong>...During this battle:</strong>
</div>
<div class="col-md-4" style="border: 1px solid black">
<strong>...In total:</strong>
</div>
</div>
<div class="row">
<div class="col-md-2" style="border: 1px solid black">
Enemy units destroyed:
</div>
<div class="col-md-4" style="border: 1px solid black">
<!-- <input type="number" class="form-control" name="enemyUnitsDestroyed"-->
<!-- formControlName="enemyUnitsDestroyed"/>-->
</div>
<div class="col-md-4" style="border: 1px solid black">
{{ unitArmy.enemyUnitsDestroyed }}
</div>
</div>
<div class="row">
<div class="col-md-2" style="border: 1px solid black">
Enemy units destroyed with psychic powers:
</div>
<div class="col-md-4" style="border: 1px solid black">
<!-- <input type="number" class="form-control" name="enemyPsychicDestroyed"-->
<!-- formControlName="enemyPsychicDestroyed"/>-->
</div>
<div class="col-md-4" style="border: 1px solid black">
{{ unitArmy.enemyPsychicDestroyed }}
</div>
</div>
<div class="row">
<div class="col-md-2" style="border: 1px solid black">
Enemy units destroyed with ranged weapons:
</div>
<div class="col-md-4" style="border: 1px solid black">
<!-- <input type="number" class="form-control" name="enemyRangedDestroyed"-->
<!-- formControlName="enemyRangedDestroyed"/>-->
</div>
<div class="col-md-4" style="border: 1px solid black">
{{ unitArmy.enemyRangedDestroyed }}
</div>
</div>
<div class="row">
<div class="col-md-2" style="border: 1px solid black">
Enemy units destroyed with melee weapons:
</div>
<div class="col-md-4" style="border: 1px solid black">
<!-- <input type="number" class="form-control" name="enemyMeleeDestroyed"-->
<!-- formControlName="enemyMeleeDestroyed"/>-->
</div>
<div class="col-md-4" style="border: 1px solid black">
{{ unitArmy.enemyMeleeDestroyed }}
</div>
</div>
</div>
<div class="unit-header" align="center" >
RANK
</div>
<div class="unit-information">
<div class="row">
<div class="col-md-5" style="color: #2d2d2d; font-size: 150%; width: 10%">{{ unitArmy.experiencePoints }} Experience Points</div>
<div class="col-md-5" style="color:#ff2b31; font-size: 150%; width: 90%">{{ unitArmy.rank }}</div>
</div>
<div class="row" style="border: 1px solid black" align="center">
Unit background and other information
</div>
<div class="row" style="border: 1px solid black">
<span>{{ unitArmy.unitDescription }}</span>
</div>
<button type="submit"
(click)="previousState()"
class="btn btn-info">
<fa-icon icon="arrow-left"></fa-icon>&nbsp;<span>Back</span>
</button>
<button type="button"
[routerLink]="['/unit-army', unitArmy.id, 'edit']"
class="btn btn-primary">
<fa-icon icon="pencil-alt"></fa-icon>&nbsp;<span>Edit</span>
</button>

View File

@ -10,6 +10,7 @@ import { AlertError } from '../../shared/alert/alert-error.model';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { HttpResponse } from '@angular/common/http'; import { HttpResponse } from '@angular/common/http';
import { IArmy } from '../../shared/model/army.model'; import { IArmy } from '../../shared/model/army.model';
import {ResponsiveService} from "../../responsive.service";
@Component({ @Component({
selector: 'jhi-unit-army-detail', selector: 'jhi-unit-army-detail',
@ -18,6 +19,8 @@ import { IArmy } from '../../shared/model/army.model';
export class UnitArmyDetailComponent implements OnInit { export class UnitArmyDetailComponent implements OnInit {
unitArmy: IUnitArmy | null = null; unitArmy: IUnitArmy | null = null;
isSaving = false; isSaving = false;
private responsiveService: ResponsiveService = new ResponsiveService();
public isMobileResolution: boolean;
armies: IArmy[] = []; armies: IArmy[] = [];
@ -58,7 +61,9 @@ export class UnitArmyDetailComponent implements OnInit {
protected unitArmyService: UnitArmyService, protected unitArmyService: UnitArmyService,
protected armyService: ArmyService, protected armyService: ArmyService,
protected fb: FormBuilder protected fb: FormBuilder
) {} ) {
this.isMobileResolution = this.responsiveService.getMobileStatus();
}
ngOnInit(): void { ngOnInit(): void {
this.activatedRoute.data.subscribe(({ unitArmy }) => (this.unitArmy = unitArmy)); this.activatedRoute.data.subscribe(({ unitArmy }) => (this.unitArmy = unitArmy));

View File

@ -25,6 +25,7 @@
<option value="Elite">Elite</option> <option value="Elite">Elite</option>
<option value="Fast Attack">Fast Attack</option> <option value="Fast Attack">Fast Attack</option>
<option value="Flyer">Flyer</option> <option value="Flyer">Flyer</option>
<option value="Dedicated Transport">DedicatedTransport</option>
<option value="Superheavy">Superheavy</option> <option value="Superheavy">Superheavy</option>
<option value="Fortification">Fortification</option> <option value="Fortification">Fortification</option>
</select> </select>

View File

@ -7,10 +7,17 @@ import { UnitArmyDetailComponent } from './unit-army-detail.component';
import { UnitArmyUpdateComponent } from './unit-army-update.component'; import { UnitArmyUpdateComponent } from './unit-army-update.component';
import { UnitArmyDeleteDialogComponent } from './unit-army-delete-dialog.component'; import { UnitArmyDeleteDialogComponent } from './unit-army-delete-dialog.component';
import { unitArmyRoute } from './unit-army.route'; import { unitArmyRoute } from './unit-army.route';
import {UnitArmyDetailDesktopComponent} from "./unit-army-detail-desktop.component";
import {UnitArmyDetailMobileComponent} from "./unit-army-detail-mobile.component";
@NgModule({ @NgModule({
imports: [CrusadetrackerSharedModule, RouterModule.forChild(unitArmyRoute)], imports: [CrusadetrackerSharedModule, RouterModule.forChild(unitArmyRoute)],
declarations: [UnitArmyComponent, UnitArmyDetailComponent, UnitArmyUpdateComponent, UnitArmyDeleteDialogComponent], declarations: [UnitArmyComponent,
UnitArmyDetailComponent,
UnitArmyDetailDesktopComponent,
UnitArmyDetailMobileComponent,
UnitArmyUpdateComponent,
UnitArmyDeleteDialogComponent],
entryComponents: [UnitArmyDeleteDialogComponent], entryComponents: [UnitArmyDeleteDialogComponent],
}) })
export class CrusadetrackerUnitArmyModule {} export class CrusadetrackerUnitArmyModule {}