mirror of
https://github.com/ubicloud/ubicloud.git
synced 2025-10-07 23:31:58 +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).
35 lines
1.2 KiB
Text
35 lines
1.2 KiB
Text
<%# locals: (object:, type:) %>
|
|
|
|
<div class="md:flex md:items-center md:justify-between pb-2 lg:pb-4">
|
|
<div class="min-w-0 flex-1">
|
|
<h3 class="text-2xl font-bold leading-7 text-gray-900 sm:truncate sm:text-2xl sm:tracking-tight">
|
|
Rename
|
|
</h3>
|
|
</div>
|
|
</div>
|
|
|
|
<% form(action: "#{path(object)}/rename", method: :post) do %>
|
|
<div class="overflow-hidden rounded-lg shadow ring-1 ring-black ring-opacity-5 bg-white divide-y divide-gray-200">
|
|
<div class="px-4 py-5 sm:p-6">
|
|
<div class="sm:flex sm:items-center sm:justify-between">
|
|
<div>
|
|
<h3 class="text-base font-semibold leading-6 text-gray-900">Rename
|
|
<%= type %></h3>
|
|
<div class="mt-2 text-sm text-gray-500">
|
|
<%== part(
|
|
"components/form/text",
|
|
name: "name",
|
|
value: object.name,
|
|
attributes: {
|
|
required: true
|
|
}
|
|
) %>
|
|
</div>
|
|
</div>
|
|
<div class="mt-5 sm:ml-6 sm:mt-0 sm:flex sm:flex-shrink-0 sm:items-center">
|
|
<%== part("components/button", text: "Rename") %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<% end %>
|