ver3
This commit is contained in:
@@ -39,11 +39,11 @@ public class Event implements Serializable {
|
||||
@Column(name = "cost", precision = 21, scale = 2)
|
||||
private BigDecimal cost;
|
||||
|
||||
@Lob
|
||||
// @Lob
|
||||
@Column(name = "comment")
|
||||
private String comment;
|
||||
|
||||
@OneToMany(fetch = FetchType.LAZY, mappedBy = "event")
|
||||
@OneToMany(fetch = FetchType.EAGER, mappedBy = "event")
|
||||
@JsonIgnoreProperties(value = { "user", "event" }, allowSetters = true)
|
||||
private Set<Registration> registrations = new HashSet<>();
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public class Registration implements Serializable {
|
||||
@Column(name = "player_name")
|
||||
private String playerName;
|
||||
|
||||
@Lob
|
||||
// @Lob
|
||||
@Column(name = "comment")
|
||||
private String comment;
|
||||
|
||||
|
||||
@@ -35,6 +35,21 @@
|
||||
<span>{{ event.comment }}</span>
|
||||
</dd>
|
||||
</dl>
|
||||
<!-- Dodajemy sekcję dla rejestracji -->
|
||||
<h3>Rejestracje</h3>
|
||||
<ul>
|
||||
<li v-for="registration in event.registrations" :key="registration.id">
|
||||
{{ registration.playerName }}
|
||||
<!-- lub inne pola, które chcesz pokazać -->
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<router-link :to="{ name: 'RegistrationCreateForEvent', params: { eventId: event.id } }" custom v-slot="{ navigate }">
|
||||
<button @click="navigate" class="btn btn-primary">
|
||||
<font-awesome-icon icon="plus"></font-awesome-icon> <span>Dodaj Rejestrację</span>
|
||||
</button>
|
||||
</router-link>
|
||||
|
||||
<button type="submit" @click.prevent="previousState()" class="btn btn-info" data-cy="entityDetailsBackButton">
|
||||
<font-awesome-icon icon="arrow-left"></font-awesome-icon> <span>Back</span>
|
||||
</button>
|
||||
|
||||
@@ -84,11 +84,12 @@
|
||||
<div class="form-group">
|
||||
<label class="form-control-label" for="registration-event">Event</label>
|
||||
<select class="form-control" id="registration-event" data-cy="event" name="event" v-model="registration.event">
|
||||
<option :value="null"></option>
|
||||
<option :value="null">Please select an event</option>
|
||||
<option
|
||||
:value="registration.event && eventOption.id === registration.event.id ? registration.event : eventOption"
|
||||
:value="eventOption.id === eventId ? eventOption : registration.event"
|
||||
v-for="eventOption in events"
|
||||
:key="eventOption.id"
|
||||
:selected="eventOption.id === eventId"
|
||||
>
|
||||
{{ eventOption.name }}
|
||||
</option>
|
||||
|
||||
@@ -76,10 +76,11 @@ export default {
|
||||
meta: { authorities: [Authority.USER] },
|
||||
},
|
||||
{
|
||||
path: 'registration/new',
|
||||
name: 'RegistrationCreate',
|
||||
path: 'registration/new/:eventId?',
|
||||
name: 'RegistrationCreateForEvent',
|
||||
component: RegistrationUpdate,
|
||||
meta: { authorities: [Authority.USER] },
|
||||
props: true,
|
||||
},
|
||||
{
|
||||
path: 'registration/:registrationId/edit',
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import type { IRegistration } from '@/shared/model/registration.model';
|
||||
|
||||
export interface IEvent {
|
||||
id?: number;
|
||||
name?: string;
|
||||
@@ -5,6 +7,7 @@ export interface IEvent {
|
||||
playersLimit?: number | null;
|
||||
cost?: number | null;
|
||||
comment?: string | null;
|
||||
registrations?: IRegistration[];
|
||||
}
|
||||
|
||||
export class Event implements IEvent {
|
||||
@@ -15,5 +18,6 @@ export class Event implements IEvent {
|
||||
public playersLimit?: number | null,
|
||||
public cost?: number | null,
|
||||
public comment?: string | null,
|
||||
public registrations?: IRegistration[],
|
||||
) {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user