Indexing update #1

Merged
partisan merged 9 commits from indexing into main 2025-01-05 21:17:34 +00:00
9 changed files with 37 additions and 16 deletions
Showing only changes of commit 8700035893 - Show all commits

View file

@ -56,7 +56,7 @@ func handleFileSearch(w http.ResponseWriter, settings UserSettings, query string
"Category": "all", "Category": "all",
"Sort": "seed", "Sort": "seed",
"Page": page, "Page": page,
"HasPrevPage": page > 1, "HasPrevPage": page >= 1,
"HasNextPage": len(combinedResults) > 0, "HasNextPage": len(combinedResults) > 0,
"LanguageOptions": languageOptions, "LanguageOptions": languageOptions,
"CurrentLang": settings.SearchLanguage, "CurrentLang": settings.SearchLanguage,

View file

@ -118,7 +118,8 @@ func handleForumsSearch(w http.ResponseWriter, settings UserSettings, query stri
"Page": page, "Page": page,
"Fetched": fmt.Sprintf("%.2f %s", elapsedTime.Seconds(), Translate("seconds")), // Time for fetching results "Fetched": fmt.Sprintf("%.2f %s", elapsedTime.Seconds(), Translate("seconds")), // Time for fetching results
"HasPrevPage": page > 1, "HasPrevPage": page > 1,
"HasNextPage": len(results) == 25, // Assuming 25 results per page "HasNextPage": len(results) >= 25,
"NoResults": len(results) == 0,
"LanguageOptions": languageOptions, "LanguageOptions": languageOptions,
"CurrentLang": settings.SearchLanguage, "CurrentLang": settings.SearchLanguage,
"Theme": settings.Theme, "Theme": settings.Theme,

View file

@ -1158,17 +1158,20 @@ p {
border-radius: 8px; border-radius: 8px;
position: relative; position: relative;
border: 1px solid var(--snip-border); border: 1px solid var(--snip-border);
margin-left: 175px;
color: var(--fg); color: var(--fg);
width: 530px; width: 530px;
padding: 15px; padding: 15px;
margin-bottom: 627px; margin-bottom: 627px;
margin-top: -20px; margin-top: 20px;
font-size: 14px; font-size: 14px;
line-height: 1.58; line-height: 1.58;
letter-spacing: normal; letter-spacing: normal;
} }
.no-results-found-offset {
margin-left: 175px;
}
/* MAP */ /* MAP */
.message { .message {

View file

@ -173,11 +173,13 @@
{{ end }} {{ end }}
</form> </form>
</div> </div>
{{ else }} {{else if .NoResults}}
<div class="no-results-found"> <div class="no-results-found no-results-found-offset">
{{ translate "no_results_found" .Query }}<br> {{ translate "no_results_found" .Query }}<br>
{{ translate "suggest_rephrase" }} {{ translate "suggest_rephrase" }}
</div> </div>
{{else}}
<div class="no-results-found no-results-found-offset">{{ translate "no_more_results" }}</div>
{{end}} {{end}}
<script defer src="/static/js/autocomplete.js"></script> <script defer src="/static/js/autocomplete.js"></script>
<script defer src="/static/js/minimenu.js"></script> <script defer src="/static/js/minimenu.js"></script>

View file

@ -143,9 +143,12 @@
<br> <br>
{{end}} {{end}}
{{else if .NoResults}} {{else if .NoResults}}
<div class="no-results">{{ translate "no_results" .Query }}</div> <div class="no-results-found">
{{ translate "no_results_found" .Query }}<br>
{{ translate "suggest_rephrase" }}
</div>
{{else}} {{else}}
<div class="no-more-results">{{ translate "no_more_results" }}</div> <div class="no-results-found">{{ translate "no_more_results" }}</div>
{{end}} {{end}}
</div> </div>
<div class="message-bottom-left" id="message-bottom-left"> <div class="message-bottom-left" id="message-bottom-left">

View file

@ -226,9 +226,12 @@
</div> </div>
</noscript> </noscript>
{{ else if .NoResults }} {{ else if .NoResults }}
<div class="no-results">{{ translate "no_results" .Query }}</div> <div class="no-results-found no-results-found-offset">
{{ translate "no_results_found" .Query }}<br>
{{ translate "suggest_rephrase" }}
</div>
{{ else }} {{ else }}
<div class="no-more-results">{{ translate "no_more_results" }}</div> <div class="no-results-found no-results-found-offset">{{ translate "no_more_results" }}</div>
{{ end }} {{ end }}
</div> </div>
<div class="message-bottom-left" id="message-bottom-left"> <div class="message-bottom-left" id="message-bottom-left">

View file

@ -144,9 +144,12 @@
<br> <br>
{{end}} {{end}}
{{else if .NoResults}} {{else if .NoResults}}
<div class="no-results">{{ translate "no_results" .Query }}</div> <div class="no-results-found">
{{ translate "no_results_found" .Query }}<br>
{{ translate "suggest_rephrase" }}
</div>
{{else}} {{else}}
<div class="no-more-results">{{ translate "no_more_results" }}</div> <div class="no-results-found">{{ translate "no_more_results" }}</div>
{{end}} {{end}}
</div> </div>
<div class="message-bottom-left" id="message-bottom-left"> <div class="message-bottom-left" id="message-bottom-left">

View file

@ -141,8 +141,13 @@
</div> </div>
</div> </div>
{{ end }} {{ end }}
{{else if .NoResults}}
<div class="no-results-found no-results-found-offset">
{{ translate "no_results_found" .Query }}<br>
{{ translate "suggest_rephrase" }}
</div>
{{else}} {{else}}
<div class="no-results">{{ translate "no_results" .Query }}</div> <div class="no-results-found no-results-found-offset">{{ translate "no_more_results" }}</div>
{{end}} {{end}}
<div class="prev-next prev-img" id="prev-next"> <div class="prev-next prev-img" id="prev-next">
<form action="/search" method="get"> <form action="/search" method="get">

View file

@ -170,6 +170,7 @@ func handleVideoSearch(w http.ResponseWriter, settings UserSettings, query strin
"Page": page, "Page": page,
"HasPrevPage": page > 1, "HasPrevPage": page > 1,
"HasNextPage": len(results) > 0, "HasNextPage": len(results) > 0,
"NoResults": len(results) == 0,
"LanguageOptions": languageOptions, "LanguageOptions": languageOptions,
"CurrentLang": settings.SearchLanguage, "CurrentLang": settings.SearchLanguage,
"Theme": settings.Theme, "Theme": settings.Theme,