Skip to content

Commit

Permalink
foo
Browse files Browse the repository at this point in the history
  • Loading branch information
dadav committed Jul 21, 2024
1 parent a72ffd9 commit e8b6df8
Show file tree
Hide file tree
Showing 9 changed files with 89 additions and 50 deletions.
6 changes: 3 additions & 3 deletions internal/v3/ui/components/author_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/v3/ui/components/head_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions internal/v3/ui/components/module_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion internal/v3/ui/components/nav_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions internal/v3/ui/components/release_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 12 additions & 2 deletions internal/v3/ui/components/search.templ
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
gen "github.com/dadav/gorge/pkg/gen/v3/openapi"
)

templ SearchView() {
templ SearchView(query string, modules []*gen.Module) {
<div class="search">
<img src="/assets/logo.png" width="400"/>
<br/>
Expand All @@ -14,11 +14,15 @@ templ SearchView() {
class="form-control"
type="search"
name="query"
value={ query }
placeholder="Name, author, version..."
hx-get="/search"
hx-params="*"
hx-trigger="input changed delay:500ms, search, load"
hx-target="#search-results"
hx-select="#search-results"
hx-swap="outerHTML"
hx-replace-url="true"
/>
<table class="table">
<thead>
Expand All @@ -28,7 +32,13 @@ templ SearchView() {
<th scope="col">Version</th>
</tr>
</thead>
<tbody id="search-results"></tbody>
<tbody id="search-results">
if len(modules) > 0 {
for _, module := range modules {
@ModuleToTableRow(module)
}
}
</tbody>
</table>
</div>
}
Expand Down
67 changes: 46 additions & 21 deletions internal/v3/ui/components/search_templ.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e8b6df8

Please sign in to comment.