youyesyet/resources/templates/auto/list-followuprequests-Followuprequests.html
2018-07-15 12:42:32 +01:00

148 lines
3.6 KiB
HTML

{% extends "base.html" %}
<!-- File list-followuprequests-Followuprequests.html generated 2018-07-15T11:36:36.861Z 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>
{% endblock %}
{% block big-links %}
<div>
<div class='big-link-container'>
<a id='next-selector' role='button' class='big-link'>
Next
</a>
</div>
{% ifmemberof %}
<div class='big-link-container'>
<a href='{{servlet-context}}/form-followuprequests-Followuprequest' class='big-link'>
Add a new Followuprequest
</a>
</div>
{% endifmemberof %}
</div>
{% endblock %}
{% block content %}
<form id='list-followuprequests-Followuprequests' class='list' action='{{servlet-context}}/list-followuprequests-Followuprequests' method='POST'>
{% csrf-field %}
<input id='offset' type='hidden' value='{{params.offset|default:0}}'/>
<input id='limit' type='hidden' value='{{params.limit|default:50}}'/>
<table caption='followuprequests'>
<thead>
<tr>
<th>
Id
</th>
<th>
Elector_id
</th>
<th>
Visit_id
</th>
<th>
Issue_id
</th>
<th>
Method_id
</th>
<th>
&nbsp;
</th>
</tr>
<tr>
<th>
<input id='id' type='text' name='id' value='{{ params.id }}'/>
</th>
<th>
<input id='elector_id_expanded' type='text' name='elector_id_expanded' value='{{ params.elector_id_expanded }}'/>
</th>
<th>
<input id='visit_id_expanded' type='text' name='visit_id_expanded' value='{{ params.visit_id_expanded }}'/>
</th>
<th>
<input id='issue_id_expanded' type='text' name='issue_id_expanded' value='{{ params.issue_id_expanded }}'/>
</th>
<th>
<input id='method_id_expanded' type='text' name='method_id_expanded' value='{{ params.method_id_expanded }}'/>
</th>
<th>
<input type='submit' id='search-widget' value='Search'/>
</th>
</tr>
</thead>
<tbody>
{% for record in records %}
<tr>
<td>
{{ record.id }}
</td>
<td>
<a href='{{servlet-context}}/form-electors-Elector?id={{ record.elector_id }}'>
{{ record.elector_id_expanded }}
</a>
</td>
<td>
<a href='{{servlet-context}}/form-visits-Visit?id={{ record.visit_id }}'>
{{ record.visit_id_expanded }}
</a>
</td>
<td>
<a href='{{servlet-context}}/form-issues-Issue?id={{ record.issue_id }}'>
{{ record.issue_id_expanded }}
</a>
</td>
<td>
<a href='{{servlet-context}}/form-followupmethods-Followupmethod?id={{ record.method_id }}'>
{{ record.method_id_expanded }}
</a>
</td>
<td>
<a href='{{servlet-context}}/form-followuprequests-Followuprequest?id={{ record.id }}'>
View
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</form>
{% endblock %}
{% block extra-script %}
var form = document.getElementById('list-followuprequests-Followuprequests');
var ow = document.getElementById('offset');
var lw = document.getElementById('limit');
form.addEventListener('submit', function() {
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 %}
document.getElementById('next-selector').addEventListener('click', function () {
ow.value=(parseInt(ow.value)+parseInt(lw.value));
console.log('Updated offset to ' + ow.value);
form.submit();
});
{% endblock %}