diff --git a/app/assets/stylesheets/splats.css b/app/assets/stylesheets/splats.css
index 0dd687956..d189e72b9 100644
--- a/app/assets/stylesheets/splats.css
+++ b/app/assets/stylesheets/splats.css
@@ -69,7 +69,7 @@
.splat__bubble {
aspect-ratio: 1 / 0.96;
background-color: var(--color-bg);
- background-image: radial-gradient(90% 90% at 50% 50%, #FFFFFF80 0%, #ffffff90 45%, var(--splat-color) 70%);
+ background-image: radial-gradient(90% 90% at 50% 50%, #FFFFFFFF 0%, #ffffff90 45%, var(--splat-color) 70%);
background-position: 0;
background-size: 100%;
block-size: 95%;
@@ -79,11 +79,20 @@
transform: rotate(var(--splat-rotate));
z-index: -1;
+ a {
+ color: var(--splat-color);
+ }
+
&.splat__category {
+ aspect-ratio: unset;
inset: auto auto 3cqi 3cqi;
+ & {
- inset: auto auto 0 24cqi;
+ inset: auto auto -5cqi 26cqi;
+
+ + & {
+ inset: auto auto -5cqi 52cqi;
+ }
}
}
@@ -105,6 +114,12 @@
scale: 1;
transform: none;
}
+
+ &.splat__category-new {
+ .windshield & {
+ display: none;
+ }
+ }
}
.splat__title {
diff --git a/app/assets/stylesheets/utilities.css b/app/assets/stylesheets/utilities.css
index d6f2dd0fa..0a3173ff6 100644
--- a/app/assets/stylesheets/utilities.css
+++ b/app/assets/stylesheets/utilities.css
@@ -239,3 +239,8 @@
/* Visibility */
[hidden] { display: none; }
[contents] { display: contents; }
+
+/* Turbo */
+turbo-frame {
+ display: contents;
+}
diff --git a/app/controllers/categories_controller.rb b/app/controllers/categories_controller.rb
new file mode 100644
index 000000000..02af1a511
--- /dev/null
+++ b/app/controllers/categories_controller.rb
@@ -0,0 +1,39 @@
+class CategoriesController < ApplicationController
+ before_action :set_category, only: :destroy
+ before_action :set_splat, only: %i[ new create ]
+
+ def index
+ @categories = Category.all
+ end
+
+ def new
+ @category = Category.new
+ end
+
+ def create
+ @category = Category.new(category_params)
+ @category.save
+
+ @category.splats << @splat
+ redirect_to splat_path(@splat)
+ end
+
+ def destroy
+ @category.destroy
+ redirect_to categories_path
+ end
+
+ private
+
+ def category_params
+ params.require(:category).permit(:title)
+ end
+
+ def set_category
+ @category = Category.find(params[:id])
+ end
+
+ def set_splat
+ @splat = Splat.find(params[:splat_id])
+ end
+end
diff --git a/app/controllers/splats_controller.rb b/app/controllers/splats_controller.rb
index ae5408174..cfe056b28 100644
--- a/app/controllers/splats_controller.rb
+++ b/app/controllers/splats_controller.rb
@@ -1,5 +1,5 @@
class SplatsController < ApplicationController
- before_action :set_splat, only: [ :show, :edit, :update ]
+ before_action :set_splat, only: %i[ show edit update ]
def index
if params[:category_id]
diff --git a/app/models/category.rb b/app/models/category.rb
index bd7a63a92..4034bd7be 100644
--- a/app/models/category.rb
+++ b/app/models/category.rb
@@ -1,4 +1,4 @@
class Category < ApplicationRecord
has_many :categorizations
- has_many :splats, through: :categorizations
+ has_many :splats, through: :categorizations, dependent: :destroy
end
diff --git a/app/views/categories/index.html.erb b/app/views/categories/index.html.erb
new file mode 100644
index 000000000..0c175fd23
--- /dev/null
+++ b/app/views/categories/index.html.erb
@@ -0,0 +1,20 @@
+All categories
+
+ <% @categories.each do | category | %>
+
+