realms-wiki/realms/templates/layout.html
Matthew Scragg eb12c84e9a Added RDBMS info
Canonical names to forced to lowercase
Made user model compatible to other DBs
CSS adjustments
Basic Firepad support (no presence info)
Cleaned up JS a bit
Added ability to remove draft from localstorage
Added support for drafts on multiple pages
Alert user if page changes, issue #1
2014-10-03 13:49:18 -05:00

121 lines
4.3 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>{{ config.SITE_TITLE }}</title>
<link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.ico') }}">
{% for bundle in g.assets['css'] %}
{% assets bundle %}
<link href="{{ ASSET_URL }}" rel="stylesheet">
{% endassets %}
{% endfor %}
{% 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">
<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="/">{{ config.SITE_TITLE }}</a>
</div>
<div class="navbar-collapse collapse navbar-inverse-collapse">
<ul class="nav navbar-nav">
<li><a href="{{ url_for('wiki.create') }}"><i class="fa fa-plus"></i> New</a></li>
{% if name %}
<li><a href="{{ url_for('wiki.edit', name=name) }}"><i class="fa fa-pencil"></i> Edit</a></li>
<li><a href="{{ url_for('wiki.history', name=name) }}"><i class="fa fa-clock-o"></i> History</a></li>
{% endif %}
</ul>
<ul class="nav navbar-nav navbar-right">
{% if current_user.is_authenticated() %}
<li class="dropdown user-avatar">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<span>
<img src="{{ current_user.avatar }}" class="menu-avatar">
<span>{{ current_user.username }} <i class="icon-caret-down"></i></span>
</span>
</a>
<ul class="dropdown-menu">
<li><a href="{{ url_for('auth.settings') }}"><i class="fa fa-gear"></i> Settings</a></li>
<li><a href="{{ url_for('auth.logout') }}"><i class="fa fa-power-off"></i> Logout</a></li>
</ul>
</li>
{% else %}
<li><a href="{{ url_for('auth.login') }}"><i class="fa fa-user"></i> &nbsp;Login</a></li>
{% if config.REGISTRATION_ENABLED %}
<li><a href="{{ url_for('auth.register') }}"><i class="fa fa-users"></i> &nbsp;Register</a></li>
{% endif %}
{% 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">&times;</button>
{{ message }}
</div>
{% endfor %}
{% endif %}
{% endwith %}
{% block body %}{% endblock %}
</div>
</div>
<script>
var Config = {};
{% for attr in ['RELATIVE_PATH'] %}
Config.{{ attr }} = {{ config[attr]|tojson }};
{% endfor %}
var User = {};
User.is_authenticated = {{ current_user.is_authenticated()|tojson }};
{% for attr in ['username', 'email'] %}
User.{{ attr }} = {{ current_user[attr]|tojson }};
{% endfor %}
</script>
{% for bundle in g.assets['js'] %}
{% assets bundle %}
{% if bundle == 'editor.js' %}
<script type="text/javascript" data-ace-base="src" charset="utf-8" src="{{ ASSET_URL }}"></script>
{% else %}
<script type="text/javascript" src="{{ ASSET_URL }}"></script>
{% endif %}
{% endassets %}
{% endfor %}
{% block js %}{% endblock %}
</body>
</html>