fix: various menu fixes
This commit is contained in:
@@ -76,6 +76,9 @@ export class AdminCommService {
|
|||||||
range: (start: Moment, count: number) => {
|
range: (start: Moment, count: number) => {
|
||||||
return this.http.post<Status>(environment.apiEndpoint+`/admin/menu/${start.toISOString()}/${count}/`, null, {withCredentials: true})
|
return this.http.post<Status>(environment.apiEndpoint+`/admin/menu/${start.toISOString()}/${count}/`, null, {withCredentials: true})
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
rm: (id: string) => {
|
||||||
|
return this.http.delete<Status>(environment.apiEndpoint+`/admin/menu/${id}`, {withCredentials: true})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<span>{{element.day.format('DD.MM.YYYY')}}r.</span>
|
<span>{{element.day.format('DD.MM.YYYY')}}r.</span>
|
||||||
<p>{{element.day.format('dddd')}}</p>
|
<p>{{element.day.format('dddd')}}</p>
|
||||||
<app-field-editor category="Nazwa" [(word)]="element.dayTitle" (wordChange)="editTitle(element._id)"/><br><hr>
|
<app-field-editor category="Nazwa" [(word)]="element.dayTitle" (wordChange)="editTitle(element._id)"/><br><hr>
|
||||||
<button>Usuń dzień</button>
|
<button (click)="">Usuń dzień</button>
|
||||||
</td>
|
</td>
|
||||||
</div>
|
</div>
|
||||||
<div matColumnDef="sn">
|
<div matColumnDef="sn">
|
||||||
@@ -80,7 +80,7 @@
|
|||||||
<tr mat-row *matRowDef="let row; columns: dcols"></tr>
|
<tr mat-row *matRowDef="let row; columns: dcols"></tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<ng-component *ngIf="options">
|
<ng-container *ngIf="options">
|
||||||
<datalist id="sn-fancy">
|
<datalist id="sn-fancy">
|
||||||
<option *ngFor="let i of options.sn.fancy">{{i}}</option>
|
<option *ngFor="let i of options.sn.fancy">{{i}}</option>
|
||||||
</datalist>
|
</datalist>
|
||||||
@@ -108,4 +108,4 @@
|
|||||||
<datalist id="kol">
|
<datalist id="kol">
|
||||||
<option *ngFor="let i of options.kol">{{i}}</option>
|
<option *ngFor="let i of options.kol">{{i}}</option>
|
||||||
</datalist>
|
</datalist>
|
||||||
</ng-component>
|
</ng-container>
|
||||||
@@ -124,4 +124,8 @@ export class MenuNewComponent {
|
|||||||
getStat(day: moment.Moment, m: "ob" | "kol") {
|
getStat(day: moment.Moment, m: "ob" | "kol") {
|
||||||
this.ac.menu.stat(day, m).subscribe((s) => this.sb.open(`${s.y} / ${s.y+s.n} = ${((s.y/(s.y+s.n))*100).toFixed(2)}%`, "Zamknij", {duration: 2500}))
|
this.ac.menu.stat(day, m).subscribe((s) => this.sb.open(`${s.y} / ${s.y+s.n} = ${((s.y/(s.y+s.n))*100).toFixed(2)}%`, "Zamknij", {duration: 2500}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
remove(id: string) {
|
||||||
|
this.ac.menu.rm(id).subscribe(this.refreshIfGood)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li *ngFor="let i of ls.defaultItems.sn">{{i}}</li>
|
<li *ngFor="let i of ls.defaultItems.sn">{{i}}</li>
|
||||||
<li *ngFor="let i of getsn.fancy">{{i.charAt(0).toUpperCase()+i.substring(1)}}</li>
|
<li *ngFor="let i of getsn.fancy">{{i.charAt(0).toUpperCase()+i.substring(1)}}</li>
|
||||||
|
<li *ngIf="getsn.second">{{getsn.second.charAt(0).toUpperCase()+getsn.second.substring(1)}}</li>
|
||||||
</ul>
|
</ul>
|
||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
</mat-card>
|
</mat-card>
|
||||||
|
|||||||
Reference in New Issue
Block a user