Files
fizzy/app/views/bubbles/show.html.erb
T
Jose Farias 88e3640272 Merge branch 'main' into comboboxes
* main:
  Ensure @filter isn't nil
  Bump boost size, adjust assignee alignment
  Stub duplicate finder button
  Move pop action
  Remove some of the more vertical ones
  List name next to assignee
  Bump font size
  Display tags inside the bubble
  Needs a little structure
  Pull back comment decoration
  Tighten up menu
  Tighten-up workflow panel
2024-11-25 14:00:52 -06:00

112 lines
5.2 KiB
Plaintext

<% @page_title = @bubble.title %>
<% @filter ||= Current.user.filters.first || Filter.persist!({}) %>
<% content_for :header do %>
<nav>
<%= link_to "#", class: "btn flex-item-justify-start", data: { controller: "back-navigation", back_navigation_fallback_destination_value: bubbles_path(bucket_id: @bubble.bucket) } do %>
<%= image_tag "arrow-left.svg", aria: { hidden: true }, size: 24 %>
<span class="for-screen-reader">Back</span>
<% end %>
</nav>
<% end %>
<aside class="flex align-start justify-end" style="--bubble-color: <%= @bubble.color %>">
<div class="flex flex-column" style="row-gap: 3px;">
<%= render "bubbles/color", bubble: @bubble %>
<%= form_with model: @bubble, url: bucket_bubble_path(@bubble.bucket, @bubble), data: { controller: "form" } do |form| %>
<label class="btn full-width justify-start borderless">
<%= image_tag "calendar-add.svg", aria: { hidden: true }, size: 24 %>
<span><%= @bubble.due_on.present? ? "Change" : "Add a" %> date</span>
<%= form.date_field :due_on, class: "input input--hidden", data: { action: "change->form#submit click->form#showPicker" } %>
</label>
<% end %>
<%= render "bubbles/sidebar/assignment", bubble: @bubble %>
<%= render "bubbles/sidebar/tag", bubble: @bubble %>
<%= form_with url: "/", data: { controller: "form" } do |form| %>
<label class="btn full-width justify-start borderless">
<%= image_tag "person.svg", aria: { hidden: true }, size: 24 %>
<span>Assign to…</span>
<%= form.collection_select :assignee_id, @bubble.bucket.users.active, :id, :name, { prompt: "Assign to…", selected: @bubble.assignees.pluck(:id) },
class: "input input--hidden txt-medium",
data: { action: "change->form#submit click->form#showPicker" } %>
</label>
<% end %>
<div class="position-relative" data-controller="dialog" data-action="keydown.esc->dialog#close">
<button class="btn full-width justify-start borderless" data-action="dialog#toggle">
<%= image_tag "tag.svg", aria: { hidden: true }, size: 24 %>
<span>Tags</span>
</button>
<dialog class="tag-picker panel fill-white shadow gap-half align-center" data-dialog-target="dialog" data-action="keydown.esc->dialog#close click@document->dialog#closeOnClickOutside">
<%= image_tag "tag.svg", aria: { hidden: true }, size: 24 %>
<%= form_with model: Tag.new, url: bucket_bubble_tags_path(@bubble.bucket, @bubble), class: "min-width flex-item-grow", data: { turbo_frame: "_top" } do |form| %>
<%= form.text_field :title, class: "input", autofocus: "on", list: "tags-list" %>
<%= form.submit "Create Tag", hidden: true %>
<datalist id="tags-list">
<%= Current.account.tags.each do |tag| %>
<option value="<%= tag.title %>"></option>
<% end %>
</datalist>
<% end %>
<form method="dialog">
<button class="btn txt-small" title="Close (esc)">
<%= image_tag "remove.svg", aria: { hidden: true }, size: 24 %>
<span class="for-screen-reader">Close</span>
</button>
</form>
</dialog>
</div>
<% if @bubble.image.attached? %>
<%= button_to bucket_bubble_image_path(@bubble.bucket, @bubble), method: :delete, class: "btn full-width justify-start borderless" do %>
<%= image_tag "picture-add.svg", aria: { hidden: true }, size: 24 %>
<span>Clear background image</span>
<% end %>
<% else %>
<%= form_with model: @bubble, url: bucket_bubble_path(@bubble.bucket, @bubble), data: { controller: "form" } do |form| %>
<label class="btn full-width justify-start borderless">
<%= image_tag "picture-add.svg", aria: { hidden: true }, size: 24 %>
<span>Add an image</span>
<%= form.file_field :image, class: "input",
accept: "image/png, image/jpeg, image/jpg, image/webp",
data: { action: "upload-preview#previewImage form#submit", upload_preview_target: "input" },
hidden: true %>
</label>
<% end %>
<% end %>
<%= button_to bucket_bubble_boosts_path(@bubble.bucket, @bubble), class: "btn full-width justify-start borderless", data: { turbo_frame: dom_id(@bubble, :boosts) } do %>
<%= image_tag "thumb-up.svg", aria: { hidden: true }, size: 24 %>
<span>Boost this</span>
<% end %>
<hr class="separator--horizontal full-width" style="--border-color: var(--color-subtle);" />
<%= render "bubbles/pop_toggle", bubble: @bubble %>
<button class="btn full-width justify-start borderless">
<%= image_tag "picture-double.svg", aria: { hidden: true }, size: 24 %>
<span>I've seen this</span>
</button>
</div>
</aside>
<div class="bubble__container">
<div class="bubble__perma flex justify-center center margin-block-end-double">
<%= render "bubbles/bubble", bubble: @bubble %>
</div>
<%= render "bubbles/messages", bubble: @bubble %>
</div>
<div class="flex align-start justify-start">
<%= turbo_frame_tag dom_id(@bubble, :stage_picker), src: new_bucket_bubble_stage_picker_path(@bubble.bucket, @bubble) %>
</div>