customer design improvement
This commit is contained in:
parent
bf15b3b77c
commit
166eb5b7dd
@ -25,12 +25,21 @@
|
||||
<div class="col-lg-3 col-sm-12 app-font-weight-bold"><span class="title">Terem</span></div>
|
||||
<div class="col-lg-9 col-sm-12"><span>{{registration.event?.room?.name }}</span></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-sm-12 app-font-weight-bold"><span class="title">Státusz</span></div>
|
||||
<div class="col-lg-9 col-sm-12">
|
||||
<span *ngIf="registration.deleted_at">{{ "Lemondva" }}</span>
|
||||
<span *ngIf="registration.deleted_at == null">{{ "Aktív" }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-9 col-sm-12 pt-2">
|
||||
<a *ngIf="mayCancel(registration)" class="btn btn-primary d-lg-none w-100" (click)="cancel(registration)">Lemondás</a>
|
||||
<a *ngIf="mayCancel(registration)" class="btn btn-primary d-none d-lg-inline-block" (click)="cancel(registration)">Lemondás</a>
|
||||
<a class="btn btn-dark d-lg-none w-100 mt-2" (click)="goBack( )">Vissza</a>
|
||||
<a class="btn btn-dark d-none d-lg-inline-block ms-2 " (click)="goBack( )">Vissza</a>
|
||||
<a class="btn btn-dark d-none d-lg-inline-block "
|
||||
[class.ms-2]="registration.deleted_at == null"
|
||||
(click)="goBack( )">Vissza</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import {Event, EventService, Registration} from "../../services/event.service";
|
||||
import {Observable} from "rxjs";
|
||||
import { EventService, Registration} from "../../services/event.service";
|
||||
import {ActivatedRoute, Router} from "@angular/router";
|
||||
import {tap} from "rxjs/operators";
|
||||
import {NavigationService} from "../../services/navigation.service";
|
||||
@ -23,11 +22,6 @@ export class RegistrationComponent implements OnInit {
|
||||
this.activeRoute.params.subscribe( value => {
|
||||
console.info("map: ", this.activeRoute.snapshot.paramMap);
|
||||
let registration = this.eventService.findRegistration(+this.activeRoute.snapshot.paramMap.get('idRegistration'));
|
||||
registration = registration.pipe(
|
||||
tap(x => {
|
||||
console.info("reg",x);
|
||||
})
|
||||
);
|
||||
|
||||
registration.subscribe(
|
||||
value1 => {
|
||||
@ -50,10 +44,10 @@ export class RegistrationComponent implements OnInit {
|
||||
}
|
||||
|
||||
mayCancel(registration: Registration) {
|
||||
return true;
|
||||
return registration.deleted_at == null;
|
||||
}
|
||||
|
||||
goBack() {
|
||||
this.navigationService.navigateToHome();
|
||||
this.navigationService.navigateRegistrations();
|
||||
}
|
||||
}
|
||||
|
||||
@ -104,6 +104,7 @@ export interface EventsAvailableResponse {
|
||||
export interface Registration {
|
||||
id: number;
|
||||
created_at: number;
|
||||
deleted_at: number;
|
||||
event?: Event
|
||||
}
|
||||
|
||||
|
||||
@ -74,11 +74,11 @@ class EventRegistrationController extends CustomerApiController
|
||||
* @throws Throwable
|
||||
* @return Response
|
||||
*/
|
||||
public function actionCancel($idRegistraton) {
|
||||
$manager = new EventRegistrationManager();
|
||||
$registration = $manager->loadRegistration($idRegistraton);
|
||||
public function actionCancel($idRegistration) {
|
||||
$manager = new \common\manager\EventRegistrationManager();
|
||||
$registration = $manager->loadRegistration($idRegistration);
|
||||
$manager->deleteRegistration($registration);
|
||||
$registration = $manager->loadRegistration($idRegistraton);
|
||||
$registration = $manager->loadRegistration($idRegistration);
|
||||
return $this->asJson($registration);
|
||||
}
|
||||
|
||||
|
||||
@ -17,6 +17,7 @@ class EventRegistrationAvailable extends EventRegistration
|
||||
"id" => "id",
|
||||
"created_at" => "created_at",
|
||||
"updated_at" => "updated_at",
|
||||
"deleted_at" => "deleted_at",
|
||||
];
|
||||
$fields['event'] = 'event';
|
||||
return $fields;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user