microblog/app/templates/base.html

70 lines
2.7 KiB
HTML
Raw Normal View History

2012-12-16 08:40:47 +00:00
<!DOCTYPE html>
2012-12-16 08:26:19 +00:00
<html>
<head>
{% if title %}
<title>{{title}} - microblog</title>
{% else %}
<title>microblog</title>
{% endif %}
2013-04-15 06:13:17 +00:00
<link href="{{ url_for('.static', filename = 'css/bootstrap.min.css') }}" rel="stylesheet" media="screen">
<link href="{{ url_for('.static', filename = 'css/bootstrap-responsive.min.css') }}" rel="stylesheet">
2012-12-16 08:40:47 +00:00
<script src="http://code.jquery.com/jquery-latest.js"></script>
2013-04-15 06:13:17 +00:00
<script src="{{ url_for('.static', filename = 'js/bootstrap.min.js') }}"></script>
<script src="{{ url_for('.static', filename = 'js/moment.min.js') }}"></script>
2013-02-01 05:48:20 +00:00
{% if g.locale != 'en' %}
2013-04-15 06:13:17 +00:00
<script src="{{ url_for('.static', filename = 'js/moment-' + g.locale + '.min.js') }}"></script>
2013-02-01 05:48:20 +00:00
{% endif %}
2012-12-16 08:40:47 +00:00
<meta name="viewport" content="width=device-width, initial-scale=1.0">
2013-02-20 06:59:54 +00:00
<script>
function translate(sourceLang, destLang, sourceId, destId, loadingId) {
$(destId).hide();
$(loadingId).show();
$.post('/translate', {
text: $(sourceId).text(),
sourceLang: sourceLang,
destLang: destLang
}).done(function(translated) {
$(destId).text(translated['text'])
$(loadingId).hide();
$(destId).show();
}).fail(function() {
$(destId).text("{{ _('Error: Could not contact server.') }}");
$(loadingId).hide();
$(destId).show();
});
}
</script>
2012-12-16 08:26:19 +00:00
</head>
<body>
2012-12-16 08:40:47 +00:00
<div class="container">
<div class="navbar">
<div class="navbar-inner">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
2013-04-15 06:13:17 +00:00
<a class="brand" href="{{ url_for('index') }}">microblog</a>
2012-12-16 08:40:47 +00:00
<ul class="nav">
2013-02-01 05:48:20 +00:00
<li><a href="{{ url_for('index') }}">{{ _('Home') }}</a></li>
2012-12-16 08:40:47 +00:00
{% if g.user.is_authenticated() %}
2013-02-01 05:48:20 +00:00
<li><a href="{{ url_for('user', nickname = g.user.nickname) }}">{{ _('Your Profile') }}</a></li>
<li><a href="{{ url_for('logout') }}">{{ _('Logout') }}</a></li>
2012-12-16 08:40:47 +00:00
{% endif %}
</ul>
<div class="nav-collapse collapse">
{% if g.user.is_authenticated() %}
2013-02-01 05:48:20 +00:00
<form class="navbar-search pull-right" action="{{url_for('search')}}" method="post" name="search">{{g.search_form.hidden_tag()}}{{g.search_form.search(size=20,placeholder=_('Search'),class="search-query")}}</form>
2012-12-16 08:40:47 +00:00
{% endif %}
</div>
</div>
</div>
<div class="row">
<div class="span12">
{% block content %}{% endblock %}
</div>
</div>
</div>
2012-12-16 08:26:19 +00:00
</body>
</html>