Files
fizzy/app/views/bubbles/show.html.erb
T
Jason Zimdars 28a569c49b Tickets
2025-03-17 21:24:08 -05:00

97 lines
4.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.
<% @page_title = @bubble.title %>
<% content_for :header do %>
<% if @bubble.creating? && @bubble.can_recover_abandoned_creation? %>
<div class="fill-selected position-sticky flex align-center gap-half justify-center border-block margin-block-end"
style="view-transition-name: draft-banner; --bubble-color: <%= @bubble.color %>;">
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 btn--reversed", data: { turbo_action: "replace" } do %>
<span>Restore</span>
<% end %>
</div>
<% end %>
<% if @bubble.drafted? %>
<div class="fill-selected position-sticky flex align-center gap-half fill-highlight justify-center border-block margin-block-end"
style="view-transition-name: draft-banner;">
This is a draft, its only visible to you.
<%= render "bubbles/publish", bubble: @bubble %>
</div>
<% end %>
<nav class="align-start max-width">
<%= link_to root_path, class: "btn flex-item-justify-start", data: { controller: "hotkey", action: "keydown.esc@document->hotkey#click" } do %>
<%= image_tag "home.svg", aria: { hidden: true }, size: 24 %>
<span class="for-screen-reader">Home</span>
<% end %>
<header class="search flex flex-inline flex-column center flex-shrink txt--large">
<input type="search" placeholder="Type names, tags, phrases to find something…" class="input input--search">
</header>
<div class="btn btn--placeholder flex-item-justify-end"></div>
</nav>
<% end %>
<div data-controller="beacon" data-beacon-url-value="<%= bucket_bubble_readings_url(@bubble.bucket, @bubble) %>">
<div class="card__container position-relative margin-block-start <%= "card__container--pointing" unless @bubble.published? %>">
<%= render "bubbles/card", bubble: @bubble %>
<div class="card__actions flex flex-column gap-half">
<%= render "bubbles/color", bubble: @bubble %>
<%= render "bubbles/image", bubble: @bubble %>
<%= button_to bucket_bubble_path(@bubble.bucket, @bubble),
method: :delete,
class: "btn",
data: { turbo_confirm: "Are you sure you want to delete this?" } do %>
<%= image_tag "trash.svg", aria: { hidden: true }, size: 24 %>
<span class="for-screen-reader">Delete</span>
<% end %>
</div>
<% if @bubble.published? %>
<div class="card__actions card__actions--right flex flex-column gap-half">
<%= turbo_frame_tag dom_id(@bubble, :watch), src: bucket_bubble_watch_path(@bubble.bucket, @bubble) %>
<%= turbo_frame_tag dom_id(@bubble, :pin), src: bucket_bubble_pin_path(@bubble.bucket, @bubble) %>
</div>
<% end %>
</div>
<% unless @bubble.drafted? || @bubble.creating? %>
<div class="card__actions-wrapper">
<%= render "bubbles/pop_toggle", bubble: @bubble %>
</div>
<% end %>
<% if @bubble.published? %>
<%= render "bubbles/messages", bubble: @bubble %>
<% else %>
<div class="comments align-center center borderless margin-block-start flex flex-column gap-half">
<div class="comment comment--new flex align-start full-width">
<form data-controller="outlet-auto-save paste"
class="flex flex-column gap full-width"
data-outlet-auto-save-auto-save-outlet="#bubble_form"
data-action="paste->paste#pasteFiles">
<%= tag.house_md @bubble.draft_comment, name: "bubble[draft_comment]", class: "input comment__input",
form: "bubble_form",
placeholder: new_comment_placeholder(@bubble),
data: { action: "house-md:change->outlet-auto-save#change focusout->outlet-auto-save#submit", uploads_url: uploads_url(format: "json") } %>
</form>
</div>
</div>
<% end %>
<% if @bubble.creating? %>
<div class="comments center pad-block flex align-center gap">
<%= button_to "Create card", 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" %>
</div>
<% end %>
</div>
<%= link_to "Go back", bubbles_path(bucket_ids: [ @bubble.bucket ]), class: "btn", data: { controller: "hotkey", action: "keydown.esc@document->hotkey#click" }, hidden: true %>
<%= render "notifications/tray" %>
<%= render "bubbles/pins/tray" %>