User profile page working.
This commit is contained in:
parent
b65223198c
commit
ab568365ef
46 changed files with 873 additions and 698 deletions
|
|
@ -1,20 +1,14 @@
|
|||
{% extends "base.html" %}
|
||||
<!-- File list-events-Events.html generated 2018-07-15T11:36:36.889Z by adl.to-selmer-templates.
|
||||
<!-- File list-events-Events.html generated 2018-07-15T19:59:46.662Z by adl.to-selmer-templates.
|
||||
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||
|
||||
|
||||
{% block back-links %}
|
||||
<div>
|
||||
<div class='back-link-container'>
|
||||
{% ifequal params.offset "0" %}
|
||||
<a id='back-link' class='back-link' href='{{servlet-context}}/admin'>
|
||||
Back
|
||||
</a>
|
||||
{% else %}
|
||||
<a id='prev-selector' class='back-link'>
|
||||
Previous
|
||||
</a>
|
||||
{% endifunequal %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -39,8 +33,8 @@ Add a new Event
|
|||
{% block content %}
|
||||
<form id='list-events-Events' class='list' action='{{servlet-context}}/list-events-Events' method='POST'>
|
||||
{% csrf-field %}
|
||||
<input id='offset' type='hidden' value='{{params.offset|default:0}}'/>
|
||||
<input id='limit' type='hidden' value='{{params.limit|default:50}}'/>
|
||||
<input id='offset' name='offset' type='text' value='{{params.offset|default:0}}'/>
|
||||
<input id='limit' name='limit' type='text' value='{{params.limit|default:50}}'/>
|
||||
<table caption='events'>
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
@ -129,20 +123,25 @@ View
|
|||
var ow = document.getElementById('offset');
|
||||
var lw = document.getElementById('limit');
|
||||
form.addEventListener('submit', function() {
|
||||
ow.value='0';
|
||||
ow.value='0';
|
||||
});
|
||||
|
||||
{% ifunequal params.offset "0" %}
|
||||
document.getElementById('prev-selector').addEventListener('click', function () {
|
||||
ow.value=(parseInt(ow.value)-parseInt(lw.value));
|
||||
console.log('Updated offset to ' + ow.value);
|
||||
form.submit();
|
||||
});
|
||||
{% endifunequal %}
|
||||
var prevSelector = document.getElementById('prev-selector');
|
||||
if (prevSelector != null) {
|
||||
prevSelector.addEventListener('click', function () {
|
||||
if (parseInt(ow.value)===0) {
|
||||
window.location = '{{servlet-context}}/admin';
|
||||
} else {
|
||||
ow.value=(parseInt(ow.value)-parseInt(lw.value));
|
||||
console.log('Updated offset to ' + ow.value);
|
||||
form.submit();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
document.getElementById('next-selector').addEventListener('click', function () {
|
||||
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
||||
console.log('Updated offset to ' + ow.value);
|
||||
form.submit();
|
||||
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
||||
console.log('Updated offset to ' + ow.value);
|
||||
form.submit();
|
||||
});
|
||||
{% endblock %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue