This commit is contained in:
2025-11-07 13:34:32 -08:00
commit 1e8c5a972b
436 changed files with 11000 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
<%= leafable_edit_form(section, id: "leafable-editor") do |form| %>
<h1><%= form.text_area :body, class: "input input--textara full-width txt-align-center", required: true, autocomplete: "off", autofocus: true %></h1>
<%= form.submit "Save", hidden: true %>
<% end %>

View File

@@ -0,0 +1,33 @@
<% content_for(:title) { "Edit #{ @section.title }" } %>
<% content_for :header do %>
<%= render "leafables/edit_header", leaf: @leaf, book: @book %>
<% end %>
<% content_for :toolbar do %>
<div class="page-toolbar fill-selected align-center gap-half margin-block-end-double">
<%= editing_mode_toggle_switch(@leaf, checked: true) %>
<span class="separator margin-inline-half" aria-hidden="true"></span>
<label class="btn txt-small">
<%= hidden_field_tag "section[theme]", nil, id: nil, form: "leafable-editor" %>
<%= check_box_tag "section[theme]", "dark", @section.theme.present?, class: "switch__input", form: "leafable-editor" %>
<%= image_tag "theme-switch.svg", aria: { hidden: true }, size: 24 %>
<span class="for-screen-reader">Change theme</span>
</label>
<span class="separator margin-inline-half" aria-hidden="true"></span>
<button type="submit" form="leafable-editor" class="btn flex page-toolbar__save flex-item-justify-end flex-item-no-shrink txt-small">
<%= image_tag "check.svg", aria: { hidden: true }, size: 24 %>
<span class="for-screen-reader">Save</span>
</button>
</div>
<% end %>
<div class="page--section <%= "theme--dark" if @section.theme == "dark" %>">
<%= render "sections/form", book: @book, section: @section %>
</div>
<%= render "leaves/edit_footer", leaf: @leaf %>

View File

@@ -0,0 +1,19 @@
<% content_for(:title) { "New section page" } %>
<% content_for :header do %>
<nav>
<%= link_to @book, class: "btn flex-item-justify-start" do %>
<%= image_tag "remove.svg", aria: { hidden: true }, size: 24 %>
<span class="for-screen-reader">Cancel</span>
<% end %>
<button type="submit" form="leafable-editor", class="btn flex-item-justify-end">
<%= image_tag "check.svg", aria: { hidden: true }, size: 24 %>
<span class="for-screen-reader">Save</span>
</button>
</nav>
<% end %>
<div class="page--section">
<%= render "sections/form", book: @book, section: @section %>
</div>

View File

@@ -0,0 +1,3 @@
<%= turbo_stream.replace dom_id(@leaf) do %>
<%= render "leaves/leaf", leaf: @leaf %>
<% end %>