Cleanup templates
This commit is contained in:
parent
b4a8ae73eb
commit
c50e11d0d5
6 changed files with 194 additions and 310 deletions
|
@ -14,43 +14,7 @@
|
|||
<body>
|
||||
<div class="Home">
|
||||
<div class="contentBox_">
|
||||
<div style="margin-bottom: 1rem;" class='searchBar'>
|
||||
<form action="/search" method="get">
|
||||
<div class="search_entry">
|
||||
<input style="width: 19rem;" type='text' id="q" name="q" value='' placeholder="Enter a level name or code"/>
|
||||
<button class="searchButton" id='searchButton' type='submit'>🔍</button>
|
||||
</div>
|
||||
<details>
|
||||
<summary>More options</summary>
|
||||
{% macro option(name, value, key) -%}
|
||||
<option value={{ value }} {{ isSelected(value, key) }}>{{ name }}</option>
|
||||
{%- endmacro %}
|
||||
<div class="sortType">
|
||||
<label for="sort">Sort type</label>
|
||||
<select id="sort" name="sort">
|
||||
{{ option("Rating", "average_rating", "sort") }}
|
||||
{{ option("Upload date", "created_at", "sort") }}
|
||||
{{ option("Difficulty", "average_difficulty", "sort") }}
|
||||
{{ option("Plays", "play_count", "sort") }}
|
||||
</select>
|
||||
<select id="dir" name="dir">
|
||||
{{ option("Descending", "desc", "dir") }}
|
||||
{{ option("Ascending", "asc", "dir") }}
|
||||
</select>
|
||||
</div>
|
||||
<div class="upload_date">
|
||||
<label for="date">Upload date</label>
|
||||
<select id="date" name="date">
|
||||
{{ option("All time", -1, "date") }}
|
||||
{{ option("Past 30 days", 720, "date") }}
|
||||
{{ option("Past 7 days", 168, "date") }}
|
||||
{{ option("Past day", 24, "date") }}
|
||||
{{ option("Past hour", 1, "date") }}
|
||||
</select>
|
||||
</div>
|
||||
</details>
|
||||
</form>
|
||||
</div>
|
||||
<span style="margin-bottom: 1em;">{% include "searchBar.html" %}</span>
|
||||
<div class="contentBox">
|
||||
<div class="header">IWM Browser</div>
|
||||
<div class="splitter"></div>
|
||||
|
|
38
iwm_browser/templates/levelCard.html
Normal file
38
iwm_browser/templates/levelCard.html
Normal file
|
@ -0,0 +1,38 @@
|
|||
<div class="searchResultCard">
|
||||
<div class="thumbnail"><img aria-hidden="true" src="{{ generate_thumbnail_url(map['ID'], THUMB_URL) }}"></div>
|
||||
<div class="details">
|
||||
<div class="basic">
|
||||
<div class="levelTitle"><a href="/level/{{ map['ID'] }}">{{ map['Name'] }}</a></div>
|
||||
<div class="levelDifficulty"><span aria-label="Difficulty: {{ map['AverageUserDifficulty']|int }}">Difficulty: {{ '▲' * map['AverageUserDifficulty']|int }}</span></div>
|
||||
<div class="creatorName">by <a href="/user/{{ map['CreatorId'] }}"><b>{{ map['CreatorName'] }}</b></a></div>
|
||||
<div class="levelRating">{{ map['NumThumbsUp'] }} 👍 {{ map['NumThumbsDown'] }} 👎</div>
|
||||
<div class="replayVisibility">Replays visible: {{ "always" if map['ReplayVisibility'] == 2 }}{{ "after clear" if map['ReplayVisibility'] == 0 }}</div>
|
||||
<div class="dragonCoins">Gems : {{ map['DragonCoins'] }}</div>
|
||||
{% if map['Description'] != ''%}<div class="levelDescription">{{ map['Description'] }}</div>{% endif %}
|
||||
<div class="levelCode"><label for="levelCode-input-{{ map['ID'] }}">Code:</label> <input id="levelCode-input-{{ map['ID'] }}" type="text" onclick="copy(this)" readonly=1 value="{{ map['MapCode'] }}" /></div>
|
||||
<div class="fullResponse">
|
||||
<details>
|
||||
<summary>Full server response</summary>
|
||||
<table>
|
||||
<thead><td>Key</td><td>Value</td></thead>
|
||||
<tbody>
|
||||
{% for value in map %}
|
||||
<tr>
|
||||
<td>{{value}}</td><td>{{map[value]}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- <pre>{{ json_dumps(map, indent=4) }}</pre> -->
|
||||
</details>
|
||||
</div>
|
||||
</div>
|
||||
<div class="times">
|
||||
<div class="FirstClear">First Clear: <a href="/user/{{map['FirstClearUserID']}}"><b>{{ map['FirstClearUsername'] }}</b></a></div>
|
||||
{% set BestTime = convert_times(map['BestTimePlaytime']) %}
|
||||
{% set BestFullTime = convert_times(map['BestFullTimePlaytime']) %}
|
||||
<div class="BestTime">Best Time: <a href="/user/{{ map['BestFullTimeUserID'] }}"><b>{{ map['BestTimeUsername'] }}</b></a> [{{ BestTime[0] }}:{{ BestTime[1] }}:{{ BestTime[2] }}]</div>
|
||||
{% if map['BestFullTimeUserID'] != 0 %}<div class="BestTime {{ 'illegal' if not map['DragonCoins']}}">Best 100% Time: <a href="/user/{{map['BestFullTimeUserID']}}"><b>{{ map['BestFullTimeUsername'] }}</b></a> [{{ BestFullTime[0] }}:{{ BestFullTime[1] }}:{{ BestFullTime[2] }}]{{ "(illegal time)" if not map['DragonCoins'] }}</div>{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,78 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title></title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="{{ combineCSS(
|
||||
'/static/index.css',
|
||||
'/static/main.css',
|
||||
'/static/search/search.css',
|
||||
'/static/search/searchResults.css'
|
||||
) }}">
|
||||
<!-- Optional features -->
|
||||
<script>
|
||||
function copy(obj) {
|
||||
// copies the contents of the
|
||||
// input field to clipboard, and
|
||||
// adds the "copied" css class
|
||||
navigator.clipboard.writeText(obj.value);
|
||||
alert("Level code copied")
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="Search">
|
||||
<div class="contentBox_">
|
||||
<div class="header">Level</div>
|
||||
<div class="splitter"></div>
|
||||
<div class="searchResults">
|
||||
<div class="searchResultCard full">
|
||||
<div class="thumbnail"><img aria-hidden="true" src="{{ generate_thumbnail_url(map['ID'], THUMB_URL) }}"></div>
|
||||
<div class="details">
|
||||
<div class="basic">
|
||||
<div class="levelTitle"><a href="/level/{{ map['ID'] }}">{{ map['Name'] }}</a></div>
|
||||
<div class="levelDifficulty"><span aria-label="Difficulty: {{ map['AverageUserDifficulty']|int }}">Difficulty: {{ '▲' * map['AverageUserDifficulty']|int }}</span></div>
|
||||
<div class="creatorName">by <a href="/user/{{ map['CreatorId'] }}"><b>{{ map['CreatorName'] }}</b></a></div>
|
||||
<div class="levelRating">{{ map['NumThumbsUp'] }} 👍 {{ map['NumThumbsDown'] }} 👎</div>
|
||||
<div class="replayVisibility">Replays visible: {{ "always" if map['ReplayVisibility'] == 2 }}{{ "after clear" if map['ReplayVisibility'] == 0 }}</div>
|
||||
<div class="dragonCoins">Gems : {{ map['DragonCoins'] }}</div>
|
||||
{% if map['Description'] != ''%}<div class="levelDescription">{{ map['Description'] }}</div>{% endif %}
|
||||
<div class="levelCode"><label for="levelCode-input-{{ map['ID'] }}">Code:</label> <input id="levelCode-input-{{ map['ID'] }}" type="text" onclick="copy(this)" readonly=1 value="{{ map['MapCode'] }}" /></div>
|
||||
<div class="fullResponse">
|
||||
<details>
|
||||
<summary>Full server response</summary>
|
||||
<table>
|
||||
<thead><td>Key</td><td>Value</td></thead>
|
||||
<tbody>
|
||||
{% for value in map %}
|
||||
<tr>
|
||||
<td>{{value}}</td><td>{{map[value]}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- <pre>{{ json_dumps(map, indent=4) }}</pre> -->
|
||||
</details>
|
||||
<head>
|
||||
<title></title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="{{ combineCSS(
|
||||
'/static/index.css',
|
||||
'/static/main.css',
|
||||
'/static/search/search.css',
|
||||
'/static/search/searchResults.css'
|
||||
) }}">
|
||||
<!-- Optional features -->
|
||||
<script>
|
||||
function copy(obj) {
|
||||
// copies the contents of the
|
||||
// input field to clipboard, and
|
||||
// adds the "copied" css class
|
||||
navigator.clipboard.writeText(obj.value);
|
||||
alert("Level code copied")
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="Search">
|
||||
<div class="contentBox_">
|
||||
<div class="header">Level</div>
|
||||
<div class="splitter"></div>
|
||||
<div class="searchResults">
|
||||
{% include 'levelCard.html' %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="times">
|
||||
<div class="FirstClear">First Clear: <a href="/user/{{map['FirstClearUserID']}}"><b>{{ map['FirstClearUsername'] }}</b></a></div>
|
||||
{% set BestTime = convert_times(map['BestTimePlaytime']) %}
|
||||
{% set BestFullTime = convert_times(map['BestFullTimePlaytime']) %}
|
||||
<div class="BestTime">Best Time: <a href="/user/{{ map['BestFullTimeUserID'] }}"><b>{{ map['BestTimeUsername'] }}</b></a> [{{ BestTime[0] }}:{{ BestTime[1] }}:{{ BestTime[2] }}]</div>
|
||||
{% if map['BestFullTimeUserID'] != 0 %}<div class="BestTime {{ 'illegal' if not map['DragonCoins']}}">Best 100% Time: <a href="/user/{{map['BestFullTimeUserID']}}"><b>{{ map['BestFullTimeUsername'] }}</b></a> [{{ BestFullTime[0] }}:{{ BestFullTime[1] }}:{{ BestFullTime[2] }}]{{ "(illegal time)" if not map['DragonCoins'] }}</div>{% endif %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,86 +1,45 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!-- {{ QueryValues }} -->
|
||||
<title>IWM Browser</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="{{ combineCSS(
|
||||
'/static/index.css',
|
||||
'/static/main.css',
|
||||
'/static/search/search.css',
|
||||
'/static/search/searchResults.css'
|
||||
) }}">
|
||||
<!-- Optional features -->
|
||||
<script>
|
||||
function copy(obj) {
|
||||
// copies the contents of the
|
||||
// input field to clipboard, and
|
||||
// adds the "copied" css class
|
||||
navigator.clipboard.writeText(obj.value);
|
||||
//alert("Level code copied")
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="Search">
|
||||
<div class="contentBox_">
|
||||
<div class="playlist-details">
|
||||
<h1>{{ response.Name }} </h1>
|
||||
<h2>by <a href="/user/{{ response.CreatorID }}">{{ response.CreatorName }}</a></h2>
|
||||
<p>ID: {{ response.ID }}</p>
|
||||
<p>Maps: {{ response.MapCount }}</p>
|
||||
</div>
|
||||
{% if response.Maps %}
|
||||
<div class="searchResults">
|
||||
{% for map in response.Maps %}
|
||||
<div class="searchResultCard">
|
||||
<div class="thumbnail"><img aria-hidden="true" src="{{ generate_thumbnail_url(map['ID'], THUMB_URL) }}"></div>
|
||||
<div class="details">
|
||||
<div class="basic">
|
||||
<div class="levelTitle"><a href="/level/{{ map['ID'] }}">{{ map['Name'] }}</a></div>
|
||||
<div class="levelDifficulty"><span aria-label="Difficulty: {{ map['AverageUserDifficulty']|int }}">Difficulty: {{ '▲' * map['AverageUserDifficulty']|int }}</span></div>
|
||||
<div class="creatorName">by <a href="/user/{{ map['CreatorId'] }}"><b>{{ map['CreatorName'] }}</b></a></div>
|
||||
<div class="levelRating">{{ map['NumThumbsUp'] }} 👍 {{ map['NumThumbsDown'] }} 👎</div>
|
||||
<div class="replayVisibility">Replays visible: {{ "always" if map['ReplayVisibility'] == 2 }}{{ "after clear" if map['ReplayVisibility'] == 0 }}</div>
|
||||
<div class="dragonCoins">Gems : {{ map['DragonCoins'] }}</div>
|
||||
{% if map['Description'] != ''%}<div class="levelDescription">{{ map['Description'] }}</div>{% endif %}
|
||||
<div class="levelCode"><label for="levelCode-input-{{ map['ID'] }}">Code:</label> <input id="levelCode-input-{{ map['ID'] }}" type="text" onclick="copy(this)" readonly=1 value="{{ map['MapCode'] }}" /></div>
|
||||
<div class="fullResponse">
|
||||
<details>
|
||||
<summary>Full server response</summary>
|
||||
<table>
|
||||
<thead><td>Key</td><td>Value</td></thead>
|
||||
<tbody>
|
||||
{% for value in map %}
|
||||
<tr>
|
||||
<td>{{value}}</td><td>{{map[value]}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- <pre>{{ json_dumps(map, indent=4) }}</pre> -->
|
||||
</details>
|
||||
</div>
|
||||
</div>
|
||||
<div class="times">
|
||||
<div class="FirstClear">First Clear: <a href="/user/{{map['FirstClearUserID']}}"><b>{{ map['FirstClearUsername'] }}</b></a></div>
|
||||
{% set BestTime = convert_times(map['BestTimePlaytime']) %}
|
||||
{% set BestFullTime = convert_times(map['BestFullTimePlaytime']) %}
|
||||
<div class="BestTime">Best Time: <a href="/user/{{ map['BestFullTimeUserID'] }}"><b>{{ map['BestTimeUsername'] }}</b></a> [{{ BestTime[0] }}:{{ BestTime[1] }}:{{ BestTime[2] }}]</div>
|
||||
{% if map['BestFullTimeUserID'] != 0 %}<div class="BestTime {{ 'illegal' if not map['DragonCoins']}}">Best 100% Time: <a href="/user/{{map['BestFullTimeUserID']}}"><b>{{ map['BestFullTimeUsername'] }}</b></a> [{{ BestFullTime[0] }}:{{ BestFullTime[1] }}:{{ BestFullTime[2] }}]{{ "(illegal time)" if not map['DragonCoins'] }}</div>{% endif %}
|
||||
</div>
|
||||
|
||||
<head>
|
||||
<!-- {{ QueryValues }} -->
|
||||
<title>IWM Browser</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="{{ combineCSS(
|
||||
'/static/index.css',
|
||||
'/static/main.css',
|
||||
'/static/search/search.css',
|
||||
'/static/search/searchResults.css'
|
||||
) }}">
|
||||
<!-- Optional features -->
|
||||
<script>
|
||||
function copy(obj) {
|
||||
// copies the contents of the
|
||||
// input field to clipboard, and
|
||||
// adds the "copied" css class
|
||||
navigator.clipboard.writeText(obj.value);
|
||||
//alert("Level code copied")
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="Search">
|
||||
<div class="contentBox_">
|
||||
<div class="playlist-details">
|
||||
<h1>{{ response.Name }} </h1>
|
||||
<h2>by <a href="/user/{{ response.CreatorID }}">{{ response.CreatorName }}</a></h2>
|
||||
<p>ID: {{ response.ID }}</p>
|
||||
<p>Maps: {{ response.MapCount }}</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
|
||||
{% if response.Maps %}
|
||||
<div class="searchResults">
|
||||
{% for map in response.Maps %}
|
||||
{% include 'levelCard.html' %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,127 +1,53 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!-- {{ QueryValues }} -->
|
||||
<title>IWM Browser - {{ QueryValues["q"] if QueryValues["q"] is not none }}{{ QueryValues["type"] }}</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="{{ combineCSS(
|
||||
'/static/index.css',
|
||||
'/static/main.css',
|
||||
'/static/search/search.css',
|
||||
'/static/search/searchResults.css'
|
||||
) }}">
|
||||
<!-- Optional features -->
|
||||
<script>
|
||||
function copy(obj) {
|
||||
// copies the contents of the
|
||||
// input field to clipboard, and
|
||||
// adds the "copied" css class
|
||||
navigator.clipboard.writeText(obj.value);
|
||||
//alert("Level code copied")
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="Search">
|
||||
<div class="contentBox_">
|
||||
<div class="header">Search</div>
|
||||
<div class="splitter"></div>
|
||||
<div class='searchBar'>
|
||||
<form action="/search" method="get">
|
||||
<div class="search_entry">
|
||||
<input type='text' id="q" name="q" value='{{ QueryValues["q"] if QueryValues["q"] is not none }}' placeholder="Enter a level name or code"/>
|
||||
<button class="searchButton" id='searchButton' type='submit'>🔍</button>
|
||||
</div>
|
||||
<details>
|
||||
<summary>More options</summary>
|
||||
{% macro option(name, value, key) -%}
|
||||
<option value={{ value }} {{ isSelected(value, QueryValues[key]) }}>{{ name }}</option>
|
||||
{%- endmacro %}
|
||||
<div class="sortType">
|
||||
<label for="sort">Sort type</label>
|
||||
<select id="sort" name="sort">
|
||||
{{ option("Rating", "average_rating", "sort") }}
|
||||
{{ option("Upload date", "created_at", "sort") }}
|
||||
{{ option("Difficulty", "average_difficulty", "sort") }}
|
||||
{{ option("Plays", "play_count", "sort") }}
|
||||
</select>
|
||||
<select id="dir" name="dir">
|
||||
{{ option("Descending", "desc", "dir") }}
|
||||
{{ option("Ascending", "asc", "dir") }}
|
||||
</select>
|
||||
</div>
|
||||
<div class="upload_date">
|
||||
<label for="date">Upload date</label>
|
||||
<select id="date" name="date">
|
||||
{{ option("All time", -1, "date") }}
|
||||
{{ option("Past 30 days", 720, "date") }}
|
||||
{{ option("Past 7 days", 168, "date") }}
|
||||
{{ option("Past day", 24, "date") }}
|
||||
{{ option("Past hour", 1, "date") }}
|
||||
</select>
|
||||
</div>
|
||||
</details>
|
||||
</form>
|
||||
</div>
|
||||
{% if searchResults %}
|
||||
<div class="searchResults">
|
||||
{% for map in searchResults %}
|
||||
<div class="searchResultCard">
|
||||
<div class="thumbnail"><img aria-hidden="true" src="{{ generate_thumbnail_url(map['ID'], THUMB_URL) }}"></div>
|
||||
<div class="details">
|
||||
<div class="basic">
|
||||
<div class="levelTitle"><a href="/level/{{ map['ID'] }}">{{ map['Name'] }}</a></div>
|
||||
<div class="levelDifficulty"><span aria-label="Difficulty: {{ map['AverageUserDifficulty']|int }}">Difficulty: {{ '▲' * map['AverageUserDifficulty']|int }}</span></div>
|
||||
<div class="creatorName">by <a href="/user/{{ map['CreatorId'] }}"><b>{{ map['CreatorName'] }}</b></a></div>
|
||||
<div class="levelRating">{{ map['NumThumbsUp'] }} 👍 {{ map['NumThumbsDown'] }} 👎</div>
|
||||
<div class="replayVisibility">Replays visible: {{ "always" if map['ReplayVisibility'] == 2 }}{{ "after clear" if map['ReplayVisibility'] == 0 }}</div>
|
||||
<div class="dragonCoins">Gems : {{ map['DragonCoins'] }}</div>
|
||||
{% if map['Description'] != ''%}<div class="levelDescription">{{ map['Description'] }}</div>{% endif %}
|
||||
<div class="levelCode"><label for="levelCode-input-{{ map['ID'] }}">Code:</label> <input id="levelCode-input-{{ map['ID'] }}" type="text" onclick="copy(this)" readonly=1 value="{{ map['MapCode'] }}" /></div>
|
||||
<div class="fullResponse">
|
||||
<details>
|
||||
<summary>Full server response</summary>
|
||||
<table>
|
||||
<thead><td>Key</td><td>Value</td></thead>
|
||||
<tbody>
|
||||
{% for value in map %}
|
||||
<tr>
|
||||
<td>{{value}}</td><td>{{map[value]}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<!-- <pre>{{ json_dumps(map, indent=4) }}</pre> -->
|
||||
</details>
|
||||
</div>
|
||||
</div>
|
||||
<div class="times">
|
||||
<div class="FirstClear">First Clear: <a href="/user/{{map['FirstClearUserID']}}"><b>{{ map['FirstClearUsername'] }}</b></a></div>
|
||||
{% set BestTime = convert_times(map['BestTimePlaytime']) %}
|
||||
{% set BestFullTime = convert_times(map['BestFullTimePlaytime']) %}
|
||||
<div class="BestTime">Best Time: <a href="/user/{{ map['BestFullTimeUserID'] }}"><b>{{ map['BestTimeUsername'] }}</b></a> [{{ BestTime[0] }}:{{ BestTime[1] }}:{{ BestTime[2] }}]</div>
|
||||
{% if map['BestFullTimeUserID'] != 0 %}<div class="BestTime {{ 'illegal' if not map['DragonCoins']}}">Best 100% Time: <a href="/user/{{map['BestFullTimeUserID']}}"><b>{{ map['BestFullTimeUsername'] }}</b></a> [{{ BestFullTime[0] }}:{{ BestFullTime[1] }}:{{ BestFullTime[2] }}]{{ "(illegal time)" if not map['DragonCoins'] }}</div>{% endif %}
|
||||
</div>
|
||||
<head>
|
||||
<!-- {{ QueryValues }} -->
|
||||
<title>IWM Browser - {{ QueryValues["q"] if QueryValues["q"] is not none }}{{ QueryValues["type"] }}</title>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="{{ combineCSS(
|
||||
'/static/index.css',
|
||||
'/static/main.css',
|
||||
'/static/search/search.css',
|
||||
'/static/search/searchResults.css'
|
||||
) }}">
|
||||
<!-- Optional features -->
|
||||
<script>
|
||||
function copy(obj) {
|
||||
// copies the contents of the
|
||||
// input field to clipboard, and
|
||||
// adds the "copied" css class
|
||||
navigator.clipboard.writeText(obj.value);
|
||||
//alert("Level code copied")
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="Search">
|
||||
<div class="contentBox_">
|
||||
<div class="header">Search</div>
|
||||
<div class="splitter"></div>
|
||||
{% include "searchBar.html" %}
|
||||
{% if searchResults %}
|
||||
<div class="searchResults">
|
||||
{% for map in searchResults %}
|
||||
{% include "levelCard.html" %}
|
||||
{% endfor %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
<div class="searchResultsFooter">
|
||||
{% set searchPage = builtins.int(QueryValues['p']) %}
|
||||
<p>Page {{ searchPage+1 }}</p>
|
||||
{#<!-- {% if not searchPage <= 0 %}<a href="/search?q={{ QueryValues['q'] }}&sort={{ QueryValues['sort'] }}&dir={{ QueryValues['dir'] }}&date={{ QueryValues['date'] }}&p={{ QueryValues['p']-1 }}">Prev</a>{% endif %} -->#}
|
||||
{% if not searchPage <= 0 %}<a href="/search?{{ urlencode(builtins.dict(QueryValues, **{'p': searchPage-1})) }}">Prev</a>{% endif %}
|
||||
{% if not entryNumber < entryLimit %}<a href="/search?{{ urlencode(builtins.dict(QueryValues, **{'p': searchPage+1})) }}">Next</a>{% endif %}
|
||||
{#{% if not entryNumber < entryLimit %}<a href="/search?q={{ QueryValues['q'] }}&sort={{ QueryValues['sort'] }}&dir={{ QueryValues['dir'] }}&date={{ QueryValues['date'] }}&p={{ QueryValues['p']+1 }}">Next</a>{% endif %}#}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
<div class="searchResultsFooter">
|
||||
{% set searchPage = builtins.int(QueryValues['p']) %}
|
||||
<p>Page {{ searchPage+1 }}</p>
|
||||
{#<!-- {% if not searchPage <= 0 %}<a href="/search?q={{ QueryValues['q'] }}&sort={{ QueryValues['sort'] }}&dir={{ QueryValues['dir'] }}&date={{ QueryValues['date'] }}&p={{ QueryValues['p']-1 }}">Prev</a>{% endif %} -->#}
|
||||
{% if not searchPage <= 0 %}<a href="/search?{{ urlencode(builtins.dict(QueryValues, **{'p': searchPage-1})) }}">Prev</a>{% endif %}
|
||||
{% if not entryNumber < entryLimit %}<a href="/search?{{ urlencode(builtins.dict(QueryValues, **{'p': searchPage+1})) }}">Next</a>{% endif %}
|
||||
{#{% if not entryNumber < entryLimit %}<a href="/search?q={{ QueryValues['q'] }}&sort={{ QueryValues['sort'] }}&dir={{ QueryValues['dir'] }}&date={{ QueryValues['date'] }}&p={{ QueryValues['p']+1 }}">Next</a>{% endif %}#}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</body>
|
||||
</html>
|
||||
|
|
39
iwm_browser/templates/searchBar.html
Normal file
39
iwm_browser/templates/searchBar.html
Normal file
|
@ -0,0 +1,39 @@
|
|||
<div class='searchBar'>
|
||||
<form action="/search" method="get">
|
||||
<div class="search_entry">
|
||||
{% set QueryValues = "" if not QueryValues %}
|
||||
<input type='text' id="q" name="q" value='{{ QueryValues["q"] if QueryValues["q"] is not none }}' placeholder="Enter a level name or code"/>
|
||||
<button class="searchButton" id='searchButton' type='submit'>🔍</button>
|
||||
</div>
|
||||
<details>
|
||||
<summary>More options</summary>
|
||||
{% macro option(name, value, key) -%}
|
||||
<option value={{ value }} {{ isSelected(value, QueryValues[key]) }}>{{ name }}</option>
|
||||
{%- endmacro %}
|
||||
<div class="sortType">
|
||||
<label for="sort">Sort type</label>
|
||||
<select id="sort" name="sort">
|
||||
{{ option("Rating", "average_rating", "sort") }}
|
||||
{{ option("Upload date", "created_at", "sort") }}
|
||||
{{ option("Difficulty", "average_difficulty", "sort") }}
|
||||
{{ option("Plays", "play_count", "sort") }}
|
||||
</select>
|
||||
<select id="dir" name="dir">
|
||||
{{ option("Descending", "desc", "dir") }}
|
||||
{{ option("Ascending", "asc", "dir") }}
|
||||
</select>
|
||||
</div>
|
||||
<div class="upload_date">
|
||||
<label for="date">Upload date</label>
|
||||
<select id="date" name="date">
|
||||
{{ option("All time", -1, "date") }}
|
||||
{{ option("Past 30 days", 720, "date") }}
|
||||
{{ option("Past 7 days", 168, "date") }}
|
||||
{{ option("Past day", 24, "date") }}
|
||||
{{ option("Past hour", 1, "date") }}
|
||||
</select>
|
||||
</div>
|
||||
</details>
|
||||
</form>
|
||||
</div>
|
||||
|
Loading…
Reference in a new issue