Make our HTML actually valid. Fix indentation.

This commit is contained in:
ReimuHakurei 2017-05-24 06:06:39 +00:00
parent 16cfcff846
commit 8d393f5917
3 changed files with 224 additions and 217 deletions

View File

@ -281,4 +281,8 @@ a.text-purple:hover, a.text-purple:active, a.text-purple:focus { color: #a760e0;
.btn.active span.glyphicon-unchecked {
display: none;
}
.center {
float: none;
margin: 0 auto;
text-align: center;
}

View File

@ -4,7 +4,7 @@
<meta charset="utf-8">
<title>{% block title %}{{ config.SITE_NAME }}{% endblock %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
<meta name="viewport" content="width=device-width">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="shortcut icon" type="image/png" href="/static/favicon.png">
<link rel="icon" type="image/png" href="/static/favicon.png">
@ -48,229 +48,232 @@
<!-- Fixed navbar -->
<nav class="navbar navbar-default navbar-static-top navbar-inverse">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">{{ config.SITE_NAME }}</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li {% if request.path == "/upload" %} class="active"{% endif %}><a href="/upload">Upload</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
About
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li {% if request.path == "/rules" %} class="active"{% endif %}><a href="/rules">Rules</a></li>
<li {% if request.path == "/help" %} class="active"{% endif %}><a href="/help">Help</a></li>
</ul>
</li>
<li><a href="{% if rss_filter %}{{ url_for('home', page='rss', **rss_filter) }}{% else %}{{ url_for('home', page='rss') }}{% endif %}">RSS</a></li>
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">{{ config.SITE_NAME }}</a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li {% if request.path == "/upload" %} class="active"{% endif %}><a href="/upload">Upload</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
About
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li {% if request.path == "/rules" %} class="active"{% endif %}><a href="/rules">Rules</a></li>
<li {% if request.path == "/help" %} class="active"{% endif %}><a href="/help">Help</a></li>
</ul>
</li>
<li><a href="{% if rss_filter %}{{ url_for('home', page='rss', **rss_filter) }}{% else %}{{ url_for('home', page='rss') }}{% endif %}">RSS</a></li>
{% if config.SITE_FLAVOR == 'nyaa' %}
<li><a href="https://sukebei.nyaa.si/">Fap</a></li>
{% elif config.SITE_FLAVOR == 'sukebei' %}
<li><a href="https://nyaa.si/">Fun</a></li>
{% endif %}
</ul>
<ul class="nav navbar-nav navbar-right">
{% if g.user %}
<li class="dropdown">
<a href="#" class="dropdown-toggle visible-lg visible-sm visible-xs" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-user fa-fw"></i>
{{ g.user.username }}
<span class="caret"></span>
</a>
<a href="#" class="dropdown-toggle hidden-lg hidden-sm hidden-xs" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-user fa-fw"></i>
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li class="hidden-lg hidden-sm hidden-xs">
<a><i class="fa fa-user fa-fw"></i>Logged in as {{ g.user.username }}</a>
</li>
<li class="hidden-lg hidden-sm hidden-xs divider" role="separator">
</li>
<li>
<a href="{{ url_for('view_user', user_name=g.user.username) }}">
<i class="fa fa-user fa-fw"></i>
Torrents
</a>
</li>
<li>
<a href="/profile">
<i class="fa fa-gear fa-fw"></i>
Profile
</a>
</li>
<li>
<a href="/logout">
<i class="fa fa-times fa-fw"></i>
Logout
</a>
</li>
</ul>
</li>
{% else %}
<li class="dropdown">
<a href="#" class="dropdown-toggle visible-lg visible-sm visible-xs" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-user fa-fw"></i>
Guest
<span class="caret"></span>
</a>
<a href="#" class="dropdown-toggle hidden-lg hidden-sm hidden-xs" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-user fa-fw"></i>
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li>
<a href="/login">
<i class="fa fa-sign-in fa-fw"></i>
Login
</a>
</li>
<li>
<a href="/register">
<i class="fa fa-pencil fa-fw"></i>
Register
</a>
</li>
</ul>
</li>
{% endif %}
</ul>
{% set nyaa_cats = [('1_0', 'Anime', 'Anime'),
('1_1', '- Anime Music Video', 'Anime - AMV'),
('1_2', '- English-translated', 'Anime - English'),
('1_3', '- Non-English-translated', 'Anime - Non-English'),
('1_4', '- Raw', 'Anime - Raw'),
('2_0', 'Audio', 'Audio'),
('2_1', '- Lossless', 'Audio - Lossless'),
('2_2', '- Lossy', 'Audio - Lossy'),
('3_0', 'Literature', 'Literature'),
('3_1', '- English-translated', 'Literature - English'),
('3_2', '- Non-English-translated', 'Literature - Non-English'),
('3_3', '- Raw', 'Literature - Raw'),
('4_0', 'Live Action', 'Live Action'),
('4_1', '- English-translated', 'Live Action - English'),
('4_2', '- Idol/Promotional Video', 'Live Action - Idol/PV'),
('4_3', '- Non-English-translated', 'Live Action - Non-English'),
('4_4', '- Raw', 'Live Action - Raw'),
('5_0', 'Pictures', 'Pictures'),
('5_1', '- Graphics', 'Pictures - Graphics'),
('5_2', '- Photos', 'Pictures - Photos'),
('6_0', 'Software', 'Software'),
('6_1', '- Applications', 'Software - Apps'),
('6_2', '- Games', 'Software - Games')]
%}
{% set suke_cats = [('1_0', 'Art', 'Art'),
('1_1', '- Anime', 'Art - Anime'),
('1_2', '- Doujinshi', 'Art - Doujinshi'),
('1_3', '- Games', 'Art - Games'),
('1_4', '- Manga', 'Art - Manga'),
('1_5', '- Pictures', 'Art - Pictures'),
('2_0', 'Real Life', 'Real Life'),
('2_1', '- Photobooks and Pictures', 'Real Life - Pictures'),
('2_2', '- Videos', 'Real Life - Videos')]
%}
{% if config.SITE_FLAVOR == 'nyaa' %}
<li><a href="https://sukebei.nyaa.si/">Fap</a></li>
{% set used_cats = nyaa_cats %}
{% elif config.SITE_FLAVOR == 'sukebei' %}
<li><a href="https://nyaa.si/">Fun</a></li>
{% set used_cats = suke_cats %}
{% endif %}
</ul>
<ul class="nav navbar-nav navbar-right">
{% if g.user %}
<li class="dropdown">
<a href="#" class="dropdown-toggle visible-lg visible-sm visible-xs" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-user fa-fw"></i>
{{ g.user.username }}
<span class="caret"></span>
</a>
<a href="#" class="dropdown-toggle hidden-lg hidden-sm hidden-xs" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-user fa-fw"></i>
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li class="hidden-lg hidden-sm hidden-xs">
<a><i class="fa fa-user fa-fw"></i>Logged in as {{ g.user.username }}</a>
</li>
<li class="hidden-lg hidden-sm hidden-xs divider" role="separator">
</li>
<li>
<a href="{{ url_for('view_user', user_name=g.user.username) }}">
<i class="fa fa-user fa-fw"></i>
Torrents
</a>
</li>
<li>
<a href="/profile">
<i class="fa fa-gear fa-fw"></i>
Profile
</a>
</li>
<li>
<a href="/logout">
<i class="fa fa-times fa-fw"></i>
Logout
</a>
</li>
</ul>
</li>
{% else %}
<li class="dropdown">
<a href="#" class="dropdown-toggle visible-lg visible-sm visible-xs" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-user fa-fw"></i>
Guest
<span class="caret"></span>
</a>
<a href="#" class="dropdown-toggle hidden-lg hidden-sm hidden-xs" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-user fa-fw"></i>
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li>
<a href="/login">
<i class="fa fa-sign-in fa-fw"></i>
Login
</a>
</li>
<li>
<a href="/register">
<i class="fa fa-pencil fa-fw"></i>
Register
</a>
</li>
</ul>
</li>
{% endif %}
</ul>
{% set nyaa_cats = [('1_0', 'Anime', 'Anime'),
('1_1', '- Anime Music Video', 'Anime - AMV'),
('1_2', '- English-translated', 'Anime - English'),
('1_3', '- Non-English-translated', 'Anime - Non-English'),
('1_4', '- Raw', 'Anime - Raw'),
('2_0', 'Audio', 'Audio'),
('2_1', '- Lossless', 'Audio - Lossless'),
('2_2', '- Lossy', 'Audio - Lossy'),
('3_0', 'Literature', 'Literature'),
('3_1', '- English-translated', 'Literature - English'),
('3_2', '- Non-English-translated', 'Literature - Non-English'),
('3_3', '- Raw', 'Literature - Raw'),
('4_0', 'Live Action', 'Live Action'),
('4_1', '- English-translated', 'Live Action - English'),
('4_2', '- Idol/Promotional Video', 'Live Action - Idol/PV'),
('4_3', '- Non-English-translated', 'Live Action - Non-English'),
('4_4', '- Raw', 'Live Action - Raw'),
('5_0', 'Pictures', 'Pictures'),
('5_1', '- Graphics', 'Pictures - Graphics'),
('5_2', '- Photos', 'Pictures - Photos'),
('6_0', 'Software', 'Software'),
('6_1', '- Applications', 'Software - Apps'),
('6_2', '- Games', 'Software - Games')] %}
{% set suke_cats = [('1_0', 'Art', 'Art'),
('1_1', '- Anime', 'Art - Anime'),
('1_2', '- Doujinshi', 'Art - Doujinshi'),
('1_3', '- Games', 'Art - Games'),
('1_4', '- Manga', 'Art - Manga'),
('1_5', '- Pictures', 'Art - Pictures'),
('2_0', 'Real Life', 'Real Life'),
('2_1', '- Photobooks and Pictures', 'Real Life - Pictures'),
('2_2', '- Videos', 'Real Life - Videos')] %}
{% if config.SITE_FLAVOR == 'nyaa' %}
{% set used_cats = nyaa_cats %}
{% elif config.SITE_FLAVOR == 'sukebei' %}
{% set used_cats = suke_cats %}
{% endif %}
<div class="search-container visible-xs visible-sm">
<div class="search-container visible-xs visible-sm">
{% if user_page %}
<form class="navbar-form navbar-right form" action="{{ url_for('view_user', user_name=user.username) }}" method="get">
{% else %}
<form class="navbar-form navbar-right form" action="/" method="get">
{% endif %}
<input type="text" class="form-control" name="q" placeholder="Search..." value="{{ search["term"] if search is defined else '' }}">
<br>
<select class="form-control" title="Filter" data-width="120px" name="f">
<option value="0" title="No filter" {% if search is defined and search["quality_filter"] == "0" %}selected{% else %}selected{% endif %}>No filter</option>
<option value="1" title="No remakes" {% if search is defined and search["quality_filter"] == "1" %}selected{% endif %}>No remakes</option>
<option value="2" title="Trusted only" {% if search is defined and search["quality_filter"] == "2" %}selected{% endif %}>Trusted only</option>
</select>
<br>
<select class="form-control" title="Category" data-width="200px" name="c">
<option value="0_0" title="All categories" {% if search is defined and search["category"] == "0_0" %}selected{% else %}selected{% endif %}>
All categories
</option>
{% for cat_id, cat_name, cat_title in used_cats %}
<option value="{{ cat_id }}" title="{{ cat_title }}" {% if search is defined and search.category == cat_id %}selected{% endif %}>
{{ cat_name }}
</option>
{% endfor %}
</select>
<br>
<button class="btn btn-primary form-control" type="submit">
<i class="fa fa-search fa-fw"></i> Search
</button>
</form>
</div>
{% if user_page %}
<form class="navbar-form navbar-right form" action="{{ url_for('view_user', user_name=user.username) }}" method="get">
{% else %}
<form class="navbar-form navbar-right form" action="/" method="get">
{% endif %}
<input type="text" class="form-control" name="q" placeholder="Search..." value="{{ search["term"] if search is defined else '' }}">
<br>
<select class="form-control" title="Filter" data-width="120px" name="f">
<option value="0" title="No filter" {% if search is defined and search["quality_filter"] == "0" %}selected{% else %}selected{% endif %}>No filter</option>
<option value="1" title="No remakes" {% if search is defined and search["quality_filter"] == "1" %}selected{% endif %}>No remakes</option>
<option value="2" title="Trusted only" {% if search is defined and search["quality_filter"] == "2" %}selected{% endif %}>Trusted only</option>
</select>
<br>
<select class="form-control" title="Category" data-width="200px" name="c">
<option value="0_0" title="All categories" {% if search is defined and search["category"] == "0_0" %}selected{% else %}selected{% endif %}>
All categories
</option>
{% for cat_id, cat_name, cat_title in used_cats %}
<option value="{{ cat_id }}" title="{{ cat_title }}" {% if search is defined and search.category == cat_id %}selected{% endif %}>
{{ cat_name }}
</option>
{% endfor %}
</select>
<br>
<button class="btn btn-primary form-control" type="submit">
<i class="fa fa-search fa-fw"></i> Search
</button>
<div class="input-group search-container hidden-xs hidden-sm">
<input type="text" class="form-control search-bar" name="q" placeholder="Search..." value="{{ search["term"] if search is defined else '' }}">
<div class="input-group-btn nav-filter" id="navFilter-criteria">
<select class="selectpicker show-tick" title="Filter" data-width="120px" name="f">
<option value="0" title="No filter" {% if search is defined and search["quality_filter"] == "0" %}selected{% else %}selected{% endif %}>No filter</option>
<option value="1" title="No remakes" {% if search is defined and search["quality_filter"] == "1" %}selected{% endif %}>No remakes</option>
<option value="2" title="Trusted only" {% if search is defined and search["quality_filter"] == "2" %}selected{% endif %}>Trusted only</option>
</select>
</div>
<div class="input-group-btn nav-filter" id="navFilter-category">
<!--
On narrow viewports, there isn't enough room to fit the full stuff in the selectpicker, so we show a full-width one on wide viewports, but squish it on narrow ones.
-->
<select class="selectpicker show-tick visible-lg" title="Category" data-width="200px" name="c">
<option value="0_0" title="All categories" {% if search is defined and search["category"] == "0_0" %}selected{% else %}selected{% endif %}>
All categories
</option>
{% for cat_id, cat_name, cat_title in used_cats %}
<option value="{{ cat_id }}" title="{{ cat_title }}" {% if search is defined and search.category == cat_id %}selected{% endif %}>
{{ cat_name }}
</option>
{% endfor %}
</select>
<select class="selectpicker show-tick hidden-lg" title="Category" data-width="130px" name="c">
<option value="0_0" title="All categories" {% if search is defined and search["category"] == "0_0" %}selected{% else %}selected{% endif %}>
All categories
</option>
{% for cat_id, cat_name, cat_title in used_cats %}
<option value="{{ cat_id }}" title="{{ cat_title }}" {% if search is defined and search.category == cat_id %}selected{% endif %}>
{{ cat_name }}
</option>
{% endfor %}
</select>
</div>
<div class="input-group-btn search-btn">
<button class="btn btn-primary" type="submit">
<i class="fa fa-search fa-fw"></i>
</button>
</div>
</div>
</form>
</div>
{% if user_page %}
<form class="navbar-form navbar-right form" action="{{ url_for('view_user', user_name=user.username) }}" method="get">
{% else %}
<form class="navbar-form navbar-right form" action="/" method="get">
{% endif %}
<div class="input-group search-container hidden-xs hidden-sm">
<input type="text" class="form-control search-bar" name="q" placeholder="Search..." value="{{ search["term"] if search is defined else '' }}">
<div class="input-group-btn nav-filter" id="navFilter-criteria">
<select class="selectpicker show-tick" title="Filter" data-width="120px" name="f">
<option value="0" title="No filter" {% if search is defined and search["quality_filter"] == "0" %}selected{% else %}selected{% endif %}>No filter</option>
<option value="1" title="No remakes" {% if search is defined and search["quality_filter"] == "1" %}selected{% endif %}>No remakes</option>
<option value="2" title="Trusted only" {% if search is defined and search["quality_filter"] == "2" %}selected{% endif %}>Trusted only</option>
</select>
</div>
<div class="input-group-btn nav-filter" id="navFilter-category">
<!--
On narrow viewports, there isn't enough room to fit the full stuff in the selectpicker, so we show a full-width one on wide viewports, but squish it on narrow ones.
-->
<select class="selectpicker show-tick visible-lg" title="Category" data-width="200px" name="c">
<option value="0_0" title="All categories" {% if search is defined and search["category"] == "0_0" %}selected{% else %}selected{% endif %}>
All categories
</option>
{% for cat_id, cat_name, cat_title in used_cats %}
<option value="{{ cat_id }}" title="{{ cat_title }}" {% if search is defined and search.category == cat_id %}selected{% endif %}>
{{ cat_name }}
</option>
{% endfor %}
</select>
<select class="selectpicker show-tick hidden-lg" title="Category" data-width="130px" name="c">
<option value="0_0" title="All categories" {% if search is defined and search["category"] == "0_0" %}selected{% else %}selected{% endif %}>
All categories
</option>
{% for cat_id, cat_name, cat_title in used_cats %}
<option value="{{ cat_id }}" title="{{ cat_title }}" {% if search is defined and search.category == cat_id %}selected{% endif %}>
{{ cat_name }}
</option>
{% endfor %}
</select>
</div>
<div class="input-group-btn search-btn">
<button class="btn btn-primary" type="submit">
<i class="fa fa-search fa-fw"></i>
</button>
</div>
</div>
</form>
</div> <!-- where is this? in a hurry, will fix later -->
</div><!--/.nav-collapse -->
</nav>

View File

@ -56,7 +56,7 @@
{% else %}
<a href="/?c={{ cat_id }}" title="{{ torrent.main_category.name }} - {{ torrent.sub_category.name }}">
{% endif %}
<img src="/static/img/icons/{{ icon_dir }}/{{ cat_id }}.png">
<img src="/static/img/icons/{{ icon_dir }}/{{ cat_id }}.png" alt="{{ category_name(cat_id) }}">
</a>
</td>
{% if use_elastic %}
@ -99,7 +99,7 @@
<h3>No results found</h3>
{% endif %}
<center>
<div class="center">
{% if use_elastic %}
{{ pagination.info }}
{{ pagination.links }}
@ -107,4 +107,4 @@
{% from "bootstrap/pagination.html" import render_pagination %}
{{ render_pagination(torrent_query) }}
{% endif %}
</center>
</div>