realms-wiki/realms/templates/layout.html

132 lines
5 KiB
HTML
Raw Normal View History

2013-09-26 16:51:15 +03:00
<!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>
2013-12-03 22:09:57 +02:00
<link rel="shortcut icon" href="{{ url_for('static', filename='img/favicon.ico') }}">
{% for bundle in g.assets['css'] %}
{% assets bundle %}
2014-09-04 23:40:53 +03:00
<link href="{{ ASSET_URL }}" rel="stylesheet">
2014-09-05 00:35:28 +03:00
{% endassets %}
{% endfor %}
2013-10-10 00:35:06 +03:00
{% block css %}{% endblock %}
2013-09-26 16:51:15 +03:00
<!-- 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 -->
2014-08-20 18:28:25 +03:00
<div class="navbar navbar-inverse">
2013-09-26 16:51:15 +03:00
<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>
2016-01-31 19:06:34 +02:00
<a class="navbar-brand" href="{{ url_for('wiki.page') }}">{{ config.SITE_TITLE }}</a>
2013-09-26 16:51:15 +03:00
</div>
2013-10-03 17:58:07 +03:00
<div class="navbar-collapse collapse navbar-inverse-collapse">
2013-09-26 16:51:15 +03:00
<ul class="nav navbar-nav">
2014-10-09 23:47:12 +03:00
{% if config.get('ROOT_ENDPOINT') != 'wiki.index' %}
2015-12-07 01:17:44 +02:00
<li><a href="{{ url_for('wiki.index') }}"><i class="fa fa-list"></i><span class="hidden-sm"> Index</span></a></li>
2014-10-09 23:47:12 +03:00
{% endif %}
2015-12-07 01:17:44 +02:00
<li><a href="{{ url_for('wiki.create') }}"><i class="fa fa-plus"></i><span class="hidden-sm"> New</span></a></li>
2014-08-20 18:28:25 +03:00
{% if name %}
2015-12-07 01:17:44 +02:00
<li><a href="{{ url_for('wiki.edit', name=name) }}"><i class="fa fa-pencil"></i><span class="hidden-sm"> Edit</span></a></li>
<li><a href="{{ url_for('wiki.history', name=name) }}"><i class="fa fa-clock-o"></i><span class="hidden-sm"> History</span></a></li>
2014-08-20 18:28:25 +03:00
{% endif %}
2013-09-26 16:51:15 +03:00
</ul>
2014-11-12 01:06:28 +02:00
2013-09-26 16:51:15 +03:00
<ul class="nav navbar-nav navbar-right">
2014-11-12 01:06:28 +02:00
<li>
<form class="navbar-form" role="search" action="{{ url_for('search.search') }}">
<div class="form-group">
<input name="q" type="text" class="form-control" placeholder="Search">
</div>
</form>
</li>
2016-07-14 03:43:06 +03:00
{% if current_user.is_authenticated %}
2013-10-03 17:58:07 +03:00
<li class="dropdown user-avatar">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<span>
2015-12-16 07:29:55 +02:00
<img src="{{ current_user.avatar }}?s=24" class="avatar">
2014-09-02 17:29:04 +03:00
<span>{{ current_user.username }} <i class="icon-caret-down"></i></span>
2013-10-03 17:58:07 +03:00
</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>
2013-10-03 17:58:07 +03:00
</ul>
</li>
{% else %}
<li><a href="{{ url_for('auth.login') }}"><i class="fa fa-user"></i> &nbsp;Login</a></li>
{% if config.REGISTRATION_ENABLED and 'auth.local' in config.MODULES %}
2015-10-14 06:52:30 +03:00
<li><a href="{{ url_for('auth.local.register') }}"><i class="fa fa-users"></i> &nbsp;Register</a></li>
{% endif %}
2013-10-02 04:50:48 +03:00
{% endif %}
2013-09-26 16:51:15 +03:00
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<!-- Page Menu -->
2013-10-03 17:58:07 +03:00
<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 = {};
2016-07-14 03:43:06 +03:00
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'] %}
2014-02-07 05:40:58 +02:00
{% 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 %}
2014-02-07 05:40:58 +02:00
{% endassets %}
{% endfor %}
2013-10-02 04:50:48 +03:00
{% block js %}{% endblock %}
2013-09-26 16:51:15 +03:00
</body>
</html>