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

12 lines
480 B
Plaintext
Raw Normal View History

2024-06-07 15:53:32 +00:00
<div class="stat" id="<%= dom_id(stat) %>">
2024-06-10 19:39:46 +00:00
<% if @editable %>
2024-06-11 10:37:58 +00:00
<%= link_to(t(".delete"), stat,
data: { turbo_method: :delete, turbo_confirm: t(".confirm_delete", name: stat.name) }) %>
2024-06-10 19:39:46 +00:00
<% end %>
2024-06-07 15:53:32 +00:00
<h6><%= stat.name %></h6>
2024-06-11 10:37:58 +00:00
<%= 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 %>
2024-06-07 15:53:32 +00:00
</div>