mirror of
https://github.com/ubicloud/ubicloud.git
synced 2025-10-04 13:52:06 +08:00
This switches Clover to use the form method for forms, which automatically handles adding the appropriate csrf tag, so you don't need to duplicate the path in a separate csrf_tag call. The form method comes from the forme_route_csrf plugin, which is what CloverAdmin already uses. While here, change some rodauth forms to use *_path instead of "/" + *_route. Also, change some "#{@project.path}#{@pg.path}" to path(@pg).
25 lines
893 B
Text
25 lines
893 B
Text
<div class="overflow-hidden rounded-lg shadow ring-1 ring-black ring-opacity-5 bg-white divide-y divide-gray-200">
|
|
<% form(action: "#{@project.path}/discount-code", method: :post) do %>
|
|
<div class="px-4 py-5 sm:p-6">
|
|
<div class="space-y-12">
|
|
<div>
|
|
<div class="grid grid-cols-1 gap-x-6 gap-y-8 sm:grid-cols-8">
|
|
<div class="sm:col-span-4">
|
|
<%== part(
|
|
"components/form/text",
|
|
name: "discount_code",
|
|
label: "Discount Code",
|
|
attributes: {
|
|
required: true,
|
|
}
|
|
) %>
|
|
</div>
|
|
<div class="col-span-2 sm:col-span-3 flex justify-start items-end">
|
|
<%== part("components/form/submit_button", text: "Apply") %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
</div>
|