tabletop-companion/app/views/text_fields/_text_field.html.erb

26 lines
943 B
Plaintext
Raw Permalink Normal View History

2024-06-14 11:59:35 +00:00
<div class="text-field" id="<%= dom_id(text_field) %>">
<% if @editable %>
2024-06-18 07:43:39 +00:00
<div class="feature-edit-buttons">
<%= icon_link_to("cod-triangle_left", reorder_down_character_sheet_feature_path(text_field),
data: { turbo_method: :patch }) %>
<%= icon_link_to("md-delete", text_field,
data: { turbo_method: :delete, turbo_confirm: t(".confirm_delete", name: text_field.name) }) %>
<%= icon_link_to("cod-triangle_right", reorder_up_character_sheet_feature_path(text_field),
data: { turbo_method: :patch }) %>
</div>
2024-06-14 11:59:35 +00:00
<% end %>
<h6><%= text_field.name %></h6>
<% if @editable %>
<%= form_with model: text_field, class: "text-field-form" do |f| %>
<%= f.rich_text_area :content %>
<%= f.submit t(".save") %>
<% end %>
<% else %>
2024-06-21 09:57:03 +00:00
<%= link_to text_field, data: { turbo_frame: :modal } do %>
<%= text_field.content %>
<% end %>
2024-06-14 11:59:35 +00:00
<% end %>
</div>