AItool commited on
Commit
5b946bc
·
verified ·
1 Parent(s): b070982

form improvement order

Browse files
Files changed (1) hide show
  1. testnavbar.py +17 -7
testnavbar.py CHANGED
@@ -126,15 +126,25 @@ def product_detail(product_name: str):
126
  render_md(example_product_description.format(product_name=product_name))
127
  ),
128
  Div(
129
- H3("Order Form", cls="text-lg font-semibold mb-3"),
130
  # Form automatically has a class of 'space-y-3' for a margin between each child.
131
  Form(
132
- # LabelInput is a convenience wrapper for a label and input that links them.
133
- LabelInput("Name", id='name', placeholder=product_name),
134
- LabelInput("Email", id='email', placeholder='accountemail@example.com'),
135
- LabelInput("Quantity", id='quantity',placeholder='1'),
136
- Div(PaymentMethod, cls='space-y-4'),
137
- # ButtonT.primary because this is the primary action of the page!
 
 
 
 
 
 
 
 
 
 
138
  Button("Add to order", cls=(ButtonT.primary, "w-full mt-4")),
139
  Button("Continue shopping",
140
  cls=(ButtonT.secondary, "w-full mt-2"),
 
126
  render_md(example_product_description.format(product_name=product_name))
127
  ),
128
  Div(
129
+ H3("Order", cls="text-lg font-semibold mb-3"),
130
  # Form automatically has a class of 'space-y-3' for a margin between each child.
131
  Form(
132
+ # Product info (read-only)
133
+ LabelInput("Product", id="name", value=product_name, readonly=True,
134
+ cls="bg-gray-100 cursor-not-allowed"),
135
+ LabelInput("Price", id="price", value=price, readonly=True,
136
+ cls="bg-gray-100 cursor-not-allowed"),
137
+
138
+ # Order details
139
+ LabelInput("Quantity", id="quantity", placeholder="1"),
140
+
141
+ # Customer info
142
+ LabelInput("Email", id="email", placeholder="accountemail@example.com"),
143
+
144
+ # Payment section
145
+ Div(PaymentMethod, cls="space-y-4 mt-4"),
146
+
147
+ # Actions
148
  Button("Add to order", cls=(ButtonT.primary, "w-full mt-4")),
149
  Button("Continue shopping",
150
  cls=(ButtonT.secondary, "w-full mt-2"),