1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-22 11:52:21 +01:00

(wip) show event reservation users

This commit is contained in:
Du Peng 2023-05-15 18:23:13 +02:00
parent 1b65540257
commit 4d0fe29bcc
3 changed files with 19 additions and 1 deletions

View File

@ -45,6 +45,13 @@ export interface Reservation {
}, },
total_booked_seats?: number, total_booked_seats?: number,
created_at?: TDateISO, created_at?: TDateISO,
booking_users_attributes?: {
id: number,
name: string,
event_price_category_id: number,
booked_id: number,
booked_type: string,
}
} }
export interface ReservationIndexFilter extends ApiFilter { export interface ReservationIndexFilter extends ApiFilter {

View File

@ -29,7 +29,11 @@
<tbody> <tbody>
<tr ng-repeat="reservation in reservations" ng-class="{'disabled': isCancelled(reservation)}"> <tr ng-repeat="reservation in reservations" ng-class="{'disabled': isCancelled(reservation)}">
<td class="text-c"> <td class="text-c">
<a ui-sref="app.logged.members_show({id: reservation.user_id})">{{ reservation.user_full_name }} </a> <a ui-sref="app.logged.members_show({id: reservation.user_id})" ng-if="event.event_type === 'standard'">{{ reservation.user_full_name }} </a>
<div ng-repeat="bu in reservation.booking_users_attributes">
<span ng-if="bu.booked_type !== 'User'">{{bu.name}}</span>
<a ui-sref="app.logged.members_show({id: bu.booked_id})" ng-if="bu.booked_type === 'User'">{{bu.name}}</a>
</div>
</td> </td>
<td>{{ reservation.created_at | amDateFormat:'LL LTS' }}</td> <td>{{ reservation.created_at | amDateFormat:'LL LTS' }}</td>
<td> <td>

View File

@ -32,3 +32,10 @@ json.reservable do
json.id reservation.reservable.id json.id reservation.reservable.id
json.name reservation.reservable.name json.name reservation.reservable.name
end end
json.booking_users_attributes reservation.booking_users.order(booked_type: :desc) do |bu|
json.id bu.id
json.name bu.name
json.event_price_category_id bu.event_price_category_id
json.booked_id bu.booked_id
json.booked_type bu.booked_type
end