tabletop-companion/app/views/stats/_stat.html.erb

12 lines
480 B
Plaintext

<div class="stat" id="<%= dom_id(stat) %>">
<% if @editable %>
<%= link_to(t(".delete"), stat,
data: { turbo_method: :delete, turbo_confirm: t(".confirm_delete", name: stat.name) }) %>
<% end %>
<h6><%= stat.name %></h6>
<%= form_with model: stat, class: "stat-form",
data: { controller: "stat-update", stat_update_update_url_value: stat_path(stat) } do |f| %>
<%= f.number_field :value, disabled: !@editable %>
<% end %>
</div>