mirror of
https://github.com/we-promise/sure.git
synced 2026-04-20 20:44:08 +00:00
Add ability to delete all tags (#2200)
* Add ability to delete all tags * Downcase resource for confirmation * Clean up deletion resource names * titleize button
This commit is contained in:
committed by
GitHub
parent
dcc43cb253
commit
c022e862aa
@@ -19,7 +19,7 @@
|
||||
href: account_path(account),
|
||||
method: :delete,
|
||||
icon: "trash-2",
|
||||
confirm: CustomConfirm.for_resource_deletion("Account", high_severity: true),
|
||||
confirm: CustomConfirm.for_resource_deletion("account", high_severity: true),
|
||||
data: { turbo_frame: :_top }
|
||||
) %>
|
||||
<% end %>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
href: destroy_all_categories_path,
|
||||
method: :delete,
|
||||
icon: "trash-2",
|
||||
confirm: CustomConfirm.for_resource_deletion("All categories", high_severity: true)) %>
|
||||
confirm: CustomConfirm.for_resource_deletion("all categories", high_severity: true)) %>
|
||||
<% end %>
|
||||
|
||||
<%= render LinkComponent.new(
|
||||
|
||||
@@ -17,6 +17,6 @@
|
||||
href: chat_path(chat),
|
||||
icon: "trash-2",
|
||||
method: :delete,
|
||||
confirm: CustomConfirm.for_resource_deletion("Chat")) %>
|
||||
confirm: CustomConfirm.for_resource_deletion("chat")) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
href: chat_path(chat),
|
||||
icon: "trash-2",
|
||||
method: :delete,
|
||||
confirm: CustomConfirm.for_resource_deletion("Chat")) %>
|
||||
confirm: CustomConfirm.for_resource_deletion("chat")) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</nav>
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
href: import_path(import),
|
||||
icon: "trash-2",
|
||||
method: :delete,
|
||||
confirm: CustomConfirm.for_resource_deletion("Import")) %>
|
||||
confirm: CustomConfirm.for_resource_deletion("import")) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
href: rule_path(rule),
|
||||
icon: "trash-2",
|
||||
method: :delete,
|
||||
confirm: CustomConfirm.for_resource_deletion("Rule")) %>
|
||||
confirm: CustomConfirm.for_resource_deletion("rule")) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
href: destroy_all_rules_path,
|
||||
icon: "trash-2",
|
||||
method: :delete,
|
||||
confirm: CustomConfirm.for_resource_deletion("All rules", high_severity: true)) %>
|
||||
confirm: CustomConfirm.for_resource_deletion("all rules", high_severity: true)) %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -1,13 +1,27 @@
|
||||
<header class="flex items-center justify-between">
|
||||
<h1 class="text-primary text-xl font-medium"><%= t(".tags") %></h1>
|
||||
|
||||
<%= render LinkComponent.new(
|
||||
text: t(".new"),
|
||||
variant: "primary",
|
||||
href: new_tag_path,
|
||||
icon: "plus",
|
||||
frame: :modal
|
||||
) %>
|
||||
<div class="flex items-center gap-2">
|
||||
<%= render MenuComponent.new do |menu| %>
|
||||
<% menu.with_item(
|
||||
variant: "button",
|
||||
text: "Delete all",
|
||||
href: destroy_all_tags_path,
|
||||
method: :delete,
|
||||
icon: "trash-2",
|
||||
confirm: CustomConfirm.for_resource_deletion("all tags", high_severity: true)) %>
|
||||
<% end %>
|
||||
|
||||
<%= render LinkComponent.new(
|
||||
text: t(".new"),
|
||||
variant: "primary",
|
||||
href: new_tag_path,
|
||||
icon: "plus",
|
||||
frame: :modal
|
||||
) %>
|
||||
|
||||
</div>
|
||||
|
||||
</header>
|
||||
|
||||
<div class="bg-container shadow-border-xs rounded-xl p-4">
|
||||
|
||||
Reference in New Issue
Block a user