diff --git a/pkg/booking/campsite.go b/pkg/booking/campsite.go index 8acc07a..c5c0a14 100644 --- a/pkg/booking/campsite.go +++ b/pkg/booking/campsite.go @@ -71,12 +71,14 @@ type CampsiteEntry struct { ID int Label string Type string + TypeSlug string Active bool Selected bool Bookings map[time.Time]*CampsiteBooking } type CampsiteBooking struct { + URL string Holder string Status string Nights int @@ -89,6 +91,7 @@ func CollectCampsiteEntries(ctx context.Context, company *auth.Company, conn *da select campsite_id , campsite.label , campsite_type.name + , campsite_type.slug , campsite.active from campsite join campsite_type using (campsite_type_id) @@ -104,7 +107,7 @@ func CollectCampsiteEntries(ctx context.Context, company *auth.Company, conn *da var campsites []*CampsiteEntry for rows.Next() { entry := &CampsiteEntry{} - if err = rows.Scan(&entry.ID, &entry.Label, &entry.Type, &entry.Active); err != nil { + if err = rows.Scan(&entry.ID, &entry.Label, &entry.Type, &entry.TypeSlug, &entry.Active); err != nil { return nil, err } campsites = append(campsites, entry) @@ -122,6 +125,7 @@ func collectCampsiteBookings(ctx context.Context, company *auth.Company, conn *d rows, err := conn.Query(ctx, ` select campsite.label , lower(booking_campsite.stay * daterange($2::date, $3::date)) + , '/admin/bookings/' || booking.slug , holder_name , booking_status , upper(booking_campsite.stay * daterange($2::date, $3::date)) - lower(booking_campsite.stay * daterange($2::date, $3::date)) @@ -142,7 +146,7 @@ func collectCampsiteBookings(ctx context.Context, company *auth.Company, conn *d entry := &CampsiteBooking{} var label string var date time.Time - if err = rows.Scan(&label, &date, &entry.Holder, &entry.Status, &entry.Nights, &entry.Begin, &entry.End); err != nil { + if err = rows.Scan(&label, &date, &entry.URL, &entry.Holder, &entry.Status, &entry.Nights, &entry.Begin, &entry.End); err != nil { return err } campsite := campsites[label] diff --git a/web/static/camper.css b/web/static/camper.css index 8cb28c7..3f5b3a8 100644 --- a/web/static/camper.css +++ b/web/static/camper.css @@ -832,6 +832,7 @@ label[x-show] > span, label[x-show] > br { #campsites-booking tbody td { position: relative; + user-select: none; } #campsites-booking tbody div { diff --git a/web/templates/admin/booking/grid.gohtml b/web/templates/admin/booking/grid.gohtml index e349233..daa53d3 100644 --- a/web/templates/admin/booking/grid.gohtml +++ b/web/templates/admin/booking/grid.gohtml @@ -1,10 +1,12 @@ +{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/booking.adminBookingForm */ -}}
{{ range .Months }} {{ range .Spans }} - + {{- end }} {{- end }} @@ -12,7 +14,8 @@ {{ range .Months }} - + {{- end }} @@ -36,10 +39,11 @@
{{ .Holder }}
{{- else -}} - + {{- end }} {{- end }} {{- end }} diff --git a/web/templates/admin/campsite/index.gohtml b/web/templates/admin/campsite/index.gohtml index ba19775..ecb9158 100644 --- a/web/templates/admin/campsite/index.gohtml +++ b/web/templates/admin/campsite/index.gohtml @@ -42,6 +42,17 @@ {{ else -}}

{{( gettext "No campsites added yet." )}}

{{- end }} + + {{- end }} {{ define "campsite-heading" -}}
{{( pgettext "Label" "header" )}}{{ pgettext .Name "month" }} {{ .Year }}{{ pgettext .Name "month" }} {{ .Year }}