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

25 lines
685 B
Plaintext

<% content_for :title, t(".character_sheet", name: @character.name) %>
<h2><%= @character.name %></h2>
<% if @editable %>
<%= link_to t(".stop_editing"), character_character_sheet_sections_path(editable: false) %>
<% else %>
<%= link_to t(".edit"), character_character_sheet_sections_path(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 %>