css generalized 'tile' (BulkList)

This commit is contained in:
Patrick Haßel 2024-09-11 14:04:27 +02:00
parent 8915d9a8d4
commit 073c42002a
11 changed files with 78 additions and 72 deletions

View File

@ -1,12 +1,9 @@
<ng-container *ngIf="bulk"> <ng-container *ngIf="bulk">
<h1> <h1>
<app-text [initial]="bulk.name" (valueChange)="set(bulk, 'name', $event)"></app-text> <app-text [initial]="bulk.name" (valueChange)="set(bulk, 'name', $event)"></app-text>
</h1> </h1>
<p>
<button (click)="create()">+ Hinzufügen</button>
</p>
<table> <table>
<tr> <tr>
<th>Eigenschaft</th> <th>Eigenschaft</th>
@ -56,4 +53,6 @@
</ng-container> </ng-container>
</table> </table>
<button (click)="create()">+ Hinzufügen</button>
</ng-container> </ng-container>

View File

@ -0,0 +1,3 @@
table {
width: 100%;
}

View File

@ -1,37 +1,32 @@
<p> <div class="tiles">
<button (click)="create()">+ Hinzufügen</button> <div class="tile" *ngFor="let bulk of bulks.sort(Bulk.compareName); trackBy: Bulk.trackBy">
</p> <div class="tileHead disabledBack" [class.enabledBack]="bulk.enabled">
<table> <div (click)="set(bulk, 'enabled', !bulk.enabled)">
<tr>
<th>&nbsp;</th>
<th>Bezeichnung</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
</tr>
<tr *ngFor="let bulk of bulks.sort(Bulk.compareName); trackBy: Bulk.trackBy">
<td class="boolean" (click)="set(bulk, 'enabled', !bulk.enabled)" [class.true]="bulk.enabled" [class.false]="!bulk.enabled">
<fa-icon *ngIf="bulk.enabled" [icon]="faCheckCircle"></fa-icon> <fa-icon *ngIf="bulk.enabled" [icon]="faCheckCircle"></fa-icon>
<fa-icon *ngIf="!bulk.enabled" [icon]="faCircle"></fa-icon> <fa-icon *ngIf="!bulk.enabled" [icon]="faCircle"></fa-icon>
</td> </div>
<td [routerLink]="['/Bulk', {id: bulk.id}]"> <div class="flexGrow" [routerLink]="['/Bulk', {id: bulk.id}]">
{{bulk.name}} {{ bulk.name }}
</td> </div>
<td class="run" (click)="run(bulk)"> <div class="tileHeadRight" (click)="run(bulk)">
<fa-icon title="Ausführen" [icon]="faPlay"></fa-icon> <fa-icon title="Ausführen" [icon]="faPlay"></fa-icon>
</td> </div>
<td class="duplicate" (click)="duplicate(bulk)"> <div class="tileHeadRight" (click)="duplicate(bulk)">
<fa-icon title="Duplizieren" [icon]="faCopy"></fa-icon> <fa-icon title="Duplizieren" [icon]="faCopy"></fa-icon>
</td> </div>
<td class="delete" (click)="delete(bulk)"> <div class="tileHeadDelete" (click)="delete(bulk)">
<fa-icon title="Löschen" [icon]="faTimes"></fa-icon> <fa-icon title="Löschen" [icon]="faTimes"></fa-icon>
</td> </div>
</tr> </div>
</table> </div>
</div>
<div class="config">
<button (click)="create()">+ Hinzufügen</button>
</div>

View File

@ -0,0 +1,3 @@
table {
width: 100%;
}

View File

@ -1,12 +1,8 @@
<div class="config">
<button (click)="create()">+ Hinzufügen</button>
</div>
<ng-container *ngFor="let device of devices; trackBy: Device.trackBy"> <ng-container *ngFor="let device of devices; trackBy: Device.trackBy">
<ng-container [ngSwitch]="device.type"> <ng-container [ngSwitch]="device.type">
<div class="device" *ngSwitchCase="'DeviceSwitch'" [ngClass]="getSwitchClassList(device)"> <div class="device" *ngSwitchCase="'DeviceSwitch'" [ngClass]="getSwitchClassList(device)">
<div class="title"> <div class="tileHeadTitle">
<app-text [initial]="device.title" (valueChange)="set(device, 'title', $event)"></app-text> <app-text [initial]="device.title" (valueChange)="set(device, 'title', $event)"></app-text>
</div> </div>
<div class="edit" [routerLink]="['/Device', {id: device.id}]"> <div class="edit" [routerLink]="['/Device', {id: device.id}]">
@ -19,7 +15,7 @@
</div> </div>
<div class="device" *ngSwitchCase="'DeviceStateScene'" [ngClass]="getStateSceneClassList(device)"> <div class="device" *ngSwitchCase="'DeviceStateScene'" [ngClass]="getStateSceneClassList(device)">
<div class="title"> <div class="tileHeadTitle">
<app-text [initial]="device.title" (valueChange)="set(device, 'title', $event)"></app-text> <app-text [initial]="device.title" (valueChange)="set(device, 'title', $event)"></app-text>
</div> </div>
<div class="edit" [routerLink]="['/Device', {id: device.id}]"> <div class="edit" [routerLink]="['/Device', {id: device.id}]">
@ -33,7 +29,7 @@
</div> </div>
<div class="device" *ngSwitchCase="'DeviceShutter'" [ngClass]="getShutterClassList(device)"> <div class="device" *ngSwitchCase="'DeviceShutter'" [ngClass]="getShutterClassList(device)">
<div class="title"> <div class="tileHeadTitle">
<app-text [initial]="device.title" (valueChange)="set(device, 'title', $event)"></app-text> <app-text [initial]="device.title" (valueChange)="set(device, 'title', $event)"></app-text>
</div> </div>
<div class="edit" [routerLink]="['/Device', {id: device.id}]"> <div class="edit" [routerLink]="['/Device', {id: device.id}]">
@ -75,3 +71,7 @@
</ng-container> </ng-container>
</ng-container> </ng-container>
<div class="config">
<button (click)="create()">+ Hinzufügen</button>
</div>

View File

@ -9,7 +9,7 @@
margin-right: 5px; margin-right: 5px;
} }
.title { .tileHeadTitle {
float: left; float: left;
font-weight: bold; font-weight: bold;
} }

View File

@ -13,7 +13,7 @@
<fa-icon *ngIf="entry.enabled" [icon]="faCheckCircle"></fa-icon> <fa-icon *ngIf="entry.enabled" [icon]="faCheckCircle"></fa-icon>
<fa-icon *ngIf="!entry.enabled" [icon]="faCircle"></fa-icon> <fa-icon *ngIf="!entry.enabled" [icon]="faCircle"></fa-icon>
</div> </div>
<div class="title"> <div class="tileHeadTitle">
<select [ngModel]="entry.bulk?.id" (ngModelChange)="entryService.set(entry, 'bulk', $event)"> <select [ngModel]="entry.bulk?.id" (ngModelChange)="entryService.set(entry, 'bulk', $event)">
<option [ngValue]="null">-</option> <option [ngValue]="null">-</option>
<option [ngValue]="bulk.id" *ngFor="let bulk of bulks.sort(Bulk.compareName)">{{ bulk.name }}</option> <option [ngValue]="bulk.id" *ngFor="let bulk of bulks.sort(Bulk.compareName)">{{ bulk.name }}</option>
@ -61,7 +61,7 @@
</div> </div>
<div class="tileBodyFlex" *ngIf="entry.type === 'TIME'"> <div class="tileBodyFlex" *ngIf="entry.type === 'TIME'">
<div class="flexFull time"> <div class="flexGrow time">
<button class="buttonPlus" (click)="dayMinuteAdd(entry, +60)">+</button> <button class="buttonPlus" (click)="dayMinuteAdd(entry, +60)">+</button>
<button class="buttonMinus" (click)="dayMinuteAdd(entry, -60)">-</button> <button class="buttonMinus" (click)="dayMinuteAdd(entry, -60)">-</button>
<input type="time" [ngModel]="entry.time" (ngModelChange)="timeFromString(entry, $event)"> <input type="time" [ngModel]="entry.time" (ngModelChange)="timeFromString(entry, $event)">
@ -71,7 +71,7 @@
</div> </div>
<div class="tileBodyFlex" *ngIf="entry.type === 'SUNRISE' || entry.type === 'SUNSET'"> <div class="tileBodyFlex" *ngIf="entry.type === 'SUNRISE' || entry.type === 'SUNSET'">
<div class="flexFull sun"> <div class="flexGrow sun">
<div *ngFor="let zenith of getZenithEntries(entry.type); trackBy: trackByZenith"> <div *ngFor="let zenith of getZenithEntries(entry.type); trackBy: trackByZenith">
<app-bool [label]="zenith.title" [value]="entry.zenith === zenith.value" (onChange)="entryService.set(entry, 'zenith', zenith.value)"></app-bool> <app-bool [label]="zenith.title" [value]="entry.zenith === zenith.value" (onChange)="entryService.set(entry, 'zenith', zenith.value)"></app-bool>
</div> </div>
@ -101,13 +101,13 @@
</div> </div>
<div class="tileBodyFlex"> <div class="tileBodyFlex">
<div class="flexFull timestamp" [class.skipFont]="entry.skip" *ngIf="entry.executable"> <div class="flexGrow timestamp" [class.skipFont]="entry.skip" *ngIf="entry.executable">
{{ timeService.relativeDate(entry.nextFuzzyTimestamp) }} {{ timeService.relativeDate(entry.nextFuzzyTimestamp) }}
<span [class.fuzzyFont]="entry.fuzzySeconds" *ngIf="entry.fuzzySeconds"> <span [class.fuzzyFont]="entry.fuzzySeconds" *ngIf="entry.fuzzySeconds">
(eig: {{ entry.nextClearTimestamp.date | date:'HH:mm' }}) (eig: {{ entry.nextClearTimestamp.date | date:'HH:mm' }})
</span> </span>
</div> </div>
<div class="flexFull inactive" *ngIf="entry.todo"> <div class="flexGrow inactive" *ngIf="entry.todo">
{{ entry.todo }} {{ entry.todo }}
</div> </div>
</div> </div>

View File

@ -9,15 +9,15 @@
<fa-icon *ngIf="!schedule.enabled" [icon]="faCircle"></fa-icon> <fa-icon *ngIf="!schedule.enabled" [icon]="faCircle"></fa-icon>
</div> </div>
<div class="title" [routerLink]="['/Schedule', {id: schedule.id}]"> <div class="tileHeadTitle" [routerLink]="['/Schedule', {id: schedule.id}]">
{{ schedule.title }} {{ schedule.title }}
</div> </div>
<div class="skip" (click)="skip(schedule.next)" *ngIf="schedule.next"> <div class="tileHeadRight" (click)="skip(schedule.next)" *ngIf="schedule.next">
<img class="icon" src="assets/skip.svg" [alt]="'Über.'">{{ schedule.next?.skip }} <img class="icon" src="assets/skip.svg" [alt]="'Über.'">{{ schedule.next?.skip }}
</div> </div>
<div class="delete" (click)="delete(schedule)"> <div class="tileHeadRight" (click)="delete(schedule)">
<fa-icon title="Löschen" [icon]="faTimes"></fa-icon> <fa-icon title="Löschen" [icon]="faTimes"></fa-icon>
</div> </div>
@ -48,4 +48,6 @@
</div> </div>
<button (click)="create()">+ Hinzufügen</button> <div class="config">
<button (click)="create()">+ Hinzufügen</button>
</div>

View File

@ -1,13 +1,5 @@
@import "../../../../config"; @import "../../../../config";
.skip {
float: right !important;
}
.delete {
float: right !important;
}
.last { .last {
color: gray; color: gray;
font-size: 60%; font-size: 60%;

View File

@ -151,7 +151,11 @@ table.vertical {
.config { .config {
clear: both; clear: both;
margin-bottom: 5px; margin: 0 @margin @margin;
@media (min-width: 1001px) {
width: 400px;
}
} }
.buttonPlus { .buttonPlus {

View File

@ -23,10 +23,19 @@
padding: @padding; padding: @padding;
} }
.title { .tileHeadTitle {
flex-grow: 1; flex-grow: 1;
} }
.tileHeadRight {
float: right;
}
.tileHeadDelete {
float: right;
color: darkred;
}
} }
.tileBody { .tileBody {
@ -46,6 +55,10 @@
} }
.flexGrow {
flex-grow: 1;
}
.flexHalf { .flexHalf {
width: 50%; width: 50%;
} }
@ -59,11 +72,6 @@
.flexIconInput { .flexIconInput {
float: left; float: left;
width: calc(100% - 1.5em); width: calc(100% - 1.5em);
text-align: center;
}
.flexFull {
width: 100%;
} }
} }