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

18 lines
526 B
Plaintext
Raw Normal View History

2024-06-14 11:59:35 +00:00
<div class="text-field" id="<%= dom_id(text_field) %>">
<% if @editable %>
<%= link_to t(".delete"), text_field,
data: { turbo_method: :delete, turbo_confirm: t(".confirm_delete", name: text_field.name) } %>
<% 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 %>
<p><%= text_field.content %></p>
<% end %>
</div>