- Book-styled UI with parchment aesthetic and Russian navigation - Characters model with Konva.js 2D canvas drawing (draggable shapes) - StoryPages model with character association and page navigation - Stimulus controllers: canvas (editor) + canvas-preview (read-only) - Full Russian interface: all labels, buttons, flash messages in Russian
43 lines
2.0 KiB
Plaintext
43 lines
2.0 KiB
Plaintext
<% content_for :title, @page.title.presence || "Страница" %>
|
|
|
|
<div class="page-card page-reader">
|
|
<% if @page.title.present? %>
|
|
<h1 class="chapter-title"><%= @page.title %></h1>
|
|
<% end %>
|
|
|
|
<% if @page.character %>
|
|
<div style="margin-bottom:24px;display:flex;align-items:center;gap:12px;">
|
|
<% if @page.character.canvas_data.present? %>
|
|
<canvas width="60" height="80" data-canvas-data="<%= @page.character.canvas_data %>" style="border-radius:4px;background:#f0e4c8;border:1px solid #c8b37a;"></canvas>
|
|
<% end %>
|
|
<div>
|
|
<div style="font-size:0.78rem;text-transform:uppercase;letter-spacing:0.08em;color:var(--ink-light);font-style:normal;font-family:system-ui,sans-serif;">Персонаж</div>
|
|
<div style="font-weight:700;color:<%= @page.character.color %>"><%= @page.character.name %></div>
|
|
<% if @page.character.description.present? %>
|
|
<div style="font-size:0.85rem;font-style:italic;color:var(--ink-light);margin-top:2px;"><%= @page.character.description %></div>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
<div class="section-divider" style="margin:16px 0 24px;">— ◆ —</div>
|
|
<% end %>
|
|
|
|
<div class="page-content"><%= @page.content %></div>
|
|
|
|
<div class="page-navigation">
|
|
<div>
|
|
<% if @prev_page %>
|
|
<%= link_to "← #{@prev_page.title.presence || 'Предыдущая'}", story_page_path(@prev_page), class: "btn btn-secondary btn-sm" %>
|
|
<% end %>
|
|
</div>
|
|
<div class="action-row" style="margin:0;gap:6px;">
|
|
<%= link_to "✎ Редактировать", edit_story_page_path(@page), class: "btn btn-secondary btn-sm" %>
|
|
<%= link_to "✕ Удалить", story_page_path(@page), data: { turbo_method: :delete, turbo_confirm: "Удалить эту страницу?" }, class: "btn btn-danger btn-sm" %>
|
|
</div>
|
|
<div>
|
|
<% if @next_page %>
|
|
<%= link_to "#{@next_page.title.presence || 'Следующая'} →", story_page_path(@next_page), class: "btn btn-secondary btn-sm" %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
</div>
|