User profile page working.

This commit is contained in:
Simon Brooke 2018-07-16 10:17:02 +01:00
parent b65223198c
commit ab568365ef
46 changed files with 873 additions and 698 deletions

View file

@ -1,7 +1,7 @@
------------------------------------------------------------------------
-- File queries.sql
--
-- autogenerated by adl.to-hugsql-queries at 2018-07-15T11:36:34.811Z
-- autogenerated by adl.to-hugsql-queries at 2018-07-15T19:59:44.610Z
--
-- See [Application Description
-- Language](https://github.com/simon-brooke/adl).
@ -814,52 +814,52 @@ ORDER BY lv_visits.address_id,
lv_visits.date,
lv_visits.id
-- :name search-strings-addresses :? :1
-- :name search-strings-addresses :? :*
-- :doc selects existing address records having any string field matching the parameter of the same name by substring match
SELECT DISTINCT * FROM lv_addresses
WHERE false
--~ (if (:address params) "OR address LIKE '%:address%'")
--~ (if (:postcode params) "OR postcode LIKE '%:postcode%'")
--~ (if (:phone params) "OR phone LIKE '%:phone%'")
--~ (if (:district_id params) "OR district_id = :district_id")
--~ (if (:latitude params) "OR latitude = :latitude")
--~ (if (:longitude params) "OR longitude = :longitude")
--~ (if (:locality params) "OR locality = :locality")
--~ (if (:id params) "OR id = :id")
--~ (if (:address params) (str "OR address LIKE '%" (:address params) "%'"))
--~ (if (:postcode params) (str "OR postcode = :postcode"))
--~ (if (:phone params) (str "OR phone LIKE '%" (:phone params) "%'"))
--~ (if (:district_id params) (str "OR district_id_expanded LIKE '%" (:district_id params) "%'"))
--~ (if (:latitude params) (str "OR latitude = :latitude"))
--~ (if (:longitude params) (str "OR longitude = :longitude"))
--~ (if (:locality params) (str "OR locality = :locality"))
--~ (if (:id params) (str "OR id = :id"))
ORDER BY lv_addresses.address,
lv_addresses.postcode,
lv_addresses.id
--~ (if (:offset params) "OFFSET :offset ")
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
-- :name search-strings-authorities :? :1
-- :name search-strings-authorities :? :*
-- :doc selects existing authority records having any string field matching the parameter of the same name by substring match
SELECT DISTINCT * FROM lv_authorities
WHERE false
--~ (if (:request-token-uri params) "OR request_token_uri LIKE '%:request-token-uri%'")
--~ (if (:access-token-uri params) "OR access_token_uri LIKE '%:access-token-uri%'")
--~ (if (:authorize-uri params) "OR authorize_uri LIKE '%:authorize-uri%'")
--~ (if (:consumer-key params) "OR consumer_key LIKE '%:consumer-key%'")
--~ (if (:consumer-secret params) "OR consumer_secret LIKE '%:consumer-secret%'")
--~ (if (:id params) "OR id LIKE '%:id%'")
--~ (if (:request-token-uri params) (str "OR request_token_uri LIKE '%" (:request-token-uri params) "%'"))
--~ (if (:access-token-uri params) (str "OR access_token_uri LIKE '%" (:access-token-uri params) "%'"))
--~ (if (:authorize-uri params) (str "OR authorize_uri LIKE '%" (:authorize-uri params) "%'"))
--~ (if (:consumer-key params) (str "OR consumer_key LIKE '%" (:consumer-key params) "%'"))
--~ (if (:consumer-secret params) (str "OR consumer_secret LIKE '%" (:consumer-secret params) "%'"))
--~ (if (:id params) (str "OR id LIKE '%" (:id params) "%'"))
--~ (if (:offset params) "OFFSET :offset ")
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
-- :name search-strings-canvassers :? :1
-- :name search-strings-canvassers :? :*
-- :doc selects existing canvasser records having any string field matching the parameter of the same name by substring match
SELECT DISTINCT * FROM lv_canvassers
WHERE false
--~ (if (:username params) "OR username LIKE '%:username%'")
--~ (if (:fullname params) "OR fullname LIKE '%:fullname%'")
--~ (if (:avatar params) "OR avatar = :avatar")
--~ (if (:bio params) "OR bio LIKE '%:bio%'")
--~ (if (:elector_id params) "OR elector_id = :elector_id")
--~ (if (:address_id params) "OR address_id = :address_id")
--~ (if (:phone params) "OR phone LIKE '%:phone%'")
--~ (if (:email params) "OR email LIKE '%:email%'")
--~ (if (:authority_id params) "OR authority_id LIKE '%:authority_id%'")
--~ (if (:authorised params) "OR authorised = :authorised")
--~ (if (:id params) "OR id = :id")
--~ (if (:username params) (str "OR username LIKE '%" (:username params) "%'"))
--~ (if (:fullname params) (str "OR fullname LIKE '%" (:fullname params) "%'"))
--~ (if (:avatar params) (str "OR avatar = :avatar"))
--~ (if (:bio params) (str "OR bio LIKE '%" (:bio params) "%'"))
--~ (if (:elector_id params) (str "OR elector_id_expanded LIKE '%" (:elector_id params) "%'"))
--~ (if (:address_id params) (str "OR address_id_expanded LIKE '%" (:address_id params) "%'"))
--~ (if (:phone params) (str "OR phone LIKE '%" (:phone params) "%'"))
--~ (if (:email params) (str "OR email LIKE '%" (:email params) "%'"))
--~ (if (:authority_id params) (str "OR authority_id_expanded LIKE '%" (:authority_id params) "%'"))
--~ (if (:authorised params) (str "OR authorised = :authorised"))
--~ (if (:id params) (str "OR id = :id"))
ORDER BY lv_canvassers.username,
lv_canvassers.fullname,
lv_canvassers.address_id,
@ -869,55 +869,55 @@ ORDER BY lv_canvassers.username,
--~ (if (:offset params) "OFFSET :offset ")
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
-- :name search-strings-districts :? :1
-- :name search-strings-districts :? :*
-- :doc selects existing district records having any string field matching the parameter of the same name by substring match
SELECT DISTINCT * FROM lv_districts
WHERE false
--~ (if (:name params) "OR name LIKE '%:name%'")
--~ (if (:id params) "OR id = :id")
--~ (if (:name params) (str "OR name LIKE '%" (:name params) "%'"))
--~ (if (:id params) (str "OR id = :id"))
ORDER BY lv_districts.name,
lv_districts.id
--~ (if (:offset params) "OFFSET :offset ")
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
-- :name search-strings-dwellings :? :1
-- :name search-strings-dwellings :? :*
-- :doc selects existing dwelling records having any string field matching the parameter of the same name by substring match
SELECT DISTINCT * FROM lv_dwellings
WHERE false
--~ (if (:address_id params) "OR address_id = :address_id")
--~ (if (:sub-address params) "OR sub_address LIKE '%:sub-address%'")
--~ (if (:id params) "OR id = :id")
--~ (if (:address_id params) (str "OR address_id_expanded LIKE '%" (:address_id params) "%'"))
--~ (if (:sub-address params) (str "OR sub_address LIKE '%" (:sub-address params) "%'"))
--~ (if (:id params) (str "OR id = :id"))
ORDER BY lv_dwellings.address_id,
lv_dwellings.sub_address,
lv_dwellings.id
--~ (if (:offset params) "OFFSET :offset ")
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
-- :name search-strings-electors :? :1
-- :name search-strings-electors :? :*
-- :doc selects existing elector records having any string field matching the parameter of the same name by substring match
SELECT DISTINCT * FROM lv_electors
WHERE false
--~ (if (:name params) "OR name LIKE '%:name%'")
--~ (if (:dwelling_id params) "OR dwelling_id = :dwelling_id")
--~ (if (:phone params) "OR phone LIKE '%:phone%'")
--~ (if (:email params) "OR email LIKE '%:email%'")
--~ (if (:gender params) "OR gender LIKE '%:gender%'")
--~ (if (:id params) "OR id = :id")
--~ (if (:name params) (str "OR name LIKE '%" (:name params) "%'"))
--~ (if (:dwelling_id params) (str "OR dwelling_id_expanded LIKE '%" (:dwelling_id params) "%'"))
--~ (if (:phone params) (str "OR phone LIKE '%" (:phone params) "%'"))
--~ (if (:email params) (str "OR email LIKE '%" (:email params) "%'"))
--~ (if (:gender params) (str "OR gender_expanded LIKE '%" (:gender params) "%'"))
--~ (if (:id params) (str "OR id = :id"))
ORDER BY lv_electors.name,
lv_electors.id
--~ (if (:offset params) "OFFSET :offset ")
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
-- :name search-strings-events :? :1
-- :name search-strings-events :? :*
-- :doc selects existing event records having any string field matching the parameter of the same name by substring match
SELECT DISTINCT * FROM lv_events
WHERE false
--~ (if (:name params) "OR name LIKE '%:name%'")
--~ (if (:date params) "OR date = ':date'")
--~ (if (:time params) "OR time = ':time'")
--~ (if (:decription params) "OR decription LIKE '%:decription%'")
--~ (if (:cancelled params) "OR cancelled = :cancelled")
--~ (if (:id params) "OR id = :id")
--~ (if (:name params) (str "OR name LIKE '%" (:name params) "%'"))
--~ (if (:date params) (str "OR date = ':date'"))
--~ (if (:time params) (str "OR time = ':time'"))
--~ (if (:decription params) (str "OR decription LIKE '%" (:decription params) "%'"))
--~ (if (:cancelled params) (str "OR cancelled = :cancelled"))
--~ (if (:id params) (str "OR id = :id"))
ORDER BY lv_events.name,
lv_events.date,
lv_events.time,
@ -925,39 +925,39 @@ ORDER BY lv_events.name,
--~ (if (:offset params) "OFFSET :offset ")
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
-- :name search-strings-followupactions :? :1
-- :name search-strings-followupactions :? :*
-- :doc selects existing followupaction records having any string field matching the parameter of the same name by substring match
SELECT DISTINCT * FROM lv_followupactions
WHERE false
--~ (if (:request_id params) "OR request_id = :request_id")
--~ (if (:actor params) "OR actor = :actor")
--~ (if (:date params) "OR date = ':date'")
--~ (if (:notes params) "OR notes LIKE '%:notes%'")
--~ (if (:closed params) "OR closed = :closed")
--~ (if (:id params) "OR id = :id")
--~ (if (:request_id params) (str "OR request_id_expanded LIKE '%" (:request_id params) "%'"))
--~ (if (:actor params) (str "OR actor_expanded LIKE '%" (:actor params) "%'"))
--~ (if (:date params) (str "OR date = ':date'"))
--~ (if (:notes params) (str "OR notes LIKE '%" (:notes params) "%'"))
--~ (if (:closed params) (str "OR closed = :closed"))
--~ (if (:id params) (str "OR id = :id"))
ORDER BY lv_followupactions.date,
lv_followupactions.notes,
lv_followupactions.id
--~ (if (:offset params) "OFFSET :offset ")
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
-- :name search-strings-followupmethods :? :1
-- :name search-strings-followupmethods :? :*
-- :doc selects existing followupmethod records having any string field matching the parameter of the same name by substring match
SELECT DISTINCT * FROM lv_followupmethods
WHERE false
--~ (if (:id params) "OR id LIKE '%:id%'")
--~ (if (:id params) (str "OR id LIKE '%" (:id params) "%'"))
--~ (if (:offset params) "OFFSET :offset ")
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
-- :name search-strings-followuprequests :? :1
-- :name search-strings-followuprequests :? :*
-- :doc selects existing followuprequest records having any string field matching the parameter of the same name by substring match
SELECT DISTINCT * FROM lv_followuprequests
WHERE false
--~ (if (:elector_id params) "OR elector_id = :elector_id")
--~ (if (:visit_id params) "OR visit_id = :visit_id")
--~ (if (:issue_id params) "OR issue_id LIKE '%:issue_id%'")
--~ (if (:method_id params) "OR method_id LIKE '%:method_id%'")
--~ (if (:id params) "OR id = :id")
--~ (if (:elector_id params) (str "OR elector_id_expanded LIKE '%" (:elector_id params) "%'"))
--~ (if (:visit_id params) (str "OR visit_id_expanded LIKE '%" (:visit_id params) "%'"))
--~ (if (:issue_id params) (str "OR issue_id_expanded LIKE '%" (:issue_id params) "%'"))
--~ (if (:method_id params) (str "OR method_id_expanded LIKE '%" (:method_id params) "%'"))
--~ (if (:id params) (str "OR id = :id"))
ORDER BY lv_followuprequests.elector_id,
lv_followuprequests.visit_id,
lv_followuprequests.issue_id,
@ -965,78 +965,78 @@ ORDER BY lv_followuprequests.elector_id,
--~ (if (:offset params) "OFFSET :offset ")
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
-- :name search-strings-genders :? :1
-- :name search-strings-genders :? :*
-- :doc selects existing gender records having any string field matching the parameter of the same name by substring match
SELECT DISTINCT * FROM lv_genders
WHERE false
--~ (if (:id params) "OR id LIKE '%:id%'")
--~ (if (:id params) (str "OR id LIKE '%" (:id params) "%'"))
--~ (if (:offset params) "OFFSET :offset ")
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
-- :name search-strings-intentions :? :1
-- :name search-strings-intentions :? :*
-- :doc selects existing intention records having any string field matching the parameter of the same name by substring match
SELECT DISTINCT * FROM lv_intentions
WHERE false
--~ (if (:visit_id params) "OR visit_id = :visit_id")
--~ (if (:elector_id params) "OR elector_id = :elector_id")
--~ (if (:option_id params) "OR option_id LIKE '%:option_id%'")
--~ (if (:locality params) "OR locality = :locality")
--~ (if (:id params) "OR id = :id")
--~ (if (:visit_id params) (str "OR visit_id_expanded LIKE '%" (:visit_id params) "%'"))
--~ (if (:elector_id params) (str "OR elector_id_expanded LIKE '%" (:elector_id params) "%'"))
--~ (if (:option_id params) (str "OR option_id_expanded LIKE '%" (:option_id params) "%'"))
--~ (if (:locality params) (str "OR locality = :locality"))
--~ (if (:id params) (str "OR id = :id"))
--~ (if (:offset params) "OFFSET :offset ")
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
-- :name search-strings-issues :? :1
-- :name search-strings-issues :? :*
-- :doc selects existing issue records having any string field matching the parameter of the same name by substring match
SELECT DISTINCT * FROM lv_issues
WHERE false
--~ (if (:url params) "OR url LIKE '%:url%'")
--~ (if (:current params) "OR current = :current")
--~ (if (:brief params) "OR brief LIKE '%:brief%'")
--~ (if (:id params) "OR id LIKE '%:id%'")
--~ (if (:url params) (str "OR url LIKE '%" (:url params) "%'"))
--~ (if (:current params) (str "OR current = :current"))
--~ (if (:brief params) (str "OR brief LIKE '%" (:brief params) "%'"))
--~ (if (:id params) (str "OR id LIKE '%" (:id params) "%'"))
--~ (if (:offset params) "OFFSET :offset ")
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
-- :name search-strings-options :? :1
-- :name search-strings-options :? :*
-- :doc selects existing option records having any string field matching the parameter of the same name by substring match
SELECT DISTINCT * FROM lv_options
WHERE false
--~ (if (:id params) "OR id LIKE '%:id%'")
--~ (if (:id params) (str "OR id LIKE '%" (:id params) "%'"))
--~ (if (:offset params) "OFFSET :offset ")
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
-- :name search-strings-roles :? :1
-- :name search-strings-roles :? :*
-- :doc selects existing role records having any string field matching the parameter of the same name by substring match
SELECT DISTINCT * FROM lv_roles
WHERE false
--~ (if (:name params) "OR name LIKE '%:name%'")
--~ (if (:id params) "OR id = :id")
--~ (if (:name params) (str "OR name LIKE '%" (:name params) "%'"))
--~ (if (:id params) (str "OR id = :id"))
ORDER BY lv_roles.name,
lv_roles.id
--~ (if (:offset params) "OFFSET :offset ")
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
-- :name search-strings-teams :? :1
-- :name search-strings-teams :? :*
-- :doc selects existing team records having any string field matching the parameter of the same name by substring match
SELECT DISTINCT * FROM lv_teams
WHERE false
--~ (if (:name params) "OR name LIKE '%:name%'")
--~ (if (:district_id params) "OR district_id = :district_id")
--~ (if (:latitude params) "OR latitude = :latitude")
--~ (if (:longitude params) "OR longitude = :longitude")
--~ (if (:id params) "OR id = :id")
--~ (if (:name params) (str "OR name LIKE '%" (:name params) "%'"))
--~ (if (:district_id params) (str "OR district_id_expanded LIKE '%" (:district_id params) "%'"))
--~ (if (:latitude params) (str "OR latitude = :latitude"))
--~ (if (:longitude params) (str "OR longitude = :longitude"))
--~ (if (:id params) (str "OR id = :id"))
ORDER BY lv_teams.name,
lv_teams.id
--~ (if (:offset params) "OFFSET :offset ")
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
-- :name search-strings-visits :? :1
-- :name search-strings-visits :? :*
-- :doc selects existing visit records having any string field matching the parameter of the same name by substring match
SELECT DISTINCT * FROM lv_visits
WHERE false
--~ (if (:address_id params) "OR address_id = :address_id")
--~ (if (:canvasser_id params) "OR canvasser_id = :canvasser_id")
--~ (if (:date params) "OR date = ':date'")
--~ (if (:id params) "OR id = :id")
--~ (if (:address_id params) (str "OR address_id_expanded LIKE '%" (:address_id params) "%'"))
--~ (if (:canvasser_id params) (str "OR canvasser_id_expanded LIKE '%" (:canvasser_id params) "%'"))
--~ (if (:date params) (str "OR date = ':date'"))
--~ (if (:id params) (str "OR id = :id"))
ORDER BY lv_visits.address_id,
lv_visits.date,
lv_visits.id

View file

@ -5,7 +5,7 @@
--
-- auto-generated by [Application Description Language framework]
--
-- (https://github.com/simon-brooke/adl) at 20180715T113635.982Z
-- (https://github.com/simon-brooke/adl) at 20180715T195945.839Z
--
-- A web-app intended to be used by canvassers
-- campaigning for a 'Yes' vote in the second independence

View file

@ -1,5 +1,5 @@
{% extends "base.html" %}
<!-- File application-index.html generated 2018-07-15T11:36:36.877Z by adl.to-selmer-templates.
<!-- File application-index.html generated 2018-07-15T19:59:46.651Z by adl.to-selmer-templates.
See [Application Description Language](https://github.com/simon-brooke/adl).-->

View file

@ -1,5 +1,5 @@
{% extends "base.html" %}
<!-- File form-addresses-Address.html generated 2018-07-15T11:36:36.868Z by adl.to-selmer-templates.
<!-- File form-addresses-Address.html generated 2018-07-15T19:59:46.643Z by adl.to-selmer-templates.
See [Application Description Language](https://github.com/simon-brooke/adl).-->

View file

@ -1,5 +1,5 @@
{% extends "base.html" %}
<!-- File form-authorities-Authority.html generated 2018-07-15T11:36:36.882Z by adl.to-selmer-templates.
<!-- File form-authorities-Authority.html generated 2018-07-15T19:59:46.656Z by adl.to-selmer-templates.
See [Application Description Language](https://github.com/simon-brooke/adl).-->

View file

@ -1,5 +1,5 @@
{% extends "base.html" %}
<!-- File form-canvassers-Canvasser.html generated 2018-07-15T11:36:36.886Z by adl.to-selmer-templates.
<!-- File form-canvassers-Canvasser.html generated 2018-07-15T19:59:46.660Z by adl.to-selmer-templates.
See [Application Description Language](https://github.com/simon-brooke/adl).-->

View file

@ -1,5 +1,5 @@
{% extends "base.html" %}
<!-- File form-districts-District.html generated 2018-07-15T11:36:36.863Z by adl.to-selmer-templates.
<!-- File form-districts-District.html generated 2018-07-15T19:59:46.640Z by adl.to-selmer-templates.
See [Application Description Language](https://github.com/simon-brooke/adl).-->

View file

@ -1,5 +1,5 @@
{% extends "base.html" %}
<!-- File form-dwellings-Dwelling.html generated 2018-07-15T11:36:36.894Z by adl.to-selmer-templates.
<!-- File form-dwellings-Dwelling.html generated 2018-07-15T19:59:46.667Z by adl.to-selmer-templates.
See [Application Description Language](https://github.com/simon-brooke/adl).-->

View file

@ -1,5 +1,5 @@
{% extends "base.html" %}
<!-- File form-electors-Elector.html generated 2018-07-15T11:36:36.880Z by adl.to-selmer-templates.
<!-- File form-electors-Elector.html generated 2018-07-15T19:59:46.654Z by adl.to-selmer-templates.
See [Application Description Language](https://github.com/simon-brooke/adl).-->

View file

@ -1,5 +1,5 @@
{% extends "base.html" %}
<!-- File form-events-Events.html generated 2018-07-15T11:36:36.884Z by adl.to-selmer-templates.
<!-- File form-events-Events.html generated 2018-07-15T19:59:46.658Z by adl.to-selmer-templates.
See [Application Description Language](https://github.com/simon-brooke/adl).-->

View file

@ -1,5 +1,5 @@
{% extends "base.html" %}
<!-- File form-followupactions-Followupaction.html generated 2018-07-15T11:36:36.896Z by adl.to-selmer-templates.
<!-- File form-followupactions-Followupaction.html generated 2018-07-15T19:59:46.668Z by adl.to-selmer-templates.
See [Application Description Language](https://github.com/simon-brooke/adl).-->

View file

@ -1,5 +1,5 @@
{% extends "base.html" %}
<!-- File form-followupmethods-Followupmethod.html generated 2018-07-15T11:36:36.897Z by adl.to-selmer-templates.
<!-- File form-followupmethods-Followupmethod.html generated 2018-07-15T19:59:46.669Z by adl.to-selmer-templates.
See [Application Description Language](https://github.com/simon-brooke/adl).-->

View file

@ -1,5 +1,5 @@
{% extends "base.html" %}
<!-- File form-followuprequests-Followuprequest.html generated 2018-07-15T11:36:36.866Z by adl.to-selmer-templates.
<!-- File form-followuprequests-Followuprequest.html generated 2018-07-15T19:59:46.642Z by adl.to-selmer-templates.
See [Application Description Language](https://github.com/simon-brooke/adl).-->

View file

@ -1,5 +1,5 @@
{% extends "base.html" %}
<!-- File form-genders-Gender.html generated 2018-07-15T11:36:36.860Z by adl.to-selmer-templates.
<!-- File form-genders-Gender.html generated 2018-07-15T19:59:46.638Z by adl.to-selmer-templates.
See [Application Description Language](https://github.com/simon-brooke/adl).-->

View file

@ -1,5 +1,5 @@
{% extends "base.html" %}
<!-- File form-intentions-Intention.html generated 2018-07-15T11:36:36.892Z by adl.to-selmer-templates.
<!-- File form-intentions-Intention.html generated 2018-07-15T19:59:46.664Z by adl.to-selmer-templates.
See [Application Description Language](https://github.com/simon-brooke/adl).-->

View file

@ -1,5 +1,5 @@
{% extends "base.html" %}
<!-- File form-issues-Issue.html generated 2018-07-15T11:36:36.872Z by adl.to-selmer-templates.
<!-- File form-issues-Issue.html generated 2018-07-15T19:59:46.646Z by adl.to-selmer-templates.
See [Application Description Language](https://github.com/simon-brooke/adl).-->

View file

@ -1,5 +1,5 @@
{% extends "base.html" %}
<!-- File form-options-Option.html generated 2018-07-15T11:36:36.891Z by adl.to-selmer-templates.
<!-- File form-options-Option.html generated 2018-07-15T19:59:46.664Z by adl.to-selmer-templates.
See [Application Description Language](https://github.com/simon-brooke/adl).-->

View file

@ -1,5 +1,5 @@
{% extends "base.html" %}
<!-- File form-roles-Role.html generated 2018-07-15T11:36:36.874Z by adl.to-selmer-templates.
<!-- File form-roles-Role.html generated 2018-07-15T19:59:46.647Z by adl.to-selmer-templates.
See [Application Description Language](https://github.com/simon-brooke/adl).-->

View file

@ -1,5 +1,5 @@
{% extends "base.html" %}
<!-- File form-teams-Team.html generated 2018-07-15T11:36:36.878Z by adl.to-selmer-templates.
<!-- File form-teams-Team.html generated 2018-07-15T19:59:46.652Z by adl.to-selmer-templates.
See [Application Description Language](https://github.com/simon-brooke/adl).-->

View file

@ -1,5 +1,5 @@
{% extends "base.html" %}
<!-- File form-visits-Visit.html generated 2018-07-15T11:36:36.876Z by adl.to-selmer-templates.
<!-- File form-visits-Visit.html generated 2018-07-15T19:59:46.650Z by adl.to-selmer-templates.
See [Application Description Language](https://github.com/simon-brooke/adl).-->

View file

@ -1,20 +1,14 @@
{% extends "base.html" %}
<!-- File list-addresses-Addresses.html generated 2018-07-15T11:36:36.883Z by adl.to-selmer-templates.
<!-- File list-addresses-Addresses.html generated 2018-07-15T19:59:46.657Z 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 Address
{% block content %}
<form id='list-addresses-Addresses' class='list' action='{{servlet-context}}/list-addresses-Addresses' 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='addresses'>
<thead>
<tr>
@ -83,7 +77,7 @@ Longitude
<input id='phone' type='text' name='phone' value='{{ params.phone }}'/>
</th>
<th>
<input id='district_id_expanded' type='text' name='district_id_expanded' value='{{ params.district_id_expanded }}'/>
<input id='district_id' type='text' name='district_id' value='{{ params.district_id }}'/>
</th>
<th>
<input id='latitude' type='number' name='latitude' value='{{ params.latitude }}'/>
@ -140,20 +134,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 %}

View file

@ -1,20 +1,14 @@
{% extends "base.html" %}
<!-- File list-authorities-Authorities.html generated 2018-07-15T11:36:36.864Z by adl.to-selmer-templates.
<!-- File list-authorities-Authorities.html generated 2018-07-15T19:59:46.641Z 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 Authority
{% block content %}
<form id='list-authorities-Authorities' class='list' action='{{servlet-context}}/list-authorities-Authorities' 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='authorities'>
<thead>
<tr>
@ -111,20 +105,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 %}

View file

@ -1,20 +1,14 @@
{% extends "base.html" %}
<!-- File list-canvassers-Canvassers.html generated 2018-07-15T11:36:36.893Z by adl.to-selmer-templates.
<!-- File list-canvassers-Canvassers.html generated 2018-07-15T19:59:46.666Z 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 Canvasser
{% block content %}
<form id='list-canvassers-Canvassers' class='list' action='{{servlet-context}}/list-canvassers-Canvassers' 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='canvassers'>
<thead>
<tr>
@ -77,10 +71,10 @@ Authorised
<input id='fullname' type='text' name='fullname' value='{{ params.fullname }}'/>
</th>
<th>
<input id='address_id_expanded' type='text' name='address_id_expanded' value='{{ params.address_id_expanded }}'/>
<input id='address_id' type='text' name='address_id' value='{{ params.address_id }}'/>
</th>
<th>
<input id='authority_id_expanded' type='text' name='authority_id_expanded' value='{{ params.authority_id_expanded }}'/>
<input id='authority_id' type='text' name='authority_id' value='{{ params.authority_id }}'/>
</th>
<th>
<input id='authorised' type='text' name='authorised' value='{{ params.authorised }}'/>
@ -133,20 +127,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 %}

View file

@ -1,20 +1,14 @@
{% extends "base.html" %}
<!-- File list-districts-Districts.html generated 2018-07-15T11:36:36.888Z by adl.to-selmer-templates.
<!-- File list-districts-Districts.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 District
{% block content %}
<form id='list-districts-Districts' class='list' action='{{servlet-context}}/list-districts-Districts' 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='districts'>
<thead>
<tr>
@ -93,20 +87,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 %}

View file

@ -1,20 +1,14 @@
{% extends "base.html" %}
<!-- File list-dwellings-Dwellings.html generated 2018-07-15T11:36:36.881Z by adl.to-selmer-templates.
<!-- File list-dwellings-Dwellings.html generated 2018-07-15T19:59:46.655Z 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 Dwelling
{% block content %}
<form id='list-dwellings-Dwellings' class='list' action='{{servlet-context}}/list-dwellings-Dwellings' 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='dwellings'>
<thead>
<tr>
@ -62,7 +56,7 @@ Sub-address
<input id='id' type='text' name='id' value='{{ params.id }}'/>
</th>
<th>
<input id='address_id_expanded' type='text' name='address_id_expanded' value='{{ params.address_id_expanded }}'/>
<input id='address_id' type='text' name='address_id' value='{{ params.address_id }}'/>
</th>
<th>
<input id='sub_address' type='text' name='sub_address' value='{{ params.sub_address }}'/>
@ -104,20 +98,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 %}

View file

@ -1,20 +1,14 @@
{% extends "base.html" %}
<!-- File list-electors-Electors.html generated 2018-07-15T11:36:36.871Z by adl.to-selmer-templates.
<!-- File list-electors-Electors.html generated 2018-07-15T19:59:46.645Z 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 Elector
{% block content %}
<form id='list-electors-Electors' class='list' action='{{servlet-context}}/list-electors-Electors' 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='electors'>
<thead>
<tr>
@ -74,7 +68,7 @@ Gender
<input id='name' type='text' name='name' value='{{ params.name }}'/>
</th>
<th>
<input id='dwelling_id_expanded' type='text' name='dwelling_id_expanded' value='{{ params.dwelling_id_expanded }}'/>
<input id='dwelling_id' type='text' name='dwelling_id' value='{{ params.dwelling_id }}'/>
</th>
<th>
<input id='phone' type='text' name='phone' value='{{ params.phone }}'/>
@ -83,7 +77,7 @@ Gender
<input id='email' type='text' name='email' value='{{ params.email }}'/>
</th>
<th>
<input id='gender_expanded' type='text' name='gender_expanded' value='{{ params.gender_expanded }}'/>
<input id='gender' type='text' name='gender' value='{{ params.gender }}'/>
</th>
<th>
<input type='submit' id='search-widget' value='Search'/>
@ -133,20 +127,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 %}

View file

@ -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 %}

View file

@ -1,20 +1,14 @@
{% extends "base.html" %}
<!-- File list-followupactions-Followupactions.html generated 2018-07-15T11:36:36.893Z by adl.to-selmer-templates.
<!-- File list-followupactions-Followupactions.html generated 2018-07-15T19:59:46.665Z 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 Followupaction
{% block content %}
<form id='list-followupactions-Followupactions' class='list' action='{{servlet-context}}/list-followupactions-Followupactions' 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='followupactions'>
<thead>
<tr>
@ -68,10 +62,10 @@ Closed
<input id='id' type='text' name='id' value='{{ params.id }}'/>
</th>
<th>
<input id='request_id_expanded' type='text' name='request_id_expanded' value='{{ params.request_id_expanded }}'/>
<input id='request_id' type='text' name='request_id' value='{{ params.request_id }}'/>
</th>
<th>
<input id='actor_expanded' type='text' name='actor_expanded' value='{{ params.actor_expanded }}'/>
<input id='actor' type='text' name='actor' value='{{ params.actor }}'/>
</th>
<th>
<input id='date' type='date' name='date' value='{{ params.date }}'/>
@ -124,20 +118,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 %}

View file

@ -1,20 +1,14 @@
{% extends "base.html" %}
<!-- File list-followupmethods-Followupmethods.html generated 2018-07-15T11:36:36.876Z by adl.to-selmer-templates.
<!-- File list-followupmethods-Followupmethods.html generated 2018-07-15T19:59:46.649Z 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 Followupmethod
{% block content %}
<form id='list-followupmethods-Followupmethods' class='list' action='{{servlet-context}}/list-followupmethods-Followupmethods' 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='followupmethods'>
<thead>
<tr>
@ -84,20 +78,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 %}

View file

@ -1,20 +1,14 @@
{% extends "base.html" %}
<!-- File list-followuprequests-Followuprequests.html generated 2018-07-15T11:36:36.861Z by adl.to-selmer-templates.
<!-- File list-followuprequests-Followuprequests.html generated 2018-07-15T19:59:46.638Z 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 Followuprequest
{% 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}}'/>
<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='followuprequests'>
<thead>
<tr>
@ -68,16 +62,16 @@ Method_id
<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 }}'/>
<input id='elector_id' type='text' name='elector_id' value='{{ params.elector_id }}'/>
</th>
<th>
<input id='visit_id_expanded' type='text' name='visit_id_expanded' value='{{ params.visit_id_expanded }}'/>
<input id='visit_id' type='text' name='visit_id' value='{{ params.visit_id }}'/>
</th>
<th>
<input id='issue_id_expanded' type='text' name='issue_id_expanded' value='{{ params.issue_id_expanded }}'/>
<input id='issue_id' type='text' name='issue_id' value='{{ params.issue_id }}'/>
</th>
<th>
<input id='method_id_expanded' type='text' name='method_id_expanded' value='{{ params.method_id_expanded }}'/>
<input id='method_id' type='text' name='method_id' value='{{ params.method_id }}'/>
</th>
<th>
<input type='submit' id='search-widget' value='Search'/>
@ -128,20 +122,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 %}

View file

@ -1,20 +1,14 @@
{% extends "base.html" %}
<!-- File list-genders-Genders.html generated 2018-07-15T11:36:36.857Z by adl.to-selmer-templates.
<!-- File list-genders-Genders.html generated 2018-07-15T19:59:46.634Z 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 Gender
{% block content %}
<form id='list-genders-Genders' class='list' action='{{servlet-context}}/list-genders-Genders' 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='genders'>
<thead>
<tr>
@ -84,20 +78,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 %}

View file

@ -1,20 +1,14 @@
{% extends "base.html" %}
<!-- File list-intentions-Intentions.html generated 2018-07-15T11:36:36.895Z by adl.to-selmer-templates.
<!-- File list-intentions-Intentions.html generated 2018-07-15T19:59:46.667Z 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 Intention
{% block content %}
<form id='list-intentions-Intentions' class='list' action='{{servlet-context}}/list-intentions-Intentions' 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='intentions'>
<thead>
<tr>
@ -62,13 +56,13 @@ Locality
</tr>
<tr>
<th>
<input id='visit_id_expanded' type='text' name='visit_id_expanded' value='{{ params.visit_id_expanded }}'/>
<input id='visit_id' type='text' name='visit_id' value='{{ params.visit_id }}'/>
</th>
<th>
<input id='elector_id_expanded' type='text' name='elector_id_expanded' value='{{ params.elector_id_expanded }}'/>
<input id='elector_id' type='text' name='elector_id' value='{{ params.elector_id }}'/>
</th>
<th>
<input id='option_id_expanded' type='text' name='option_id_expanded' value='{{ params.option_id_expanded }}'/>
<input id='option_id' type='text' name='option_id' value='{{ params.option_id }}'/>
</th>
<th>
<input id='locality' type='number' name='locality' value='{{ params.locality }}'/>
@ -117,20 +111,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 %}

View file

@ -1,20 +1,14 @@
{% extends "base.html" %}
<!-- File list-issues-Issues.html generated 2018-07-15T11:36:36.890Z by adl.to-selmer-templates.
<!-- File list-issues-Issues.html generated 2018-07-15T19:59:46.663Z 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 Issue
{% block content %}
<form id='list-issues-Issues' class='list' action='{{servlet-context}}/list-issues-Issues' 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='issues'>
<thead>
<tr>
@ -111,20 +105,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 %}

View file

@ -1,20 +1,14 @@
{% extends "base.html" %}
<!-- File list-options-Options.html generated 2018-07-15T11:36:36.862Z by adl.to-selmer-templates.
<!-- File list-options-Options.html generated 2018-07-15T19:59:46.639Z 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 Option
{% block content %}
<form id='list-options-Options' class='list' action='{{servlet-context}}/list-options-Options' 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='options'>
<thead>
<tr>
@ -84,20 +78,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 %}

View file

@ -1,20 +1,14 @@
{% extends "base.html" %}
<!-- File list-roles-Roles.html generated 2018-07-15T11:36:36.875Z by adl.to-selmer-templates.
<!-- File list-roles-Roles.html generated 2018-07-15T19:59:46.648Z 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 Role
{% block content %}
<form id='list-roles-Roles' class='list' action='{{servlet-context}}/list-roles-Roles' 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='roles'>
<thead>
<tr>
@ -93,20 +87,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 %}

View file

@ -1,20 +1,14 @@
{% extends "base.html" %}
<!-- File list-teams-Teams.html generated 2018-07-15T11:36:36.859Z by adl.to-selmer-templates.
<!-- File list-teams-Teams.html generated 2018-07-15T19:59:46.637Z 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 Team
{% block content %}
<form id='list-teams-Teams' class='list' action='{{servlet-context}}/list-teams-Teams' 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='teams'>
<thead>
<tr>
@ -71,7 +65,7 @@ Longitude
<input id='name' type='text' name='name' value='{{ params.name }}'/>
</th>
<th>
<input id='district_id_expanded' type='text' name='district_id_expanded' value='{{ params.district_id_expanded }}'/>
<input id='district_id' type='text' name='district_id' value='{{ params.district_id }}'/>
</th>
<th>
<input id='latitude' type='number' name='latitude' value='{{ params.latitude }}'/>
@ -122,20 +116,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 %}

View file

@ -1,20 +1,14 @@
{% extends "base.html" %}
<!-- File list-visits-Visits.html generated 2018-07-15T11:36:36.858Z by adl.to-selmer-templates.
<!-- File list-visits-Visits.html generated 2018-07-15T19:59:46.635Z 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 Visit
{% block content %}
<form id='list-visits-Visits' class='list' action='{{servlet-context}}/list-visits-Visits' 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='visits'>
<thead>
<tr>
@ -65,10 +59,10 @@ Date
<input id='id' type='text' name='id' value='{{ params.id }}'/>
</th>
<th>
<input id='address_id_expanded' type='text' name='address_id_expanded' value='{{ params.address_id_expanded }}'/>
<input id='address_id' type='text' name='address_id' value='{{ params.address_id }}'/>
</th>
<th>
<input id='canvasser_id_expanded' type='text' name='canvasser_id_expanded' value='{{ params.canvasser_id_expanded }}'/>
<input id='canvasser_id' type='text' name='canvasser_id' value='{{ params.canvasser_id }}'/>
</th>
<th>
<input id='date' type='date' name='date' value='{{ params.date }}'/>
@ -115,20 +109,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 %}

View file

@ -58,7 +58,7 @@
<!-- big-links: put any main navigation links into this block -->
{% endblock %}
</div>
<div if="#content">
<div id="content">
{% block content %}
<!-- content: put your main page content into this block -->
{% endblock %}

View file

@ -4,6 +4,7 @@
[cheshire.core :refer [generate-string parse-string]]
[clojure.java.jdbc :as jdbc]
[conman.core :as conman]
[hugsql.core :as hugsql]
[mount.core :refer [defstate]]
[youyesyet.config :refer [env]])
(:import org.postgresql.util.PGobject
@ -23,6 +24,7 @@
:stop (conman/disconnect! *db*))
(conman/bind-connection *db* "sql/queries.auto.sql" "sql/queries.sql")
(hugsql/def-sqlvec-fns "sql/queries.auto.sql")
(defn to-date [^java.sql.Date sql-date]
(-> sql-date (.getTime) (java.util.Date.)))

View file

@ -13,8 +13,9 @@
[youyesyet.routes.auto :refer [auto-selmer-routes]]
[youyesyet.routes.auto-json :refer [auto-rest-routes]]
[youyesyet.routes.issue-experts :refer [issue-expert-routes]]
[youyesyet.routes.rest :refer [rest-routes]]
[youyesyet.routes.logged-in :refer [logged-in-routes]]
[youyesyet.routes.oauth :refer [oauth-routes]]
[youyesyet.routes.rest :refer [rest-routes]]
[youyesyet.routes.roles :refer [roles-routes]]
[youyesyet.routes.services :refer [service-routes]]
[youyesyet.env :refer [defaults]]))
@ -70,6 +71,9 @@
(-> #'home-routes
(wrap-routes middleware/wrap-csrf)
(wrap-routes middleware/wrap-formats))
(-> #'logged-in-routes
(wrap-routes middleware/wrap-csrf)
(wrap-routes middleware/wrap-formats))
(-> #'roles-routes
(wrap-routes middleware/wrap-csrf)
(wrap-routes middleware/wrap-formats))

View file

@ -68,18 +68,18 @@
;; than me so there's almost certainly a reason it doesn't.
[template session & [params]]
(let [user (:user session)]
(log/debug (str "layout/render: template: '" template "'; user: '" (:username user)))
(log/debug (str "layout/render: template: '" template "'; session: '" session "'; params: '" params "'"))
(content-type
(ok
(parser/render-file
template
(assoc params
:page template
(merge params
{:page template
:csrf-token *anti-forgery-token*
:user user
:user-roles (get-user-roles user)
:site-title (:site-title env)
:version (System/getProperty "youyesyet.version"))))
:version (System/getProperty "youyesyet.version")})))
"text/html; charset=utf-8")))

View file

@ -1,6 +1,6 @@
(ns
youyesyet.routes.auto
"User interface routes for Youyesyet auto-generated by [Application Description Language framework](https://github.com/simon-brooke/adl) at 20180715T113636.250Z"
"User interface routes for Youyesyet auto-generated by [Application Description Language framework](https://github.com/simon-brooke/adl) at 20180715T195946.069Z"
(:require
[adl-support.core :as support]
[clojure.java.io :as io]
@ -45,18 +45,22 @@
#{:locality :address :phone :postcode :longitude :district_id
:id :latitude}
(keys params))
(support/do-or-log-error
(db/search-strings-addresses db/*db* params)
:message
"Error while searching address records"
:error-return
{:warnings ["Error while searching address records"]})
(support/do-or-log-error
(db/list-addresses db/*db* {})
:message
"Error while fetching address records"
:error-return
{:warnings ["Error while fetching address records"]}))]
(do
(log/debug (db/search-strings-addresses-sqlvec params))
(support/do-or-log-error
(db/search-strings-addresses db/*db* params)
:message
"Error while searching address records"
:error-return
{:warnings ["Error while searching address records"]}))
(do
(log/debug (db/list-addresses-sqlvec params))
(support/do-or-log-error
(db/list-addresses db/*db* {})
:message
"Error while fetching address records"
:error-return
{:warnings ["Error while fetching address records"]})))]
(if (:warnings records) records {:records records}))))))
(defn
@ -119,18 +123,22 @@
#{:access-token-uri :request-token-uri :authorize-uri :id
:consumer-secret :consumer-key}
(keys params))
(support/do-or-log-error
(db/search-strings-authorities db/*db* params)
:message
"Error while searching authority records"
:error-return
{:warnings ["Error while searching authority records"]})
(support/do-or-log-error
(db/list-authorities db/*db* {})
:message
"Error while fetching authority records"
:error-return
{:warnings ["Error while fetching authority records"]}))]
(do
(log/debug (db/search-strings-authorities-sqlvec params))
(support/do-or-log-error
(db/search-strings-authorities db/*db* params)
:message
"Error while searching authority records"
:error-return
{:warnings ["Error while searching authority records"]}))
(do
(log/debug (db/list-authorities-sqlvec params))
(support/do-or-log-error
(db/list-authorities db/*db* {})
:message
"Error while fetching authority records"
:error-return
{:warnings ["Error while fetching authority records"]})))]
(if (:warnings records) records {:records records}))))))
(defn
@ -179,18 +187,22 @@
#{:email :phone :roles :username :fullname :bio :elector_id
:expertise :id :avatar :address_id :authority_id :authorised}
(keys params))
(support/do-or-log-error
(db/search-strings-canvassers db/*db* params)
:message
"Error while searching canvasser records"
:error-return
{:warnings ["Error while searching canvasser records"]})
(support/do-or-log-error
(db/list-canvassers db/*db* {})
:message
"Error while fetching canvasser records"
:error-return
{:warnings ["Error while fetching canvasser records"]}))]
(do
(log/debug (db/search-strings-canvassers-sqlvec params))
(support/do-or-log-error
(db/search-strings-canvassers db/*db* params)
:message
"Error while searching canvasser records"
:error-return
{:warnings ["Error while searching canvasser records"]}))
(do
(log/debug (db/list-canvassers-sqlvec params))
(support/do-or-log-error
(db/list-canvassers db/*db* {})
:message
"Error while fetching canvasser records"
:error-return
{:warnings ["Error while fetching canvasser records"]})))]
(if (:warnings records) records {:records records}))))))
(defn
@ -296,18 +308,22 @@
[records
(if
(some #{:name :id} (keys params))
(support/do-or-log-error
(db/search-strings-districts db/*db* params)
:message
"Error while searching district records"
:error-return
{:warnings ["Error while searching district records"]})
(support/do-or-log-error
(db/list-districts db/*db* {})
:message
"Error while fetching district records"
:error-return
{:warnings ["Error while fetching district records"]}))]
(do
(log/debug (db/search-strings-districts-sqlvec params))
(support/do-or-log-error
(db/search-strings-districts db/*db* params)
:message
"Error while searching district records"
:error-return
{:warnings ["Error while searching district records"]}))
(do
(log/debug (db/list-districts-sqlvec params))
(support/do-or-log-error
(db/list-districts db/*db* {})
:message
"Error while fetching district records"
:error-return
{:warnings ["Error while fetching district records"]})))]
(if (:warnings records) records {:records records}))))))
(defn
@ -353,18 +369,22 @@
[records
(if
(some #{:id :address_id :sub-address} (keys params))
(support/do-or-log-error
(db/search-strings-dwellings db/*db* params)
:message
"Error while searching dwelling records"
:error-return
{:warnings ["Error while searching dwelling records"]})
(support/do-or-log-error
(db/list-dwellings db/*db* {})
:message
"Error while fetching dwelling records"
:error-return
{:warnings ["Error while fetching dwelling records"]}))]
(do
(log/debug (db/search-strings-dwellings-sqlvec params))
(support/do-or-log-error
(db/search-strings-dwellings db/*db* params)
:message
"Error while searching dwelling records"
:error-return
{:warnings ["Error while searching dwelling records"]}))
(do
(log/debug (db/list-dwellings-sqlvec params))
(support/do-or-log-error
(db/list-dwellings db/*db* {})
:message
"Error while fetching dwelling records"
:error-return
{:warnings ["Error while fetching dwelling records"]})))]
(if (:warnings records) records {:records records}))))))
(defn
@ -426,18 +446,22 @@
(some
#{:email :phone :name :dwelling_id :id :gender}
(keys params))
(support/do-or-log-error
(db/search-strings-electors db/*db* params)
:message
"Error while searching elector records"
:error-return
{:warnings ["Error while searching elector records"]})
(support/do-or-log-error
(db/list-electors db/*db* {})
:message
"Error while fetching elector records"
:error-return
{:warnings ["Error while fetching elector records"]}))]
(do
(log/debug (db/search-strings-electors-sqlvec params))
(support/do-or-log-error
(db/search-strings-electors db/*db* params)
:message
"Error while searching elector records"
:error-return
{:warnings ["Error while searching elector records"]}))
(do
(log/debug (db/list-electors-sqlvec params))
(support/do-or-log-error
(db/list-electors db/*db* {})
:message
"Error while fetching elector records"
:error-return
{:warnings ["Error while fetching elector records"]})))]
(if (:warnings records) records {:records records}))))))
(defn
@ -548,18 +572,22 @@
(some
#{:date :name :time :teams :cancelled :decription :id}
(keys params))
(support/do-or-log-error
(db/search-strings-events db/*db* params)
:message
"Error while searching event records"
:error-return
{:warnings ["Error while searching event records"]})
(support/do-or-log-error
(db/list-events db/*db* {})
:message
"Error while fetching event records"
:error-return
{:warnings ["Error while fetching event records"]}))]
(do
(log/debug (db/search-strings-events-sqlvec params))
(support/do-or-log-error
(db/search-strings-events db/*db* params)
:message
"Error while searching event records"
:error-return
{:warnings ["Error while searching event records"]}))
(do
(log/debug (db/list-events-sqlvec params))
(support/do-or-log-error
(db/list-events db/*db* {})
:message
"Error while fetching event records"
:error-return
{:warnings ["Error while fetching event records"]})))]
(if (:warnings records) records {:records records}))))))
(defn
@ -583,18 +611,23 @@
(some
#{:closed :date :id :notes :request_id :actor}
(keys params))
(support/do-or-log-error
(db/search-strings-followupactions db/*db* params)
:message
"Error while searching followupaction records"
:error-return
{:warnings ["Error while searching followupaction records"]})
(support/do-or-log-error
(db/list-followupactions db/*db* {})
:message
"Error while fetching followupaction records"
:error-return
{:warnings ["Error while fetching followupaction records"]}))]
(do
(log/debug (db/search-strings-followupactions-sqlvec params))
(support/do-or-log-error
(db/search-strings-followupactions db/*db* params)
:message
"Error while searching followupaction records"
:error-return
{:warnings ["Error while searching followupaction records"]}))
(do
(log/debug (db/list-followupactions-sqlvec params))
(support/do-or-log-error
(db/list-followupactions db/*db* {})
:message
"Error while fetching followupaction records"
:error-return
{:warnings
["Error while fetching followupaction records"]})))]
(if (:warnings records) records {:records records}))))))
(defn
@ -669,18 +702,23 @@
[records
(if
(some #{:id} (keys params))
(support/do-or-log-error
(db/search-strings-followupmethods db/*db* params)
:message
"Error while searching followupmethod records"
:error-return
{:warnings ["Error while searching followupmethod records"]})
(support/do-or-log-error
(db/list-followupmethods db/*db* {})
:message
"Error while fetching followupmethod records"
:error-return
{:warnings ["Error while fetching followupmethod records"]}))]
(do
(log/debug (db/search-strings-followupmethods-sqlvec params))
(support/do-or-log-error
(db/search-strings-followupmethods db/*db* params)
:message
"Error while searching followupmethod records"
:error-return
{:warnings ["Error while searching followupmethod records"]}))
(do
(log/debug (db/list-followupmethods-sqlvec params))
(support/do-or-log-error
(db/list-followupmethods db/*db* {})
:message
"Error while fetching followupmethod records"
:error-return
{:warnings
["Error while fetching followupmethod records"]})))]
(if (:warnings records) records {:records records}))))))
(defn
@ -730,18 +768,24 @@
(some
#{:issue_id :visit_id :elector_id :id :method_id}
(keys params))
(support/do-or-log-error
(db/search-strings-followuprequests db/*db* params)
:message
"Error while searching followuprequest records"
:error-return
{:warnings ["Error while searching followuprequest records"]})
(support/do-or-log-error
(db/list-followuprequests db/*db* {})
:message
"Error while fetching followuprequest records"
:error-return
{:warnings ["Error while fetching followuprequest records"]}))]
(do
(log/debug (db/search-strings-followuprequests-sqlvec params))
(support/do-or-log-error
(db/search-strings-followuprequests db/*db* params)
:message
"Error while searching followuprequest records"
:error-return
{:warnings
["Error while searching followuprequest records"]}))
(do
(log/debug (db/list-followuprequests-sqlvec params))
(support/do-or-log-error
(db/list-followuprequests db/*db* {})
:message
"Error while fetching followuprequest records"
:error-return
{:warnings
["Error while fetching followuprequest records"]})))]
(if (:warnings records) records {:records records}))))))
(defn
@ -843,18 +887,22 @@
[records
(if
(some #{:id} (keys params))
(support/do-or-log-error
(db/search-strings-genders db/*db* params)
:message
"Error while searching gender records"
:error-return
{:warnings ["Error while searching gender records"]})
(support/do-or-log-error
(db/list-genders db/*db* {})
:message
"Error while fetching gender records"
:error-return
{:warnings ["Error while fetching gender records"]}))]
(do
(log/debug (db/search-strings-genders-sqlvec params))
(support/do-or-log-error
(db/search-strings-genders db/*db* params)
:message
"Error while searching gender records"
:error-return
{:warnings ["Error while searching gender records"]}))
(do
(log/debug (db/list-genders-sqlvec params))
(support/do-or-log-error
(db/list-genders db/*db* {})
:message
"Error while fetching gender records"
:error-return
{:warnings ["Error while fetching gender records"]})))]
(if (:warnings records) records {:records records}))))))
(defn
@ -902,18 +950,22 @@
(some
#{:locality :option_id :visit_id :elector_id :id}
(keys params))
(support/do-or-log-error
(db/search-strings-intentions db/*db* params)
:message
"Error while searching intention records"
:error-return
{:warnings ["Error while searching intention records"]})
(support/do-or-log-error
(db/list-intentions db/*db* {})
:message
"Error while fetching intention records"
:error-return
{:warnings ["Error while fetching intention records"]}))]
(do
(log/debug (db/search-strings-intentions-sqlvec params))
(support/do-or-log-error
(db/search-strings-intentions db/*db* params)
:message
"Error while searching intention records"
:error-return
{:warnings ["Error while searching intention records"]}))
(do
(log/debug (db/list-intentions-sqlvec params))
(support/do-or-log-error
(db/list-intentions db/*db* {})
:message
"Error while fetching intention records"
:error-return
{:warnings ["Error while fetching intention records"]})))]
(if (:warnings records) records {:records records}))))))
(defn
@ -999,18 +1051,22 @@
[records
(if
(some #{:experts :brief :id :current :url} (keys params))
(support/do-or-log-error
(db/search-strings-issues db/*db* params)
:message
"Error while searching issue records"
:error-return
{:warnings ["Error while searching issue records"]})
(support/do-or-log-error
(db/list-issues db/*db* {})
:message
"Error while fetching issue records"
:error-return
{:warnings ["Error while fetching issue records"]}))]
(do
(log/debug (db/search-strings-issues-sqlvec params))
(support/do-or-log-error
(db/search-strings-issues db/*db* params)
:message
"Error while searching issue records"
:error-return
{:warnings ["Error while searching issue records"]}))
(do
(log/debug (db/list-issues-sqlvec params))
(support/do-or-log-error
(db/list-issues db/*db* {})
:message
"Error while fetching issue records"
:error-return
{:warnings ["Error while fetching issue records"]})))]
(if (:warnings records) records {:records records}))))))
(defn
@ -1067,18 +1123,22 @@
[records
(if
(some #{:id} (keys params))
(support/do-or-log-error
(db/search-strings-options db/*db* params)
:message
"Error while searching option records"
:error-return
{:warnings ["Error while searching option records"]})
(support/do-or-log-error
(db/list-options db/*db* {})
:message
"Error while fetching option records"
:error-return
{:warnings ["Error while fetching option records"]}))]
(do
(log/debug (db/search-strings-options-sqlvec params))
(support/do-or-log-error
(db/search-strings-options db/*db* params)
:message
"Error while searching option records"
:error-return
{:warnings ["Error while searching option records"]}))
(do
(log/debug (db/list-options-sqlvec params))
(support/do-or-log-error
(db/list-options db/*db* {})
:message
"Error while fetching option records"
:error-return
{:warnings ["Error while fetching option records"]})))]
(if (:warnings records) records {:records records}))))))
(defn
@ -1124,18 +1184,22 @@
[records
(if
(some #{:name :id :members} (keys params))
(support/do-or-log-error
(db/search-strings-roles db/*db* params)
:message
"Error while searching role records"
:error-return
{:warnings ["Error while searching role records"]})
(support/do-or-log-error
(db/list-roles db/*db* {})
:message
"Error while fetching role records"
:error-return
{:warnings ["Error while fetching role records"]}))]
(do
(log/debug (db/search-strings-roles-sqlvec params))
(support/do-or-log-error
(db/search-strings-roles db/*db* params)
:message
"Error while searching role records"
:error-return
{:warnings ["Error while searching role records"]}))
(do
(log/debug (db/list-roles-sqlvec params))
(support/do-or-log-error
(db/list-roles db/*db* {})
:message
"Error while fetching role records"
:error-return
{:warnings ["Error while fetching role records"]})))]
(if (:warnings records) records {:records records}))))))
(defn
@ -1194,18 +1258,22 @@
#{:name :organisers :longitude :district_id :id :latitude
:members}
(keys params))
(support/do-or-log-error
(db/search-strings-teams db/*db* params)
:message
"Error while searching team records"
:error-return
{:warnings ["Error while searching team records"]})
(support/do-or-log-error
(db/list-teams db/*db* {})
:message
"Error while fetching team records"
:error-return
{:warnings ["Error while fetching team records"]}))]
(do
(log/debug (db/search-strings-teams-sqlvec params))
(support/do-or-log-error
(db/search-strings-teams db/*db* params)
:message
"Error while searching team records"
:error-return
{:warnings ["Error while searching team records"]}))
(do
(log/debug (db/list-teams-sqlvec params))
(support/do-or-log-error
(db/list-teams db/*db* {})
:message
"Error while fetching team records"
:error-return
{:warnings ["Error while fetching team records"]})))]
(if (:warnings records) records {:records records}))))))
(defn
@ -1284,18 +1352,22 @@
[records
(if
(some #{:canvasser_id :date :id :address_id} (keys params))
(support/do-or-log-error
(db/search-strings-visits db/*db* params)
:message
"Error while searching visit records"
:error-return
{:warnings ["Error while searching visit records"]})
(support/do-or-log-error
(db/list-visits db/*db* {})
:message
"Error while fetching visit records"
:error-return
{:warnings ["Error while fetching visit records"]}))]
(do
(log/debug (db/search-strings-visits-sqlvec params))
(support/do-or-log-error
(db/search-strings-visits db/*db* params)
:message
"Error while searching visit records"
:error-return
{:warnings ["Error while searching visit records"]}))
(do
(log/debug (db/list-visits-sqlvec params))
(support/do-or-log-error
(db/list-visits db/*db* {})
:message
"Error while fetching visit records"
:error-return
{:warnings ["Error while fetching visit records"]})))]
(if (:warnings records) records {:records records}))))))
(defn

View file

@ -1,6 +1,6 @@
(ns
youyesyet.routes.auto-json
"JSON routes for youyesyet auto-generated by [Application Description Language framework](https://github.com/simon-brooke/adl) at 20180715T113634.964Z"
"JSON routes for youyesyet auto-generated by [Application Description Language framework](https://github.com/simon-brooke/adl) at 20180715T195944.782Z"
(:require
[adl-support.core :as support]
[clojure.core.memoize :as memo]

View file

@ -48,11 +48,6 @@
(if (.exists motd) (slurp motd) "")))
(defn app-page [request]
(layout/render "app.html" {:title "Canvasser app"
:user (:user (:session request))}))
(defn about-page []
(layout/render "about.html" {} {:title
(str "About " (:site-title env))
@ -126,11 +121,6 @@
:authorities (db-core/list-authorities db-core/*db*)}))))
(defn handle-logout
[request]
(dissoc (response/found "home") :user :roles))
(defroutes home-routes
(GET "/" [] (home-page))
(GET "/home" [] (home-page))
@ -139,10 +129,7 @@
(POST "/call-me" request (call-me-page request))
(GET "/login" request (login-page request))
(POST "/login" request (login-page request))
(GET "/logout" request (handle-logout request))
(GET "/notyet" [] (layout/render "notyet.html" {}
{:title "Can we persuade you?"}))
(GET "/supporter" [] (layout/render "supporter.html" {}
{:title "Have you signed up as a canvasser yet?"}))
;; TODO: this should move somewhere else but I'm not sure where yet
(GET "/app" [request] (route/restricted (app-page request))))
{:title "Have you signed up as a canvasser yet?"})))

View file

@ -0,0 +1,127 @@
(ns ^{:doc "Routes/pages available to authenticated users."
:author "Simon Brooke"} youyesyet.routes.logged-in
(:require [adl-support.core :as support]
[adl-support.utils :refer [safe-name]]
[clojure.java.io :as io]
[clojure.string :as s]
[clojure.tools.logging :as log]
[clojure.walk :refer [keywordize-keys]]
[markdown.core :refer [md-to-html-string]]
[noir.util.route :as route]
[ring.util.http-response :as response]
[youyesyet.config :refer [env]]
[youyesyet.db.core :as db]
[youyesyet.layout :as layout]
[youyesyet.oauth :as oauth]
[compojure.core :refer [defroutes GET POST]]
))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;; youyesyet.routes.logged-in: routes and pages for authenticated users.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU General Public License
;;;; as published by the Free Software Foundation; either version 2
;;;; of the License, or (at your option) any later version.
;;;;
;;;; This program is distributed in the hope that it will be useful,
;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;;;; GNU General Public License for more details.
;;;;
;;;; You should have received a copy of the GNU General Public License
;;;; along with this program; if not, write to the Free Software
;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
;;;; USA.
;;;;
;;;; Copyright (C) 2016 Simon Brooke for Radical Independence Campaign
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defn app-page [request]
(layout/render "app.html"
(:session request)
{:title "Canvasser app"}))
(defn profile-page [request]
"Show the canvassers form for the current user, only."
(let [record (-> request :session :user)]
(layout/render
"auto/form-canvassers-Canvasser.html"
(:session request)
{:title (str "Profile for " (-> request :session :user :fullname))
:record record
:elector_id
(flatten
(remove
nil?
(list
(support/do-or-log-error
(db/get-elector db/*db* {:id (:elector_id record)})
:message
"Error while fetching elector record {:id (:elector_id record)}")
(support/do-or-log-error
(db/list-electors db/*db*)
:message
"Error while fetching elector list")))),
:address_id
(flatten
(remove
nil?
(list
(support/do-or-log-error
(db/get-address db/*db* {:id (:address_id record)})
:message
"Error while fetching address record {:id (:address_id record)}")
(support/do-or-log-error
(db/list-addresses db/*db*)
:message
"Error while fetching address list")))),
:authority_id
(flatten
(remove
nil?
(list
(support/do-or-log-error
(db/get-authority db/*db* {:id (:authority_id record)})
:message
"Error while fetching authority record {:id (:authority_id record)}")
(support/do-or-log-error
(db/list-authorities db/*db*)
:message
"Error while fetching authority list")))),
:roles
(flatten
(remove
nil?
(list
nil
(support/do-or-log-error
(db/list-roles db/*db*)
:message
"Error while fetching role list")))),
:expertise
(flatten
(remove
nil?
(list
nil
(support/do-or-log-error
(db/list-issues db/*db*)
:message
"Error while fetching issue list"))))})))
(defn handle-logout
[request]
(dissoc (response/found "home") :user :roles))
(defroutes logged-in-routes
(GET "/logout" request (handle-logout request))
(GET "/profile" request (route/restricted (profile-page request)))
(GET "/app" [request] (route/restricted (app-page request)))
)

View file

@ -55,7 +55,7 @@
(defn canvassers-page
[request]
(layout/render "roles/canvasser.html" request {}))
(layout/render "roles/canvasser.html" (:session request) {}))
(defn team-organisers-page