rentease/internal/view/index.templ
2024-04-12 11:22:55 +02:00

38 lines
715 B
Text

package view
import (
"github.com/rjNemo/rentease/config"
"github.com/rjNemo/rentease/internal/view/layout"
)
func makeItems() []string {
host := config.NewHost()
items := make([]string, 0, 2)
for _, i := range host.Items {
if i.Name == "T2" || i.Name == "T3" {
items = append(items, i.Name)
}
}
return items
}
var items = makeItems()
templ Index() {
@layout.PublicLayout() {
<section>
<h1>Reserver votre sejour des maintenant</h1>
<article>
@RequestBookingForm(&RequestBookingViewModel{
Item: "T2",
From: "",
To: "",
Name: "",
PhoneNumber: "",
Email: "",
Errors: nil,
})
</article>
</section>
}
}