tabletop-companion/app/views/character_sheet_sections/index.html.erb

25 lines
621 B
Plaintext

<% content_for :title, t(".character_sheet", name: @character.name) %>
<h2><%= @character.name %></h2>
<% if @editable %>
<%= link_to t(".stop_editing"), url_for(editable: false) %>
<% else %>
<%= link_to t(".edit"), url_for(editable: true) %>
<% end %>
<div id="character_sheet">
<% if @sections.any? %>
<%= render @sections %>
<% else %>
<p><%= t(".no_sections") %></p>
<% end %>
</div>
<% if @editable %>
<div id="character_sheet_add_section">
<%= link_to t(".add_section"), new_character_character_sheet_section_path(@character),
data: { turbo_stream: true } %>
</div>
<% end %>