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

25 lines
621 B
Plaintext
Raw Normal View History

<% content_for :title, t(".character_sheet", name: @character.name) %>
<h2><%= @character.name %></h2>
2024-06-10 17:02:09 +00:00
<% if @editable %>
2024-06-13 12:39:50 +00:00
<%= link_to t(".stop_editing"), url_for(editable: false) %>
2024-06-10 17:02:09 +00:00
<% else %>
2024-06-13 12:39:50 +00:00
<%= link_to t(".edit"), url_for(editable: true) %>
2024-06-10 17:02:09 +00:00
<% end %>
<div id="character_sheet">
<% if @sections.any? %>
<%= render @sections %>
<% else %>
<p><%= t(".no_sections") %></p>
<% end %>
</div>
2024-06-10 17:02:09 +00:00
<% 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 %>