Search/templates/images.html

159 lines
8 KiB
HTML
Raw Normal View History

2024-08-13 16:38:02 +02:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
2024-08-28 21:31:27 +02:00
{{ if .IsThemeDark }}
<meta name="darkreader-lock">
{{ end }}
2024-10-09 21:03:53 +02:00
<title>{{ .Query }} - {{ translate "site_name" }}</title>
2024-08-13 16:38:02 +02:00
<link rel="stylesheet" href="/static/css/style.css">
2024-11-19 12:14:11 +01:00
<noscript>
<style>
img.placeholder-img {
display: none;
}
</style>
</noscript>
2024-12-02 14:36:08 +01:00
<link rel="stylesheet" href="/static/css/style-imageviewer.css">
<link rel="stylesheet" href="/static/css/style-fixedwidth.css">
2024-08-13 16:38:02 +02:00
<link rel="stylesheet" href="/static/css/{{.Theme}}.css">
2024-10-28 10:52:39 +01:00
<link rel="search" type="application/opensearchdescription+xml" title="{{ translate "site_name" }}" href="/opensearch.xml">
<!-- Icons -->
<link rel="icon" href="{{ .IconPathSVG }}" type="image/svg+xml">
<link rel="icon" href="{{ .IconPathPNG }}" type="image/png">
<link rel="apple-touch-icon" href="{{ .IconPathPNG }}">
2024-08-13 16:38:02 +02:00
</head>
<body>
<form action="/search" id="prev-next-form" class="results-search-container" method="GET" autocomplete="off">
2024-10-22 12:15:09 +02:00
<h1 class="logomobile">
<div class="logo-container" herf="/">
<a href="/">
2024-12-02 14:36:08 +01:00
logo
2024-10-22 12:15:09 +02:00
</a>
</div>
</h1>
2024-08-13 16:38:02 +02:00
<div class="wrapper-results">
<input type="text" name="q" value="{{ .Query }}" id="search-input"/>
2024-08-13 16:38:02 +02:00
<button id="search-wrapper-ico" class="material-icons-round" name="t" value="image">search</button>
2024-08-21 23:23:08 +02:00
<div class="autocomplete">
<ul>
</ul>
</div>
2024-08-13 16:38:02 +02:00
<input type="submit" class="hide" name="t" value="image" />
</div>
<div class="sub-search-button-wrapper">
<div class="search-container-results-btn">
<button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t" value="text">search</button>
<button name="t" value="text" class="clickable">{{ translate "web" }}</button>
2024-08-13 16:38:02 +02:00
</div>
<div class="search-container-results-btn">
<button id="sub-search-wrapper-ico" class="material-icons-round clickable search-active" name="t" value="image">image</button>
<button name="t" value="image" class="clickable search-active">{{ translate "images" }}</button>
2024-08-13 16:38:02 +02:00
</div>
<div class="search-container-results-btn">
<button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t" value="video">movie</button>
<button name="t" value="video" class="clickable">{{ translate "videos" }}</button>
2024-08-13 16:38:02 +02:00
</div>
<div class="search-container-results-btn">
<button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t" value="forum">forum</button>
<button name="t" value="forum" class="clickable">{{ translate "forums" }}</button>
2024-08-13 16:38:02 +02:00
</div>
<div id="content" class="js-enabled">
<div class="search-container-results-btn">
<button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t" value="map">map</button>
<button name="t" value="map" class="clickable">{{ translate "maps" }}</button>
2024-08-13 16:38:02 +02:00
</div>
</div>
<div class="search-container-results-btn">
<button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t" value="file">share</button>
<button name="t" value="file" class="clickable">{{ translate "torrents" }}</button>
2024-08-13 16:38:02 +02:00
</div>
</div>
<noscript>
<input type="hidden" name="js_enabled" value="true">
</noscript>
2024-08-13 16:38:02 +02:00
</form>
<form class="results_settings" action="/search" method="get">
<input type="hidden" name="q" value="{{ .Query }}">
<select class="results-settings" name="safe" id="safeSearchSelect">
<option value="disabled" {{if eq .Safe "disabled"}}selected{{end}}>{{ translate "safe_search_off" }}</option>
<option value="active" {{if eq .Safe "active"}}selected{{end}}>{{ translate "safe_search_on" }}</option>
2024-08-13 16:38:02 +02:00
</select>
<select class="results-settings" name="lang" id="languageSelect">
{{range .LanguageOptions}}
2024-10-10 18:41:53 +02:00
<option value="{{.Code}}" {{if eq .Code $.CurrentLang}}selected{{end}}>{{.Name}}</option> <!-- this is too wide or too less, fix -->
2024-08-13 16:38:02 +02:00
{{end}}
</select>
<button class="results-save" name="t" value="image">{{ translate "save_settings" }}</button>
2024-08-13 16:38:02 +02:00
</form>
<div class="search-results" id="results">
2024-11-13 16:59:42 +01:00
<!-- Results go here -->
{{ if .Results }}
<div class="images images_viewer_hidden">
<!-- Images Grid -->
{{ range $index, $result := .Results }}
<div class="image">
{{ if $.HardCacheEnabled }}
<noscript>
2024-11-13 16:59:42 +01:00
<!-- JavaScript is disabled; serve actual images -->
<img src="{{ $result.ProxyFull }}" alt="{{ $result.Title }}" class="clickable" />
</noscript>
<!-- JavaScript is enabled; use placeholders -->
2024-11-19 12:14:11 +01:00
<img
src="/static/images/placeholder.svg"
data-id="{{ $result.ID }}"
data-full="{{ $result.ProxyFull }}"
data-proxy-full="{{ $result.ProxyThumb }}"
2024-12-02 14:36:08 +01:00
data-source="{{ $result.Source }}"
2024-11-19 12:14:11 +01:00
alt="{{ $result.Title }}"
class="clickable placeholder-img"
/>
2024-11-13 16:59:42 +01:00
{{ else }}
<!-- HardCacheEnabled is false; serve images directly -->
<img src="{{ $result.ProxyFull }}" alt="{{ $result.Title }}" class="clickable" />
{{ end }}
<div class="resolution">{{ $result.Width }} × {{ $result.Height }}</div>
<div class="details">
<span class="img_title clickable">{{ $result.Title }}</span>
2024-10-13 00:04:46 +02:00
</div>
2024-11-13 16:59:42 +01:00
</div>
{{ end }}
</div>
<!-- Nav buttons -->
<noscript>
<form action="/search" id="prev-next-form" class="results-search-container" method="GET" autocomplete="off">
<!-- Existing form fields -->
<input type="hidden" name="js_disabled" value="true">
</form>
<!-- Nav buttons -->
<div class="pagination">
{{ if .HasPrevPage }}
2024-11-19 12:14:11 +01:00
<a href="/search?q={{ .Query }}&t=image&p={{ sub .Page 1 }}">{{ translate "previous" }}</a>
2024-11-13 16:59:42 +01:00
{{ end }}
{{ if .HasNextPage }}
2024-11-19 12:14:11 +01:00
<a href="/search?q={{ .Query }}&t=image&p={{ add .Page 1 }}">{{ translate "next" }}</a>
2024-08-13 16:38:02 +02:00
{{ end }}
</div>
2024-11-13 16:59:42 +01:00
</noscript>
{{ else if .NoResults }}
<div class="no-results">{{ translate "no_results" .Query }}</div>
{{ else }}
<div class="no-more-results">{{ translate "no_more_results" }}</div>
{{ end }}
2024-08-13 16:38:02 +02:00
</div>
<div class="message-bottom-left" id="message-bottom-left">
<span>{{ translate "searching_for_new_results" }}</span>
2024-08-13 16:38:02 +02:00
</div>
<div id="image-viewer-overlay" style="display: none;"></div>
<div id="template-data" data-page="{{ .Page }}" data-query="{{ .Query }}" data-type="image" data-hard-cache-enabled="{{ .HardCacheEnabled }}"></div>
2024-08-21 23:23:08 +02:00
<script defer src="/static/js/autocomplete.js"></script>
<script defer src="/static/js/imagetitletrim.js"></script>
2024-10-22 21:58:06 +02:00
<script defer src="/static/js/imageviewer.js"></script>
<script defer src="/static/js/dynamicscrollingimages.js"></script>
2024-08-13 16:38:02 +02:00
</body>
</html>