Categorize splats
This commit is contained in:
@@ -4,10 +4,11 @@
|
||||
|
||||
.btn {
|
||||
--transition: 300ms ease;
|
||||
--btn-border-radius: 2em;
|
||||
|
||||
align-items: center;
|
||||
background-color: var(--btn-background, var(--color-bg));
|
||||
border-radius: var(--btn-border-radius, 2em);
|
||||
border-radius: var(--btn-border-radius);
|
||||
border: var(--btn-border-size, 1px) solid var(--btn-border-color, var(--color-subtle-dark));
|
||||
color: var(--btn-color, var(--color-ink));
|
||||
cursor: pointer;
|
||||
@@ -69,8 +70,8 @@
|
||||
}
|
||||
|
||||
/* With radios and checkboxes */
|
||||
&:has(input[type=radio], input[type=checkbox]) {
|
||||
:is(input[type=radio], input[type=checkbox]) {
|
||||
&:has(input[type=radio]) {
|
||||
:is(input[type=radio]) {
|
||||
appearance: none;
|
||||
block-size: calc(var(--btn-size) - var(--outline-size));
|
||||
border-radius: var(--btn-border-radius);
|
||||
@@ -86,6 +87,25 @@
|
||||
}
|
||||
}
|
||||
|
||||
&:has(input[type=checkbox]) {
|
||||
position: relative;
|
||||
|
||||
:is(input[type=checkbox]) {
|
||||
appearance: none;
|
||||
border-radius: var(--btn-border-radius);
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
inset: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
img.checked {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
&:has(input:checked) {
|
||||
--btn-background: var(--color-ink);
|
||||
--btn-color: var(--color-ink-reversed);
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
:root {
|
||||
--splat-size: 30vw;
|
||||
}
|
||||
|
||||
.windshield {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(15vw, 1fr));
|
||||
@@ -10,9 +14,8 @@
|
||||
|
||||
.splat {
|
||||
--hover-size: 0;
|
||||
--splat-color: red;
|
||||
--splat-color: var(--color-ink);
|
||||
--splat-rotate: 20deg;
|
||||
--splat-size: 30vw;
|
||||
|
||||
aspect-ratio: 1;
|
||||
block-size: var(--splat-size);
|
||||
@@ -25,6 +28,10 @@
|
||||
> * {
|
||||
grid-area: 1/1;
|
||||
}
|
||||
|
||||
.splat__perma & {
|
||||
--splat-size: 50cqi !important;
|
||||
}
|
||||
}
|
||||
|
||||
.splat__date {
|
||||
|
||||
@@ -28,11 +28,11 @@ class SplatsController < ApplicationController
|
||||
end
|
||||
|
||||
private
|
||||
def splat_params
|
||||
params.require(:splat).permit(:title, :body, :color)
|
||||
end
|
||||
|
||||
def set_splat
|
||||
@splat = Splat.find(params[:id])
|
||||
end
|
||||
|
||||
def splat_params
|
||||
params.require(:splat).permit(:title, :body, :color, category_ids: [])
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
class Categorization < ApplicationRecord
|
||||
belongs_to :splat
|
||||
belongs_to :category
|
||||
end
|
||||
@@ -0,0 +1,4 @@
|
||||
class Category < ApplicationRecord
|
||||
has_many :categorizations
|
||||
has_many :splats, through: :categorizations
|
||||
end
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
class Splat < ApplicationRecord
|
||||
attribute :tag, :string
|
||||
has_many :categorizations
|
||||
has_many :categories, through: :categorizations, dependent: :destroy
|
||||
|
||||
enum :color, %w[ dodgerblue limegreen tomato mediumorchid ].index_by(&:itself), suffix: true, default: :dodgerblue
|
||||
enum :tag, %w[ Product UI Web Mobile Feature Support iOS Android ].index_by(&:itself), suffix: true
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<%= form_with model: splat, class: "flex flex-column gap" do | form | %>
|
||||
<%= form_with model: splat, class: "flex flex-column gap full-width" do | form | %>
|
||||
<%= form.label :title, class: "flex flex-column justify-start align-start" do %>
|
||||
<%= form.text_field :title, class: "input full-width", required: true, placeholder: "Name it…" %>
|
||||
<% end %>
|
||||
@@ -18,13 +18,11 @@
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="flex flex-column unpad margin-block-end borderless justify-space-between">
|
||||
<legend class="for-screen-reader">Tag</legend>
|
||||
<legend class="for-screen-reader">Category</legend>
|
||||
|
||||
<div class="flex align-center gap flex-wrap">
|
||||
<% Splat.tags.keys.each do | tag | %>
|
||||
<label class="btn txt-medium" style="--btn-background: <%= tag -%>" >
|
||||
<span><%= tag %></span>
|
||||
</label>
|
||||
<%= collection_check_boxes(:splat, :category_ids, Category.all, :id, :title) do | category | %>
|
||||
<%= category.label(class: "btn txt-medium") { category.check_box + tag.span(category.text) } %>
|
||||
<% end %>
|
||||
|
||||
<label class="btn txt-medium" >
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<div class="splat" style="view-transition-name: splat-<%= splat.id -%>; --splat-color: <%= splat.color %>; --splat-size: <%= [20, 18, 16, 14].sample %>cqi; --splat-rotate: <%= [90, 80, 75, 60, 45, 35, 25, 5, -45, -40, -75].sample %>deg;">
|
||||
<svg class="splat__svg" viewBox="0 0 934 914" xmlns="http://www.w3.org/2000/svg"><circle cx="485.2" cy="467.2" r="286.5"/><path d="m197.7 219.1c-.2-7.1 5.8-11.7 12.7-13.2 34-7.1 53.5 29.2 81.4 40 39.5 6.4 25.9-54 30.8-77.7 17.2-65.3 78.4 67.2 108.2 55.7 26.8-17.3 25.9-58.8 38.7-86.1 9.6-41.5 30.4-2.6 48.6 10.1 14.2 11.2 31.9 17.9 45.1 29.9 13 11.2 20 29.1 35.8 36.8 20.2 9.1 44.8 2.3 65.2 11.8 18.3 7.2 33.8 22.6 52.5 30.4 23 8.6 42.4 1.8 37.8 35.1 2.7 36.8 38.3 71.9 40.1 108.6-.2 21.1-30.1 21.7-22.4 36.3 22.1 32.5-7.7 51.1 21 93.3 7 43.2-91.2-7.2-14.3 78.2 13.2 13.7 22.3 28.2 4.5 40.2-18.7 18.4-19.5 18.4-45 13.8-15.5-1.2 1.8 16.5-4.6 22.7-21.1 8-6.7 22-14.6 34.9-6 3.2-14.7-2.6-21.1-4-17.2-6.2-11.5 17.5-15.3 25.7-4 7.3-15.6 1.5-22.2-.2-26.7-10.8-55.1-3.1-82.4-.2-14.2 1.1-26 2.2-30.2 18.3-8 20.8-7.5 87.5-41.5 68.5-15.3-7.2-29.8-51.7-45.3-26.4-2.8 3.9-6.4 9.3-11.2 5.9-20.7-27.6-17-71-54.3-25.6-29.6 29.4-32.5 2.5-48.8-20.5-18.9-17.1-48.4-20.5-61.6-44.6-18.5-27.6-35.8-54.6-60.2-77.9-10.5-10.8-60.9-17.2-34.7-35.6 42.5-23.5-50.6-14-19.6-30.8 33.5-11.7 12.7-23.2-10.3-28.1-6.2-1.9-22-3.3-22.7-8.2 2.9-11.2 13.8-26.5 22.6-35.7 38.3-20.1-7-33.5-23.6-48.2-4-4.4 4.8-2.9 5.5-5.8-7.4-11.8-11.8-10-.4-21.8 3.2-7.8-4.9-17.6-3.8-25.5 8.1-21 57.9-6.5 64.2-36.2-3.5-26.1-16.4-50.3 3.5-75 5.9-8.8 22.4-16.8 19.3-28.7-5.7-14.7-26.4-23.7-27.6-40.2z"/><path d="m573 256.7s29.6-24.9 55-64.4 40.3-158 88.1-127.9c44.4 28-27.7 97.3-60.3 143.3-32.6 45.9-14.3 85.7-14.3 85.7l-68.5-36.6z"/><path d="m606.4 674.7s-11.3 37-11.2 84c0 47 51.9 154.6-4.6 155.3-52.5.6-29.6-96.8-27.1-153.1s-34.5-79.7-34.5-79.7z"/><path d="m325.5 622.7s-34 16.1-71.9 44c-37.8 27.9-104.9 118.2-126.8 89.7-20.3-26.5 66.8-72.5 113.1-104.6s51.2-64.9 51.2-64.9l34.4 35.9z"/><path d="m225.7 388.5s-30.8-35.1-75.8-72.7c-45.1-37.5-169.2-98.3-146.9-126.5 20.8-26.1 104.8 63 157.6 109.3 52.9 46.2 90.4 46.9 90.4 46.9l-25.4 43z"/><path d="m327.7 593.7s-47.6 1.4-103.9 17.7c-56.3 16.2-170.6 104.9-187.6 48.8-15.8-52.2 107.7-62.8 175.9-79.7s85.8-61.9 85.8-61.9l29.9 75.1z"/><path d="m443.5 344.2s0-46.7-8.9-104.6c-9-57.9-62-185.6-26.7-192 32.9-5.9 37 116.5 46.2 186.2 9.2 69.6 36.9 95 36.9 95l-47.5 15.5z"/><path d="m433.2 340.9s-6.8-37-19.5-82.8c-12.8-45.8-56.9-146.5-40.8-151.7 15-4.8 34.8 92 49.3 147s31.6 74.9 31.6 74.9l-20.6 12.5z"/><path d="m496.8 298.1s10.8-45.7 13.6-104.2c2.8-58.6-29.9-194.6 12.9-193.4 39.8 1.1 16.5 121.7 11.2 191.8-5.3 70 21.3 100.6 21.3 100.6l-59.1 5.2z"/><path d="m647.8 525s22.1 41.1 57.6 87.8c35.4 46.7 142.8 133.8 114.7 156.2-26.1 20.8-88-84.9-129.1-141.8-41.2-56.9-77.6-66-77.6-66z"/><path d="m658.4 523s23.5 29.3 56.5 63.5 119.7 101.9 108 114.1c-10.9 11.4-74.3-64.4-113.3-105.9s-63.4-50.9-63.4-50.9z"/><path d="m622.8 591s12.2 45.3 37.6 98.2 118.8 157 80.6 176.3c-35.6 17.9-72.4-99.3-101.1-163.4-28.6-64.1-66.6-78.4-66.6-78.4l49.5-32.6z"/><path d="m613.7 441.6s43.3 17.5 100.4 30.7c57.1 13.3 195.4 11.6 188.1 46.8-6.8 32.7-121.9-9.1-189.9-26.6s-101.9-1.2-101.9-1.2l3.3-49.8z"/><path d="m666.2 496.5s38.4 27.1 91.7 51.5 191.7 44.8 174.6 84.1c-15.9 36.5-119.1-30.1-182.2-61.1-63-31-101.3-17.7-101.3-17.7l17.2-56.7z"/><path d="m57.2 500.1c-7.1-1.3-14.4-2-21.5-.7-13.9 2.4-27.3 11.4-31.7 25.2-5 15.2 2.5 30.2 12.9 41.7 7.5 8.5 16.3 16.5 27.6 16.6 19.9-.7 36.3-19.9 37.6-39 1.6-18.3-8.2-36.2-27.2-40.2-3.5-.8-7.2-1.2-10.8-1.5"/><path d="m796.1 362.9c5.4 21.4 22.7 41 44.2 46.3 16.7 4.5 33.7-3 43.2-17.2 24.3-38.2-3-125.5-53.2-116.5-8 1.5-15.8 5.8-21.4 11.6-18.2 19.3-19.3 51.3-12.8 75.6z"/><path d="m255.1 782.9c5.4 21.4 22.7 41 44.2 46.3 16.7 4.5 33.7-3 43.2-17.2 24.3-38.2-3-125.5-53.2-116.5-8 1.5-15.8 5.8-21.4 11.6-18.2 19.3-19.3 51.3-12.8 75.6z"/><path d="m771 224.4c-3.4-.5-6.8-1-10.2-1.1-23.8-1.1-36.1 23.5-16.7 36.4 9.4 6.3 22.2 2.4 26.7-7.7 5.2-11.6-.7-20.3-10.6-26.9"/><path d="m402 812.4c-3.4-.5-6.8-1-10.2-1.1-23.8-1.1-36.1 23.5-16.7 36.4 9.4 6.3 22.2 2.4 26.7-7.7 5.2-11.6-.7-20.3-10.6-26.9"/></svg>
|
||||
<%= link_to splat, class: "splat__link" do %>
|
||||
<h1 class="splat__title"><%= splat.title %></h1>
|
||||
<% end %>
|
||||
<time class="splat__date"><%= splat.updated_at.strftime("%B <br> %d").html_safe %></time>
|
||||
|
||||
<% if splat.categories.any? %>
|
||||
<span class="splat__tag"><%= splat.categories.first.title %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -21,16 +21,7 @@
|
||||
<% end %>
|
||||
|
||||
<section class="windshield">
|
||||
<% @splats.last(10).each do | splat | %>
|
||||
<div class="splat" style="view-transition-name: splat-<%= splat.id -%>; --splat-color: <%= splat.color %>; --splat-size: <%= [20, 18, 16, 14].sample %>cqi; --splat-rotate: <%= [90, 80, 75, 60, 45, 35, 25, 5, -45, -40, -75].sample %>deg;">
|
||||
<svg class="splat__svg" viewBox="0 0 934 914" xmlns="http://www.w3.org/2000/svg"><circle cx="485.2" cy="467.2" r="286.5"/><path d="m197.7 219.1c-.2-7.1 5.8-11.7 12.7-13.2 34-7.1 53.5 29.2 81.4 40 39.5 6.4 25.9-54 30.8-77.7 17.2-65.3 78.4 67.2 108.2 55.7 26.8-17.3 25.9-58.8 38.7-86.1 9.6-41.5 30.4-2.6 48.6 10.1 14.2 11.2 31.9 17.9 45.1 29.9 13 11.2 20 29.1 35.8 36.8 20.2 9.1 44.8 2.3 65.2 11.8 18.3 7.2 33.8 22.6 52.5 30.4 23 8.6 42.4 1.8 37.8 35.1 2.7 36.8 38.3 71.9 40.1 108.6-.2 21.1-30.1 21.7-22.4 36.3 22.1 32.5-7.7 51.1 21 93.3 7 43.2-91.2-7.2-14.3 78.2 13.2 13.7 22.3 28.2 4.5 40.2-18.7 18.4-19.5 18.4-45 13.8-15.5-1.2 1.8 16.5-4.6 22.7-21.1 8-6.7 22-14.6 34.9-6 3.2-14.7-2.6-21.1-4-17.2-6.2-11.5 17.5-15.3 25.7-4 7.3-15.6 1.5-22.2-.2-26.7-10.8-55.1-3.1-82.4-.2-14.2 1.1-26 2.2-30.2 18.3-8 20.8-7.5 87.5-41.5 68.5-15.3-7.2-29.8-51.7-45.3-26.4-2.8 3.9-6.4 9.3-11.2 5.9-20.7-27.6-17-71-54.3-25.6-29.6 29.4-32.5 2.5-48.8-20.5-18.9-17.1-48.4-20.5-61.6-44.6-18.5-27.6-35.8-54.6-60.2-77.9-10.5-10.8-60.9-17.2-34.7-35.6 42.5-23.5-50.6-14-19.6-30.8 33.5-11.7 12.7-23.2-10.3-28.1-6.2-1.9-22-3.3-22.7-8.2 2.9-11.2 13.8-26.5 22.6-35.7 38.3-20.1-7-33.5-23.6-48.2-4-4.4 4.8-2.9 5.5-5.8-7.4-11.8-11.8-10-.4-21.8 3.2-7.8-4.9-17.6-3.8-25.5 8.1-21 57.9-6.5 64.2-36.2-3.5-26.1-16.4-50.3 3.5-75 5.9-8.8 22.4-16.8 19.3-28.7-5.7-14.7-26.4-23.7-27.6-40.2z"/><path d="m573 256.7s29.6-24.9 55-64.4 40.3-158 88.1-127.9c44.4 28-27.7 97.3-60.3 143.3-32.6 45.9-14.3 85.7-14.3 85.7l-68.5-36.6z"/><path d="m606.4 674.7s-11.3 37-11.2 84c0 47 51.9 154.6-4.6 155.3-52.5.6-29.6-96.8-27.1-153.1s-34.5-79.7-34.5-79.7z"/><path d="m325.5 622.7s-34 16.1-71.9 44c-37.8 27.9-104.9 118.2-126.8 89.7-20.3-26.5 66.8-72.5 113.1-104.6s51.2-64.9 51.2-64.9l34.4 35.9z"/><path d="m225.7 388.5s-30.8-35.1-75.8-72.7c-45.1-37.5-169.2-98.3-146.9-126.5 20.8-26.1 104.8 63 157.6 109.3 52.9 46.2 90.4 46.9 90.4 46.9l-25.4 43z"/><path d="m327.7 593.7s-47.6 1.4-103.9 17.7c-56.3 16.2-170.6 104.9-187.6 48.8-15.8-52.2 107.7-62.8 175.9-79.7s85.8-61.9 85.8-61.9l29.9 75.1z"/><path d="m443.5 344.2s0-46.7-8.9-104.6c-9-57.9-62-185.6-26.7-192 32.9-5.9 37 116.5 46.2 186.2 9.2 69.6 36.9 95 36.9 95l-47.5 15.5z"/><path d="m433.2 340.9s-6.8-37-19.5-82.8c-12.8-45.8-56.9-146.5-40.8-151.7 15-4.8 34.8 92 49.3 147s31.6 74.9 31.6 74.9l-20.6 12.5z"/><path d="m496.8 298.1s10.8-45.7 13.6-104.2c2.8-58.6-29.9-194.6 12.9-193.4 39.8 1.1 16.5 121.7 11.2 191.8-5.3 70 21.3 100.6 21.3 100.6l-59.1 5.2z"/><path d="m647.8 525s22.1 41.1 57.6 87.8c35.4 46.7 142.8 133.8 114.7 156.2-26.1 20.8-88-84.9-129.1-141.8-41.2-56.9-77.6-66-77.6-66z"/><path d="m658.4 523s23.5 29.3 56.5 63.5 119.7 101.9 108 114.1c-10.9 11.4-74.3-64.4-113.3-105.9s-63.4-50.9-63.4-50.9z"/><path d="m622.8 591s12.2 45.3 37.6 98.2 118.8 157 80.6 176.3c-35.6 17.9-72.4-99.3-101.1-163.4-28.6-64.1-66.6-78.4-66.6-78.4l49.5-32.6z"/><path d="m613.7 441.6s43.3 17.5 100.4 30.7c57.1 13.3 195.4 11.6 188.1 46.8-6.8 32.7-121.9-9.1-189.9-26.6s-101.9-1.2-101.9-1.2l3.3-49.8z"/><path d="m666.2 496.5s38.4 27.1 91.7 51.5 191.7 44.8 174.6 84.1c-15.9 36.5-119.1-30.1-182.2-61.1-63-31-101.3-17.7-101.3-17.7l17.2-56.7z"/><path d="m57.2 500.1c-7.1-1.3-14.4-2-21.5-.7-13.9 2.4-27.3 11.4-31.7 25.2-5 15.2 2.5 30.2 12.9 41.7 7.5 8.5 16.3 16.5 27.6 16.6 19.9-.7 36.3-19.9 37.6-39 1.6-18.3-8.2-36.2-27.2-40.2-3.5-.8-7.2-1.2-10.8-1.5"/><path d="m796.1 362.9c5.4 21.4 22.7 41 44.2 46.3 16.7 4.5 33.7-3 43.2-17.2 24.3-38.2-3-125.5-53.2-116.5-8 1.5-15.8 5.8-21.4 11.6-18.2 19.3-19.3 51.3-12.8 75.6z"/><path d="m255.1 782.9c5.4 21.4 22.7 41 44.2 46.3 16.7 4.5 33.7-3 43.2-17.2 24.3-38.2-3-125.5-53.2-116.5-8 1.5-15.8 5.8-21.4 11.6-18.2 19.3-19.3 51.3-12.8 75.6z"/><path d="m771 224.4c-3.4-.5-6.8-1-10.2-1.1-23.8-1.1-36.1 23.5-16.7 36.4 9.4 6.3 22.2 2.4 26.7-7.7 5.2-11.6-.7-20.3-10.6-26.9"/><path d="m402 812.4c-3.4-.5-6.8-1-10.2-1.1-23.8-1.1-36.1 23.5-16.7 36.4 9.4 6.3 22.2 2.4 26.7-7.7 5.2-11.6-.7-20.3-10.6-26.9"/></svg>
|
||||
<%= link_to splat, class: "splat__link" do %>
|
||||
<h1 class="splat__title"><%= splat.title %></h1>
|
||||
<% end %>
|
||||
<time class="splat__date"><%= splat.updated_at.strftime("%B <br> %d").html_safe %></time>
|
||||
<span class="splat__tag"><%= ["product", "web", "mobile", "support", "bug", "UI"].sample %></span>
|
||||
</div>
|
||||
<% end %>
|
||||
<%= render @splats.last(10) %>
|
||||
</section>
|
||||
|
||||
<menu class="splats-filter flex align-center justify-center gap margin-block-start margin-none unpad position-relative">
|
||||
@@ -75,7 +66,9 @@
|
||||
<strong><%= splat.title %></strong>
|
||||
<% end %>
|
||||
<small class="flex align-center gap flex-item-shrink">
|
||||
<span class="btn txt-small txt-nowrap">Web</span>
|
||||
<% splat.categories.each do |category| %>
|
||||
<span class="btn txt-small txt-nowrap"><%= category.title %></span>
|
||||
<% end %>
|
||||
<span class="avatar txt-small txt-nowrap fill-shade"><strong>JZ</strong></span>
|
||||
<time class="txt-nowrap flex-item-justify-end"><%= splat.updated_at.strftime("%B %d").html_safe %></time>
|
||||
</small>
|
||||
|
||||
@@ -20,14 +20,8 @@
|
||||
</nav>
|
||||
<% end %>
|
||||
|
||||
|
||||
<div class="splat center" style="view-transition-name: splat-<%= @splat.id -%>; --splat-color: <%= @splat.color %>; --splat-size: 50cqi; --splat-rotate: <%= [90, 80, 75, 60, 45, 35, 25, 5, -45, -40, -75].sample %>deg;">
|
||||
<svg class="splat__svg" viewBox="0 0 934 914" xmlns="http://www.w3.org/2000/svg"><circle cx="485.2" cy="467.2" r="286.5"/><path d="m197.7 219.1c-.2-7.1 5.8-11.7 12.7-13.2 34-7.1 53.5 29.2 81.4 40 39.5 6.4 25.9-54 30.8-77.7 17.2-65.3 78.4 67.2 108.2 55.7 26.8-17.3 25.9-58.8 38.7-86.1 9.6-41.5 30.4-2.6 48.6 10.1 14.2 11.2 31.9 17.9 45.1 29.9 13 11.2 20 29.1 35.8 36.8 20.2 9.1 44.8 2.3 65.2 11.8 18.3 7.2 33.8 22.6 52.5 30.4 23 8.6 42.4 1.8 37.8 35.1 2.7 36.8 38.3 71.9 40.1 108.6-.2 21.1-30.1 21.7-22.4 36.3 22.1 32.5-7.7 51.1 21 93.3 7 43.2-91.2-7.2-14.3 78.2 13.2 13.7 22.3 28.2 4.5 40.2-18.7 18.4-19.5 18.4-45 13.8-15.5-1.2 1.8 16.5-4.6 22.7-21.1 8-6.7 22-14.6 34.9-6 3.2-14.7-2.6-21.1-4-17.2-6.2-11.5 17.5-15.3 25.7-4 7.3-15.6 1.5-22.2-.2-26.7-10.8-55.1-3.1-82.4-.2-14.2 1.1-26 2.2-30.2 18.3-8 20.8-7.5 87.5-41.5 68.5-15.3-7.2-29.8-51.7-45.3-26.4-2.8 3.9-6.4 9.3-11.2 5.9-20.7-27.6-17-71-54.3-25.6-29.6 29.4-32.5 2.5-48.8-20.5-18.9-17.1-48.4-20.5-61.6-44.6-18.5-27.6-35.8-54.6-60.2-77.9-10.5-10.8-60.9-17.2-34.7-35.6 42.5-23.5-50.6-14-19.6-30.8 33.5-11.7 12.7-23.2-10.3-28.1-6.2-1.9-22-3.3-22.7-8.2 2.9-11.2 13.8-26.5 22.6-35.7 38.3-20.1-7-33.5-23.6-48.2-4-4.4 4.8-2.9 5.5-5.8-7.4-11.8-11.8-10-.4-21.8 3.2-7.8-4.9-17.6-3.8-25.5 8.1-21 57.9-6.5 64.2-36.2-3.5-26.1-16.4-50.3 3.5-75 5.9-8.8 22.4-16.8 19.3-28.7-5.7-14.7-26.4-23.7-27.6-40.2z"/><path d="m573 256.7s29.6-24.9 55-64.4 40.3-158 88.1-127.9c44.4 28-27.7 97.3-60.3 143.3-32.6 45.9-14.3 85.7-14.3 85.7l-68.5-36.6z"/><path d="m606.4 674.7s-11.3 37-11.2 84c0 47 51.9 154.6-4.6 155.3-52.5.6-29.6-96.8-27.1-153.1s-34.5-79.7-34.5-79.7z"/><path d="m325.5 622.7s-34 16.1-71.9 44c-37.8 27.9-104.9 118.2-126.8 89.7-20.3-26.5 66.8-72.5 113.1-104.6s51.2-64.9 51.2-64.9l34.4 35.9z"/><path d="m225.7 388.5s-30.8-35.1-75.8-72.7c-45.1-37.5-169.2-98.3-146.9-126.5 20.8-26.1 104.8 63 157.6 109.3 52.9 46.2 90.4 46.9 90.4 46.9l-25.4 43z"/><path d="m327.7 593.7s-47.6 1.4-103.9 17.7c-56.3 16.2-170.6 104.9-187.6 48.8-15.8-52.2 107.7-62.8 175.9-79.7s85.8-61.9 85.8-61.9l29.9 75.1z"/><path d="m443.5 344.2s0-46.7-8.9-104.6c-9-57.9-62-185.6-26.7-192 32.9-5.9 37 116.5 46.2 186.2 9.2 69.6 36.9 95 36.9 95l-47.5 15.5z"/><path d="m433.2 340.9s-6.8-37-19.5-82.8c-12.8-45.8-56.9-146.5-40.8-151.7 15-4.8 34.8 92 49.3 147s31.6 74.9 31.6 74.9l-20.6 12.5z"/><path d="m496.8 298.1s10.8-45.7 13.6-104.2c2.8-58.6-29.9-194.6 12.9-193.4 39.8 1.1 16.5 121.7 11.2 191.8-5.3 70 21.3 100.6 21.3 100.6l-59.1 5.2z"/><path d="m647.8 525s22.1 41.1 57.6 87.8c35.4 46.7 142.8 133.8 114.7 156.2-26.1 20.8-88-84.9-129.1-141.8-41.2-56.9-77.6-66-77.6-66z"/><path d="m658.4 523s23.5 29.3 56.5 63.5 119.7 101.9 108 114.1c-10.9 11.4-74.3-64.4-113.3-105.9s-63.4-50.9-63.4-50.9z"/><path d="m622.8 591s12.2 45.3 37.6 98.2 118.8 157 80.6 176.3c-35.6 17.9-72.4-99.3-101.1-163.4-28.6-64.1-66.6-78.4-66.6-78.4l49.5-32.6z"/><path d="m613.7 441.6s43.3 17.5 100.4 30.7c57.1 13.3 195.4 11.6 188.1 46.8-6.8 32.7-121.9-9.1-189.9-26.6s-101.9-1.2-101.9-1.2l3.3-49.8z"/><path d="m666.2 496.5s38.4 27.1 91.7 51.5 191.7 44.8 174.6 84.1c-15.9 36.5-119.1-30.1-182.2-61.1-63-31-101.3-17.7-101.3-17.7l17.2-56.7z"/><path d="m57.2 500.1c-7.1-1.3-14.4-2-21.5-.7-13.9 2.4-27.3 11.4-31.7 25.2-5 15.2 2.5 30.2 12.9 41.7 7.5 8.5 16.3 16.5 27.6 16.6 19.9-.7 36.3-19.9 37.6-39 1.6-18.3-8.2-36.2-27.2-40.2-3.5-.8-7.2-1.2-10.8-1.5"/><path d="m796.1 362.9c5.4 21.4 22.7 41 44.2 46.3 16.7 4.5 33.7-3 43.2-17.2 24.3-38.2-3-125.5-53.2-116.5-8 1.5-15.8 5.8-21.4 11.6-18.2 19.3-19.3 51.3-12.8 75.6z"/><path d="m255.1 782.9c5.4 21.4 22.7 41 44.2 46.3 16.7 4.5 33.7-3 43.2-17.2 24.3-38.2-3-125.5-53.2-116.5-8 1.5-15.8 5.8-21.4 11.6-18.2 19.3-19.3 51.3-12.8 75.6z"/><path d="m771 224.4c-3.4-.5-6.8-1-10.2-1.1-23.8-1.1-36.1 23.5-16.7 36.4 9.4 6.3 22.2 2.4 26.7-7.7 5.2-11.6-.7-20.3-10.6-26.9"/><path d="m402 812.4c-3.4-.5-6.8-1-10.2-1.1-23.8-1.1-36.1 23.5-16.7 36.4 9.4 6.3 22.2 2.4 26.7-7.7 5.2-11.6-.7-20.3-10.6-26.9"/></svg>
|
||||
<%= link_to @splat, class: "splat__link" do %>
|
||||
<h1 class="splat__title"><%= @splat.title %></h1>
|
||||
<% end %>
|
||||
<time class="splat__date"><%= @splat.updated_at.strftime("%B <br> %d").html_safe %></time>
|
||||
<span class="splat__tag"><%= ["product", "web", "mobile", "support", "bug", "UI"].sample %></span>
|
||||
<div class="splat__perma flex-inline center">
|
||||
<%= render @splat %>
|
||||
</div>
|
||||
|
||||
<div class="splat__notes txt-align-start panel center borderless margin">
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
class CreateCategories < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
create_table :categories do |t|
|
||||
t.string :title
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,10 @@
|
||||
class CreateCategorizations < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
create_table :categorizations do |t|
|
||||
t.references :splat, null: false, foreign_key: true
|
||||
t.references :category, null: false, foreign_key: true
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
Generated
+23
-1
@@ -10,7 +10,27 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[8.0].define(version: 2024_07_23_192954) do
|
||||
ActiveRecord::Schema[8.0].define(version: 2024_07_24_163519) do
|
||||
create_table "categories", force: :cascade do |t|
|
||||
t.string "title"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "categories_splats", id: false, force: :cascade do |t|
|
||||
t.integer "category_id", null: false
|
||||
t.integer "splat_id", null: false
|
||||
end
|
||||
|
||||
create_table "categorizations", force: :cascade do |t|
|
||||
t.integer "splat_id", null: false
|
||||
t.integer "category_id", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["category_id"], name: "index_categorizations_on_category_id"
|
||||
t.index ["splat_id"], name: "index_categorizations_on_splat_id"
|
||||
end
|
||||
|
||||
create_table "organizations", force: :cascade do |t|
|
||||
t.string "name", null: false
|
||||
t.datetime "created_at", null: false
|
||||
@@ -50,6 +70,8 @@ ActiveRecord::Schema[8.0].define(version: 2024_07_23_192954) do
|
||||
t.index ["organization_id"], name: "index_users_on_organization_id"
|
||||
end
|
||||
|
||||
add_foreign_key "categorizations", "categories"
|
||||
add_foreign_key "categorizations", "splats"
|
||||
add_foreign_key "sessions", "users"
|
||||
add_foreign_key "users", "organizations"
|
||||
end
|
||||
|
||||
Vendored
+7
@@ -0,0 +1,7 @@
|
||||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
title: Web
|
||||
|
||||
two:
|
||||
title: Mobile
|
||||
Vendored
+17
@@ -0,0 +1,17 @@
|
||||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
splat: one
|
||||
category: one
|
||||
|
||||
two:
|
||||
splat: two
|
||||
category: two
|
||||
|
||||
three:
|
||||
splat: three
|
||||
category: one
|
||||
|
||||
four:
|
||||
splat: three
|
||||
category: two
|
||||
@@ -0,0 +1,7 @@
|
||||
require "test_helper"
|
||||
|
||||
class CategorizationTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
||||
@@ -0,0 +1,7 @@
|
||||
require "test_helper"
|
||||
|
||||
class CategoryTest < ActiveSupport::TestCase
|
||||
# test "the truth" do
|
||||
# assert true
|
||||
# end
|
||||
end
|
||||
Reference in New Issue
Block a user