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

17 lines
823 B
Plaintext
Raw Normal View History

2024-06-21 08:09:19 +00:00
<%= turbo_frame_tag :modal do %>
<div class="feature-box stat">
<%= icon_link_to "fa-close", table_character_character_sheet_sections_path(@stat.character.table, @stat.character),
class: "icon-link" %>
<h2><%= @stat.name %></h2>
<%= form_with model: @stat, class: "stat-form", data: { controller: "auto-update" } do |f| %>
<%= f.number_field :value %>
<% end %>
<%= form_with model: DiceRoll.new, url: table_dice_rolls_path(@stat.character.table), class: "stat-form",
data: { controller: "dice-roll modal-closer", action: "modal-closer#closeModal" } do |f| %>
<%= f.hidden_field :rollable_type, value: "Stat" %>
<%= f.hidden_field :rollable_id, value: @stat.id %>
<%= f.submit "#{t(".roll")}".html_safe, class: "roll-button" %>
<% end %>
</div>
<% end %>