added lang support to all html templates and cleaned up template rendering
This commit is contained in:
parent
5dd3114e2d
commit
d9d0301548
18 changed files with 645 additions and 410 deletions
|
@ -6,14 +6,14 @@
|
|||
{{ if .IsThemeDark }}
|
||||
<meta name="darkreader-lock">
|
||||
{{ end }}
|
||||
<title>{{.Query}} - Ocásek</title>
|
||||
<title>{{ translate "page_title" .Query }}</title>
|
||||
<link rel="stylesheet" href="/static/css/style.css">
|
||||
<link rel="stylesheet" href="/static/css/{{.Theme}}.css">
|
||||
<link rel="search" type="application/opensearchdescription+xml" title="Ocásek" href="/opensearch.xml">
|
||||
<link rel="search" type="application/opensearchdescription+xml" title="{{ translate "site_name" }}" href="/opensearch.xml">
|
||||
</head>
|
||||
<body>
|
||||
<form action="/search" id="prev-next-form" class="results-search-container" method="GET" autocomplete="off">
|
||||
<h1 class="logomobile"><a class="no-decoration" href="./">Ocásek</a></h1>
|
||||
<h1 class="logomobile"><a class="no-decoration" href="./">{{ translate "site_name" }}</a></h1>
|
||||
<div class="wrapper-results">
|
||||
<input type="text" name="q" value="{{ .Query }}" id="search-input"/>
|
||||
<button id="search-wrapper-ico" class="material-icons-round" name="t" value="text">search</button>
|
||||
|
@ -26,44 +26,44 @@
|
|||
<div class="sub-search-button-wrapper">
|
||||
<div class="search-container-results-btn">
|
||||
<button id="sub-search-wrapper-ico" class="material-icons-round clickable search-active" name="t" value="text">search</button>
|
||||
<button name="t" value="text" class="clickable search-active">Web</button>
|
||||
<button name="t" value="text" class="clickable search-active">{{ translate "web" }}</button>
|
||||
</div>
|
||||
<div class="search-container-results-btn">
|
||||
<button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t" value="image">image</button>
|
||||
<button name="t" value="image" class="clickable">Images</button>
|
||||
<button name="t" value="image" class="clickable">{{ translate "images" }}</button>
|
||||
</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">Videos</button>
|
||||
<button name="t" value="video" class="clickable">{{ translate "videos" }}</button>
|
||||
</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">Forums</button>
|
||||
<button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t" value="forum">image</button>
|
||||
<button name="t" value="forum" class="clickable">{{ translate "forums" }}</button>
|
||||
</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">Maps</button>
|
||||
<button name="t" value="map" class="clickable">{{ translate "maps" }}</button>
|
||||
</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">Torrents</button>
|
||||
<button name="t" value="file" class="clickable">{{ translate "torrents" }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</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}}>Safe Search Off</option>
|
||||
<option value="active" {{if eq .Safe "active"}}selected{{end}}>Safe Search On</option>
|
||||
<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>
|
||||
</select>
|
||||
<select class="results-settings" name="lang" id="languageSelect">
|
||||
{{range .LanguageOptions}}
|
||||
<option value="{{.Code}}" {{if eq .Code $.CurrentLang}}selected{{end}}>{{.Name}}</option>
|
||||
{{end}}
|
||||
</select>
|
||||
<button class="results-save" name="t" value="text">Apply settings</button>
|
||||
<button class="results-save" name="t" value="text">{{ translate "save_settings" }}</button>
|
||||
</form>
|
||||
<div class="results" id="results">
|
||||
{{if .Results}}
|
||||
|
@ -76,13 +76,13 @@
|
|||
<br>
|
||||
{{end}}
|
||||
{{else if .NoResults}}
|
||||
<div class="no-results">No results found for '{{ .Query }}'. Try different keywords.</div>
|
||||
<div class="no-results">{{ translate "no_results" .Query }}</div>
|
||||
{{else}}
|
||||
<div class="no-more-results">Looks like this is the end of results.</div>
|
||||
<div class="no-more-results">{{ translate "no_more_results" }}</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="message-bottom-left" id="message-bottom-left">
|
||||
<span>Searching for new results...</span>
|
||||
<span>{{ translate "searching_for_new_results" }}</span>
|
||||
</div>
|
||||
<div class="prev-next prev-img" id="prev-next">
|
||||
<form action="/search" method="get">
|
||||
|
@ -90,10 +90,10 @@
|
|||
<input type="hidden" name="t" value="text">
|
||||
<div id="content" class="js-enabled">
|
||||
{{ if .HasPrevPage }}
|
||||
<button type="submit" name="p" value="{{ sub .Page 1 }}">Previous</button>
|
||||
<button type="submit" name="p" value="{{ sub .Page 1 }}">{{ translate "previous" }}</button>
|
||||
{{ end }}
|
||||
{{ if .HasNextPage }}
|
||||
<button type="submit" name="p" value="{{ add .Page 1 }}">Next</button>
|
||||
<button type="submit" name="p" value="{{ add .Page 1 }}">{{ translate "next" }}</button>
|
||||
{{ end }}
|
||||
</div>
|
||||
</form>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue