<style type="text/css">
	h2 { word-break: break-all }
</style>
<script type="text/javascript" src="<%=resource%>/rtorrent.js"></script>
<%+cbi/simpleform%>
<script type="text/javascript">
	document.addEventListener("luci-loaded", async () => {
		const header = await selectElement("div.cbi-map h2");
		selectElement("#maincontent").then(main => main[0].prepend(...header));
		<% for i, tab in ipairs(self.all_tabs or {}) do %>
		eachElement("ul.tabs li.tabmenu-item-<%=tab%> a",
			tab => tab.href += "/<%=self.tab_url_postfix(tab)%>");
		<%- end %>
	});
	L.require('ui').then(function(ui) {
		<% for _, notification in ipairs(self.notifications or {}) do %>
		ui.addNotification(null, "<p><%=notification%></p>");
		<%- end %>
	});
</script>
