feat(display-attendies): display restaurant

This commit is contained in:
nikurasu 2024-03-09 05:06:13 +01:00
parent 84eff374ee
commit 151151e39e
Signed by: Nikurasu
GPG key ID: 9E7F14C03EF1F271
9 changed files with 64 additions and 42 deletions

View file

@ -89,6 +89,16 @@ func GetAttendiesByEventPublicTable(c *fiber.Ctx) error {
"WaitinglistDesc": localizer.MustLocalize(&i18n.LocalizeConfig{
MessageID: "WaitinglistDesc",
}),
"Restaurant": localizer.MustLocalize(&i18n.LocalizeConfig{
MessageID: "Restaurant",
PluralCount: 1,
}),
"Yes": localizer.MustLocalize(&i18n.LocalizeConfig{
MessageID: "Yes",
}),
"No": localizer.MustLocalize(&i18n.LocalizeConfig{
MessageID: "No",
}),
}
sort.Sort(entities.ByRegistrationTime(attendies))
roleSuiter, _ := service.GetRoleByName("Suiter")
@ -106,5 +116,6 @@ func GetAttendiesByEventPublicTable(c *fiber.Ctx) error {
"Attendies": attendies,
"SuiterWaitingList": suiterWaitingList,
"Locals": localizations,
"EventType": *(event).EventType,
})
}

View file

@ -33,4 +33,12 @@ tbody>tr:nth-child(even) {
tbody>tr:nth-child(odd) {
background-color: #e9e9e9;
}
.tdgreen {
background-color: #8bff6e;
}
.tdred {
background-color: #ff6e6e;
}

View file

@ -80,7 +80,6 @@ func GetAttendieListFromPretixJson(pretixEvent entities.Pretix_Event, event enti
func GetAttendiesFromPretixJsonWithRoleQuestion(pretixEvent *entities.Pretix_Event, event *entities.Db_Event) ([]entities.Db_Attendies, error) {
var attendies []entities.Db_Attendies
for _, order := range pretixEvent.Results {
fmt.Println("Here")
if order.Status == "c" || order.Status == "e" {
continue
}

View file

@ -6,6 +6,9 @@
<tr class="tableHeading">
<th>{{ .Locals.Name }}</th>
<th>{{ .Locals.Role }}</th>
{{ if eq .EventType "Suitwalk" }}
<th>{{ .Locals.Restaurant }}</th>
{{ end }}
</tr>
</thead>
<tbody>
@ -23,6 +26,11 @@
{{ else if eq $suiter.Role.Name "Guest" }}
<td>{{ $.Locals.Guest }}</td>
{{ end }}
{{ if $suiter.AttendsRestaurant }}
<td class="tdgreen">✓ {{ $.Locals.Yes }}</td>
{{ else }}
<td class="tdred">❌ {{ $.Locals.No }}</td>
{{ end }}
</tr>
{{end}}
</tbody>
@ -35,6 +43,9 @@
<tr class="tableHeading">
<th>{{ .Locals.Name }}</th>
<th>{{ .Locals.Role }}</th>
{{ if eq .EventType "Suitwalk" }}
<th>Restaurant</th>
{{ end }}
</tr>
</thead>
<tbody>

View file

@ -76,4 +76,17 @@ var defaultMessages = []i18n.Message{
One: "#SpecialAnimal",
Other: "#SpecialAnimals",
},
{
ID: "Restaurant",
One: "Restaurant",
Other: "Restaurantes",
},
{
ID: "Yes",
Other: "Yes",
},
{
ID: "No",
Other: "No",
},
}

View file

@ -18,6 +18,10 @@
"one": "Name",
"other": "Namen"
},
"No": {
"hash": "sha1-816c52fd2bdd94a63cd0944823a6c0aa9384c103",
"other": "Nein"
},
"Photographer": {
"hash": "sha1-dc41992cfe878fe6744f94c3a3fc5843d9f1bc11",
"one": "Pfotograph*in",
@ -27,6 +31,11 @@
"hash": "sha1-a844fcf834e7d026e7936e042c0ce2777b7fb4d9",
"other": "Angemeldet"
},
"Restaurant": {
"hash": "sha1-2b8fd2cb645ab1f1b09fbecda98978ec3518a9d9",
"one": "Restaurant",
"other": "Restaurnts"
},
"Role": {
"hash": "sha1-47dcc27d6e87ece8baebe7e3877a261a5467093d",
"one": "Rolle",
@ -52,7 +61,11 @@
"other": "Suiter Warteliste"
},
"WaitinglistDesc": {
"hash": "sha1-aadc433a212fca8d927e9134520f5a10aa7e4263",
"hash": "sha1-295479637ef85418e233d16735fdba609595dee7",
"other": "Wir setzen für jedes Event ein Verhältnis von Suitern pro Spotter fest, damit die Spotter auch noch alle versorgen können. Falls du hier gelistet bist, haben sich noch nicht genügend Spotter angemeldet."
},
"Yes": {
"hash": "sha1-5397e0583f14f6c88de06b1ef28f460a1fb5b0ae",
"other": "Ja"
}
}

View file

@ -12,11 +12,16 @@
"one": "Name",
"other": "Names"
},
"No": "No",
"Photographer": {
"one": "Photographer",
"other": "Photographers"
},
"Registered": "Registered",
"Restaurant": {
"one": "Restaurant",
"other": "Restaurnts"
},
"Role": {
"one": "Role",
"other": "Roles"
@ -34,5 +39,6 @@
"other": "Suiters"
},
"SuiterWaitinglist": "Suiter Watinglist",
"WaitinglistDesc": "We set a ratio of Suiters per Spotter for each event in order to keep the count of suiters manageble for them. If you are listed here we don't have enough spotters yet."
"WaitinglistDesc": "We set a ratio of Suiters per Spotter for each event in order to keep the count of suiters manageble for them. If you are listed here we don't have enough spotters yet.",
"Yes": "Yes"
}

View file

@ -1,21 +0,0 @@
{
"Attendie": {
"hash": "sha1-4c29d6c952ccd2b114d1792c7b18fa7f7052ebed",
"one": "Attendie",
"other": "Attendies"
},
"HelloWorld": {
"hash": "sha1-6225ffc638ce81e53cdf7868fe0c7435594f11e4",
"other": "Hello newer World"
},
"Name": {
"hash": "sha1-2b7c08c3ab75f37e2da656c1aab228f5f3a793b1",
"one": "Name",
"other": "Names"
},
"Role": {
"hash": "sha1-47dcc27d6e87ece8baebe7e3877a261a5467093d",
"one": "Role",
"other": "Roles"
}
}

View file

@ -1,18 +0,0 @@
[Attendie]
hash = "sha1-4c29d6c952ccd2b114d1792c7b18fa7f7052ebed"
one = "Attendie"
other = "Attendies"
[HelloWorld]
hash = "sha1-6225ffc638ce81e53cdf7868fe0c7435594f11e4"
other = "Hello newer World"
[Name]
hash = "sha1-2b7c08c3ab75f37e2da656c1aab228f5f3a793b1"
one = "Name"
other = "Names"
[Role]
hash = "sha1-47dcc27d6e87ece8baebe7e3877a261a5467093d"
one = "Role"
other = "Roles"