Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/models/asset.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class Asset < ApplicationRecord

def self.allowed_types_for_owner(owner)
return TYPES unless owner
owner = owner&.decorated? ? owner.object : owner

case owner.class.name
when "Workshop", "Story"
Expand Down
27 changes: 21 additions & 6 deletions app/views/community_news/_results_skeleton.html.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,27 @@
<div class="overflow-x-auto bg-white border border-gray-200 rounded-xl shadow-sm">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<!-- Header skeleton -->
<thead class="bg-gray-50 animate-pulse">
<tr>
<th class="px-6 py-3 text-left text-sm font-semibold text-gray-700">Title</th>
<th class="px-6 py-3 text-left text-sm font-semibold text-gray-700">Author</th>
<th class="px-6 py-3 text-left text-sm font-semibold text-gray-700">Project</th>
<th class="px-6 py-3 text-center text-sm font-semibold text-gray-700">Updated</th>
<th class="px-6 py-3 text-center text-sm font-semibold text-gray-700">Actions</th>
<th class="px-6 py-3 text-left">
<div class="h-4 w-24 rounded bg-gray-200"></div>
</th>

<th class="px-6 py-3 text-left">
<div class="h-4 w-20 rounded bg-gray-200"></div>
</th>

<th class="px-6 py-3 text-left">
<div class="h-4 w-32 rounded bg-gray-200"></div>
</th>

<th class="px-6 py-3 text-center">
<div class="h-4 w-16 mx-auto rounded bg-gray-200"></div>
</th>

<th class="px-6 py-3 text-right">
<div class="h-4 w-20 ml-auto rounded bg-gray-200"></div>
</th>
</tr>
</thead>

Expand Down
82 changes: 44 additions & 38 deletions app/views/stories/_results_skeleton.html.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
<div class="bg-white border border-gray-200 rounded-xl shadow-sm">
<div class="overflow-x-auto bg-white border border-gray-200 rounded-xl shadow-sm">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<!-- Header skeleton -->
<thead class="bg-gray-50 animate-pulse">
<tr>
<th class="px-4 py-2 text-left text-sm font-medium text-gray-700">Title</th>
<th class="px-4 py-2 text-left text-sm font-medium text-gray-700">Windows Type</th>
<th class="px-4 py-2 text-left text-sm font-medium text-gray-700">Workshop</th>
<th class="px-4 py-2 text-left text-sm font-medium text-gray-700">Author</th>
<th class="px-4 py-2 text-left text-sm font-medium text-gray-700">Project</th>
<th class="px-4 py-2 text-left text-sm font-medium text-gray-700">Updated At</th>
<th class="px-4 py-2 text-left text-sm font-medium text-gray-700">Actions</th>
<th class="px-6 py-3 text-left">
<div class="h-4 w-24 rounded bg-gray-200"></div>
</th>

<th class="px-6 py-3 text-left">
<div class="h-4 w-20 rounded bg-gray-200"></div>
</th>

<th class="px-6 py-3 text-left">
<div class="h-4 w-32 rounded bg-gray-200"></div>
</th>

<th class="px-6 py-3 text-center">
<div class="h-4 w-16 mx-auto rounded bg-gray-200"></div>
</th>

<th class="px-6 py-3 text-right">
<div class="h-4 w-20 ml-auto rounded bg-gray-200"></div>
</th>
</tr>
</thead>

Expand All @@ -18,47 +31,40 @@
<!-- Title -->
<td class="px-4 py-3">
<div class="flex items-center gap-3">
<div class="w-5 h-5 bg-gray-200 rounded"></div>
<!-- Bookmark -->
<div class="w-5 h-5 rounded bg-gray-200"></div>

<!-- bookmark -->
<div class="w-24 h-14 bg-gray-200 rounded"></div>
<!-- Image -->
<div class="w-24 h-14 rounded border border-gray-200 bg-gray-200"></div>

<!-- image (no border) -->
<div class="flex-1 space-y-2">
<div class="h-4 bg-gray-200 rounded w-24"></div>

<!-- badge -->
<div class="h-5 bg-gray-300 rounded w-48"></div>

<!-- title -->
<!-- Title + badge -->
<div class="flex flex-col gap-2 flex-1">
<div class="h-5 w-40 rounded bg-gray-200"></div>
<div class="h-4 w-24 rounded-full bg-gray-200"></div>
</div>
</div>
</td>

<td class="px-4 py-3">
<div class="h-4 bg-gray-200 rounded w-24"></div>
</td>

<td class="px-4 py-3">
<div class="h-4 bg-gray-200 rounded w-32"></div>
</td>

<td class="px-4 py-3">
<div class="h-4 bg-gray-200 rounded w-36"></div>
<!-- Author -->
<td class="px-6 py-4">
<div class="h-4 w-32 rounded bg-gray-200"></div>
</td>

<td class="px-4 py-3">
<div class="h-4 bg-gray-200 rounded w-28"></div>
<!-- Project -->
<td class="px-6 py-4">
<div class="h-4 w-52 rounded bg-gray-200"></div>
</td>

<td class="px-4 py-3">
<div class="h-4 bg-gray-200 rounded w-24"></div>
<!-- Updated -->
<td class="px-6 py-4 text-center">
<div class="h-4 w-20 mx-auto rounded bg-gray-200"></div>
</td>

<td class="px-4 py-3">
<div class="flex gap-2">
<div class="h-8 w-16 bg-gray-200 rounded"></div>
<div class="h-8 w-16 bg-gray-200 rounded"></div>
<!-- Actions -->
<td class="px-6 py-4 text-right">
<div class="inline-flex gap-2 justify-end">
<div class="h-8 w-14 rounded bg-gray-200"></div>
<div class="h-8 w-14 rounded bg-gray-200"></div>
</div>
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion app/views/stories/_story_results.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% if @stories.any? %>
<div class="overflow-x-auto bg-white border border-gray-200 rounded-xl shadow-sm">
<div class="overflow-x-auto bg-white border border-gray-200 rounded-xl shadow-sm blur-on-submit">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
Expand Down
Loading