diff options
| author | Astounds <kirito@disroot.org> | 2026-03-22 14:17:23 -0500 |
|---|---|---|
| committer | Astounds <kirito@disroot.org> | 2026-03-22 14:17:23 -0500 |
| commit | 84e1acaab8f7e4e7e36d19e3b6847a0ab6c33759 (patch) | |
| tree | a4021823e3e29d1efb57271dda5024825983bacf /youtube/templates | |
| parent | ed4b05d9b616c688afc6ef03dc404009c4abfc0f (diff) | |
| download | yt-local-84e1acaab8f7e4e7e36d19e3b6847a0ab6c33759.tar.lz yt-local-84e1acaab8f7e4e7e36d19e3b6847a0ab6c33759.tar.xz yt-local-84e1acaab8f7e4e7e36d19e3b6847a0ab6c33759.zip | |
yt-dlp
Diffstat (limited to 'youtube/templates')
| -rw-r--r-- | youtube/templates/base.html | 30 | ||||
| -rw-r--r-- | youtube/templates/settings.html | 14 |
2 files changed, 26 insertions, 18 deletions
diff --git a/youtube/templates/base.html b/youtube/templates/base.html index 393cc52..95207fa 100644 --- a/youtube/templates/base.html +++ b/youtube/templates/base.html @@ -35,57 +35,57 @@ </nav> <form class="form" id="site-search" action="/youtube.com/results"> <input type="search" name="search_query" class="search-box" value="{{ search_box_value }}" - {{ "autofocus" if (request.path in ("/", "/results") or error_message) else "" }} required placeholder="Type to search..."> - <button type="submit" value="Search" class="search-button">Search</button> + {{ "autofocus" if (request.path in ("/", "/results") or error_message) else "" }} required placeholder="{{ _('Type to search...') }}"> + <button type="submit" value="Search" class="search-button">{{ _('Search') }}</button> <!-- options --> <div class="dropdown"> <!-- hidden box --> <input id="options-toggle-cbox" class="opt-box" type="checkbox"> <!-- end hidden box --> - <label class="dropdown-label" for="options-toggle-cbox">Options</label> + <label class="dropdown-label" for="options-toggle-cbox">{{ _('Options') }}</label> <div class="dropdown-content"> - <h3>Sort by</h3> + <h3>{{ _('Sort by') }}</h3> <div class="option"> <input type="radio" id="sort_relevance" name="sort" value="0"> - <label for="sort_relevance">Relevance</label> + <label for="sort_relevance">{{ _('Relevance') }}</label> </div> <div class="option"> <input type="radio" id="sort_upload_date" name="sort" value="2"> - <label for="sort_upload_date">Upload date</label> + <label for="sort_upload_date">{{ _('Upload date') }}</label> </div> <div class="option"> <input type="radio" id="sort_view_count" name="sort" value="3"> - <label for="sort_view_count">View count</label> + <label for="sort_view_count">{{ _('View count') }}</label> </div> <div class="option"> <input type="radio" id="sort_rating" name="sort" value="1"> - <label for="sort_rating">Rating</label> + <label for="sort_rating">{{ _('Rating') }}</label> </div> - <h3>Upload date</h3> + <h3>{{ _('Upload date') }}</h3> <div class="option"> <input type="radio" id="time_any" name="time" value="0"> - <label for="time_any">Any</label> + <label for="time_any">{{ _('Any') }}</label> </div> <div class="option"> <input type="radio" id="time_last_hour" name="time" value="1"> - <label for="time_last_hour">Last hour</label> + <label for="time_last_hour">{{ _('Last hour') }}</label> </div> <div class="option"> <input type="radio" id="time_today" name="time" value="2"> - <label for="time_today">Today</label> + <label for="time_today">{{ _('Today') }}</label> </div> <div class="option"> <input type="radio" id="time_this_week" name="time" value="3"> - <label for="time_this_week">This week</label> + <label for="time_this_week">{{ _('This week') }}</label> </div> <div class="option"> <input type="radio" id="time_this_month" name="time" value="4"> - <label for="time_this_month">This month</label> + <label for="time_this_month">{{ _('This month') }}</label> </div> <div class="option"> <input type="radio" id="time_this_year" name="time" value="5"> - <label for="time_this_year">This year</label> + <label for="time_this_year">{{ _('This year') }}</label> </div> <h3>Type</h3> diff --git a/youtube/templates/settings.html b/youtube/templates/settings.html index a4ebabf..a5bb1e4 100644 --- a/youtube/templates/settings.html +++ b/youtube/templates/settings.html @@ -31,11 +31,19 @@ <input type="number" id="{{ 'setting_' + setting_name }}" name="{{ setting_name }}" value="{{ value }}" step="1"> {% endif %} {% elif setting_info['type'].__name__ == 'float' %} - + <input type="number" id="{{ 'setting_' + setting_name }}" name="{{ setting_name }}" value="{{ value }}" step="0.01"> {% elif setting_info['type'].__name__ == 'str' %} - <input type="text" id="{{ 'setting_' + setting_name }}" name="{{ setting_name }}" value="{{ value }}"> + {% if 'options' is in(setting_info) %} + <select id="{{ 'setting_' + setting_name }}" name="{{ setting_name }}"> + {% for option in setting_info['options'] %} + <option value="{{ option[0] }}" {{ 'selected' if option[0] == value else '' }}>{{ option[1] }}</option> + {% endfor %} + </select> + {% else %} + <input type="text" id="{{ 'setting_' + setting_name }}" name="{{ setting_name }}" value="{{ value }}"> + {% endif %} {% else %} - <span>Error: Unknown setting type: setting_info['type'].__name__</span> + <span>Error: Unknown setting type: {{ setting_info['type'].__name__ }}</span> {% endif %} </li> {% endif %} |
