tabletop-companion/app/views/character_sheet_sections/_edit_links.html.erb

17 lines
915 B
Plaintext

<%# locals: (section:, parent:, id:) -%>
<%= link_to t(".add_subsection"),
new_character_character_sheet_section_path(@character, parent_section_id: parent&.id),
data: { turbo_stream: true } %>
<% if section.present? %>
<%= link_to t(".add_stat"),
new_character_sheet_section_stat_path(section), data: { turbo_stream: true }, class: "add-stat" %>
<%= link_to t(".add_text_field"),
new_character_sheet_section_text_field_path(section), data: { turbo_stream: true }, class: "add-text-field" %>
<%= link_to t(".save_as_template"),
new_character_sheet_section_template_path(section), data: { turbo_frame: "_top" } %>
<% end %>
<% unless id == "character_sheet_add_section" %>
<%= link_to t(".delete_section", name: section.name), character_sheet_section_path(section),
data: { turbo_method: :delete, turbo_confirm: t(".confirm_delete", name: section.name) } %>
<% end %>