diff --git a/env/dev/clj/youyesyet/core.clj b/env/dev/clj/youyesyet/core.clj
index 1b703a4..c64c2e7 100644
--- a/env/dev/clj/youyesyet/core.clj
+++ b/env/dev/clj/youyesyet/core.clj
@@ -46,7 +46,9 @@
mount/start-with-args
:started)]
(log/info component "started"))
- (.addShutdownHook (Runtime/getRuntime) (Thread. handler/destroy)))
+ (.addShutdownHook (Runtime/getRuntime)
+ (Thread. handler/destroy)))
+
(defn -main [& args]
(cond
@@ -57,4 +59,9 @@
(System/exit 0))
:else
(start-app args)))
-
+
+(mount/stop)
+
+(mount/start)
+
+
diff --git a/project.clj b/project.clj
index 61956c8..303e26e 100644
--- a/project.clj
+++ b/project.clj
@@ -62,7 +62,9 @@
[lein-codox "0.10.3"]]
:bower-dependencies [[leaflet "0.7.3"]
- [jquery "3.3.1"]]
+ [jquery "3.3.1"]
+ [datatables.net "1.10.19"]
+ [datatables.net-dt "1.10.19"]]
:bower {:directory "resources/public/js/lib"}
:cucumber-feature-paths ["test/clj/features"]
diff --git a/resources/sql/queries.auto.sql b/resources/sql/queries.auto.sql
index e08aa23..27bdde1 100644
--- a/resources/sql/queries.auto.sql
+++ b/resources/sql/queries.auto.sql
@@ -1,7 +1,7 @@
------------------------------------------------------------------------
-- File queries.sql
--
--- autogenerated by adl.to-hugsql-queries at 2018-06-30T11:35:59.388Z
+-- autogenerated by adl.to-hugsql-queries at 2018-07-01T22:15:28.111Z
--
-- See [Application Description
-- Language](https://github.com/simon-brooke/adl).
diff --git a/resources/sql/youyesyet.postgres.sql b/resources/sql/youyesyet.postgres.sql
index e787f6f..a8aab30 100644
--- a/resources/sql/youyesyet.postgres.sql
+++ b/resources/sql/youyesyet.postgres.sql
@@ -5,7 +5,7 @@
--
-- auto-generated by [Application Description Language framework]
--
--- (https://github.com/simon-brooke/adl) at 20180630T113600.308Z
+-- (https://github.com/simon-brooke/adl) at 20180701T221532.672Z
--
--
-- A web-app intended to be used by canvassers campaigning for a
@@ -75,7 +75,7 @@ CREATE TABLE addresses
(
id SERIAL NOT NULL PRIMARY KEY,
address VARCHAR(256) NOT NULL,
- postcode VARCHAR(16) CONSTRAINT pattern_1 CHECK (postcode ~* '^([Gg][Ii][Rr] 0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([AZa-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z]))))[0-9][A-Za-z]{2})$'),
+ postcode VARCHAR(16) CONSTRAINT pattern_14 CHECK (postcode ~* '^([Gg][Ii][Rr] 0[Aa]{2})|((([A-Za-z][0-9]{1,2})|(([A-Za-z][A-Ha-hJ-Yj-y][0-9]{1,2})|(([AZa-z][0-9][A-Za-z])|([A-Za-z][A-Ha-hJ-Yj-y][0-9]?[A-Za-z]))))[0-9][A-Za-z]{2})$'),
phone VARCHAR(16),
district_id INTEGER,
latitude DOUBLE PRECISION,
diff --git a/resources/templates/auto/application-index.html b/resources/templates/auto/application-index.html
index c379eea..27f6615 100644
--- a/resources/templates/auto/application-index.html
+++ b/resources/templates/auto/application-index.html
@@ -1,24 +1,7 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
-
-{% endblock %}
{% block content %}
@@ -184,50 +167,3 @@ All visits made by canvassers to dwellings in which opinions were recorded.
{% endblock %}
-{% block foot %}
-
-
-{% endblock %}
\ No newline at end of file
diff --git a/resources/templates/auto/form-addresses-Address.html b/resources/templates/auto/form-addresses-Address.html
index ee7c8ba..6fbbbc4 100644
--- a/resources/templates/auto/form-addresses-Address.html
+++ b/resources/templates/auto/form-addresses-Address.html
@@ -1,24 +1,7 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
-
-{% endblock %}
{% block content %}
@@ -171,50 +154,3 @@ To delete this addresses record
{% endblock %}
-{% block foot %}
-
-
-{% endblock %}
\ No newline at end of file
diff --git a/resources/templates/auto/form-authorities-Authority.html b/resources/templates/auto/form-authorities-Authority.html
index fa47abe..02749f0 100644
--- a/resources/templates/auto/form-authorities-Authority.html
+++ b/resources/templates/auto/form-authorities-Authority.html
@@ -1,24 +1,7 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
-
-{% endblock %}
{% block content %}
@@ -148,50 +131,3 @@ To delete this authorities record
{% endblock %}
-{% block foot %}
-
-
-{% endblock %}
\ No newline at end of file
diff --git a/resources/templates/auto/form-canvassers-Canvasser.html b/resources/templates/auto/form-canvassers-Canvasser.html
index ba56e4a..7e94c21 100644
--- a/resources/templates/auto/form-canvassers-Canvasser.html
+++ b/resources/templates/auto/form-canvassers-Canvasser.html
@@ -1,24 +1,7 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
-
-{% endblock %}
{% block content %}
@@ -239,50 +222,3 @@ To delete this canvassers record
{% endblock %}
-{% block foot %}
-
-
-{% endblock %}
\ No newline at end of file
diff --git a/resources/templates/auto/form-districts-District.html b/resources/templates/auto/form-districts-District.html
index 851e38f..733f6f2 100644
--- a/resources/templates/auto/form-districts-District.html
+++ b/resources/templates/auto/form-districts-District.html
@@ -1,24 +1,7 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
-
-{% endblock %}
{% block content %}
@@ -76,50 +59,3 @@ To delete this districts record
{% endblock %}
-{% block foot %}
-
-
-{% endblock %}
\ No newline at end of file
diff --git a/resources/templates/auto/form-dwellings-Dwelling.html b/resources/templates/auto/form-dwellings-Dwelling.html
index 4a164ab..692539f 100644
--- a/resources/templates/auto/form-dwellings-Dwelling.html
+++ b/resources/templates/auto/form-dwellings-Dwelling.html
@@ -1,24 +1,7 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
-
-{% endblock %}
{% block content %}
@@ -99,50 +82,3 @@ To delete this dwellings record
{% endblock %}
-{% block foot %}
-
-
-{% endblock %}
\ No newline at end of file
diff --git a/resources/templates/auto/form-electors-Elector.html b/resources/templates/auto/form-electors-Elector.html
index d2ceff2..6ad712a 100644
--- a/resources/templates/auto/form-electors-Elector.html
+++ b/resources/templates/auto/form-electors-Elector.html
@@ -1,24 +1,7 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
-
-{% endblock %}
{% block content %}
@@ -157,50 +140,3 @@ To delete this electors record
{% endblock %}
-{% block foot %}
-
-
-{% endblock %}
\ No newline at end of file
diff --git a/resources/templates/auto/form-followupactions-Followupaction.html b/resources/templates/auto/form-followupactions-Followupaction.html
index 9486e73..ac42a80 100644
--- a/resources/templates/auto/form-followupactions-Followupaction.html
+++ b/resources/templates/auto/form-followupactions-Followupaction.html
@@ -1,24 +1,7 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
-
-{% endblock %}
{% block content %}
@@ -158,50 +141,3 @@ To delete this followupactions record
{% endblock %}
-{% block foot %}
-
-
-{% endblock %}
\ No newline at end of file
diff --git a/resources/templates/auto/form-followupmethods-Followupmethod.html b/resources/templates/auto/form-followupmethods-Followupmethod.html
index 0ebe89e..b1810ab 100644
--- a/resources/templates/auto/form-followupmethods-Followupmethod.html
+++ b/resources/templates/auto/form-followupmethods-Followupmethod.html
@@ -1,24 +1,7 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
-
-{% endblock %}
{% block content %}
@@ -58,50 +41,3 @@ To delete this followupmethods record
{% endblock %}
-{% block foot %}
-
-
-{% endblock %}
\ No newline at end of file
diff --git a/resources/templates/auto/form-followuprequests-Followuprequest.html b/resources/templates/auto/form-followuprequests-Followuprequest.html
index 810e20a..fc30435 100644
--- a/resources/templates/auto/form-followuprequests-Followuprequest.html
+++ b/resources/templates/auto/form-followuprequests-Followuprequest.html
@@ -1,24 +1,7 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
-
-{% endblock %}
{% block content %}
@@ -148,50 +131,3 @@ To delete this followuprequests record
{% endblock %}
-{% block foot %}
-
-
-{% endblock %}
\ No newline at end of file
diff --git a/resources/templates/auto/form-genders-Gender.html b/resources/templates/auto/form-genders-Gender.html
index 33c1930..9beaae3 100644
--- a/resources/templates/auto/form-genders-Gender.html
+++ b/resources/templates/auto/form-genders-Gender.html
@@ -1,24 +1,7 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
-
-{% endblock %}
{% block content %}
@@ -58,50 +41,3 @@ To delete this genders record
{% endblock %}
-{% block foot %}
-
-
-{% endblock %}
\ No newline at end of file
diff --git a/resources/templates/auto/form-intentions-Intention.html b/resources/templates/auto/form-intentions-Intention.html
index b2287ec..d04e85a 100644
--- a/resources/templates/auto/form-intentions-Intention.html
+++ b/resources/templates/auto/form-intentions-Intention.html
@@ -1,24 +1,7 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
-
-{% endblock %}
{% block content %}
@@ -126,50 +109,3 @@ To delete this intentions record
{% endblock %}
-{% block foot %}
-
-
-{% endblock %}
\ No newline at end of file
diff --git a/resources/templates/auto/form-issues-Issue.html b/resources/templates/auto/form-issues-Issue.html
index cd89da2..e2e6ebc 100644
--- a/resources/templates/auto/form-issues-Issue.html
+++ b/resources/templates/auto/form-issues-Issue.html
@@ -1,24 +1,7 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
-
-{% endblock %}
{% block content %}
@@ -94,50 +77,3 @@ To delete this issues record
{% endblock %}
-{% block foot %}
-
-
-{% endblock %}
\ No newline at end of file
diff --git a/resources/templates/auto/form-options-Option.html b/resources/templates/auto/form-options-Option.html
index 5e4524b..01647cf 100644
--- a/resources/templates/auto/form-options-Option.html
+++ b/resources/templates/auto/form-options-Option.html
@@ -1,24 +1,7 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
-
-{% endblock %}
{% block content %}
@@ -58,50 +41,3 @@ To delete this options record
{% endblock %}
-{% block foot %}
-
-
-{% endblock %}
\ No newline at end of file
diff --git a/resources/templates/auto/form-roles-Role.html b/resources/templates/auto/form-roles-Role.html
index ed2f57a..6a6986a 100644
--- a/resources/templates/auto/form-roles-Role.html
+++ b/resources/templates/auto/form-roles-Role.html
@@ -1,24 +1,7 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
-
-{% endblock %}
{% block content %}
@@ -99,50 +82,3 @@ To delete this roles record
{% endblock %}
-{% block foot %}
-
-
-{% endblock %}
\ No newline at end of file
diff --git a/resources/templates/auto/form-teams-Team.html b/resources/templates/auto/form-teams-Team.html
index 6f4bc0d..da15535 100644
--- a/resources/templates/auto/form-teams-Team.html
+++ b/resources/templates/auto/form-teams-Team.html
@@ -1,24 +1,7 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
-
-{% endblock %}
{% block content %}
@@ -181,50 +164,3 @@ To delete this teams record
{% endblock %}
-{% block foot %}
-
-
-{% endblock %}
\ No newline at end of file
diff --git a/resources/templates/auto/form-visits-Visit.html b/resources/templates/auto/form-visits-Visit.html
index 9482227..0607158 100644
--- a/resources/templates/auto/form-visits-Visit.html
+++ b/resources/templates/auto/form-visits-Visit.html
@@ -1,24 +1,7 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
-
-{% endblock %}
{% block content %}
@@ -122,50 +105,3 @@ To delete this visits record
{% endblock %}
-{% block foot %}
-
-
-{% endblock %}
\ No newline at end of file
diff --git a/resources/templates/auto/list-addresses-Addresses.html b/resources/templates/auto/list-addresses-Addresses.html
index 7ad3988..532526f 100644
--- a/resources/templates/auto/list-addresses-Addresses.html
+++ b/resources/templates/auto/list-addresses-Addresses.html
@@ -1,48 +1,44 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
+{% block back-links %}
+
+
+{% ifunequal params.offset "0" %}
+
+Previous
+
+{% else %}
+
+Back
+
+{% endifunequal %}
+
+
{% endblock %}
{% block big-links %}
+
+
{% endblock %}
{% block content %}
-
-{% endblock %}
-{% block foot %}
-
-
{% endblock %}
{% block extra-script %}
-var form = document.getElementById("content");
-document.getElementById("next-selector").addEventListener("click", function () {
- form.submit();
-});
+ var form = document.getElementById('list-addresses-Addresses');
+ var ow = document.getElementById('offset');
+ var lw = document.getElementById('limit');
+ form.addEventListener('submit', function() {
+ ow.value='0';
+ });
+
+ {% ifunequal 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 %}
diff --git a/resources/templates/auto/list-authorities-Authorities.html b/resources/templates/auto/list-authorities-Authorities.html
index d479410..6692a65 100644
--- a/resources/templates/auto/list-authorities-Authorities.html
+++ b/resources/templates/auto/list-authorities-Authorities.html
@@ -1,32 +1,44 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
+{% block back-links %}
+
+
+{% ifunequal params.offset "0" %}
+
+Previous
+
+{% else %}
+
+Back
+
+{% endifunequal %}
+
+
{% endblock %}
-
-{% block content %}
-
{% endblock %}
-{% block foot %}
-
+ var form = document.getElementById('list-authorities-Authorities');
+ var ow = document.getElementById('offset');
+ var lw = document.getElementById('limit');
+ form.addEventListener('submit', function() {
+ ow.value='0';
+ });
-{% endblock %}
\ No newline at end of file
+ {% ifunequal 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 %}
diff --git a/resources/templates/auto/list-canvassers-Canvassers.html b/resources/templates/auto/list-canvassers-Canvassers.html
index 2e2daf8..b1a546f 100644
--- a/resources/templates/auto/list-canvassers-Canvassers.html
+++ b/resources/templates/auto/list-canvassers-Canvassers.html
@@ -1,32 +1,44 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
+{% block back-links %}
+
+
+{% ifunequal params.offset "0" %}
+
+Previous
+
+{% else %}
+
+Back
+
+{% endifunequal %}
+
+
{% endblock %}
-
-{% block content %}
-
{% endblock %}
-{% block foot %}
-
+ var form = document.getElementById('list-canvassers-Canvassers');
+ var ow = document.getElementById('offset');
+ var lw = document.getElementById('limit');
+ form.addEventListener('submit', function() {
+ ow.value='0';
+ });
-{% endblock %}
\ No newline at end of file
+ {% ifunequal 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 %}
diff --git a/resources/templates/auto/list-districts-Districts.html b/resources/templates/auto/list-districts-Districts.html
index 5aa04b4..75c7410 100644
--- a/resources/templates/auto/list-districts-Districts.html
+++ b/resources/templates/auto/list-districts-Districts.html
@@ -1,32 +1,44 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
+{% block back-links %}
+
+
+{% ifunequal params.offset "0" %}
+
+Previous
+
+{% else %}
+
+Back
+
+{% endifunequal %}
+
+
{% endblock %}
-
-{% block content %}
-
{% endblock %}
-{% block foot %}
-
+ var form = document.getElementById('list-districts-Districts');
+ var ow = document.getElementById('offset');
+ var lw = document.getElementById('limit');
+ form.addEventListener('submit', function() {
+ ow.value='0';
+ });
-{% endblock %}
\ No newline at end of file
+ {% ifunequal 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 %}
diff --git a/resources/templates/auto/list-dwellings-Dwellings.html b/resources/templates/auto/list-dwellings-Dwellings.html
index d4a5468..e71d566 100644
--- a/resources/templates/auto/list-dwellings-Dwellings.html
+++ b/resources/templates/auto/list-dwellings-Dwellings.html
@@ -1,32 +1,44 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
+{% block back-links %}
+
+
+{% ifunequal params.offset "0" %}
+
+Previous
+
+{% else %}
+
+Back
+
+{% endifunequal %}
+
+
{% endblock %}
-
-{% block content %}
-
{% endblock %}
-{% block foot %}
-
+ var form = document.getElementById('list-dwellings-Dwellings');
+ var ow = document.getElementById('offset');
+ var lw = document.getElementById('limit');
+ form.addEventListener('submit', function() {
+ ow.value='0';
+ });
-{% endblock %}
\ No newline at end of file
+ {% ifunequal 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 %}
diff --git a/resources/templates/auto/list-electors-Electors.html b/resources/templates/auto/list-electors-Electors.html
index 78da6fe..7250f3c 100644
--- a/resources/templates/auto/list-electors-Electors.html
+++ b/resources/templates/auto/list-electors-Electors.html
@@ -1,32 +1,44 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
+{% block back-links %}
+
+
+{% ifunequal params.offset "0" %}
+
+Previous
+
+{% else %}
+
+Back
+
+{% endifunequal %}
+
+
{% endblock %}
-
-{% block content %}
-
{% endblock %}
-{% block foot %}
-
+ var form = document.getElementById('list-electors-Electors');
+ var ow = document.getElementById('offset');
+ var lw = document.getElementById('limit');
+ form.addEventListener('submit', function() {
+ ow.value='0';
+ });
-{% endblock %}
\ No newline at end of file
+ {% ifunequal 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 %}
diff --git a/resources/templates/auto/list-followupactions-Followupactions.html b/resources/templates/auto/list-followupactions-Followupactions.html
index c0c7c29..43967c2 100644
--- a/resources/templates/auto/list-followupactions-Followupactions.html
+++ b/resources/templates/auto/list-followupactions-Followupactions.html
@@ -1,32 +1,44 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
+{% block back-links %}
+
+
+{% ifunequal params.offset "0" %}
+
+Previous
+
+{% else %}
+
+Back
+
+{% endifunequal %}
+
+
{% endblock %}
-
-{% block content %}
-
{% endblock %}
-{% block foot %}
-
+ var form = document.getElementById('list-followupactions-Followupactions');
+ var ow = document.getElementById('offset');
+ var lw = document.getElementById('limit');
+ form.addEventListener('submit', function() {
+ ow.value='0';
+ });
-{% endblock %}
\ No newline at end of file
+ {% ifunequal 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 %}
diff --git a/resources/templates/auto/list-followupmethods-Followupmethods.html b/resources/templates/auto/list-followupmethods-Followupmethods.html
index fba6c0f..7a2f684 100644
--- a/resources/templates/auto/list-followupmethods-Followupmethods.html
+++ b/resources/templates/auto/list-followupmethods-Followupmethods.html
@@ -1,32 +1,44 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
+{% block back-links %}
+
+
+{% ifunequal params.offset "0" %}
+
+Previous
+
+{% else %}
+
+Back
+
+{% endifunequal %}
+
+
{% endblock %}
-
-{% block content %}
-
{% endblock %}
-{% block foot %}
-
+ var form = document.getElementById('list-followupmethods-Followupmethods');
+ var ow = document.getElementById('offset');
+ var lw = document.getElementById('limit');
+ form.addEventListener('submit', function() {
+ ow.value='0';
+ });
-{% endblock %}
\ No newline at end of file
+ {% ifunequal 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 %}
diff --git a/resources/templates/auto/list-followuprequests-Followuprequests.html b/resources/templates/auto/list-followuprequests-Followuprequests.html
index 1a92655..20146d0 100644
--- a/resources/templates/auto/list-followuprequests-Followuprequests.html
+++ b/resources/templates/auto/list-followuprequests-Followuprequests.html
@@ -1,32 +1,44 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
+{% block back-links %}
+
+
+{% ifunequal params.offset "0" %}
+
+Previous
+
+{% else %}
+
+Back
+
+{% endifunequal %}
+
+
{% endblock %}
-
-{% block content %}
-
{% endblock %}
-{% block foot %}
-
+ var form = document.getElementById('list-followuprequests-Followuprequests');
+ var ow = document.getElementById('offset');
+ var lw = document.getElementById('limit');
+ form.addEventListener('submit', function() {
+ ow.value='0';
+ });
-{% endblock %}
\ No newline at end of file
+ {% ifunequal 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 %}
diff --git a/resources/templates/auto/list-genders-Genders.html b/resources/templates/auto/list-genders-Genders.html
index d421968..cd81ff6 100644
--- a/resources/templates/auto/list-genders-Genders.html
+++ b/resources/templates/auto/list-genders-Genders.html
@@ -1,32 +1,44 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
+{% block back-links %}
+
+
+{% ifunequal params.offset "0" %}
+
+Previous
+
+{% else %}
+
+Back
+
+{% endifunequal %}
+
+
{% endblock %}
-
-{% block content %}
-
{% endblock %}
-{% block foot %}
-
+ var form = document.getElementById('list-genders-Genders');
+ var ow = document.getElementById('offset');
+ var lw = document.getElementById('limit');
+ form.addEventListener('submit', function() {
+ ow.value='0';
+ });
-{% endblock %}
\ No newline at end of file
+ {% ifunequal 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 %}
diff --git a/resources/templates/auto/list-intentions-Intentions.html b/resources/templates/auto/list-intentions-Intentions.html
index de75da8..5d2e535 100644
--- a/resources/templates/auto/list-intentions-Intentions.html
+++ b/resources/templates/auto/list-intentions-Intentions.html
@@ -1,32 +1,44 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
+{% block back-links %}
+
+
+{% ifunequal params.offset "0" %}
+
+Previous
+
+{% else %}
+
+Back
+
+{% endifunequal %}
+
+
{% endblock %}
-
-{% block content %}
-
{% endblock %}
-{% block foot %}
-
+ var form = document.getElementById('list-intentions-Intentions');
+ var ow = document.getElementById('offset');
+ var lw = document.getElementById('limit');
+ form.addEventListener('submit', function() {
+ ow.value='0';
+ });
-{% endblock %}
\ No newline at end of file
+ {% ifunequal 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 %}
diff --git a/resources/templates/auto/list-issues-Issues.html b/resources/templates/auto/list-issues-Issues.html
index af0eb2c..1cbe0bb 100644
--- a/resources/templates/auto/list-issues-Issues.html
+++ b/resources/templates/auto/list-issues-Issues.html
@@ -1,32 +1,44 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
+{% block back-links %}
+
+
+{% ifunequal params.offset "0" %}
+
+Previous
+
+{% else %}
+
+Back
+
+{% endifunequal %}
+
+
{% endblock %}
-
-{% block content %}
-
{% endblock %}
-{% block foot %}
-
+ var form = document.getElementById('list-issues-Issues');
+ var ow = document.getElementById('offset');
+ var lw = document.getElementById('limit');
+ form.addEventListener('submit', function() {
+ ow.value='0';
+ });
-{% endblock %}
\ No newline at end of file
+ {% ifunequal 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 %}
diff --git a/resources/templates/auto/list-options-Options.html b/resources/templates/auto/list-options-Options.html
index 3479834..65821ec 100644
--- a/resources/templates/auto/list-options-Options.html
+++ b/resources/templates/auto/list-options-Options.html
@@ -1,32 +1,44 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
+{% block back-links %}
+
+
+{% ifunequal params.offset "0" %}
+
+Previous
+
+{% else %}
+
+Back
+
+{% endifunequal %}
+
+
{% endblock %}
-
-{% block content %}
-
{% endblock %}
-{% block foot %}
-
+ var form = document.getElementById('list-options-Options');
+ var ow = document.getElementById('offset');
+ var lw = document.getElementById('limit');
+ form.addEventListener('submit', function() {
+ ow.value='0';
+ });
-{% endblock %}
\ No newline at end of file
+ {% ifunequal 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 %}
diff --git a/resources/templates/auto/list-roles-Roles.html b/resources/templates/auto/list-roles-Roles.html
index 8a2a73f..276d38a 100644
--- a/resources/templates/auto/list-roles-Roles.html
+++ b/resources/templates/auto/list-roles-Roles.html
@@ -1,32 +1,44 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
+{% block back-links %}
+
+
+{% ifunequal params.offset "0" %}
+
+Previous
+
+{% else %}
+
+Back
+
+{% endifunequal %}
+
+
{% endblock %}
-
-{% block content %}
-
{% endblock %}
-{% block foot %}
-
+ var form = document.getElementById('list-roles-Roles');
+ var ow = document.getElementById('offset');
+ var lw = document.getElementById('limit');
+ form.addEventListener('submit', function() {
+ ow.value='0';
+ });
-{% endblock %}
\ No newline at end of file
+ {% ifunequal 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 %}
diff --git a/resources/templates/auto/list-teams-Teams.html b/resources/templates/auto/list-teams-Teams.html
index bbc027c..a353d40 100644
--- a/resources/templates/auto/list-teams-Teams.html
+++ b/resources/templates/auto/list-teams-Teams.html
@@ -1,32 +1,44 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
+{% block back-links %}
+
+
+{% ifunequal params.offset "0" %}
+
+Previous
+
+{% else %}
+
+Back
+
+{% endifunequal %}
+
+
{% endblock %}
-
-{% block content %}
-
{% endblock %}
-{% block foot %}
-
+ var form = document.getElementById('list-teams-Teams');
+ var ow = document.getElementById('offset');
+ var lw = document.getElementById('limit');
+ form.addEventListener('submit', function() {
+ ow.value='0';
+ });
-{% endblock %}
\ No newline at end of file
+ {% ifunequal 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 %}
diff --git a/resources/templates/auto/list-visits-Visits.html b/resources/templates/auto/list-visits-Visits.html
index bdcfddb..70a4964 100644
--- a/resources/templates/auto/list-visits-Visits.html
+++ b/resources/templates/auto/list-visits-Visits.html
@@ -1,32 +1,44 @@
{% extends "base.html" %}
-
-{% block head %}
-
-
-
-
-
-
-
-
-
-
-
-{{site-title}}: {{title}}
-
+{% block back-links %}
+
+
+{% ifunequal params.offset "0" %}
+
+Previous
+
+{% else %}
+
+Back
+
+{% endifunequal %}
+
+
{% endblock %}
-
-{% block content %}
-
{% endblock %}
-{% block foot %}
-
+ var form = document.getElementById('list-visits-Visits');
+ var ow = document.getElementById('offset');
+ var lw = document.getElementById('limit');
+ form.addEventListener('submit', function() {
+ ow.value='0';
+ });
-{% endblock %}
\ No newline at end of file
+ {% ifunequal 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 %}
diff --git a/resources/templates/base.html b/resources/templates/base.html
index a219f55..93c779c 100644
--- a/resources/templates/base.html
+++ b/resources/templates/base.html
@@ -11,11 +11,11 @@
{{site-title}}: {{title}}
{% script "js/lib/jquery/dist/jquery.min.js" %}
+ {% endblock %}
{% block extra-head %}
{% endblock %}
- {% endblock %}
{% block whole-page %}
@@ -48,7 +48,7 @@
{% block big-links %}
{% endblock %}
-
+
{% block content %}
@@ -81,13 +81,11 @@
{% endblock %}