-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from blackfyre/artwork-search
Artwork search
- Loading branch information
Showing
37 changed files
with
964 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Launch Package", | ||
"type": "go", | ||
"request": "launch", | ||
"mode": "auto", | ||
"cwd": "${workspaceFolder}", | ||
"program": "${workspaceFolder}", | ||
"args": [ | ||
"serve" | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
{{define "title"}} | ||
Artwork search - Web Gallery of Art | ||
{{end}} | ||
|
||
{{define "body"}} | ||
{{block "search:content" .}} | ||
<section class="section"> | ||
<h1 class="title is-size-1">Artwork search</h1> | ||
<div class="columns"> | ||
<div class="column is-one-quarter"> | ||
<div class="box"> | ||
<form action="/search" hx-get="/search" hx-target="#artwork-search-results"> | ||
<div class="field"> | ||
<label class="label">Artforms</label> | ||
<div class="control"> | ||
<div class="select"> | ||
<select name="art_form"> | ||
{{range $k, $v := .ArtFormOptions}} | ||
<option value="{{$k}}" {{if eq $.ActiveFilterValues.ArtFormString | ||
$k}}selected{{end}}>{{$v}}</option> | ||
{{end}} | ||
</select> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="field"> | ||
<label class="label">Art types</label> | ||
<div class="control"> | ||
<div class="select"> | ||
<select name="art_type"> | ||
{{range $k, $v := .ArtTypeOptions}} | ||
<option value="{{$k}}" {{if eq $.ActiveFilterValues.ArtTypeString | ||
$k}}selected{{end}}>{{$v}}</option> | ||
{{end}} | ||
</select> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="field"> | ||
<label class="label">Art shool</label> | ||
<div class="control"> | ||
<div class="select"> | ||
<select name="art_school"> | ||
{{range $k, $v := .ArtSchoolOptions}} | ||
<option value="{{$k}}" {{if eq $.ActiveFilterValues.SchoolString | ||
$k}}selected{{end}}>{{$v}}</option> | ||
{{end}} | ||
</select> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="field"> | ||
<label class="label">Title</label> | ||
<p class="control"> | ||
<input class="input" type="search" name="title" placeholder="Artwork title" | ||
value="{{.ActiveFilterValues.Title}}"> | ||
</p> | ||
</div> | ||
<div class="field"> | ||
<label class="label">Artist</label> | ||
<p class="control"> | ||
<input class="input" list="artist_list" type="search" name="artist" | ||
placeholder="Artist name" value="{{.ActiveFilterValues.ArtistString}}"> | ||
<datalist id="artist_list"> | ||
{{range .ArtistNameList}} | ||
<option value="{{.}}"></option> | ||
{{end}} | ||
</datalist> | ||
</p> | ||
</div> | ||
|
||
<div class="field"><button type="submit" class="button is-primary">Search</button></div> | ||
</form> | ||
</div> | ||
</div> | ||
<div class="column" id="artwork-search-results"> | ||
{{block "search:search-results" .}} | ||
<div class="columns is-multiline works-listing" data-viewer> | ||
{{range .Artworks}} | ||
<div class="column is-one-third-tablet is-one-quarter-desktop"> | ||
<section class="card is-art-card"> | ||
<div class="card-image"> | ||
<figure class="image is-4by3 hidden-caption"> | ||
<picture> | ||
<source media="(max-width: 768px)" srcset="{{.Thumb}}"> | ||
<source media="(min-width: 769px)" srcset="{{.Thumb}}"> | ||
<source media="(min-width: 1024px)" srcset="{{.Thumb}}"> | ||
<img src="{{.Image}}" alt="{{ .Title}}" loading="lazy"> | ||
</picture> | ||
<figcaption>{{.Title}} - {{ .Technique }}</figcaption> | ||
</figure> | ||
</div> | ||
<div class="card-content"> | ||
<div> | ||
<h3 class="title is-size-3">{{ .Title}}</h3> | ||
<p class="subtitle">{{ .Technique }}</p> | ||
<div class="line-clamp-3 content"> | ||
{{safeHTML .Comment}} | ||
</div> | ||
</div> | ||
</div> | ||
<footer class="card-footer"> | ||
<a class="card-footer-item" href="/artists/{{.ArtistSlug}}/{{.Id}}" | ||
hx-get="/artists/{{.ArtistSlug}}/{{.Id}}" hx-target="#mc-area">Learn More</a> | ||
<a href="#" hx-on="click: document.getElementById('d').showModal();" | ||
hx-get="/postcard/send?awid={{.Id}}" hx-target="#d" class="card-footer-item">Send | ||
Postcard</a> | ||
</footer> | ||
<script type="application/ld+json"> | ||
{{marshalJSON .Jsonld}} | ||
</script> | ||
</section> | ||
</div> | ||
{{else}} | ||
<div class="column"> | ||
<div class="notification is-warning"> | ||
Sorry, no matching artworks found. | ||
</div> | ||
</div> | ||
{{end}} | ||
</div> | ||
{{end}} | ||
<nav class="pagination" role="navigation" aria-label="pagination"> | ||
{{.Pagination}} | ||
</nav> | ||
</div> | ||
</div> | ||
</section> | ||
{{end}} | ||
{{end}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.