viktorvsk f3d33199f0
Some checks failed
CI / Lint & Test (push) Has been cancelled
Deploy Status Page / Build & Deploy (push) Has been cancelled
Волшебная Книга: Russian book storytelling app
- 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
2026-04-25 15:29:15 +00:00

53 lines
2.4 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<% content_for :title, @character.name %>
<div class="page-card">
<div style="display:flex;align-items:flex-start;gap:32px;flex-wrap:wrap;">
<div>
<% if @character.canvas_data.present? %>
<div class="canvas-wrap">
<canvas id="preview-canvas" width="300" height="400"
data-controller="canvas-preview"
data-canvas-preview-data-value="<%= @character.canvas_data %>">
</canvas>
</div>
<% else %>
<div class="canvas-wrap" style="width:300px;height:400px;display:flex;align-items:center;justify-content:center;font-size:5rem;">🧙</div>
<% end %>
</div>
<div style="flex:1;min-width:200px;">
<h1 class="chapter-title" style="color:<%= @character.color %>"><%= @character.name %></h1>
<% if @character.description.present? %>
<p class="prose"><%= @character.description %></p>
<% end %>
<div style="margin:16px 0;">
<span class="form-label">Цвет персонажа</span>
<div style="display:flex;align-items:center;gap:8px;margin-top:4px;">
<div style="width:24px;height:24px;border-radius:50%;background:<%= @character.color %>;border:2px solid #c8b37a;"></div>
<code style="font-size:0.85rem;color:var(--ink-light);"><%= @character.color %></code>
</div>
</div>
<% pages_with_character = @character.story_pages %>
<% if pages_with_character.any? %>
<div style="margin-top:20px;">
<div class="form-label">Страницы с этим персонажем</div>
<ul style="margin:8px 0 0;padding-left:18px;">
<% pages_with_character.each_with_index do |pg, i| %>
<li><%= link_to pg.title.presence || "Страница #{i+1}", story_page_path(pg), style:"color:var(--leather);" %></li>
<% end %>
</ul>
</div>
<% end %>
<div class="action-row" style="margin-top:32px;">
<%= link_to "✎ Редактировать", edit_character_path(@character), class: "btn btn-primary" %>
<%= link_to "✕ Удалить", character_path(@character), data: { turbo_method: :delete, turbo_confirm: "Удалить персонажа «#{@character.name}»?" }, class: "btn btn-danger" %>
<%= link_to "← Все персонажи", characters_path, class: "btn btn-secondary" %>
</div>
</div>
</div>
</div>