Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions app/views/books/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
<fieldset class="flex flex-column unpad margin-block-end borderless justify-space-between">
<legend class="for-screen-reader">Cover color</legend>

<% Book.themes.keys.each do | theme | %>
<% Book.themes.keys.each do |theme| %>
<label class="btn btn--circle txt-small" style="--btn-background: var(--theme-color--<%= theme -%>)" >
<%= form.radio_button :theme, theme %>
<%= image_tag "check.svg", aria: { hidden: "true" }, size: 24, class: "checked" %>
<span class="for-screen-reader"><%= theme %></span>
</label>
<% end %>
</fieldset>

<%= tag.div class: "flex flex-column", data: { controller: "upload-preview", upload_preview_default_image_value: asset_url("empty-cover.png") } do %>
<label class="align-center center gap position-relative margin-block-end">
<% unless book.cover.attached? %>
Expand Down Expand Up @@ -39,23 +40,23 @@
<% end %>
<% end %>
<% end %>
<% end %>
</div>
<% end %>

<div class="flex flex-column gap full-width">
<div class="flex align-center gap txt-medium">
<%= translation_button(:book_title) %>
<h1 class="txt-xx-large margin-none full-width">
<%= form.text_field :title, required: true, autofocus: true, class: "input", placeholder: "Book title", autocomplete: "off" %>
</h1>
</div>
<div class="flex align-center gap txt-medium">
<%= translation_button(:book_subtitle) %>
<small class="txt-normal txt-large txt-tight-lines full-width"><%= form.text_area :subtitle, class: "input", placeholder: "Subtitle", autocomplete: "off" %></small>
</div>
<div class="flex align-center gap txt-medium">
<%= translation_button(:book_author) %>
<small class="txt-normal txt-large txt-tight-lines full-width"><%= form.text_field :author, class: "input", placeholder: "Author", autocomplete: "off" %></small>
</div>
<div class="flex flex-column gap full-width">
<div class="flex align-center gap txt-medium">
<%= translation_button(:book_title) %>
<h1 class="txt-xx-large margin-none full-width">
<%= form.text_field :title, required: true, autofocus: true, class: "input", placeholder: "Book title", autocomplete: "off" %>
</h1>
</div>
<div class="flex align-center gap txt-medium">
<%= translation_button(:book_subtitle) %>
<small class="txt-normal txt-large txt-tight-lines full-width"><%= form.text_area :subtitle, class: "input", placeholder: "Subtitle", autocomplete: "off" %></small>
</div>
<div class="flex align-center gap txt-medium">
<%= translation_button(:book_author) %>
<small class="txt-normal txt-large txt-tight-lines full-width"><%= form.text_field :author, class: "input", placeholder: "Author", autocomplete: "off" %></small>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion app/views/books/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<%= image_tag "trash.svg", aria: { hidden: true }, size: 24 %>
<span class="for-screen-reader">Delete <%= @book.title %></span>
<% end %>
<button type="submit" form="book-editor", class="new-book-btn btn btn--reversed center txt-medium--responsive" aria-label="Save changes" title="Save changes">
<button type="submit" form="book-editor" class="new-book-btn btn btn--reversed center txt-medium--responsive" aria-label="Save changes" title="Save changes">
<%= image_tag "check.svg", aria: { hidden: true }, size: 24 %>
</button>
</nav>
Expand Down
2 changes: 1 addition & 1 deletion app/views/books/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<% content_for :footer do %>
<nav class="new-book-btn flex justify-center pad">
<button type="submit" form="book-editor", class="btn btn--reversed txt-medium--responsive" aria-label="Create book" title="Create book">
<button type="submit" form="book-editor" class="btn btn--reversed txt-medium--responsive" aria-label="Create book" title="Create book">
<%= image_tag "arrow-right.svg", aria: { hidden: true }, size: 24 %>
</button>
</nav>
Expand Down
4 changes: 2 additions & 2 deletions app/views/books/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<% else %>
<span class="book__cover-wrapper">
<%= image_tag "empty-cover.png", alt: "Book cover", class: "book__cover margin-block-none center" %>
<span class="book__title overflow-line-clamp pad txt-align-start txt-tight-lines"" style="--lines: 6" aria-hidden="true"><%= @book.title %></span>
<span class="book__title overflow-line-clamp pad txt-align-start txt-tight-lines" style="--lines: 6" aria-hidden="true"><%= @book.title %></span>
</span>
<% end %>

Expand All @@ -69,7 +69,7 @@
<% end %>
<% end %>

<span data-controller="edit-mode" data-edit-mode-editing-class="edit-mode" />
<span data-controller="edit-mode" data-edit-mode-editing-class="edit-mode"></span>
</div>
</aside>

Expand Down
2 changes: 1 addition & 1 deletion app/views/pages/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<span class="for-screen-reader">Cancel</span>
<% end %>

<button type="submit" form="leafable-editor", class="btn flex-item-justify-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>
Expand Down
2 changes: 1 addition & 1 deletion app/views/pictures/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<span class="for-screen-reader">Cancel</span>
<% end %>

<button type="submit" form="leafable-editor", class="btn flex-item-justify-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>
Expand Down
2 changes: 1 addition & 1 deletion app/views/sections/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<span class="for-screen-reader">Cancel</span>
<% end %>

<button type="submit" form="leafable-editor", class="btn flex-item-justify-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>
Expand Down