Polish draft/post UI

This commit is contained in:
Jason Zimdars
2025-02-11 21:48:33 -06:00
parent b942cf0ce2
commit 0c57f9cdc5
4 changed files with 14 additions and 16 deletions
+4 -2
View File
@@ -372,6 +372,8 @@
}
textarea {
--input-color: var(--bubble-color);
hyphens: none;
&::selection {
@@ -542,9 +544,9 @@
}
}
.bubble__pop-container {
.bubble__actions-container {
background-color: color(from var(--bubble-color) srgb r g b / 0.15);
margin-block-start: -1em;
margin-block-start: -0.7em;
.btn {
--btn-background: var(--bubble-color);
+1 -1
View File
@@ -10,7 +10,7 @@
<h1 class="bubble__title">
<% if bubble.creating? %>
<%= form_with model: bubble, url: bucket_bubble_path(bubble.bucket, bubble), data: { controller: "auto-save" } do |form| %>
<%= form.text_field :title, placeholder: "Name it…", class: "input txt-align-center full-width borderless", autofocus: bubble.title.blank?, data: { action: "auto-save#change blur->auto-save#submit" } %>
<%= form.text_area :title, placeholder: "Name it…", class: "input txt-align-center full-width borderless", autofocus: bubble.title.blank?, data: { action: "auto-save#change blur->auto-save#submit keydown.enter->auto-save#submit:prevent keydown.ctrl+enter->auto-save#submit:prevent" }, rows: 5 %>
<% end %>
<% else %>
<%= turbo_frame_tag bubble, :edit do %>
+1 -1
View File
@@ -1,4 +1,4 @@
<div class="bubble__pop-container center border-radius pad flex-inline align-center justify-center gap pad-inline-double" style="--bubble-color: <%= @bubble.color %>">
<div class="bubble__actions-container center border-radius pad flex-inline align-center justify-center gap pad-inline-double" style="--bubble-color: <%= @bubble.color %>">
<% if bubble.popped? %>
<% event = bubble.events.where(action: "popped").last %>
<span class="bubble__pop-message">Popped by <%= "#{ event.creator.name } on #{ event.created_at.to_date.strftime('%B %-d') }" if event %>.</span>
+8 -12
View File
@@ -4,9 +4,9 @@
<% if @bubble.creating? && @bubble.can_recover_abandoned_creation? %>
<div class="flex align-center gap-half fill-selected justify-center border-block margin-block-end"
style="--border-color: var(--color-selected-dark); --border-style: dashed; view-transition-name: draft-banner;">
You have an unsaved bubble. Would you like to continue where you left off?
You have an unsaved work. Would you like to continue where you left off?
<%= button_to bucket_bubble_recover_path(@bubble.bucket, @bubble), class: "btn txt-small btn--link", data: { turbo_action: "replace" } do %>
<span>Yes please!</span>
<span>Restore</span>
<% end %>
</div>
<% end %>
@@ -93,8 +93,12 @@
<%= render "bubbles/bubble", bubble: @bubble %>
</div>
<% unless @bubble.drafted? %>
<% if @bubble.creating? %>
<div class="bubble__actions-container center border-radius pad flex-inline align-center justify-center gap pad-inline-double" style="--bubble-color: <%= @bubble.color %>">
<%= button_to "Create bubble", bucket_bubble_publish_path(@bubble.bucket, @bubble), class: "btn btn--reversed" %>
<%= button_to "Save as draft", bucket_bubble_path(@bubble.bucket, @bubble), name: "bubble[status]", value: "drafted", method: :put, class: "btn btn--plain borderless fill-transparent" %>
</div>
<% elsif !@bubble.drafted? %>
<%= render "bubbles/pop_toggle", bubble: @bubble %>
<% end %>
@@ -105,12 +109,4 @@
<%= turbo_frame_tag dom_id(@bubble, :stage_picker), src: new_bucket_bubble_stage_picker_path(@bubble.bucket, @bubble) %>
</div>
<% if @bubble.creating? %>
<div>
<%= button_to "Publish", bucket_bubble_publish_path(@bubble.bucket, @bubble) %>
<%= button_to "Save a draft", bucket_bubble_path(@bubble.bucket, @bubble), name: "bubble[status]", value: "drafted", method: :put %>
<%= button_to "Cancel", bucket_bubble_path(@bubble.bucket, @bubble), method: :delete %>
</div>
<% end %>
<%= render "notifications/tray" %>