did some major cleanup work and implemented subpages

This commit is contained in:
sqozz 2015-02-05 22:17:33 +01:00
parent 9d9b505886
commit a8bf953078
11 changed files with 76 additions and 159 deletions

View File

@ -1,2 +1,15 @@
#!/usr/bin/python3
#/* vim:set ts=2 set noexpandtab */
from flask import Flask, render_template, url_for
app = Flask(__name__)
@app.route("/")
def index():
return render_template("search.html")
@app.route("/categorys")
def categorys():
return render_template("categorys.html")
if __name__ == "__main__":
app.run(debug=True)

9
templates/categorys.html Normal file
View File

@ -0,0 +1,9 @@
<!--
vim: ts=2 noexpandtab
-->
{% extends "index.html" %}
{% block title %}{{ super() }} - Categorys{% endblock%}
{% set active_page = "categorys" %}
{% block content %}
<p>CATEGORYS</p>
{% endblock content%}

48
templates/index.html Normal file
View File

@ -0,0 +1,48 @@
<!--
vim: ts=2 noexpandtab
-->
{% set navigation_bar = [
("/", "search", "Search"),
("/categorys", "categorys", "Categorys")
] -%}
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" href="favicon.ico">
<title>{% block title %}TorrentIndexer{% endblock %}</title>
<link href="{{ url_for("static", filename="css/bootstrap.css") }}" rel="stylesheet">
<link href="{{ url_for("static", filename="css/style.css") }}" rel="stylesheet">
</head>
<body>
<div class="site-wrapper">
<div class="site-wrapper-inner">
<div class="cover-container">
<div class="masthead clearfix">
<div class="inner">
<h3 class="masthead-brand"><a href="/">TorrentIndexer</a></h3>
<nav>
<ul class="nav masthead-nav">
{% for href, id, caption in navigation_bar %}
<li {% if id == active_page %}class="active"{% endif %}><a href="{{ href|e }}">{{ caption|e }}</a></li>
{% endfor %}
</ul>
</nav>
</div>
</div>
<div class="inner cover">
{% block content %}{% endblock %}
</div>
</div>
</div>
</div>
<script src="{{ url_for("static", filename="js/jquery.js") }}"></script>
<script src="{{ url_for("static", filename="js/bootstrap.js") }}"></script>
</body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -1,51 +0,0 @@
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
// IT'S JUST JUNK FOR OUR DOCS!
// ++++++++++++++++++++++++++++++++++++++++++
/*!
* Copyright 2014 Twitter, Inc.
*
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
* details, see http://creativecommons.org/licenses/by/3.0/.
*/
// Intended to prevent false-positive bug reports about Bootstrap not working properly in old versions of IE due to folks testing using IE's unreliable emulation modes.
(function () {
'use strict';
function emulatedIEMajorVersion() {
var groups = /MSIE ([0-9.]+)/.exec(window.navigator.userAgent)
if (groups === null) {
return null
}
var ieVersionNum = parseInt(groups[1], 10)
var ieMajorVersion = Math.floor(ieVersionNum)
return ieMajorVersion
}
function actualNonEmulatedIEMajorVersion() {
// Detects the actual version of IE in use, even if it's in an older-IE emulation mode.
// IE JavaScript conditional compilation docs: http://msdn.microsoft.com/en-us/library/ie/121hztk3(v=vs.94).aspx
// @cc_on docs: http://msdn.microsoft.com/en-us/library/ie/8ka90k2e(v=vs.94).aspx
var jscriptVersion = new Function('/*@cc_on return @_jscript_version; @*/')() // jshint ignore:line
if (jscriptVersion === undefined) {
return 11 // IE11+ not in emulation mode
}
if (jscriptVersion < 9) {
return 8 // IE8 (or lower; haven't tested on IE<8)
}
return jscriptVersion // IE9 or IE10 in any mode, or IE11 in non-IE11 mode
}
var ua = window.navigator.userAgent
if (ua.indexOf('Opera') > -1 || ua.indexOf('Presto') > -1) {
return // Opera, which might pretend to be IE
}
var emulated = emulatedIEMajorVersion()
if (emulated === null) {
return // Not IE
}
var nonEmulated = actualNonEmulatedIEMajorVersion()
if (emulated !== nonEmulated) {
window.alert('WARNING: You appear to be using IE' + nonEmulated + ' in IE' + emulated + ' emulation mode.\nIE emulation modes can behave significantly differently from ACTUAL older versions of IE.\nPLEASE DON\'T FILE BOOTSTRAP BUGS based on testing in IE emulation modes!')
}
})();

View File

@ -1,22 +0,0 @@
/*!
* IE10 viewport hack for Surface/desktop Windows 8 bug
* Copyright 2014 Twitter, Inc.
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
* details, see http://creativecommons.org/licenses/by/3.0/.
*/
// See the Getting Started docs for more information:
// http://getbootstrap.com/getting-started/#support-ie10-width
(function () {
'use strict';
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
var msViewportStyle = document.createElement('style')
msViewportStyle.appendChild(
document.createTextNode(
'@-ms-viewport{width:auto!important}'
)
)
document.querySelector('head').appendChild(msViewportStyle)
}
})();

View File

@ -1,63 +1,9 @@
<!--
vim: ts=2 noexpandtab
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<link rel="icon" href="favicon.ico">
<title>{{pageTitle}}</title>
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/cover.css" rel="stylesheet">
</head>
<body>
<div class="site-wrapper">
<div class="site-wrapper-inner">
<div class="cover-container">
<div class="masthead clearfix">
<div class="inner">
<h3 class="masthead-brand">Cover</h3>
<nav>
<ul class="nav masthead-nav">
<li class="active"><a href="#">Search</a></li>
<li><a href="#">Features</a></li>
<li><a href="#">Contact</a></li>
</ul>
</nav>
</div>
</div>
<div class="inner cover">
<form>
<input type=text>
<input type="submit" value="Submit">
</form>
<h1 class="cover-heading">Cover your page.</h1>
<p class="lead">Cover is a one-page template for building
simple and beautiful home pages. Download, edit the text, and add your
own fullscreen background photo to make it your own.</p>
<p class="lead">
<a href="#" class="btn btn-lg btn-default">Learn more</a>
</p>
</div>
<div class="mastfoot">
<div class="inner">
<p>This is a Footer, maybe some dump sayings here?</p>
</div>
</div>
</div>
</div>
</div>
<script src="js/jquery.js"></script>
<script src="js/bootstrap.js"></script>
<script src="js/docs.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="js/ie10-viewport-bug-workaround.js"></script>
</body>
</html>
{% extends "index.html" %}
{% block title %}{{ super() }} - Search{% endblock%}
{% set active_page = "search" %}
{% block content %}
<p>SEARCH</p>
{% endblock content%}