{% extends "base.html" %}
{% load staticfiles i18n %}

{% block title %}{{ page.title }}{% endblock %}

{% block editbtn %}
	{% if perms.spages.change_spage %}
		<div style="position:absolute;top;10px;right:10px;z-index1000">
			<a href="/admin/spages/spage/{{ page.pk }}/change/?m=fs">
				{% trans 'Edit' %}
			</a>
		</div>
	{% endif %}
{% endblock %}

{% block content %}
<div id="pagecontent"></div>
<script type="text/javascript">
{% include "spages/spagelib/page.js" %}
{% include "spages/spagelib/promise.min.js" %}
function loadPage(resturl){
	var container = 'pagecontent';
	promise.get(resturl,{},{"Accept":"application/json"}).then(function(error, data, xhr) {
	    if (error) {console.log('Error ' + xhr.status);return;}
	    content = JSON.parse(data).content;
	    //console.log(content+"\n"+resturl);
	    document.getElementById(container).innerHTML = content;
	});
}
{% include "spages/auto/routes.js" %}
page();
</script>
{% endblock %}