Nest bubbles et al under projects
This commit is contained in:
@@ -1,30 +1,24 @@
|
||||
class AssignmentsController < ApplicationController
|
||||
before_action :set_bubble, only: %i[ create update ]
|
||||
include BubbleScoped, ProjectScoped
|
||||
|
||||
before_action :set_assignment, only: :update
|
||||
|
||||
def create
|
||||
@assignment = @bubble.assignments.build(assignment_params)
|
||||
@assignment.save
|
||||
|
||||
redirect_to @bubble
|
||||
@assignment = @bubble.assignments.create!(assignment_params)
|
||||
redirect_to project_bubble_url(@project, @bubble)
|
||||
end
|
||||
|
||||
def update
|
||||
@assignment.update(assignment_params)
|
||||
redirect_to @bubble
|
||||
@assignment.update!(assignment_params)
|
||||
redirect_to project_bubble_url(@project, @bubble)
|
||||
end
|
||||
|
||||
private
|
||||
def assignment_params
|
||||
params.require(:assignment).permit(:user_id)
|
||||
end
|
||||
|
||||
def assignment_params
|
||||
params.require(:assignment).permit(:user_id)
|
||||
end
|
||||
|
||||
def set_assignment
|
||||
@assignment = @bubble.assignments.find(params[:id])
|
||||
end
|
||||
|
||||
def set_bubble
|
||||
@bubble = Bubble.find(params[:bubble_id])
|
||||
end
|
||||
def set_assignment
|
||||
@assignment = @bubble.assignments.find(params[:id])
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class BoostsController < ApplicationController
|
||||
include BubbleScoped
|
||||
include BubbleScoped, ProjectScoped
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
class Bubbles::ImagesController < ApplicationController
|
||||
include BubbleScoped
|
||||
include BubbleScoped, ProjectScoped
|
||||
|
||||
def destroy
|
||||
@bubble.image.purge_later
|
||||
redirect_to @bubble
|
||||
redirect_to project_bubble_url(@bubble.project, @bubble)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
class BubblesController < ApplicationController
|
||||
include ProjectScoped
|
||||
|
||||
before_action :set_bubble, only: %i[ show edit update ]
|
||||
|
||||
def index
|
||||
@@ -8,17 +10,17 @@ class BubblesController < ApplicationController
|
||||
@most_active_bubbles = @tag.bubbles.left_joins(:comments, :boosts).group(:id).order(Arel.sql("COUNT(comments.id) + COUNT(boosts.id) DESC")).limit(10)
|
||||
else
|
||||
@bubbles = Bubble.all.order(created_at: :desc)
|
||||
@most_active_bubbles = Bubble.left_joins(:comments, :boosts).group(:id).order(Arel.sql("COUNT(comments.id) + COUNT(boosts.id) DESC")).limit(10)
|
||||
@most_active_bubbles = @project.bubbles.left_joins(:comments, :boosts).group(:id).order(Arel.sql("COUNT(comments.id) + COUNT(boosts.id) DESC")).limit(10)
|
||||
end
|
||||
end
|
||||
|
||||
def new
|
||||
@bubble = Bubble.new
|
||||
@bubble = @project.bubbles.build
|
||||
end
|
||||
|
||||
def create
|
||||
@bubble = Bubble.create!(bubble_params)
|
||||
redirect_to @bubble
|
||||
@bubble = @project.bubbles.create!(bubble_params)
|
||||
redirect_to project_bubble_url(@project, @bubble)
|
||||
end
|
||||
|
||||
def show
|
||||
@@ -29,13 +31,13 @@ class BubblesController < ApplicationController
|
||||
|
||||
def update
|
||||
@bubble.update!(bubble_params)
|
||||
redirect_to @bubble
|
||||
redirect_to project_bubble_url(@project, @bubble)
|
||||
end
|
||||
|
||||
|
||||
private
|
||||
def set_bubble
|
||||
@bubble = Bubble.find(params[:id])
|
||||
@bubble = @project.bubbles.find(params[:id])
|
||||
end
|
||||
|
||||
def bubble_params
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
class CommentsController < ApplicationController
|
||||
include BubbleScoped
|
||||
include BubbleScoped, ProjectScoped
|
||||
|
||||
def create
|
||||
@bubble.comments.create!(comment_params)
|
||||
redirect_to @bubble
|
||||
redirect_to project_bubble_url(@project, @bubble)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -7,6 +7,6 @@ module BubbleScoped
|
||||
|
||||
private
|
||||
def set_bubble
|
||||
@bubble = Bubble.find(params[:bubble_id])
|
||||
@bubble = @project.bubbles.find(params[:bubble_id])
|
||||
end
|
||||
end
|
||||
|
||||
@@ -11,10 +11,7 @@ class ProjectsController < ApplicationController
|
||||
|
||||
def create
|
||||
@project = Current.account.projects.create!(project_params)
|
||||
redirect_to @project
|
||||
end
|
||||
|
||||
def show
|
||||
redirect_to project_url(@project)
|
||||
end
|
||||
|
||||
def edit
|
||||
@@ -22,7 +19,7 @@ class ProjectsController < ApplicationController
|
||||
|
||||
def update
|
||||
@project.update!(project_params)
|
||||
redirect_to @project
|
||||
redirect_to project_url(@project)
|
||||
end
|
||||
|
||||
def destroy
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
class TagsController < ApplicationController
|
||||
include ProjectScoped
|
||||
|
||||
before_action :set_bubble, only: %i[ new create ]
|
||||
before_action :set_tag, only: :destroy
|
||||
|
||||
@@ -11,12 +13,12 @@ class TagsController < ApplicationController
|
||||
|
||||
def create
|
||||
@bubble.tags << Tag.find_or_create_by!(tag_params)
|
||||
redirect_to @bubble
|
||||
redirect_to project_bubble_url(@project, @bubble)
|
||||
end
|
||||
|
||||
def destroy
|
||||
@tag.destroy
|
||||
redirect_to tags_path
|
||||
redirect_to project_tags_url(@project)
|
||||
end
|
||||
|
||||
private
|
||||
@@ -29,6 +31,6 @@ class TagsController < ApplicationController
|
||||
end
|
||||
|
||||
def set_bubble
|
||||
@bubble = Bubble.find(params[:bubble_id])
|
||||
@bubble = @project.bubbles.find(params[:bubble_id])
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<%= link_to new_bubble_boost_path(bubble), data: { action: "toggle-class#toggle" } do %>
|
||||
<%= link_to new_project_bubble_boost_path(bubble.project, bubble), data: { action: "toggle-class#toggle" } do %>
|
||||
+ <%= bubble.boosts.size if bubble.boosts.any? %>
|
||||
<% end %>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<%= turbo_frame_tag dom_id(@bubble, :boosts) do %>
|
||||
<%= form_with url: bubble_boosts_path(@bubble), data: { controller: "auto-submit" } do |form| %>
|
||||
<%= form_with url: project_bubble_boosts_path(@bubble.project, @bubble), data: { controller: "auto-submit" } do |form| %>
|
||||
<%= form.submit "Boost this", hidden: true %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<span class="bubble__bubble bubble__meta bubble__assignee <%= "bubble__assignee--new" if bubble.assignees.none? %>">
|
||||
<%= form_with model: [bubble, Assignment.new], data: { controller: "form" } do |form| %>
|
||||
<%= form_with model: Assignment.new, url: project_bubble_assignments_path(bubble.project, bubble), data: { controller: "form" } do |form| %>
|
||||
<label class="btn btn--plain position-relative fill-transparent" style="--btn-icon-size: 2em;">
|
||||
<% if bubble.assignees.any? %>
|
||||
<% if bubble.assignees.many? %>
|
||||
|
||||
@@ -4,5 +4,5 @@
|
||||
animation_play_class: "boosting",
|
||||
toggle_class_toggle_class: "boosting",
|
||||
action: "animationend->toggle-class#toggle" } do %>
|
||||
<%= turbo_frame_tag dom_id(bubble, :boosts), src: bubble_boosts_path(bubble) %>
|
||||
<%= turbo_frame_tag dom_id(bubble, :boosts), src: project_bubble_boosts_path(bubble.project, bubble) %>
|
||||
<% end %>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<div class="bubble" data-controller="upload-preview" style="view-transition-name: bubble-<%= bubble.id -%>; --bubble-color: <%= bubble.color %>; <%= bubble_rotation(bubble) -%> <%= bubble_size(bubble) %>">
|
||||
<h1 class="bubble__title">
|
||||
<%= turbo_frame_tag bubble, :edit do %>
|
||||
<%= link_to bubble.title, edit_bubble_path(bubble), class: "txt-undecorated" %>
|
||||
<%= link_to bubble.title, edit_project_bubble_path(bubble.project, bubble), class: "txt-undecorated" %>
|
||||
<% end %>
|
||||
</h1>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<path d="m391.65 879.47c-110.52-15.95-212.21-91.86-255.92-191.23-66.78-143.65-41.62-347.61 48.08-481.17 368.33-516.3 1252.97 520.2 451.03 660.78-44.07 8.84-88.98 13.49-133.01 15.68-36.69 2-73.37 1.91-109.99-4.03z"/>
|
||||
</svg>
|
||||
|
||||
<%= link_to bubble, class: "bubble__link" do %>
|
||||
<%= link_to project_bubble_path(bubble.project, bubble), class: "bubble__link" do %>
|
||||
<span class="for-screen-reader"><%= bubble.title %></span>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
</button>
|
||||
|
||||
<dialog class="bubble__color-picker" data-dialog-target="dialog">
|
||||
<%= form_with model: bubble, data: { controller: "form", action: "change->form#submit" } do |form| %>
|
||||
<%= form_with model: bubble, url: project_bubble_path(bubble.project, bubble), data: { controller: "form", action: "change->form#submit" } do |form| %>
|
||||
<% Bubble.colors.keys.each do |color| %>
|
||||
<span class="bubble__color-picker__color">
|
||||
<label class="btn btn--circle" style="--btn-background: <%= color -%>" title="<%= color %>">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<% if bubble.due_on.present? %>
|
||||
<%= form_with model: bubble, data: { controller: "form" } do |form| %>
|
||||
<%= form_with model: bubble, url: project_bubble_path(bubble.project, bubble), data: { controller: "form" } do |form| %>
|
||||
<label class="bubble__bubble bubble__meta bubble__date">
|
||||
<%= bubble.due_on.strftime("%b <br> %d").html_safe %>
|
||||
<%= form.date_field :due_on, class: "input input--hidden", data: { action: "change->form#submit click->form#showPicker" } %>
|
||||
@@ -8,7 +8,7 @@
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="bubble__bubble bubble__meta bubble__date bubble__date--new">
|
||||
<%= form_with model: bubble, data: { controller: "form" } do |form| %>
|
||||
<%= form_with model: bubble, url: project_bubble_path(bubble.project, bubble), data: { controller: "form" } do |form| %>
|
||||
<label class="btn btn--plain" style="--btn-icon-size: 2.5em; margin-inline-end: -0.2em">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="var(--bubble-color)"><path d="M9.569,16.5H2.5A.5.5,0,0,1,2,16V7.5A.5.5,0,0,1,2.5,7H16a.5.5,0,0,1,.5.5V9.57a7.281,7.281,0,0,1,2,0V3a1,1,0,0,0-1-1H15a.25.25,0,0,1-.25-.25v-1a.75.75,0,1,0-1.5,0V4.5a.75.75,0,1,1-1.5,0v-2a.5.5,0,0,0-.5-.5H7a.25.25,0,0,1-.25-.25v-1a.75.75,0,0,0-1.5,0V4.5a.75.75,0,1,1-1.5,0v-2a.5.5,0,0,0-.5-.5H1A1,1,0,0,0,0,3V16.5a2,2,0,0,0,2,2H9.569a7.281,7.281,0,0,1,0-2Z"/><path fill="var(--color-positive)" d="M17.5,11A6.5,6.5,0,1,0,24,17.5,6.508,6.508,0,0,0,17.5,11Zm.75,9a.75.75,0,1,1-1.5,0V18.5a.25.25,0,0,0-.25-.25H15a.75.75,0,0,1,0-1.5h1.5a.25.25,0,0,0,.25-.25V15a.75.75,0,1,1,1.5,0v1.5a.25.25,0,0,0,.25.25H20a.75.75,0,0,1,0,1.5H18.5a.25.25,0,0,0-.25.25Z"/></svg>
|
||||
<%= form.date_field :due_on, class: "input input--hidden", data: { action: "change->form#submit click->form#showPicker"} %>
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
|
||||
<div class="bubble__bubble bubble__meta bubble__attachment">
|
||||
<% if bubble.image.attached? %>
|
||||
<%= button_to bubble_image_path(bubble), method: :delete, class: "btn btn--plain", style: "--btn-icon-size: 3em; margin-block-start: -0.5em; margin-inline-end: -0.2em" do %>
|
||||
<%= button_to project_bubble_image_path(bubble.project, bubble), method: :delete, class: "btn btn--plain", style: "--btn-icon-size: 3em; margin-block-start: -0.5em; margin-inline-end: -0.2em" do %>
|
||||
<svg viewBox="0 0 24 20" xmlns="http://www.w3.org/2000/svg" fill="var(--bubble-color)"><path fill="var(--color-negative)" d="m19.1 0c-2.8 0-5 2.2-5 5s2.2 5 5 5 5-2.2 5-5-2.2-5-5-5zm-.8 5.7h-1.2c-.3 0-.6-.3-.6-.6s.3-.6.6-.6h1.2s1.6 0 1.6 0h1.2c.3 0 .6.3.6.6s-.3.6-.6.6h-1.2s-1.6 0-1.6 0z"/><path d="m6.7 10.5c.9 0 1.6-.7 1.6-1.6s-.7-1.6-1.6-1.6-1.6.7-1.6 1.6.7 1.6 1.6 1.6z" fill="none"/><path d="m9.7 16.9h.1l-.1-.1z"/><path d="m19.2 11.6v6.3c0 .2 0 .4-.4.4h-16.8v-13.7c0-.2 0-.4.4-.4h10.1c0-.7.3-1.3.5-1.8h-11.6c-.9.2-1.4.9-1.4 1.8v14c0 1 .8 1.8 1.8 1.8h17.5c1 0 1.8-.8 1.8-1.8v-6.9c-.6.2-1.2.3-1.8.3z"/><path d="m4.8 5.5c-.7 0-1.3.6-1.3 1.3v8.9c0 .4.2.7.5 1l2.6-3.5c.2-.3.6-.5.9-.5s0 0 0 0c.4 0 .7.2.9.5l.9 1.3 2.3-3.5c.3-.4.8-.7 1.3-.7s0 0 0 0c.5 0 1 .3 1.3.7l3.1 5c0-.1 0-.2 0-.3v-4.2c-2.8-.6-4.9-3-5.1-6h-7.6zm1.9 5c-.9 0-1.6-.7-1.6-1.6s.7-1.6 1.6-1.6 1.6.7 1.6 1.6-.7 1.6-1.6 1.6z"/><path d="m5.2 16.9h2.6l1-1.5-1.2-1.7z"/><path d="m10.4 15.8-.7 1 .1.1h1.3 5.1l-3.1-5.1z"/></svg>
|
||||
<span class="for-screen-reader">Remove image</span>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<%= form_with model: bubble, data: { controller: "form" } do |form| %>
|
||||
<%= form_with model: bubble, url: project_bubble_path(bubble.project, bubble), data: { controller: "form" } do |form| %>
|
||||
<label class="btn btn--plain input--file" style="--btn-icon-size: 3em; margin-block-start: -0.5em; margin-inline-end: -0.2em">
|
||||
<svg viewBox="0 0 24 20" xmlns="http://www.w3.org/2000/svg" fill="var(--bubble-color)"><path fill="var(--color-positive)" d="m19.1 0c-2.8 0-5 2.2-5 5s2.2 5 5 5 5-2.2 5-5-2.2-5-5-5zm-.1 2.5c.3 0 .6.3.6.6v1.2c0 .2 0 .2.2.2h1.2c.3 0 .6.3.6.6s-.3.6-.6.6h-1.2c-.2 0-.2 0-.2.2v1.2c0 .3-.3.6-.6.6s-.6-.3-.6-.6v-1.2c0-.2 0-.2-.2-.2h-1.2c-.3 0-.6-.3-.6-.6s.3-.6.6-.6h1.2c.2 0 .2 0 .2-.2v-1.2c0-.3.3-.6.6-.6z"/><path d="m6.7 10.5c.9 0 1.6-.7 1.6-1.6s-.7-1.6-1.6-1.6-1.6.7-1.6 1.6.7 1.6 1.6 1.6z" fill="none"/><path d="m9.7 16.9h.1l-.1-.1z"/><path d="m19.2 11.6v6.3c0 .2 0 .4-.4.4h-16.8v-13.7c0-.2 0-.4.4-.4h10.1c0-.7.3-1.3.5-1.8h-11.6c-.9.2-1.4.9-1.4 1.8v14c0 1 .8 1.8 1.8 1.8h17.5c1 0 1.8-.8 1.8-1.8v-6.9c-.6.2-1.2.3-1.8.3z"/><path d="m4.8 5.5c-.7 0-1.3.6-1.3 1.3v8.9c0 .4.2.7.5 1l2.6-3.5c.2-.3.6-.5.9-.5s0 0 0 0c.4 0 .7.2.9.5l.9 1.3 2.3-3.5c.3-.4.8-.7 1.3-.7s0 0 0 0c.5 0 1 .3 1.3.7l3.1 5c0-.1 0-.2 0-.3v-4.2c-2.8-.6-4.9-3-5.1-6h-7.6zm1.9 5c-.9 0-1.6-.7-1.6-1.6s.7-1.6 1.6-1.6 1.6.7 1.6 1.6-.7 1.6-1.6 1.6z"/><path d="m5.2 16.9h2.6l1-1.5-1.2-1.7z"/><path d="m10.4 15.8-.7 1 .1.1h1.3 5.1l-3.1-5.1z"/></svg>
|
||||
<%= form.file_field :image, class: "input",
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<% bubble.tags.each do |tag| %>
|
||||
<%= link_to "##{tag.title}", bubbles_path(tag_id: tag), class: "bubble__bubble bubble__meta bubble__tag" %>
|
||||
<%= link_to "##{tag.title}", project_bubbles_path(bubble.project, tag_id: tag), class: "bubble__bubble bubble__meta bubble__tag" %>
|
||||
<% end %>
|
||||
|
||||
<% if bubble.tags.size < 3 %>
|
||||
<span class="bubble__bubble bubble__meta bubble__tag">
|
||||
<%= turbo_frame_tag :new_tag do %>
|
||||
<%= link_to "#", new_bubble_tag_path(bubble), class: "bubble__tag--new" %>
|
||||
<%= link_to "#", new_project_bubble_tag_path(bubble.project, bubble), class: "bubble__tag--new" %>
|
||||
<% end %>
|
||||
</span>
|
||||
<% end %>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<%= turbo_frame_tag @bubble, :edit do %>
|
||||
<%= form_with model: @bubble, class: "flex flex-column gap full-width", data: { controller: "form" } do |form| %>
|
||||
<%= form_with model: @bubble, url: project_bubble_path(@bubble.project, @bubble), class: "flex flex-column gap full-width", data: { controller: "form" } do |form| %>
|
||||
<%= form.label :title, class: "flex flex-column justify-center align-center" do %>
|
||||
<%= form.text_area :title, class: "input input--textara txt-align-center full-width borderless",
|
||||
required: true, rows: 5, autofocus: true, placeholder: "Name it…",
|
||||
@@ -7,6 +7,6 @@
|
||||
style: "color: var(--spat-color); --input-border-radius: 0" %>
|
||||
<% end %>
|
||||
<%= form.submit "Save", hidden: true %>
|
||||
<%= link_to "Close editor and discard changes", bubble_path(@bubble), data: { form_target: "cancel" }, hidden: true %>
|
||||
<%= link_to "Close editor and discard changes", project_bubble_path(@bubble.project, @bubble), data: { form_target: "cancel" }, hidden: true %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -11,14 +11,14 @@
|
||||
<% if @tag %>
|
||||
in <%= @tag.title %>
|
||||
|
||||
<%= link_to bubbles_path, class: "btn txt-small" do %>
|
||||
<%= link_to project_bubbles_path(@project), class: "btn txt-small" do %>
|
||||
<%= image_tag "remove.svg", aria: { hidden: true }, size: 24 %>
|
||||
<span class="for-screen-reader">Clear</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</h1>
|
||||
|
||||
<%= button_to bubbles_path, method: :post, params: { bubble: { title: "Untitled"} }, class: "btn btn--plain", form_class: "flex-item-justify-end" do %>
|
||||
<%= button_to project_bubbles_path(@project), method: :post, params: { bubble: { title: "Untitled"} }, class: "btn btn--plain", form_class: "flex-item-justify-end" do %>
|
||||
<%= image_tag "bubble-add.svg", aria: { hidden: true }, size: 24 %>
|
||||
<span class="for-screen-reader">Create a new bubble</span>
|
||||
<% end %>
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<%= link_to bubble, class: "bubble__title-link flex align-center gap flex-item-grow min-width" do %>
|
||||
<%= link_to project_bubble_path(bubble.project, bubble), class: "bubble__title-link flex align-center gap flex-item-grow min-width" do %>
|
||||
<strong class="bubble__title-text flex--inline gap-half overflow-ellipsis"><%= bubble.title %></strong>
|
||||
<% end %>
|
||||
|
||||
<small class="flex align-center gap flex-item-no-shrink">
|
||||
<% bubble.tags.each do |tag| %>
|
||||
<%= link_to "##{tag.title}", bubbles_path(tag_id: tag.id), style: "color: #{ bubble.color }" %>
|
||||
<%= link_to "##{tag.title}", project_bubbles_path(bubble.project, tag_id: tag.id), style: "color: #{bubble.color}" %>
|
||||
<% end %>
|
||||
<time class="txt-nowrap flex-item-justify-end"><%= bubble.created_at.strftime("%b %d") %></time>
|
||||
</small>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="bubble__perma flex justify-center center">
|
||||
<div class="bubble" style="view-transition-name: bubble-<%= @bubble.id -%>; --bubble-color: <%= @bubble.color %>; <%= bubble_size(@bubble) %> <%= bubble_rotation(@bubble) %>">
|
||||
<%= form_with model: @bubble, class: "flex flex-column gap full-width" do |form| %>
|
||||
<%= form_with model: @bubble, url: project_bubble_path(@bubble.project, @bubble), class: "flex flex-column gap full-width" do |form| %>
|
||||
<h1 class="bubble__title">
|
||||
<%= form.text_area :title, class: "input full-width borderless", required: true, placeholder: "Name it…", rows: 4, autofocus: true %>
|
||||
</h1>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<% content_for :header do %>
|
||||
<nav>
|
||||
<%= link_to bubbles_path, class: "btn flex-item-justify-start" do %>
|
||||
<%= link_to project_bubbles_path(@bubble.project), class: "btn flex-item-justify-start" do %>
|
||||
<%= image_tag "arrow-left.svg", aria: { hidden: true }, size: 24 %>
|
||||
<span class="for-screen-reader">All Bubbles</span>
|
||||
<% end %>
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
<dialog class="panel" id="bubble-edit-panel" data-dialog-target="dialog" popover>
|
||||
<div class="flex pad">
|
||||
<%= turbo_frame_tag @bubble, :edit, src: edit_bubble_path(@bubble), target: "_top" %>
|
||||
<%= turbo_frame_tag @bubble, :edit, src: edit_project_bubble_path(@bubble.project, @bubble), target: "_top" %>
|
||||
</div>
|
||||
</dialog>
|
||||
</div>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<div class="comment__content flex flex-column full-width fill-shade border-radius">
|
||||
<div class="comment__author flex align-center gap-half">
|
||||
<strong><%= comment.creator.name %></strong>
|
||||
<%= link_to bubble_path(@bubble, anchor: "comment_#{comment.id}"), class: "txt-undecorated" do %>
|
||||
<%= link_to project_bubble_path(@bubble.project, @bubble, anchor: "comment_#{comment.id}"), class: "txt-undecorated" do %>
|
||||
<time class="comment__timestamp"><%= comment.created_at.strftime("%b %d").html_safe %></time>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<strong><%= Current.user.name %></strong>
|
||||
</div>
|
||||
<div class="comment__body txt-align-start margin-block-start-half">
|
||||
<%= form_with model: Comment.new, url: bubble_comments_path(@bubble), class: "flex flex-column gap full-width" do |form| %>
|
||||
<%= form_with model: Comment.new, url: project_bubble_comments_path(@bubble.project, @bubble), class: "flex flex-column gap full-width" do |form| %>
|
||||
<%= form.text_area :body, class: "input", required: true, rows: 4,
|
||||
placeholder: (@bubble.comments.empty? && @bubble.creator == Current.user) ? "Add some notes…" : "Type your comment…" %>
|
||||
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
|
||||
<ul>
|
||||
<% @projects.each do |project| %>
|
||||
<li><%= link_to project.name, project %></li>
|
||||
<li><%= link_to project.name, project_bubbles_path(project) %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
<h1>Project: <%= @project.name %></h1>
|
||||
<p><%= link_to "Edit", edit_project_path(@project) %>
|
||||
@@ -1,5 +1,5 @@
|
||||
<%= turbo_frame_tag :new_tag do %>
|
||||
<%= form_with model: Tag.new, url: bubble_tags_path(@bubble), data: { turbo_frame: "_top" } do |form| %>
|
||||
<%= form_with model: Tag.new, url: project_bubble_tags_path(@bubble.project, @bubble), data: { turbo_frame: "_top" } do |form| %>
|
||||
<%= form.text_field :title, class: "input borderless", autofocus: "on", list: "tags-list" %>
|
||||
<%= form.submit "Create Tag", hidden: true %>
|
||||
|
||||
|
||||
+12
-12
@@ -1,22 +1,22 @@
|
||||
Rails.application.routes.draw do
|
||||
root "bubbles#index"
|
||||
root "projects#index"
|
||||
|
||||
resource :session
|
||||
|
||||
resources :projects do
|
||||
resource :access, controller: "projects/accesses"
|
||||
|
||||
resources :bubbles do
|
||||
resource :image, controller: "bubbles/images"
|
||||
|
||||
resources :assignments
|
||||
resources :boosts
|
||||
resources :comments
|
||||
resources :tags, shallow: true
|
||||
end
|
||||
|
||||
resources :tags, only: :index
|
||||
end
|
||||
|
||||
resources :bubbles do
|
||||
resource :image, controller: "bubbles/images"
|
||||
|
||||
resources :assignments
|
||||
resources :boosts
|
||||
resources :comments
|
||||
resources :tags, shallow: true
|
||||
end
|
||||
|
||||
resources :tags, only: :index
|
||||
|
||||
get "up", to: "rails/health#show", as: :rails_health_check
|
||||
end
|
||||
|
||||
Generated
-1
@@ -21,7 +21,6 @@ ActiveRecord::Schema[8.0].define(version: 2024_09_17_174301) do
|
||||
t.index ["user_id"], name: "index_accesses_on_user_id"
|
||||
end
|
||||
|
||||
>>>>>>> d17053b (Introduce projects and accesses)
|
||||
create_table "accounts", force: :cascade do |t|
|
||||
t.string "name", null: false
|
||||
t.datetime "created_at", null: false
|
||||
|
||||
Vendored
+4
-6
@@ -1,9 +1,7 @@
|
||||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
user: :kevin
|
||||
bubble: one
|
||||
user: kevin
|
||||
bubble: logo
|
||||
|
||||
two:
|
||||
user: :jz
|
||||
bubble: two
|
||||
user: jz
|
||||
bubble: layout
|
||||
|
||||
Reference in New Issue
Block a user