added "next" button for videos

This commit is contained in:
partisan 2024-06-10 13:12:09 +02:00
parent b3eb7e39ea
commit fe96287442
2 changed files with 35 additions and 18 deletions

View file

@ -10,10 +10,10 @@
<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>
<div class="wrapper-results">
<input type="text" name="q" value="{{ .Query }}" id="search-input" placeholder="Type to search..." />
<button id="search-wrapper-ico" class="material-icons-round" name="t" value="video">search</button>
<input type="submit" class="hide" name="t" value="video" />
</div>
<input type="text" name="q" value="{{ .Query }}" id="search-input" placeholder="Type to search..." />
<button id="search-wrapper-ico" class="material-icons-round" name="t" value="video">search</button>
<input type="submit" class="hide" name="t" value="video" />
</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>
@ -32,17 +32,16 @@
<button name="t" value="forum" class="clickable">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>
<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>
</div>
</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>
</div>
</div>
</div>
</form>
<!-- Results go here -->
<p class="fetched fetched_dif fetched_vid"><!-- { fetched } --></p>
@ -51,11 +50,11 @@
<div>
<div class="video__results">
<div class="video__img__results">
<a href="{{ .Href }}"> <img src="{{ .Image }}">
<div class="duration">{{ .Duration }}</div>
</img></a>
<a href="{{ .Href }}"> <img src="{{ .Image }}">
<div class="duration">{{ .Duration }}</div>
</img></a>
</div>
<div class="results video-results-margin">
<div class="results video-results-margin">
<h3 class="video_title" href="{{ .Href }}">{{ .Title }}</h3></a>
<p class="stats">{{ .Views }} <span class="pipe">|</span> {{ .Date }}</p>
<p class="publish__info">YouTube <span class="pipe">|</span> {{ .Creator }}</p>
@ -64,12 +63,23 @@
</div>
{{ end }}
{{ else }}
<div class="no-results">No results found for '{{ .Query }}'. Try different keywords.</div>>
<div class="no-results">No results found for '{{ .Query }}'. Try different keywords.</div>
{{ end }}
<div class="prev-next prev-img" id="prev-next">
<form action="/search" method="get">
<input type="hidden" name="q" value="{{ .Query }}">
<input type="hidden" name="t" value="video">
{{ if .HasPrevPage }}
<button type="submit" name="p" value="{{ sub .Page 1 }}">Previous</button>
{{ end }}
{{ if .HasNextPage }}
<button type="submit" name="p" value="{{ add .Page 1 }}">Next</button>
{{ end }}
</form>
</div>
<script>
// Check if JavaScript is enabled and modify the DOM accordingly
document.getElementById('content').classList.remove('js-enabled');
</script>
</body>
</html>
</html>