140 lines
4.8 KiB
HTML
140 lines
4.8 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="description" content="">
|
|
<meta name="author" content="">
|
|
|
|
<title>Realms</title>
|
|
|
|
<link href="/static/css/bootstrap/spacelab.css" rel="stylesheet">
|
|
<link href="/static/css/font-awesome.min.css" rel="stylesheet">
|
|
<link href="/static/vendor/highlightjs/styles/github.css" rel="stylesheet">
|
|
<link href="/static/css/style.css" rel="stylesheet">
|
|
{% block css %}{% endblock %}
|
|
|
|
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
|
<!--[if lt IE 9]>
|
|
<script src="/static/js/html5shiv.js"></script>
|
|
<script src="/static/js/respond.min.js"></script>
|
|
<![endif]-->
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<!-- Fixed navbar -->
|
|
<div class="navbar navbar-inverse navbar-fixed-top">
|
|
<div class="container">
|
|
<div class="navbar-header">
|
|
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
</button>
|
|
<a class="navbar-brand" href="/">Realms</a>
|
|
</div>
|
|
<div class="navbar-collapse collapse navbar-inverse-collapse">
|
|
<ul class="nav navbar-nav">
|
|
</ul>
|
|
<ul class="nav navbar-nav navbar-right">
|
|
<li class="dropdown">
|
|
<a href="#" class="dropdown-toggle" role="menu" data-toggle="dropdown">Write
|
|
<i class="icon-caret-down"></i></a>
|
|
<ul class="dropdown-menu">
|
|
<li class="dropdown-header">Page Options</li>
|
|
<li><a href="/create/">Create Page</a></li>
|
|
{% if name %}
|
|
<li><a href="/edit/{{ name }}">Edit Page</a></li>
|
|
<li><a href="/history/{{ name }}">History</a></li>
|
|
{% endif %}
|
|
<li class="divider"></li>
|
|
<li class="dropdown-header">Site Options</li>
|
|
<li><a href="/_new/">Create New Wiki</a></li>
|
|
</ul>
|
|
</li>
|
|
|
|
{% if session.get('user') %}
|
|
<li class="dropdown user-avatar">
|
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
|
<span>
|
|
<img src="{{ session['user'].get('avatar') }}" class="menu-avatar">
|
|
<span>{{ session['user'].get('username') }} <i class="icon-caret-down"></i></span>
|
|
</span>
|
|
</a>
|
|
<ul class="dropdown-menu">
|
|
<li><a href="/account">Account</a></li>
|
|
<li><a href="/logout">Logout</a></li>
|
|
</ul>
|
|
</li>
|
|
{% else %}
|
|
<li><a href="/login"><i class="icon-user"></i> Login</a></li>
|
|
<li><a href="/register"><i class="icon-pencil"></i> Register</a></li>
|
|
{% endif %}
|
|
</ul>
|
|
</div><!--/.nav-collapse -->
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Page Menu -->
|
|
|
|
|
|
|
|
|
|
<div class="container">
|
|
<div id="main-body">
|
|
{% with messages = get_flashed_messages(with_categories=True) %}
|
|
{% if messages %}
|
|
{% for category, message in messages %}
|
|
{% if category == 'message' %}
|
|
{% set category = "info" %}
|
|
{% endif %}
|
|
<div class='alert alert-{{ category }}'>
|
|
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
|
{{ message }}
|
|
</div>
|
|
{% endfor %}
|
|
{% endif %}
|
|
{% endwith %}
|
|
{% block body %}{% endblock %}
|
|
</div>
|
|
</div>
|
|
|
|
{% assets "js_common" %}
|
|
<script type="text/javascript" src="{{ ASSET_URL }}"></script>
|
|
{% endassets %}
|
|
<script>
|
|
hljs.initHighlightingOnLoad();
|
|
|
|
// Markdown Renderer
|
|
MDR = {
|
|
doc: null,
|
|
callback: WMD.convert,
|
|
convert: function(md, sanitize){
|
|
this.doc = this.callback(md);
|
|
var html = this.doc.html;
|
|
if (sanitize) {
|
|
// Causes some problems with inline styles
|
|
html = html_sanitize(html);
|
|
}
|
|
html = this.hook(html);
|
|
return html;
|
|
},
|
|
hook: function(html) {
|
|
if (!this.doc.metadata) {
|
|
return html;
|
|
}
|
|
try {
|
|
var template = Handlebars.compile(html);
|
|
return template(this.doc.metadata);
|
|
} catch(e) {
|
|
return html;
|
|
}
|
|
}
|
|
};
|
|
|
|
</script>
|
|
{% block js %}{% endblock %}
|
|
</body>
|
|
</html>
|