woodwind/woodwind/templates/base.jinja2

111 lines
3.6 KiB
Django/Jinja

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Woodwind</title>
<link rel="shortcut icon" href="{{ url_for('static', filename='logo.png') }}"/>
<link rel="apple-touch-icon" href="{{ url_for('static', filename='logo.png') }}"/>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css', version='2016-01-30') }}"/>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css"/>
<script src="//code.jquery.com/jquery-2.1.3.min.js"></script>
<script src="{{ url_for('static', filename='moment.min.js') }}"></script>
<script src="{{ url_for('static', filename='cassis.js') }}"></script>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
{% block head %}{% endblock %}
</head>
<body>
<header>
{% if current_user.is_authenticated %}
<div style="overflow: auto;">
<span class="h-x-app" style="font-weight: bold">
<img class="u-logo" src="{{ url_for('static', filename='logo.png') }}" style="max-height: 1.5em; vertical-align: middle;" />
Woodwind
</span>
<ul id="navigation">
<li>
<a href="{{ url_for('.index') }}">Home</a>
</li>
<li>
<a href="{{ url_for('.subscriptions') }}">Subscriptions</a>
</li>
<li>
<a href="{{ url_for('.settings') }}">Settings</a>
</li>
<li>
{{ current_user.url }}
(<a href="{{ url_for('.logout') }}">Logout</a>)
</li>
</ul>
</div>
{% else %}
<h1 class="h-x-app">
<img class="u-logo" src="{{ url_for('static', filename='logo.png') }}" style="max-height: 1.5em; vertical-align: middle;" />
Woodwind
</h1>
{% endif %}
{% for message in get_flashed_messages() %}
<div class="flash">{{ message }}</div>
{% endfor %}
{% if not current_user.is_authenticated %}
<form action="{{ url_for('.login') }}" method="POST">
<input type="url" name="me" placeholder="https://yourdomain.com" />
<input type="hidden" name="next" placeholder="{{ request.path }}" />
<button style="text-align: right;" type="submit">Login</button>
</form>
Your Woodwind account is tied to your personal domain name. Check out IndieWebCamp's <a href="http://indiewebcamp.com/Getting_Started" target="_blank">Getting Started</a> page for details.
{% endif %}
{% block header %}{% endblock %}
</header>
<main>
{% block body %}{% endblock %}
</main>
{% block foot %}{% endblock %}
<script>
$("input[type='url']").blur(function() {
if (this.value.trim() != '') {
this.value = web_address_to_uri(this.value, true);
}
});
$("input[type='url']").on("invalid", function() {
if (this.value.trim() == '') {
console.log('value is empty');
return true;
}
else {
this.value = web_address_to_uri(this.value, true);
if (this.willValidate) {
this.setCustomValidity('');
this.parentNode.submit();
return false;
} else if (document.getElementById('error')) {
return true;
} else {
var html = document.createElement("div");
html.id = 'error';
html.innerHTML = "Oops! looks like you didn't enter a URL. Try starting with http://";
this.parentNode.appendChild(html);
return true;
}
}
});
</script>
<!-- load Tweet embeds -->
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
</body>
</html>