add simple settings template, cleanup

This commit is contained in:
partisan 2024-04-15 08:35:17 +02:00
parent d6edd14f16
commit 1efca320c8
10 changed files with 192 additions and 154 deletions

View file

@ -1,28 +0,0 @@
{% extends "results_layout.html" %}
{% block body %}
<p class="fetched fetched_dif fetched_vid">{{ lang_data.results.results }} {{ fetched }} {{ lang_data.results.seconds }}</p>
{% if results %}
{% for result in results %}
<div><div class="video__results">
<div class="video__img__results">
<a href="{{ result[0] }}"> <img src="{{ result[6] }}">
<div class="duration">{{ result[7] }}</div>
</img></a>
</div>
<div class="results video-results-margin">
<a {% if settings.new_tab == "active" %} target="_blank" {% endif %} href="{{ result[0] }}"><h3 class="video_title" href="{{ result[0] }}">{{ result[1] }}</h3></a>
<p class="stats">{{ result[3] }} • {{ result[2] }}</p>
<p class="publish__info">{{ result[5] }} <span class="pipe">|</span> {{ result[4] }}</p>
</div>
</div>
</div>
{% endfor %}
</div>
{% else %}
<div class="no-results-found">
Your search '{{ q }}' came back with no results.<br>
Try rephrasing your search term and/or recorrect any spelling mistakes.
</div>
{% endif %}
{% endblock %}

27
templates/search.html Normal file
View file

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Search with Ocásek</title>
<link rel="stylesheet" href="/static/css/style.css">
</head>
<body>
<div class="settings-search-div settings-search-div-search">
<a id="openSettings" class="material-symbols-outlined" href="/settings">tune</a>
</div>
<form action="/search" class="search-container" method="post" autocomplete="off">
<h1>Ocásek</h1>
<div class="wrapper">
<input type="text" name="q" autofocus id="search-input" placeholder="Type to search..." />
<button id="search-wrapper-ico" class="material-icons-round" name="t" value="text" type="submit">search</button>
<a id="clearSearch" class="material-symbols-outline">close</a>
</div>
<div class="search-button-wrapper">
<input type="hidden" name="p" value="1">
<button name="t" value="text" type="submit">Search Text</button>
<button name="t" value="image" type="submit">Search Images</button>
</div>
</form>
</body>
</html>

70
templates/settings.html Normal file
View file

@ -0,0 +1,70 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Settings</title>
<link rel="stylesheet" type="text/css" href="static/css/style.css">
</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>
<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="text">search</button>
<input type="submit" class="hide" name="t" value="text" />
</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">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>
</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>
</div>
<div class="search-container-results-btn">
<button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t" value="reddit">forum</button>
<button name="t" value="forum" class="clickable">Forums</button>
</div>
<div class="search-container-results-btn">
<button id="sub-search-wrapper-ico" class="material-icons-round clickable" name="t" value="torrent">share</button>
<button name="t" value="torrent" class="clickable">Torrents</button>
</div>
</div>
</div>
</form>
<div class="results_settings">
<form>
<h1>Settings</h1>
<h2>Theme</h2>
<label for="theme-dark">Dark Theme:</label>
<input type="checkbox" class="results-settings" id="theme-dark" name="theme" value="dark"><br>
<h2>Language</h2>
<label for="ui-language">UI Language:</label>
<select id="ui-language" class="results-settings" name="ui_language">
<option value="english">English</option>
<option value="deutsch">Deutsch</option>
</select><br>
<label for="search-language">Search Language:</label>
<select id="search-language" class="results-settings" name="search_language">
<option value="english">English</option>
<option value="deutsch">Deutsch</option>
</select>
<h2>Privacy</h2>
<label for="theme-dark">Use JavaScript:</label>
<input type="checkbox" class="results-settings" id="theme-dark" name="theme" value="dark"><br>
<label for="theme-dark">Use search suggestions:</label>
<input type="checkbox" class="results-settings" id="theme-dark" name="theme" value="dark"><br><br>
<input type="submit" class="results-settings" value="Save">
</form>
<div>
</body>
</html>