Added tutor list to viewed observations.

This commit is contained in:
neviyn 2018-11-01 13:36:12 +00:00
parent 2666814ef5
commit 9ed2543355
2 changed files with 6 additions and 2 deletions

View File

@ -43,9 +43,11 @@ data class Tutor(
@GeneratedValue(strategy = GenerationType.IDENTITY)
val id: Long = 0,
val name: String,
@JsonIgnore
@ManyToOne(fetch = FetchType.LAZY)
val site: Site
) {
@JsonIgnore
@ManyToMany
@JoinTable(name = "tutor_observations",
joinColumns = [JoinColumn(name = " tutor_id", referencedColumnName = "id")],
@ -91,7 +93,6 @@ data class Observation(
val knowledge: Double?,
@ElementCollection
val entries: List<Entry>,
@JsonIgnore
@ManyToMany(mappedBy = "observations")
val tutors: Set<Tutor>,
@ManyToMany

View File

@ -59,7 +59,10 @@
<p slot="title">{{ observation.date }}<br/>{{ observation.whom }} {{ observation.type }}<br/>{{ observation.observed }}</p>
<h2>{{ observation.date }}, {{ observation.whom }}<br/>{{ observation.type }}, {{ observation.observed }}</h2>
<b-row align-h="center">
<h4><span v-bind:key="index" v-for="(person, index) in observation.persons"><i>{{ person.name }}<span v-if="index+1 < observation.persons.length">,&nbsp;</span></i></span></h4>
<h4>Observed by:&nbsp;<span v-bind:key="index" v-for="(tutor, index) in observation.tutors"><i>{{ tutor.name }}<span v-if="index+1 < observation.tutors.length">,&nbsp;</span></i></span></h4>
</b-row>
<b-row align-h="center">
<h4>Participants:&nbsp;<span v-bind:key="index" v-for="(person, index) in observation.persons"><i>{{ person.name }}<span v-if="index+1 < observation.persons.length">,&nbsp;</span></i></span></h4>
</b-row>
<br />
<b-row class="mb-2">