42e408859b
It is hard to remember to add `/` at the end of the URL when configuring a new etherpad URL. Also, web server proxies tend to do weird stuff when you assume that you have a slash on the end of each URL. So, I took a look at how to avoid doing that. It turns out that both urljoin / os.path.join are kinda bad for handling URL building. Also, APPLICATION_ROOT didn't seem that necessary since Flask knows what to do with a `/` at the start of a URL, so I dropped it. I think this doesn't break anything!
45 lines
1.1 KiB
HTML
45 lines
1.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang='en'>
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<title>{{ name }} in octomode</title>
|
|
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='main.css') }}">
|
|
{% block head %}
|
|
{% endblock %}
|
|
</head>
|
|
<body>
|
|
<div id="wrapper">
|
|
{% block content %}
|
|
{% endblock %}
|
|
</div>
|
|
</body>
|
|
<script>
|
|
window.addEventListener('load', function () {
|
|
|
|
// Insert the nav buttons, after the page is loaded
|
|
const nav = document.createElement('div');
|
|
nav.id = 'nav';
|
|
|
|
nav.innerHTML = `
|
|
<h1>{{ name }} <a href="/"><em class="octomode">in octomode</em></a></h1>
|
|
<div id="buttons">
|
|
|
|
<a href="/{{ name }}/pad"><button>pad</button></a>:
|
|
<input type="text" name="pad" value="https://pad.vvvvvvaria.org/{{ name }}.md">
|
|
|
|
<a href="/{{ name }}/stylesheet"><button>stylesheet</button></a>:
|
|
<input type="text" name="pad" value="https://pad.vvvvvvaria.org/{{ name }}.css">
|
|
|
|
<a href="/{{ name }}/html"><button>html</button></a>
|
|
|
|
<a href="/{{ name }}/pdf"><button>pdf</button></a>
|
|
</div>`;
|
|
|
|
document.body.insertBefore(nav, document.body.firstChild);
|
|
|
|
})
|
|
</script>
|
|
{% block footer %}
|
|
{% endblock %}
|
|
</html>
|