update search results page

This commit is contained in:
Evan Jarrett
2026-01-16 14:36:11 -06:00
parent c48a763529
commit 2d7d2fd5ca
8 changed files with 71 additions and 46 deletions
+1
View File
@@ -15,6 +15,7 @@ steps:
command: |
go mod download
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.7.2
go generate ./...
- name: Run Linter
environment:
+1
View File
@@ -14,6 +14,7 @@ steps:
CGO_ENABLED: 1
command: |
go mod download
go generate ./...
- name: Run Tests
environment:
@@ -0,0 +1,51 @@
{{ define "card-grid" }}
{{/*
Card grid component - displays repository cards in a responsive grid
Required:
- .Repositories: []db.RepoCardData - list of repositories to display
Optional:
- .Columns: int - number of columns on xl screens (3 or 4, default 3)
- .EmptyMessage: string - message when no repositories (default: "No repositories found.")
- .EmptyIcon: string - lucide icon name for empty state
- .EmptySubtext: string - secondary text for empty state
- .LoadMoreURL: string - URL for Load More button (HTMX)
- .TargetID: string - HTMX target ID for Load More
- .HasMore: bool - whether to show Load More button
*/}}
{{ if .Repositories }}
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3{{ if eq .Columns 4 }} xl:grid-cols-4{{ end }} gap-6">
{{ range .Repositories }}
{{ template "repo-card" . }}
{{ end }}
</div>
{{ if and .HasMore .LoadMoreURL }}
<div class="mt-6 text-center">
<button
class="btn btn-outline"
hx-get="{{ .LoadMoreURL }}"
hx-trigger="click"
hx-target="#{{ .TargetID }}"
hx-swap="beforeend"
>
Load More
</button>
</div>
{{ end }}
{{ else }}
<div class="py-12 text-center">
{{ if .EmptyIcon }}
<div class="text-base-content/60 mb-4">
<i data-lucide="{{ .EmptyIcon }}" class="size-12 mx-auto mb-4"></i>
<p class="text-lg">{{ or .EmptyMessage "No repositories found." }}</p>
</div>
{{ if .EmptySubtext }}
<p class="text-base-content/40 text-sm">{{ .EmptySubtext }}</p>
{{ end }}
{{ else }}
<p class="text-base-content/60">{{ or .EmptyMessage "No repositories found." }}</p>
{{ end }}
</div>
{{ end }}
{{ end }}
+1 -5
View File
@@ -56,11 +56,7 @@
{{ if .RecentRepos }}
<section>
<h2 class="text-2xl font-bold mb-6">What's New</h2>
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
{{ range .RecentRepos }}
{{ template "repo-card" . }}
{{ end }}
</div>
{{ template "card-grid" (dict "Repositories" .RecentRepos) }}
</section>
{{ end }}
</div>
+5 -3
View File
@@ -89,14 +89,14 @@
<p>If you are located in the European Economic Area (EEA), you have the following rights:</p>
<h3 class="text-lg font-medium mt-4">Right to Access</h3>
<p>You may request a copy of all personal data we store about you. This includes:</p>
<p>You may export a copy of all personal data we store about you via the "Export Data" button in your account settings. This export includes:</p>
<ul class="list-disc list-inside space-y-1 ml-4">
<li>Layer records associated with your DID on our PDS</li>
<li>Server logs containing your handle, DID, IP address, or actions (if retained)</li>
<li>OAuth tokens, web UI sessions, and device tokens</li>
<li>Cached PDS data</li>
<li>List of registered devices (credential helper)</li>
</ul>
<p class="mt-2">For data not included in the self-service export (such as server logs), contact us and we will respond within 30 days.</p>
<p class="text-base-content/70 text-sm mt-2">Note: Data stored on your own PDS is already under your control and accessible to you directly.</p>
<h3 class="text-lg font-medium mt-6">Right to Erasure ("Right to be Forgotten")</h3>
@@ -156,12 +156,13 @@
<p>If you are a California resident, you have the following rights under the California Consumer Privacy Act:</p>
<h3 class="text-lg font-medium mt-4">Right to Know</h3>
<p>You may request disclosure of:</p>
<p>You may export a copy of your personal data via the "Export Data" button in your account settings. You may also request disclosure of:</p>
<ul class="list-disc list-inside space-y-1 ml-4">
<li>The categories of personal information we collect</li>
<li>The purposes for which we use your personal information</li>
<li>The categories of third parties with whom we share your personal information</li>
</ul>
<p class="mt-2">For data not included in the self-service export (such as server logs), contact us and we will respond within 30 days.</p>
<h3 class="text-lg font-medium mt-6">Right to Delete</h3>
<p>You may delete your personal information via the account settings page, subject to the same technical limitations described in the GDPR section above. For data not accessible through self-service, we will respond to requests within 45 days, except where retention is necessary for:</p>
@@ -305,6 +306,7 @@
<h3 class="text-lg font-medium mt-4">Self-Service (via Settings)</h3>
<p>Most data management can be done directly through your account settings at {{ .RegistryURL }}:</p>
<ul class="list-disc list-inside space-y-1 ml-4">
<li><strong>Export your data:</strong> Use the "Export Data" button in settings to download a copy of all personal data we store about you.</li>
<li><strong>Delete your data:</strong> Use the "Delete Account" button in settings. This will remove your layer records, cached data, and authentication tokens. You may also choose to have us delete <code class="bg-base-200 px-1.5 py-0.5 rounded text-sm font-mono">io.atcr.*</code> records from your PDS (requires active OAuth session).</li>
<li><strong>Revoke device tokens:</strong> Manage and revoke credential helper devices in settings.</li>
<li><strong>Update your data:</strong> Corrections happen through normal use of the service.</li>
+2 -8
View File
@@ -53,15 +53,9 @@
<div class="text-center text-base-content/60 py-12">
<p>This user hasn't set up their ATCR profile yet.</p>
</div>
{{ else if .Repositories }}
<div class="w-full grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6">
{{ range .Repositories }}
{{ template "repo-card" . }}
{{ end }}
</div>
{{ else }}
<div class="text-center text-base-content/60 py-12">
<p>No images yet.</p>
<div class="w-full">
{{ template "card-grid" (dict "Repositories" .Repositories "EmptyMessage" "No images yet.") }}
</div>
{{ end }}
</div>
@@ -1,30 +1,10 @@
{{/* Search results partial - renders repository cards in a grid */}}
{{ if gt (len .Repositories) 0 }}
<div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
{{ range .Repositories }}
{{ template "repo-card" . }}
{{ end }}
</div>
{{ if .HasMore }}
<div class="mt-6 text-center">
<button
class="btn btn-outline"
hx-get="/api/search-results?q={{ .SearchQuery }}&offset={{ .NextOffset }}"
hx-trigger="click"
hx-target="#search-results"
hx-swap="beforeend"
>
Load More
</button>
</div>
{{ end }}
{{ else }}
<div class="py-12 text-center">
<div class="text-base-content/60 mb-4">
<i data-lucide="search-x" class="size-12 mx-auto mb-4"></i>
<p class="text-lg">No repositories found matching your search.</p>
</div>
<p class="text-base-content/40 text-sm">Try a different search term or browse the homepage.</p>
</div>
{{ end }}
{{ template "card-grid" (dict
"Repositories" .Repositories
"EmptyIcon" "search-x"
"EmptyMessage" "No repositories found matching your search."
"EmptySubtext" "Try a different search term or browse the homepage."
"LoadMoreURL" (printf "/api/search-results?q=%s&offset=%d" .SearchQuery .NextOffset)
"TargetID" "search-results"
"HasMore" .HasMore
) }}
+1 -1
View File
@@ -12,7 +12,7 @@ import (
"atcr.io/pkg/appview/licenses"
)
//go:generate sh -c "cd ../.. && npm run build"
//go:generate sh -c "command -v npm >/dev/null 2>&1 && cd ../.. && npm run build || echo 'npm not found, skipping build'"
//go:embed templates/**/*.html
var templatesFS embed.FS