mirror of
https://github.com/rjNemo/rentease.git
synced 2026-06-12 13:46:51 +00:00
new booking
This commit is contained in:
parent
96ee9ac18b
commit
a120f85c11
2 changed files with 76 additions and 54 deletions
|
|
@ -4,58 +4,80 @@ import "github.com/rjNemo/rentease/internal/view/layout"
|
|||
|
||||
templ NewBooking(platforms []string) {
|
||||
@layout.BaseLayout() {
|
||||
<hgroup>
|
||||
<h1>New Booking </h1>
|
||||
<h2>Create a new booking </h2>
|
||||
<hgroup class="flex flex-col">
|
||||
<h1 class="text-2xl font-bold text-primary">New Booking</h1>
|
||||
<span class="text-sm text-base-content/60">Create a new booking</span>
|
||||
</hgroup>
|
||||
<form method="POST">
|
||||
<fieldset class="grid">
|
||||
<label for="name">
|
||||
Customer name
|
||||
<input type="text" id="name" name="name" placeholder="John Doe" required autofocus/>
|
||||
</label>
|
||||
<label for="phone_number">
|
||||
Phone number
|
||||
<input type="tel" id="phone_number" name="phone_number" placeholder="06 12 34 56 78"/>
|
||||
</label>
|
||||
<label for="customer_number">
|
||||
Customer number
|
||||
<input type="number" inputmode="numeric" id="customer_number" name="customer_number" placeholder="1" required/>
|
||||
</label>
|
||||
<form method="POST" class="p-4 bg-base-200 rounded-lg shadow-lg max-w-4xl mx-auto">
|
||||
<fieldset class="space-y-6">
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||
<label class="form-control w-full">
|
||||
<div class="label">
|
||||
<span class="label-text">Customer name</span>
|
||||
</div>
|
||||
<input type="text" id="name" name="name" placeholder="John Doe" required autofocus class="input input-bordered w-full"/>
|
||||
</label>
|
||||
<label class="form-control w-full">
|
||||
<div class="label">
|
||||
<span class="label-text">Phone number</span>
|
||||
</div>
|
||||
<input type="tel" id="phone_number" name="phone_number" placeholder="06 12 34 56 78" class="input input-bordered w-full"/>
|
||||
</label>
|
||||
<label class="form-control w-full">
|
||||
<div class="label">
|
||||
<span class="label-text">Customer number</span>
|
||||
</div>
|
||||
<input type="number" inputmode="numeric" id="customer_number" name="customer_number" placeholder="1" required class="input input-bordered w-full"/>
|
||||
</label>
|
||||
</div>
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||
<label class="form-control w-full">
|
||||
<div class="label">
|
||||
<span class="label-text">Email</span>
|
||||
</div>
|
||||
<input type="email" id="email" name="email" placeholder="john@doe.com" class="input input-bordered w-full"/>
|
||||
</label>
|
||||
<label class="form-control">
|
||||
<div class="label">
|
||||
<span class="label-text">From</span>
|
||||
</div>
|
||||
<input type="date" id="from" name="from" required class="input input-bordered w-full"/>
|
||||
</label>
|
||||
<label class="form-control w-full">
|
||||
<div class="label">
|
||||
<span class="label-text">To</span>
|
||||
</div>
|
||||
<input type="date" id="to" name="to" required class="input input-bordered w-full"/>
|
||||
</label>
|
||||
</div>
|
||||
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
||||
<label class="form-control w-full">
|
||||
<div class="label">
|
||||
<span class="label-text">Platform</span>
|
||||
</div>
|
||||
<select id="platform" name="platform" class="select select-bordered w-full">
|
||||
for _, platform := range platforms {
|
||||
<option value={ platform }>{ platform } </option>
|
||||
}
|
||||
</select>
|
||||
</label>
|
||||
<label class="form-control w-full">
|
||||
<div class="label">
|
||||
<span class="label-text">Fees</span>
|
||||
</div>
|
||||
<input type="number" inputmode="decimal" step="0.01" id="platform_fees" name="platform_fees" placeholder="0" class="input input-bordered w-full"/>
|
||||
</label>
|
||||
<label class="form-control w-full">
|
||||
<div class="label">
|
||||
<span class="label-text">Platform ID</span>
|
||||
</div>
|
||||
<input type="text" id="external_id" name="external_id" placeholder="XXX-XXXX-XX" class="input input-bordered w-full"/>
|
||||
</label>
|
||||
</div>
|
||||
<div class="mt-6 flex justify-end">
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset class="grid">
|
||||
<label for="email">
|
||||
Email
|
||||
<input type="email" id="email" name="email" placeholder="john@doe.com"/>
|
||||
</label>
|
||||
<label for="from">
|
||||
From
|
||||
<input type="date" id="from" name="from" required/>
|
||||
</label>
|
||||
<label for="to">
|
||||
To
|
||||
<input type="date" id="to" name="to" required/>
|
||||
</label>
|
||||
</fieldset>
|
||||
<fieldset class="grid">
|
||||
<label for="platform">
|
||||
Platform
|
||||
<select id="platform" name="platform">
|
||||
for _, platform := range platforms {
|
||||
<option value={ platform }>{ platform } </option>
|
||||
}
|
||||
</select>
|
||||
</label>
|
||||
<label for="platform_fees">
|
||||
Fees
|
||||
<input type="number" inputmode="decimal" step="0.01" id="platform_fees" name="platform_fees" placeholder="0"/>
|
||||
</label>
|
||||
<label for="external_id">
|
||||
Platform ID
|
||||
<input type="text" id="external_id" name="external_id" placeholder="XXX-XXXX-XX"/>
|
||||
</label>
|
||||
</fieldset>
|
||||
<button type="submit">Submit</button>
|
||||
</form>
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ func NewBooking(platforms []string) templ.Component {
|
|||
}()
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<hgroup><h1>New Booking </h1><h2>Create a new booking </h2></hgroup><form method=\"POST\"><fieldset class=\"grid\"><label for=\"name\">Customer name <input type=\"text\" id=\"name\" name=\"name\" placeholder=\"John Doe\" required autofocus></label> <label for=\"phone_number\">Phone number <input type=\"tel\" id=\"phone_number\" name=\"phone_number\" placeholder=\"06 12 34 56 78\"></label> <label for=\"customer_number\">Customer number <input type=\"number\" inputmode=\"numeric\" id=\"customer_number\" name=\"customer_number\" placeholder=\"1\" required></label></fieldset><fieldset class=\"grid\"><label for=\"email\">Email <input type=\"email\" id=\"email\" name=\"email\" placeholder=\"john@doe.com\"></label> <label for=\"from\">From <input type=\"date\" id=\"from\" name=\"from\" required></label> <label for=\"to\">To <input type=\"date\" id=\"to\" name=\"to\" required></label></fieldset><fieldset class=\"grid\"><label for=\"platform\">Platform <select id=\"platform\" name=\"platform\">")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<hgroup class=\"flex flex-col\"><h1 class=\"text-2xl font-bold text-primary\">New Booking</h1><span class=\"text-sm text-base-content/60\">Create a new booking</span></hgroup><form method=\"POST\" class=\"p-4 bg-base-200 rounded-lg shadow-lg max-w-4xl mx-auto\"><fieldset class=\"space-y-6\"><div class=\"grid grid-cols-1 md:grid-cols-3 gap-4\"><label class=\"form-control w-full\"><div class=\"label\"><span class=\"label-text\">Customer name</span></div><input type=\"text\" id=\"name\" name=\"name\" placeholder=\"John Doe\" required autofocus class=\"input input-bordered w-full\"></label> <label class=\"form-control w-full\"><div class=\"label\"><span class=\"label-text\">Phone number</span></div><input type=\"tel\" id=\"phone_number\" name=\"phone_number\" placeholder=\"06 12 34 56 78\" class=\"input input-bordered w-full\"></label> <label class=\"form-control w-full\"><div class=\"label\"><span class=\"label-text\">Customer number</span></div><input type=\"number\" inputmode=\"numeric\" id=\"customer_number\" name=\"customer_number\" placeholder=\"1\" required class=\"input input-bordered w-full\"></label></div><div class=\"grid grid-cols-1 md:grid-cols-3 gap-4\"><label class=\"form-control w-full\"><div class=\"label\"><span class=\"label-text\">Email</span></div><input type=\"email\" id=\"email\" name=\"email\" placeholder=\"john@doe.com\" class=\"input input-bordered w-full\"></label> <label class=\"form-control\"><div class=\"label\"><span class=\"label-text\">From</span></div><input type=\"date\" id=\"from\" name=\"from\" required class=\"input input-bordered w-full\"></label> <label class=\"form-control w-full\"><div class=\"label\"><span class=\"label-text\">To</span></div><input type=\"date\" id=\"to\" name=\"to\" required class=\"input input-bordered w-full\"></label></div><div class=\"grid grid-cols-1 md:grid-cols-3 gap-4\"><label class=\"form-control w-full\"><div class=\"label\"><span class=\"label-text\">Platform</span></div><select id=\"platform\" name=\"platform\" class=\"select select-bordered w-full\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
|
@ -55,7 +55,7 @@ func NewBooking(platforms []string) templ.Component {
|
|||
var templ_7745c5c3_Var3 string
|
||||
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(platform)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/view/bookings_new.templ`, Line: 45, Col: 31}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/view/bookings_new.templ`, Line: 60, Col: 32}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
|
|
@ -68,7 +68,7 @@ func NewBooking(platforms []string) templ.Component {
|
|||
var templ_7745c5c3_Var4 string
|
||||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(platform)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/view/bookings_new.templ`, Line: 45, Col: 44}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/view/bookings_new.templ`, Line: 60, Col: 45}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
|
|
@ -79,7 +79,7 @@ func NewBooking(platforms []string) templ.Component {
|
|||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</select></label> <label for=\"platform_fees\">Fees <input type=\"number\" inputmode=\"decimal\" step=\"0.01\" id=\"platform_fees\" name=\"platform_fees\" placeholder=\"0\"></label> <label for=\"external_id\">Platform ID <input type=\"text\" id=\"external_id\" name=\"external_id\" placeholder=\"XXX-XXXX-XX\"></label></fieldset><button type=\"submit\">Submit</button></form>")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</select></label> <label class=\"form-control w-full\"><div class=\"label\"><span class=\"label-text\">Fees</span></div><input type=\"number\" inputmode=\"decimal\" step=\"0.01\" id=\"platform_fees\" name=\"platform_fees\" placeholder=\"0\" class=\"input input-bordered w-full\"></label> <label class=\"form-control w-full\"><div class=\"label\"><span class=\"label-text\">Platform ID</span></div><input type=\"text\" id=\"external_id\" name=\"external_id\" placeholder=\"XXX-XXXX-XX\" class=\"input input-bordered w-full\"></label></div><div class=\"mt-6 flex justify-end\"><button type=\"submit\" class=\"btn btn-primary\">Submit</button></div></fieldset></form>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue