User profile page working.
This commit is contained in:
parent
b65223198c
commit
ab568365ef
|
@ -1,7 +1,7 @@
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
-- File queries.sql
|
-- 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
|
-- See [Application Description
|
||||||
-- Language](https://github.com/simon-brooke/adl).
|
-- Language](https://github.com/simon-brooke/adl).
|
||||||
|
@ -814,52 +814,52 @@ ORDER BY lv_visits.address_id,
|
||||||
lv_visits.date,
|
lv_visits.date,
|
||||||
lv_visits.id
|
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
|
-- :doc selects existing address records having any string field matching the parameter of the same name by substring match
|
||||||
SELECT DISTINCT * FROM lv_addresses
|
SELECT DISTINCT * FROM lv_addresses
|
||||||
WHERE false
|
WHERE false
|
||||||
--~ (if (:address params) "OR address LIKE '%:address%'")
|
--~ (if (:address params) (str "OR address LIKE '%" (:address params) "%'"))
|
||||||
--~ (if (:postcode params) "OR postcode LIKE '%:postcode%'")
|
--~ (if (:postcode params) (str "OR postcode = :postcode"))
|
||||||
--~ (if (:phone params) "OR phone LIKE '%:phone%'")
|
--~ (if (:phone params) (str "OR phone LIKE '%" (:phone params) "%'"))
|
||||||
--~ (if (:district_id params) "OR district_id = :district_id")
|
--~ (if (:district_id params) (str "OR district_id_expanded LIKE '%" (:district_id params) "%'"))
|
||||||
--~ (if (:latitude params) "OR latitude = :latitude")
|
--~ (if (:latitude params) (str "OR latitude = :latitude"))
|
||||||
--~ (if (:longitude params) "OR longitude = :longitude")
|
--~ (if (:longitude params) (str "OR longitude = :longitude"))
|
||||||
--~ (if (:locality params) "OR locality = :locality")
|
--~ (if (:locality params) (str "OR locality = :locality"))
|
||||||
--~ (if (:id params) "OR id = :id")
|
--~ (if (:id params) (str "OR id = :id"))
|
||||||
ORDER BY lv_addresses.address,
|
ORDER BY lv_addresses.address,
|
||||||
lv_addresses.postcode,
|
lv_addresses.postcode,
|
||||||
lv_addresses.id
|
lv_addresses.id
|
||||||
--~ (if (:offset params) "OFFSET :offset ")
|
--~ (if (:offset params) "OFFSET :offset ")
|
||||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
--~ (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
|
-- :doc selects existing authority records having any string field matching the parameter of the same name by substring match
|
||||||
SELECT DISTINCT * FROM lv_authorities
|
SELECT DISTINCT * FROM lv_authorities
|
||||||
WHERE false
|
WHERE false
|
||||||
--~ (if (:request-token-uri params) "OR request_token_uri LIKE '%:request-token-uri%'")
|
--~ (if (:request-token-uri params) (str "OR request_token_uri LIKE '%" (:request-token-uri params) "%'"))
|
||||||
--~ (if (:access-token-uri params) "OR access_token_uri LIKE '%:access-token-uri%'")
|
--~ (if (:access-token-uri params) (str "OR access_token_uri LIKE '%" (:access-token-uri params) "%'"))
|
||||||
--~ (if (:authorize-uri params) "OR authorize_uri LIKE '%:authorize-uri%'")
|
--~ (if (:authorize-uri params) (str "OR authorize_uri LIKE '%" (:authorize-uri params) "%'"))
|
||||||
--~ (if (:consumer-key params) "OR consumer_key LIKE '%:consumer-key%'")
|
--~ (if (:consumer-key params) (str "OR consumer_key LIKE '%" (:consumer-key params) "%'"))
|
||||||
--~ (if (:consumer-secret params) "OR consumer_secret LIKE '%:consumer-secret%'")
|
--~ (if (:consumer-secret params) (str "OR consumer_secret LIKE '%" (:consumer-secret params) "%'"))
|
||||||
--~ (if (:id params) "OR id LIKE '%:id%'")
|
--~ (if (:id params) (str "OR id LIKE '%" (:id params) "%'"))
|
||||||
--~ (if (:offset params) "OFFSET :offset ")
|
--~ (if (:offset params) "OFFSET :offset ")
|
||||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
--~ (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
|
-- :doc selects existing canvasser records having any string field matching the parameter of the same name by substring match
|
||||||
SELECT DISTINCT * FROM lv_canvassers
|
SELECT DISTINCT * FROM lv_canvassers
|
||||||
WHERE false
|
WHERE false
|
||||||
--~ (if (:username params) "OR username LIKE '%:username%'")
|
--~ (if (:username params) (str "OR username LIKE '%" (:username params) "%'"))
|
||||||
--~ (if (:fullname params) "OR fullname LIKE '%:fullname%'")
|
--~ (if (:fullname params) (str "OR fullname LIKE '%" (:fullname params) "%'"))
|
||||||
--~ (if (:avatar params) "OR avatar = :avatar")
|
--~ (if (:avatar params) (str "OR avatar = :avatar"))
|
||||||
--~ (if (:bio params) "OR bio LIKE '%:bio%'")
|
--~ (if (:bio params) (str "OR bio LIKE '%" (:bio params) "%'"))
|
||||||
--~ (if (:elector_id params) "OR elector_id = :elector_id")
|
--~ (if (:elector_id params) (str "OR elector_id_expanded LIKE '%" (:elector_id params) "%'"))
|
||||||
--~ (if (:address_id params) "OR address_id = :address_id")
|
--~ (if (:address_id params) (str "OR address_id_expanded LIKE '%" (:address_id params) "%'"))
|
||||||
--~ (if (:phone params) "OR phone LIKE '%:phone%'")
|
--~ (if (:phone params) (str "OR phone LIKE '%" (:phone params) "%'"))
|
||||||
--~ (if (:email params) "OR email LIKE '%:email%'")
|
--~ (if (:email params) (str "OR email LIKE '%" (:email params) "%'"))
|
||||||
--~ (if (:authority_id params) "OR authority_id LIKE '%:authority_id%'")
|
--~ (if (:authority_id params) (str "OR authority_id_expanded LIKE '%" (:authority_id params) "%'"))
|
||||||
--~ (if (:authorised params) "OR authorised = :authorised")
|
--~ (if (:authorised params) (str "OR authorised = :authorised"))
|
||||||
--~ (if (:id params) "OR id = :id")
|
--~ (if (:id params) (str "OR id = :id"))
|
||||||
ORDER BY lv_canvassers.username,
|
ORDER BY lv_canvassers.username,
|
||||||
lv_canvassers.fullname,
|
lv_canvassers.fullname,
|
||||||
lv_canvassers.address_id,
|
lv_canvassers.address_id,
|
||||||
|
@ -869,55 +869,55 @@ ORDER BY lv_canvassers.username,
|
||||||
--~ (if (:offset params) "OFFSET :offset ")
|
--~ (if (:offset params) "OFFSET :offset ")
|
||||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
--~ (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
|
-- :doc selects existing district records having any string field matching the parameter of the same name by substring match
|
||||||
SELECT DISTINCT * FROM lv_districts
|
SELECT DISTINCT * FROM lv_districts
|
||||||
WHERE false
|
WHERE false
|
||||||
--~ (if (:name params) "OR name LIKE '%:name%'")
|
--~ (if (:name params) (str "OR name LIKE '%" (:name params) "%'"))
|
||||||
--~ (if (:id params) "OR id = :id")
|
--~ (if (:id params) (str "OR id = :id"))
|
||||||
ORDER BY lv_districts.name,
|
ORDER BY lv_districts.name,
|
||||||
lv_districts.id
|
lv_districts.id
|
||||||
--~ (if (:offset params) "OFFSET :offset ")
|
--~ (if (:offset params) "OFFSET :offset ")
|
||||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
--~ (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
|
-- :doc selects existing dwelling records having any string field matching the parameter of the same name by substring match
|
||||||
SELECT DISTINCT * FROM lv_dwellings
|
SELECT DISTINCT * FROM lv_dwellings
|
||||||
WHERE false
|
WHERE false
|
||||||
--~ (if (:address_id params) "OR address_id = :address_id")
|
--~ (if (:address_id params) (str "OR address_id_expanded LIKE '%" (:address_id params) "%'"))
|
||||||
--~ (if (:sub-address params) "OR sub_address LIKE '%:sub-address%'")
|
--~ (if (:sub-address params) (str "OR sub_address LIKE '%" (:sub-address params) "%'"))
|
||||||
--~ (if (:id params) "OR id = :id")
|
--~ (if (:id params) (str "OR id = :id"))
|
||||||
ORDER BY lv_dwellings.address_id,
|
ORDER BY lv_dwellings.address_id,
|
||||||
lv_dwellings.sub_address,
|
lv_dwellings.sub_address,
|
||||||
lv_dwellings.id
|
lv_dwellings.id
|
||||||
--~ (if (:offset params) "OFFSET :offset ")
|
--~ (if (:offset params) "OFFSET :offset ")
|
||||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
--~ (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
|
-- :doc selects existing elector records having any string field matching the parameter of the same name by substring match
|
||||||
SELECT DISTINCT * FROM lv_electors
|
SELECT DISTINCT * FROM lv_electors
|
||||||
WHERE false
|
WHERE false
|
||||||
--~ (if (:name params) "OR name LIKE '%:name%'")
|
--~ (if (:name params) (str "OR name LIKE '%" (:name params) "%'"))
|
||||||
--~ (if (:dwelling_id params) "OR dwelling_id = :dwelling_id")
|
--~ (if (:dwelling_id params) (str "OR dwelling_id_expanded LIKE '%" (:dwelling_id params) "%'"))
|
||||||
--~ (if (:phone params) "OR phone LIKE '%:phone%'")
|
--~ (if (:phone params) (str "OR phone LIKE '%" (:phone params) "%'"))
|
||||||
--~ (if (:email params) "OR email LIKE '%:email%'")
|
--~ (if (:email params) (str "OR email LIKE '%" (:email params) "%'"))
|
||||||
--~ (if (:gender params) "OR gender LIKE '%:gender%'")
|
--~ (if (:gender params) (str "OR gender_expanded LIKE '%" (:gender params) "%'"))
|
||||||
--~ (if (:id params) "OR id = :id")
|
--~ (if (:id params) (str "OR id = :id"))
|
||||||
ORDER BY lv_electors.name,
|
ORDER BY lv_electors.name,
|
||||||
lv_electors.id
|
lv_electors.id
|
||||||
--~ (if (:offset params) "OFFSET :offset ")
|
--~ (if (:offset params) "OFFSET :offset ")
|
||||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
--~ (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
|
-- :doc selects existing event records having any string field matching the parameter of the same name by substring match
|
||||||
SELECT DISTINCT * FROM lv_events
|
SELECT DISTINCT * FROM lv_events
|
||||||
WHERE false
|
WHERE false
|
||||||
--~ (if (:name params) "OR name LIKE '%:name%'")
|
--~ (if (:name params) (str "OR name LIKE '%" (:name params) "%'"))
|
||||||
--~ (if (:date params) "OR date = ':date'")
|
--~ (if (:date params) (str "OR date = ':date'"))
|
||||||
--~ (if (:time params) "OR time = ':time'")
|
--~ (if (:time params) (str "OR time = ':time'"))
|
||||||
--~ (if (:decription params) "OR decription LIKE '%:decription%'")
|
--~ (if (:decription params) (str "OR decription LIKE '%" (:decription params) "%'"))
|
||||||
--~ (if (:cancelled params) "OR cancelled = :cancelled")
|
--~ (if (:cancelled params) (str "OR cancelled = :cancelled"))
|
||||||
--~ (if (:id params) "OR id = :id")
|
--~ (if (:id params) (str "OR id = :id"))
|
||||||
ORDER BY lv_events.name,
|
ORDER BY lv_events.name,
|
||||||
lv_events.date,
|
lv_events.date,
|
||||||
lv_events.time,
|
lv_events.time,
|
||||||
|
@ -925,39 +925,39 @@ ORDER BY lv_events.name,
|
||||||
--~ (if (:offset params) "OFFSET :offset ")
|
--~ (if (:offset params) "OFFSET :offset ")
|
||||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
--~ (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
|
-- :doc selects existing followupaction records having any string field matching the parameter of the same name by substring match
|
||||||
SELECT DISTINCT * FROM lv_followupactions
|
SELECT DISTINCT * FROM lv_followupactions
|
||||||
WHERE false
|
WHERE false
|
||||||
--~ (if (:request_id params) "OR request_id = :request_id")
|
--~ (if (:request_id params) (str "OR request_id_expanded LIKE '%" (:request_id params) "%'"))
|
||||||
--~ (if (:actor params) "OR actor = :actor")
|
--~ (if (:actor params) (str "OR actor_expanded LIKE '%" (:actor params) "%'"))
|
||||||
--~ (if (:date params) "OR date = ':date'")
|
--~ (if (:date params) (str "OR date = ':date'"))
|
||||||
--~ (if (:notes params) "OR notes LIKE '%:notes%'")
|
--~ (if (:notes params) (str "OR notes LIKE '%" (:notes params) "%'"))
|
||||||
--~ (if (:closed params) "OR closed = :closed")
|
--~ (if (:closed params) (str "OR closed = :closed"))
|
||||||
--~ (if (:id params) "OR id = :id")
|
--~ (if (:id params) (str "OR id = :id"))
|
||||||
ORDER BY lv_followupactions.date,
|
ORDER BY lv_followupactions.date,
|
||||||
lv_followupactions.notes,
|
lv_followupactions.notes,
|
||||||
lv_followupactions.id
|
lv_followupactions.id
|
||||||
--~ (if (:offset params) "OFFSET :offset ")
|
--~ (if (:offset params) "OFFSET :offset ")
|
||||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
--~ (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
|
-- :doc selects existing followupmethod records having any string field matching the parameter of the same name by substring match
|
||||||
SELECT DISTINCT * FROM lv_followupmethods
|
SELECT DISTINCT * FROM lv_followupmethods
|
||||||
WHERE false
|
WHERE false
|
||||||
--~ (if (:id params) "OR id LIKE '%:id%'")
|
--~ (if (:id params) (str "OR id LIKE '%" (:id params) "%'"))
|
||||||
--~ (if (:offset params) "OFFSET :offset ")
|
--~ (if (:offset params) "OFFSET :offset ")
|
||||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
--~ (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
|
-- :doc selects existing followuprequest records having any string field matching the parameter of the same name by substring match
|
||||||
SELECT DISTINCT * FROM lv_followuprequests
|
SELECT DISTINCT * FROM lv_followuprequests
|
||||||
WHERE false
|
WHERE false
|
||||||
--~ (if (:elector_id params) "OR elector_id = :elector_id")
|
--~ (if (:elector_id params) (str "OR elector_id_expanded LIKE '%" (:elector_id params) "%'"))
|
||||||
--~ (if (:visit_id params) "OR visit_id = :visit_id")
|
--~ (if (:visit_id params) (str "OR visit_id_expanded LIKE '%" (:visit_id params) "%'"))
|
||||||
--~ (if (:issue_id params) "OR issue_id LIKE '%:issue_id%'")
|
--~ (if (:issue_id params) (str "OR issue_id_expanded LIKE '%" (:issue_id params) "%'"))
|
||||||
--~ (if (:method_id params) "OR method_id LIKE '%:method_id%'")
|
--~ (if (:method_id params) (str "OR method_id_expanded LIKE '%" (:method_id params) "%'"))
|
||||||
--~ (if (:id params) "OR id = :id")
|
--~ (if (:id params) (str "OR id = :id"))
|
||||||
ORDER BY lv_followuprequests.elector_id,
|
ORDER BY lv_followuprequests.elector_id,
|
||||||
lv_followuprequests.visit_id,
|
lv_followuprequests.visit_id,
|
||||||
lv_followuprequests.issue_id,
|
lv_followuprequests.issue_id,
|
||||||
|
@ -965,78 +965,78 @@ ORDER BY lv_followuprequests.elector_id,
|
||||||
--~ (if (:offset params) "OFFSET :offset ")
|
--~ (if (:offset params) "OFFSET :offset ")
|
||||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
--~ (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
|
-- :doc selects existing gender records having any string field matching the parameter of the same name by substring match
|
||||||
SELECT DISTINCT * FROM lv_genders
|
SELECT DISTINCT * FROM lv_genders
|
||||||
WHERE false
|
WHERE false
|
||||||
--~ (if (:id params) "OR id LIKE '%:id%'")
|
--~ (if (:id params) (str "OR id LIKE '%" (:id params) "%'"))
|
||||||
--~ (if (:offset params) "OFFSET :offset ")
|
--~ (if (:offset params) "OFFSET :offset ")
|
||||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
--~ (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
|
-- :doc selects existing intention records having any string field matching the parameter of the same name by substring match
|
||||||
SELECT DISTINCT * FROM lv_intentions
|
SELECT DISTINCT * FROM lv_intentions
|
||||||
WHERE false
|
WHERE false
|
||||||
--~ (if (:visit_id params) "OR visit_id = :visit_id")
|
--~ (if (:visit_id params) (str "OR visit_id_expanded LIKE '%" (:visit_id params) "%'"))
|
||||||
--~ (if (:elector_id params) "OR elector_id = :elector_id")
|
--~ (if (:elector_id params) (str "OR elector_id_expanded LIKE '%" (:elector_id params) "%'"))
|
||||||
--~ (if (:option_id params) "OR option_id LIKE '%:option_id%'")
|
--~ (if (:option_id params) (str "OR option_id_expanded LIKE '%" (:option_id params) "%'"))
|
||||||
--~ (if (:locality params) "OR locality = :locality")
|
--~ (if (:locality params) (str "OR locality = :locality"))
|
||||||
--~ (if (:id params) "OR id = :id")
|
--~ (if (:id params) (str "OR id = :id"))
|
||||||
--~ (if (:offset params) "OFFSET :offset ")
|
--~ (if (:offset params) "OFFSET :offset ")
|
||||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
--~ (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
|
-- :doc selects existing issue records having any string field matching the parameter of the same name by substring match
|
||||||
SELECT DISTINCT * FROM lv_issues
|
SELECT DISTINCT * FROM lv_issues
|
||||||
WHERE false
|
WHERE false
|
||||||
--~ (if (:url params) "OR url LIKE '%:url%'")
|
--~ (if (:url params) (str "OR url LIKE '%" (:url params) "%'"))
|
||||||
--~ (if (:current params) "OR current = :current")
|
--~ (if (:current params) (str "OR current = :current"))
|
||||||
--~ (if (:brief params) "OR brief LIKE '%:brief%'")
|
--~ (if (:brief params) (str "OR brief LIKE '%" (:brief params) "%'"))
|
||||||
--~ (if (:id params) "OR id LIKE '%:id%'")
|
--~ (if (:id params) (str "OR id LIKE '%" (:id params) "%'"))
|
||||||
--~ (if (:offset params) "OFFSET :offset ")
|
--~ (if (:offset params) "OFFSET :offset ")
|
||||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
--~ (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
|
-- :doc selects existing option records having any string field matching the parameter of the same name by substring match
|
||||||
SELECT DISTINCT * FROM lv_options
|
SELECT DISTINCT * FROM lv_options
|
||||||
WHERE false
|
WHERE false
|
||||||
--~ (if (:id params) "OR id LIKE '%:id%'")
|
--~ (if (:id params) (str "OR id LIKE '%" (:id params) "%'"))
|
||||||
--~ (if (:offset params) "OFFSET :offset ")
|
--~ (if (:offset params) "OFFSET :offset ")
|
||||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
--~ (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
|
-- :doc selects existing role records having any string field matching the parameter of the same name by substring match
|
||||||
SELECT DISTINCT * FROM lv_roles
|
SELECT DISTINCT * FROM lv_roles
|
||||||
WHERE false
|
WHERE false
|
||||||
--~ (if (:name params) "OR name LIKE '%:name%'")
|
--~ (if (:name params) (str "OR name LIKE '%" (:name params) "%'"))
|
||||||
--~ (if (:id params) "OR id = :id")
|
--~ (if (:id params) (str "OR id = :id"))
|
||||||
ORDER BY lv_roles.name,
|
ORDER BY lv_roles.name,
|
||||||
lv_roles.id
|
lv_roles.id
|
||||||
--~ (if (:offset params) "OFFSET :offset ")
|
--~ (if (:offset params) "OFFSET :offset ")
|
||||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
--~ (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
|
-- :doc selects existing team records having any string field matching the parameter of the same name by substring match
|
||||||
SELECT DISTINCT * FROM lv_teams
|
SELECT DISTINCT * FROM lv_teams
|
||||||
WHERE false
|
WHERE false
|
||||||
--~ (if (:name params) "OR name LIKE '%:name%'")
|
--~ (if (:name params) (str "OR name LIKE '%" (:name params) "%'"))
|
||||||
--~ (if (:district_id params) "OR district_id = :district_id")
|
--~ (if (:district_id params) (str "OR district_id_expanded LIKE '%" (:district_id params) "%'"))
|
||||||
--~ (if (:latitude params) "OR latitude = :latitude")
|
--~ (if (:latitude params) (str "OR latitude = :latitude"))
|
||||||
--~ (if (:longitude params) "OR longitude = :longitude")
|
--~ (if (:longitude params) (str "OR longitude = :longitude"))
|
||||||
--~ (if (:id params) "OR id = :id")
|
--~ (if (:id params) (str "OR id = :id"))
|
||||||
ORDER BY lv_teams.name,
|
ORDER BY lv_teams.name,
|
||||||
lv_teams.id
|
lv_teams.id
|
||||||
--~ (if (:offset params) "OFFSET :offset ")
|
--~ (if (:offset params) "OFFSET :offset ")
|
||||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
--~ (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
|
-- :doc selects existing visit records having any string field matching the parameter of the same name by substring match
|
||||||
SELECT DISTINCT * FROM lv_visits
|
SELECT DISTINCT * FROM lv_visits
|
||||||
WHERE false
|
WHERE false
|
||||||
--~ (if (:address_id params) "OR address_id = :address_id")
|
--~ (if (:address_id params) (str "OR address_id_expanded LIKE '%" (:address_id params) "%'"))
|
||||||
--~ (if (:canvasser_id params) "OR canvasser_id = :canvasser_id")
|
--~ (if (:canvasser_id params) (str "OR canvasser_id_expanded LIKE '%" (:canvasser_id params) "%'"))
|
||||||
--~ (if (:date params) "OR date = ':date'")
|
--~ (if (:date params) (str "OR date = ':date'"))
|
||||||
--~ (if (:id params) "OR id = :id")
|
--~ (if (:id params) (str "OR id = :id"))
|
||||||
ORDER BY lv_visits.address_id,
|
ORDER BY lv_visits.address_id,
|
||||||
lv_visits.date,
|
lv_visits.date,
|
||||||
lv_visits.id
|
lv_visits.id
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
--
|
--
|
||||||
-- auto-generated by [Application Description Language framework]
|
-- 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
|
-- A web-app intended to be used by canvassers
|
||||||
-- campaigning for a 'Yes' vote in the second independence
|
-- campaigning for a 'Yes' vote in the second independence
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,20 +1,14 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
{% block back-links %}
|
{% block back-links %}
|
||||||
<div>
|
<div>
|
||||||
<div class='back-link-container'>
|
<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'>
|
<a id='prev-selector' class='back-link'>
|
||||||
Previous
|
Previous
|
||||||
</a>
|
</a>
|
||||||
{% endifunequal %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -39,8 +33,8 @@ Add a new Address
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<form id='list-addresses-Addresses' class='list' action='{{servlet-context}}/list-addresses-Addresses' method='POST'>
|
<form id='list-addresses-Addresses' class='list' action='{{servlet-context}}/list-addresses-Addresses' method='POST'>
|
||||||
{% csrf-field %}
|
{% csrf-field %}
|
||||||
<input id='offset' type='hidden' value='{{params.offset|default:0}}'/>
|
<input id='offset' name='offset' type='text' value='{{params.offset|default:0}}'/>
|
||||||
<input id='limit' type='hidden' value='{{params.limit|default:50}}'/>
|
<input id='limit' name='limit' type='text' value='{{params.limit|default:50}}'/>
|
||||||
<table caption='addresses'>
|
<table caption='addresses'>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -83,7 +77,7 @@ Longitude
|
||||||
<input id='phone' type='text' name='phone' value='{{ params.phone }}'/>
|
<input id='phone' type='text' name='phone' value='{{ params.phone }}'/>
|
||||||
</th>
|
</th>
|
||||||
<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>
|
||||||
<th>
|
<th>
|
||||||
<input id='latitude' type='number' name='latitude' value='{{ params.latitude }}'/>
|
<input id='latitude' type='number' name='latitude' value='{{ params.latitude }}'/>
|
||||||
|
@ -143,13 +137,18 @@ View
|
||||||
ow.value='0';
|
ow.value='0';
|
||||||
});
|
});
|
||||||
|
|
||||||
{% ifunequal params.offset "0" %}
|
var prevSelector = document.getElementById('prev-selector');
|
||||||
document.getElementById('prev-selector').addEventListener('click', function () {
|
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));
|
ow.value=(parseInt(ow.value)-parseInt(lw.value));
|
||||||
console.log('Updated offset to ' + ow.value);
|
console.log('Updated offset to ' + ow.value);
|
||||||
form.submit();
|
form.submit();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
{% endifunequal %}
|
}
|
||||||
|
|
||||||
document.getElementById('next-selector').addEventListener('click', function () {
|
document.getElementById('next-selector').addEventListener('click', function () {
|
||||||
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
||||||
|
|
|
@ -1,20 +1,14 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
{% block back-links %}
|
{% block back-links %}
|
||||||
<div>
|
<div>
|
||||||
<div class='back-link-container'>
|
<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'>
|
<a id='prev-selector' class='back-link'>
|
||||||
Previous
|
Previous
|
||||||
</a>
|
</a>
|
||||||
{% endifunequal %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -39,8 +33,8 @@ Add a new Authority
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<form id='list-authorities-Authorities' class='list' action='{{servlet-context}}/list-authorities-Authorities' method='POST'>
|
<form id='list-authorities-Authorities' class='list' action='{{servlet-context}}/list-authorities-Authorities' method='POST'>
|
||||||
{% csrf-field %}
|
{% csrf-field %}
|
||||||
<input id='offset' type='hidden' value='{{params.offset|default:0}}'/>
|
<input id='offset' name='offset' type='text' value='{{params.offset|default:0}}'/>
|
||||||
<input id='limit' type='hidden' value='{{params.limit|default:50}}'/>
|
<input id='limit' name='limit' type='text' value='{{params.limit|default:50}}'/>
|
||||||
<table caption='authorities'>
|
<table caption='authorities'>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -114,13 +108,18 @@ View
|
||||||
ow.value='0';
|
ow.value='0';
|
||||||
});
|
});
|
||||||
|
|
||||||
{% ifunequal params.offset "0" %}
|
var prevSelector = document.getElementById('prev-selector');
|
||||||
document.getElementById('prev-selector').addEventListener('click', function () {
|
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));
|
ow.value=(parseInt(ow.value)-parseInt(lw.value));
|
||||||
console.log('Updated offset to ' + ow.value);
|
console.log('Updated offset to ' + ow.value);
|
||||||
form.submit();
|
form.submit();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
{% endifunequal %}
|
}
|
||||||
|
|
||||||
document.getElementById('next-selector').addEventListener('click', function () {
|
document.getElementById('next-selector').addEventListener('click', function () {
|
||||||
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
||||||
|
|
|
@ -1,20 +1,14 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
{% block back-links %}
|
{% block back-links %}
|
||||||
<div>
|
<div>
|
||||||
<div class='back-link-container'>
|
<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'>
|
<a id='prev-selector' class='back-link'>
|
||||||
Previous
|
Previous
|
||||||
</a>
|
</a>
|
||||||
{% endifunequal %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -39,8 +33,8 @@ Add a new Canvasser
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<form id='list-canvassers-Canvassers' class='list' action='{{servlet-context}}/list-canvassers-Canvassers' method='POST'>
|
<form id='list-canvassers-Canvassers' class='list' action='{{servlet-context}}/list-canvassers-Canvassers' method='POST'>
|
||||||
{% csrf-field %}
|
{% csrf-field %}
|
||||||
<input id='offset' type='hidden' value='{{params.offset|default:0}}'/>
|
<input id='offset' name='offset' type='text' value='{{params.offset|default:0}}'/>
|
||||||
<input id='limit' type='hidden' value='{{params.limit|default:50}}'/>
|
<input id='limit' name='limit' type='text' value='{{params.limit|default:50}}'/>
|
||||||
<table caption='canvassers'>
|
<table caption='canvassers'>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -77,10 +71,10 @@ Authorised
|
||||||
<input id='fullname' type='text' name='fullname' value='{{ params.fullname }}'/>
|
<input id='fullname' type='text' name='fullname' value='{{ params.fullname }}'/>
|
||||||
</th>
|
</th>
|
||||||
<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>
|
||||||
<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>
|
||||||
<th>
|
<th>
|
||||||
<input id='authorised' type='text' name='authorised' value='{{ params.authorised }}'/>
|
<input id='authorised' type='text' name='authorised' value='{{ params.authorised }}'/>
|
||||||
|
@ -136,13 +130,18 @@ View
|
||||||
ow.value='0';
|
ow.value='0';
|
||||||
});
|
});
|
||||||
|
|
||||||
{% ifunequal params.offset "0" %}
|
var prevSelector = document.getElementById('prev-selector');
|
||||||
document.getElementById('prev-selector').addEventListener('click', function () {
|
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));
|
ow.value=(parseInt(ow.value)-parseInt(lw.value));
|
||||||
console.log('Updated offset to ' + ow.value);
|
console.log('Updated offset to ' + ow.value);
|
||||||
form.submit();
|
form.submit();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
{% endifunequal %}
|
}
|
||||||
|
|
||||||
document.getElementById('next-selector').addEventListener('click', function () {
|
document.getElementById('next-selector').addEventListener('click', function () {
|
||||||
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
||||||
|
|
|
@ -1,20 +1,14 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
{% block back-links %}
|
{% block back-links %}
|
||||||
<div>
|
<div>
|
||||||
<div class='back-link-container'>
|
<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'>
|
<a id='prev-selector' class='back-link'>
|
||||||
Previous
|
Previous
|
||||||
</a>
|
</a>
|
||||||
{% endifunequal %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -39,8 +33,8 @@ Add a new District
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<form id='list-districts-Districts' class='list' action='{{servlet-context}}/list-districts-Districts' method='POST'>
|
<form id='list-districts-Districts' class='list' action='{{servlet-context}}/list-districts-Districts' method='POST'>
|
||||||
{% csrf-field %}
|
{% csrf-field %}
|
||||||
<input id='offset' type='hidden' value='{{params.offset|default:0}}'/>
|
<input id='offset' name='offset' type='text' value='{{params.offset|default:0}}'/>
|
||||||
<input id='limit' type='hidden' value='{{params.limit|default:50}}'/>
|
<input id='limit' name='limit' type='text' value='{{params.limit|default:50}}'/>
|
||||||
<table caption='districts'>
|
<table caption='districts'>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -96,13 +90,18 @@ View
|
||||||
ow.value='0';
|
ow.value='0';
|
||||||
});
|
});
|
||||||
|
|
||||||
{% ifunequal params.offset "0" %}
|
var prevSelector = document.getElementById('prev-selector');
|
||||||
document.getElementById('prev-selector').addEventListener('click', function () {
|
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));
|
ow.value=(parseInt(ow.value)-parseInt(lw.value));
|
||||||
console.log('Updated offset to ' + ow.value);
|
console.log('Updated offset to ' + ow.value);
|
||||||
form.submit();
|
form.submit();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
{% endifunequal %}
|
}
|
||||||
|
|
||||||
document.getElementById('next-selector').addEventListener('click', function () {
|
document.getElementById('next-selector').addEventListener('click', function () {
|
||||||
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
||||||
|
|
|
@ -1,20 +1,14 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
{% block back-links %}
|
{% block back-links %}
|
||||||
<div>
|
<div>
|
||||||
<div class='back-link-container'>
|
<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'>
|
<a id='prev-selector' class='back-link'>
|
||||||
Previous
|
Previous
|
||||||
</a>
|
</a>
|
||||||
{% endifunequal %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -39,8 +33,8 @@ Add a new Dwelling
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<form id='list-dwellings-Dwellings' class='list' action='{{servlet-context}}/list-dwellings-Dwellings' method='POST'>
|
<form id='list-dwellings-Dwellings' class='list' action='{{servlet-context}}/list-dwellings-Dwellings' method='POST'>
|
||||||
{% csrf-field %}
|
{% csrf-field %}
|
||||||
<input id='offset' type='hidden' value='{{params.offset|default:0}}'/>
|
<input id='offset' name='offset' type='text' value='{{params.offset|default:0}}'/>
|
||||||
<input id='limit' type='hidden' value='{{params.limit|default:50}}'/>
|
<input id='limit' name='limit' type='text' value='{{params.limit|default:50}}'/>
|
||||||
<table caption='dwellings'>
|
<table caption='dwellings'>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -62,7 +56,7 @@ Sub-address
|
||||||
<input id='id' type='text' name='id' value='{{ params.id }}'/>
|
<input id='id' type='text' name='id' value='{{ params.id }}'/>
|
||||||
</th>
|
</th>
|
||||||
<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>
|
||||||
<th>
|
<th>
|
||||||
<input id='sub_address' type='text' name='sub_address' value='{{ params.sub_address }}'/>
|
<input id='sub_address' type='text' name='sub_address' value='{{ params.sub_address }}'/>
|
||||||
|
@ -107,13 +101,18 @@ View
|
||||||
ow.value='0';
|
ow.value='0';
|
||||||
});
|
});
|
||||||
|
|
||||||
{% ifunequal params.offset "0" %}
|
var prevSelector = document.getElementById('prev-selector');
|
||||||
document.getElementById('prev-selector').addEventListener('click', function () {
|
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));
|
ow.value=(parseInt(ow.value)-parseInt(lw.value));
|
||||||
console.log('Updated offset to ' + ow.value);
|
console.log('Updated offset to ' + ow.value);
|
||||||
form.submit();
|
form.submit();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
{% endifunequal %}
|
}
|
||||||
|
|
||||||
document.getElementById('next-selector').addEventListener('click', function () {
|
document.getElementById('next-selector').addEventListener('click', function () {
|
||||||
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
||||||
|
|
|
@ -1,20 +1,14 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
{% block back-links %}
|
{% block back-links %}
|
||||||
<div>
|
<div>
|
||||||
<div class='back-link-container'>
|
<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'>
|
<a id='prev-selector' class='back-link'>
|
||||||
Previous
|
Previous
|
||||||
</a>
|
</a>
|
||||||
{% endifunequal %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -39,8 +33,8 @@ Add a new Elector
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<form id='list-electors-Electors' class='list' action='{{servlet-context}}/list-electors-Electors' method='POST'>
|
<form id='list-electors-Electors' class='list' action='{{servlet-context}}/list-electors-Electors' method='POST'>
|
||||||
{% csrf-field %}
|
{% csrf-field %}
|
||||||
<input id='offset' type='hidden' value='{{params.offset|default:0}}'/>
|
<input id='offset' name='offset' type='text' value='{{params.offset|default:0}}'/>
|
||||||
<input id='limit' type='hidden' value='{{params.limit|default:50}}'/>
|
<input id='limit' name='limit' type='text' value='{{params.limit|default:50}}'/>
|
||||||
<table caption='electors'>
|
<table caption='electors'>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -74,7 +68,7 @@ Gender
|
||||||
<input id='name' type='text' name='name' value='{{ params.name }}'/>
|
<input id='name' type='text' name='name' value='{{ params.name }}'/>
|
||||||
</th>
|
</th>
|
||||||
<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>
|
||||||
<th>
|
<th>
|
||||||
<input id='phone' type='text' name='phone' value='{{ params.phone }}'/>
|
<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 }}'/>
|
<input id='email' type='text' name='email' value='{{ params.email }}'/>
|
||||||
</th>
|
</th>
|
||||||
<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>
|
||||||
<th>
|
<th>
|
||||||
<input type='submit' id='search-widget' value='Search'/>
|
<input type='submit' id='search-widget' value='Search'/>
|
||||||
|
@ -136,13 +130,18 @@ View
|
||||||
ow.value='0';
|
ow.value='0';
|
||||||
});
|
});
|
||||||
|
|
||||||
{% ifunequal params.offset "0" %}
|
var prevSelector = document.getElementById('prev-selector');
|
||||||
document.getElementById('prev-selector').addEventListener('click', function () {
|
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));
|
ow.value=(parseInt(ow.value)-parseInt(lw.value));
|
||||||
console.log('Updated offset to ' + ow.value);
|
console.log('Updated offset to ' + ow.value);
|
||||||
form.submit();
|
form.submit();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
{% endifunequal %}
|
}
|
||||||
|
|
||||||
document.getElementById('next-selector').addEventListener('click', function () {
|
document.getElementById('next-selector').addEventListener('click', function () {
|
||||||
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
||||||
|
|
|
@ -1,20 +1,14 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
{% block back-links %}
|
{% block back-links %}
|
||||||
<div>
|
<div>
|
||||||
<div class='back-link-container'>
|
<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'>
|
<a id='prev-selector' class='back-link'>
|
||||||
Previous
|
Previous
|
||||||
</a>
|
</a>
|
||||||
{% endifunequal %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -39,8 +33,8 @@ Add a new Event
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<form id='list-events-Events' class='list' action='{{servlet-context}}/list-events-Events' method='POST'>
|
<form id='list-events-Events' class='list' action='{{servlet-context}}/list-events-Events' method='POST'>
|
||||||
{% csrf-field %}
|
{% csrf-field %}
|
||||||
<input id='offset' type='hidden' value='{{params.offset|default:0}}'/>
|
<input id='offset' name='offset' type='text' value='{{params.offset|default:0}}'/>
|
||||||
<input id='limit' type='hidden' value='{{params.limit|default:50}}'/>
|
<input id='limit' name='limit' type='text' value='{{params.limit|default:50}}'/>
|
||||||
<table caption='events'>
|
<table caption='events'>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -132,13 +126,18 @@ View
|
||||||
ow.value='0';
|
ow.value='0';
|
||||||
});
|
});
|
||||||
|
|
||||||
{% ifunequal params.offset "0" %}
|
var prevSelector = document.getElementById('prev-selector');
|
||||||
document.getElementById('prev-selector').addEventListener('click', function () {
|
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));
|
ow.value=(parseInt(ow.value)-parseInt(lw.value));
|
||||||
console.log('Updated offset to ' + ow.value);
|
console.log('Updated offset to ' + ow.value);
|
||||||
form.submit();
|
form.submit();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
{% endifunequal %}
|
}
|
||||||
|
|
||||||
document.getElementById('next-selector').addEventListener('click', function () {
|
document.getElementById('next-selector').addEventListener('click', function () {
|
||||||
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
||||||
|
|
|
@ -1,20 +1,14 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
{% block back-links %}
|
{% block back-links %}
|
||||||
<div>
|
<div>
|
||||||
<div class='back-link-container'>
|
<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'>
|
<a id='prev-selector' class='back-link'>
|
||||||
Previous
|
Previous
|
||||||
</a>
|
</a>
|
||||||
{% endifunequal %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -39,8 +33,8 @@ Add a new Followupaction
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<form id='list-followupactions-Followupactions' class='list' action='{{servlet-context}}/list-followupactions-Followupactions' method='POST'>
|
<form id='list-followupactions-Followupactions' class='list' action='{{servlet-context}}/list-followupactions-Followupactions' method='POST'>
|
||||||
{% csrf-field %}
|
{% csrf-field %}
|
||||||
<input id='offset' type='hidden' value='{{params.offset|default:0}}'/>
|
<input id='offset' name='offset' type='text' value='{{params.offset|default:0}}'/>
|
||||||
<input id='limit' type='hidden' value='{{params.limit|default:50}}'/>
|
<input id='limit' name='limit' type='text' value='{{params.limit|default:50}}'/>
|
||||||
<table caption='followupactions'>
|
<table caption='followupactions'>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -68,10 +62,10 @@ Closed
|
||||||
<input id='id' type='text' name='id' value='{{ params.id }}'/>
|
<input id='id' type='text' name='id' value='{{ params.id }}'/>
|
||||||
</th>
|
</th>
|
||||||
<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>
|
||||||
<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>
|
||||||
<th>
|
<th>
|
||||||
<input id='date' type='date' name='date' value='{{ params.date }}'/>
|
<input id='date' type='date' name='date' value='{{ params.date }}'/>
|
||||||
|
@ -127,13 +121,18 @@ View
|
||||||
ow.value='0';
|
ow.value='0';
|
||||||
});
|
});
|
||||||
|
|
||||||
{% ifunequal params.offset "0" %}
|
var prevSelector = document.getElementById('prev-selector');
|
||||||
document.getElementById('prev-selector').addEventListener('click', function () {
|
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));
|
ow.value=(parseInt(ow.value)-parseInt(lw.value));
|
||||||
console.log('Updated offset to ' + ow.value);
|
console.log('Updated offset to ' + ow.value);
|
||||||
form.submit();
|
form.submit();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
{% endifunequal %}
|
}
|
||||||
|
|
||||||
document.getElementById('next-selector').addEventListener('click', function () {
|
document.getElementById('next-selector').addEventListener('click', function () {
|
||||||
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
||||||
|
|
|
@ -1,20 +1,14 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
{% block back-links %}
|
{% block back-links %}
|
||||||
<div>
|
<div>
|
||||||
<div class='back-link-container'>
|
<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'>
|
<a id='prev-selector' class='back-link'>
|
||||||
Previous
|
Previous
|
||||||
</a>
|
</a>
|
||||||
{% endifunequal %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -39,8 +33,8 @@ Add a new Followupmethod
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<form id='list-followupmethods-Followupmethods' class='list' action='{{servlet-context}}/list-followupmethods-Followupmethods' method='POST'>
|
<form id='list-followupmethods-Followupmethods' class='list' action='{{servlet-context}}/list-followupmethods-Followupmethods' method='POST'>
|
||||||
{% csrf-field %}
|
{% csrf-field %}
|
||||||
<input id='offset' type='hidden' value='{{params.offset|default:0}}'/>
|
<input id='offset' name='offset' type='text' value='{{params.offset|default:0}}'/>
|
||||||
<input id='limit' type='hidden' value='{{params.limit|default:50}}'/>
|
<input id='limit' name='limit' type='text' value='{{params.limit|default:50}}'/>
|
||||||
<table caption='followupmethods'>
|
<table caption='followupmethods'>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -87,13 +81,18 @@ View
|
||||||
ow.value='0';
|
ow.value='0';
|
||||||
});
|
});
|
||||||
|
|
||||||
{% ifunequal params.offset "0" %}
|
var prevSelector = document.getElementById('prev-selector');
|
||||||
document.getElementById('prev-selector').addEventListener('click', function () {
|
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));
|
ow.value=(parseInt(ow.value)-parseInt(lw.value));
|
||||||
console.log('Updated offset to ' + ow.value);
|
console.log('Updated offset to ' + ow.value);
|
||||||
form.submit();
|
form.submit();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
{% endifunequal %}
|
}
|
||||||
|
|
||||||
document.getElementById('next-selector').addEventListener('click', function () {
|
document.getElementById('next-selector').addEventListener('click', function () {
|
||||||
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
||||||
|
|
|
@ -1,20 +1,14 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
{% block back-links %}
|
{% block back-links %}
|
||||||
<div>
|
<div>
|
||||||
<div class='back-link-container'>
|
<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'>
|
<a id='prev-selector' class='back-link'>
|
||||||
Previous
|
Previous
|
||||||
</a>
|
</a>
|
||||||
{% endifunequal %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -39,8 +33,8 @@ Add a new Followuprequest
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<form id='list-followuprequests-Followuprequests' class='list' action='{{servlet-context}}/list-followuprequests-Followuprequests' method='POST'>
|
<form id='list-followuprequests-Followuprequests' class='list' action='{{servlet-context}}/list-followuprequests-Followuprequests' method='POST'>
|
||||||
{% csrf-field %}
|
{% csrf-field %}
|
||||||
<input id='offset' type='hidden' value='{{params.offset|default:0}}'/>
|
<input id='offset' name='offset' type='text' value='{{params.offset|default:0}}'/>
|
||||||
<input id='limit' type='hidden' value='{{params.limit|default:50}}'/>
|
<input id='limit' name='limit' type='text' value='{{params.limit|default:50}}'/>
|
||||||
<table caption='followuprequests'>
|
<table caption='followuprequests'>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -68,16 +62,16 @@ Method_id
|
||||||
<input id='id' type='text' name='id' value='{{ params.id }}'/>
|
<input id='id' type='text' name='id' value='{{ params.id }}'/>
|
||||||
</th>
|
</th>
|
||||||
<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>
|
||||||
<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>
|
||||||
<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>
|
||||||
<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>
|
||||||
<th>
|
<th>
|
||||||
<input type='submit' id='search-widget' value='Search'/>
|
<input type='submit' id='search-widget' value='Search'/>
|
||||||
|
@ -131,13 +125,18 @@ View
|
||||||
ow.value='0';
|
ow.value='0';
|
||||||
});
|
});
|
||||||
|
|
||||||
{% ifunequal params.offset "0" %}
|
var prevSelector = document.getElementById('prev-selector');
|
||||||
document.getElementById('prev-selector').addEventListener('click', function () {
|
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));
|
ow.value=(parseInt(ow.value)-parseInt(lw.value));
|
||||||
console.log('Updated offset to ' + ow.value);
|
console.log('Updated offset to ' + ow.value);
|
||||||
form.submit();
|
form.submit();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
{% endifunequal %}
|
}
|
||||||
|
|
||||||
document.getElementById('next-selector').addEventListener('click', function () {
|
document.getElementById('next-selector').addEventListener('click', function () {
|
||||||
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
||||||
|
|
|
@ -1,20 +1,14 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
{% block back-links %}
|
{% block back-links %}
|
||||||
<div>
|
<div>
|
||||||
<div class='back-link-container'>
|
<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'>
|
<a id='prev-selector' class='back-link'>
|
||||||
Previous
|
Previous
|
||||||
</a>
|
</a>
|
||||||
{% endifunequal %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -39,8 +33,8 @@ Add a new Gender
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<form id='list-genders-Genders' class='list' action='{{servlet-context}}/list-genders-Genders' method='POST'>
|
<form id='list-genders-Genders' class='list' action='{{servlet-context}}/list-genders-Genders' method='POST'>
|
||||||
{% csrf-field %}
|
{% csrf-field %}
|
||||||
<input id='offset' type='hidden' value='{{params.offset|default:0}}'/>
|
<input id='offset' name='offset' type='text' value='{{params.offset|default:0}}'/>
|
||||||
<input id='limit' type='hidden' value='{{params.limit|default:50}}'/>
|
<input id='limit' name='limit' type='text' value='{{params.limit|default:50}}'/>
|
||||||
<table caption='genders'>
|
<table caption='genders'>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -87,13 +81,18 @@ View
|
||||||
ow.value='0';
|
ow.value='0';
|
||||||
});
|
});
|
||||||
|
|
||||||
{% ifunequal params.offset "0" %}
|
var prevSelector = document.getElementById('prev-selector');
|
||||||
document.getElementById('prev-selector').addEventListener('click', function () {
|
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));
|
ow.value=(parseInt(ow.value)-parseInt(lw.value));
|
||||||
console.log('Updated offset to ' + ow.value);
|
console.log('Updated offset to ' + ow.value);
|
||||||
form.submit();
|
form.submit();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
{% endifunequal %}
|
}
|
||||||
|
|
||||||
document.getElementById('next-selector').addEventListener('click', function () {
|
document.getElementById('next-selector').addEventListener('click', function () {
|
||||||
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
||||||
|
|
|
@ -1,20 +1,14 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
{% block back-links %}
|
{% block back-links %}
|
||||||
<div>
|
<div>
|
||||||
<div class='back-link-container'>
|
<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'>
|
<a id='prev-selector' class='back-link'>
|
||||||
Previous
|
Previous
|
||||||
</a>
|
</a>
|
||||||
{% endifunequal %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -39,8 +33,8 @@ Add a new Intention
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<form id='list-intentions-Intentions' class='list' action='{{servlet-context}}/list-intentions-Intentions' method='POST'>
|
<form id='list-intentions-Intentions' class='list' action='{{servlet-context}}/list-intentions-Intentions' method='POST'>
|
||||||
{% csrf-field %}
|
{% csrf-field %}
|
||||||
<input id='offset' type='hidden' value='{{params.offset|default:0}}'/>
|
<input id='offset' name='offset' type='text' value='{{params.offset|default:0}}'/>
|
||||||
<input id='limit' type='hidden' value='{{params.limit|default:50}}'/>
|
<input id='limit' name='limit' type='text' value='{{params.limit|default:50}}'/>
|
||||||
<table caption='intentions'>
|
<table caption='intentions'>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -62,13 +56,13 @@ Locality
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<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>
|
||||||
<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>
|
||||||
<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>
|
||||||
<th>
|
<th>
|
||||||
<input id='locality' type='number' name='locality' value='{{ params.locality }}'/>
|
<input id='locality' type='number' name='locality' value='{{ params.locality }}'/>
|
||||||
|
@ -120,13 +114,18 @@ View
|
||||||
ow.value='0';
|
ow.value='0';
|
||||||
});
|
});
|
||||||
|
|
||||||
{% ifunequal params.offset "0" %}
|
var prevSelector = document.getElementById('prev-selector');
|
||||||
document.getElementById('prev-selector').addEventListener('click', function () {
|
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));
|
ow.value=(parseInt(ow.value)-parseInt(lw.value));
|
||||||
console.log('Updated offset to ' + ow.value);
|
console.log('Updated offset to ' + ow.value);
|
||||||
form.submit();
|
form.submit();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
{% endifunequal %}
|
}
|
||||||
|
|
||||||
document.getElementById('next-selector').addEventListener('click', function () {
|
document.getElementById('next-selector').addEventListener('click', function () {
|
||||||
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
||||||
|
|
|
@ -1,20 +1,14 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
{% block back-links %}
|
{% block back-links %}
|
||||||
<div>
|
<div>
|
||||||
<div class='back-link-container'>
|
<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'>
|
<a id='prev-selector' class='back-link'>
|
||||||
Previous
|
Previous
|
||||||
</a>
|
</a>
|
||||||
{% endifunequal %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -39,8 +33,8 @@ Add a new Issue
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<form id='list-issues-Issues' class='list' action='{{servlet-context}}/list-issues-Issues' method='POST'>
|
<form id='list-issues-Issues' class='list' action='{{servlet-context}}/list-issues-Issues' method='POST'>
|
||||||
{% csrf-field %}
|
{% csrf-field %}
|
||||||
<input id='offset' type='hidden' value='{{params.offset|default:0}}'/>
|
<input id='offset' name='offset' type='text' value='{{params.offset|default:0}}'/>
|
||||||
<input id='limit' type='hidden' value='{{params.limit|default:50}}'/>
|
<input id='limit' name='limit' type='text' value='{{params.limit|default:50}}'/>
|
||||||
<table caption='issues'>
|
<table caption='issues'>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -114,13 +108,18 @@ View
|
||||||
ow.value='0';
|
ow.value='0';
|
||||||
});
|
});
|
||||||
|
|
||||||
{% ifunequal params.offset "0" %}
|
var prevSelector = document.getElementById('prev-selector');
|
||||||
document.getElementById('prev-selector').addEventListener('click', function () {
|
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));
|
ow.value=(parseInt(ow.value)-parseInt(lw.value));
|
||||||
console.log('Updated offset to ' + ow.value);
|
console.log('Updated offset to ' + ow.value);
|
||||||
form.submit();
|
form.submit();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
{% endifunequal %}
|
}
|
||||||
|
|
||||||
document.getElementById('next-selector').addEventListener('click', function () {
|
document.getElementById('next-selector').addEventListener('click', function () {
|
||||||
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
||||||
|
|
|
@ -1,20 +1,14 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
{% block back-links %}
|
{% block back-links %}
|
||||||
<div>
|
<div>
|
||||||
<div class='back-link-container'>
|
<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'>
|
<a id='prev-selector' class='back-link'>
|
||||||
Previous
|
Previous
|
||||||
</a>
|
</a>
|
||||||
{% endifunequal %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -39,8 +33,8 @@ Add a new Option
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<form id='list-options-Options' class='list' action='{{servlet-context}}/list-options-Options' method='POST'>
|
<form id='list-options-Options' class='list' action='{{servlet-context}}/list-options-Options' method='POST'>
|
||||||
{% csrf-field %}
|
{% csrf-field %}
|
||||||
<input id='offset' type='hidden' value='{{params.offset|default:0}}'/>
|
<input id='offset' name='offset' type='text' value='{{params.offset|default:0}}'/>
|
||||||
<input id='limit' type='hidden' value='{{params.limit|default:50}}'/>
|
<input id='limit' name='limit' type='text' value='{{params.limit|default:50}}'/>
|
||||||
<table caption='options'>
|
<table caption='options'>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -87,13 +81,18 @@ View
|
||||||
ow.value='0';
|
ow.value='0';
|
||||||
});
|
});
|
||||||
|
|
||||||
{% ifunequal params.offset "0" %}
|
var prevSelector = document.getElementById('prev-selector');
|
||||||
document.getElementById('prev-selector').addEventListener('click', function () {
|
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));
|
ow.value=(parseInt(ow.value)-parseInt(lw.value));
|
||||||
console.log('Updated offset to ' + ow.value);
|
console.log('Updated offset to ' + ow.value);
|
||||||
form.submit();
|
form.submit();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
{% endifunequal %}
|
}
|
||||||
|
|
||||||
document.getElementById('next-selector').addEventListener('click', function () {
|
document.getElementById('next-selector').addEventListener('click', function () {
|
||||||
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
||||||
|
|
|
@ -1,20 +1,14 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
{% block back-links %}
|
{% block back-links %}
|
||||||
<div>
|
<div>
|
||||||
<div class='back-link-container'>
|
<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'>
|
<a id='prev-selector' class='back-link'>
|
||||||
Previous
|
Previous
|
||||||
</a>
|
</a>
|
||||||
{% endifunequal %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -39,8 +33,8 @@ Add a new Role
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<form id='list-roles-Roles' class='list' action='{{servlet-context}}/list-roles-Roles' method='POST'>
|
<form id='list-roles-Roles' class='list' action='{{servlet-context}}/list-roles-Roles' method='POST'>
|
||||||
{% csrf-field %}
|
{% csrf-field %}
|
||||||
<input id='offset' type='hidden' value='{{params.offset|default:0}}'/>
|
<input id='offset' name='offset' type='text' value='{{params.offset|default:0}}'/>
|
||||||
<input id='limit' type='hidden' value='{{params.limit|default:50}}'/>
|
<input id='limit' name='limit' type='text' value='{{params.limit|default:50}}'/>
|
||||||
<table caption='roles'>
|
<table caption='roles'>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -96,13 +90,18 @@ View
|
||||||
ow.value='0';
|
ow.value='0';
|
||||||
});
|
});
|
||||||
|
|
||||||
{% ifunequal params.offset "0" %}
|
var prevSelector = document.getElementById('prev-selector');
|
||||||
document.getElementById('prev-selector').addEventListener('click', function () {
|
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));
|
ow.value=(parseInt(ow.value)-parseInt(lw.value));
|
||||||
console.log('Updated offset to ' + ow.value);
|
console.log('Updated offset to ' + ow.value);
|
||||||
form.submit();
|
form.submit();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
{% endifunequal %}
|
}
|
||||||
|
|
||||||
document.getElementById('next-selector').addEventListener('click', function () {
|
document.getElementById('next-selector').addEventListener('click', function () {
|
||||||
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
||||||
|
|
|
@ -1,20 +1,14 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
{% block back-links %}
|
{% block back-links %}
|
||||||
<div>
|
<div>
|
||||||
<div class='back-link-container'>
|
<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'>
|
<a id='prev-selector' class='back-link'>
|
||||||
Previous
|
Previous
|
||||||
</a>
|
</a>
|
||||||
{% endifunequal %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -39,8 +33,8 @@ Add a new Team
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<form id='list-teams-Teams' class='list' action='{{servlet-context}}/list-teams-Teams' method='POST'>
|
<form id='list-teams-Teams' class='list' action='{{servlet-context}}/list-teams-Teams' method='POST'>
|
||||||
{% csrf-field %}
|
{% csrf-field %}
|
||||||
<input id='offset' type='hidden' value='{{params.offset|default:0}}'/>
|
<input id='offset' name='offset' type='text' value='{{params.offset|default:0}}'/>
|
||||||
<input id='limit' type='hidden' value='{{params.limit|default:50}}'/>
|
<input id='limit' name='limit' type='text' value='{{params.limit|default:50}}'/>
|
||||||
<table caption='teams'>
|
<table caption='teams'>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -71,7 +65,7 @@ Longitude
|
||||||
<input id='name' type='text' name='name' value='{{ params.name }}'/>
|
<input id='name' type='text' name='name' value='{{ params.name }}'/>
|
||||||
</th>
|
</th>
|
||||||
<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>
|
||||||
<th>
|
<th>
|
||||||
<input id='latitude' type='number' name='latitude' value='{{ params.latitude }}'/>
|
<input id='latitude' type='number' name='latitude' value='{{ params.latitude }}'/>
|
||||||
|
@ -125,13 +119,18 @@ View
|
||||||
ow.value='0';
|
ow.value='0';
|
||||||
});
|
});
|
||||||
|
|
||||||
{% ifunequal params.offset "0" %}
|
var prevSelector = document.getElementById('prev-selector');
|
||||||
document.getElementById('prev-selector').addEventListener('click', function () {
|
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));
|
ow.value=(parseInt(ow.value)-parseInt(lw.value));
|
||||||
console.log('Updated offset to ' + ow.value);
|
console.log('Updated offset to ' + ow.value);
|
||||||
form.submit();
|
form.submit();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
{% endifunequal %}
|
}
|
||||||
|
|
||||||
document.getElementById('next-selector').addEventListener('click', function () {
|
document.getElementById('next-selector').addEventListener('click', function () {
|
||||||
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
||||||
|
|
|
@ -1,20 +1,14 @@
|
||||||
{% extends "base.html" %}
|
{% 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).-->
|
See [Application Description Language](https://github.com/simon-brooke/adl).-->
|
||||||
|
|
||||||
|
|
||||||
{% block back-links %}
|
{% block back-links %}
|
||||||
<div>
|
<div>
|
||||||
<div class='back-link-container'>
|
<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'>
|
<a id='prev-selector' class='back-link'>
|
||||||
Previous
|
Previous
|
||||||
</a>
|
</a>
|
||||||
{% endifunequal %}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -39,8 +33,8 @@ Add a new Visit
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<form id='list-visits-Visits' class='list' action='{{servlet-context}}/list-visits-Visits' method='POST'>
|
<form id='list-visits-Visits' class='list' action='{{servlet-context}}/list-visits-Visits' method='POST'>
|
||||||
{% csrf-field %}
|
{% csrf-field %}
|
||||||
<input id='offset' type='hidden' value='{{params.offset|default:0}}'/>
|
<input id='offset' name='offset' type='text' value='{{params.offset|default:0}}'/>
|
||||||
<input id='limit' type='hidden' value='{{params.limit|default:50}}'/>
|
<input id='limit' name='limit' type='text' value='{{params.limit|default:50}}'/>
|
||||||
<table caption='visits'>
|
<table caption='visits'>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -65,10 +59,10 @@ Date
|
||||||
<input id='id' type='text' name='id' value='{{ params.id }}'/>
|
<input id='id' type='text' name='id' value='{{ params.id }}'/>
|
||||||
</th>
|
</th>
|
||||||
<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>
|
||||||
<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>
|
||||||
<th>
|
<th>
|
||||||
<input id='date' type='date' name='date' value='{{ params.date }}'/>
|
<input id='date' type='date' name='date' value='{{ params.date }}'/>
|
||||||
|
@ -118,13 +112,18 @@ View
|
||||||
ow.value='0';
|
ow.value='0';
|
||||||
});
|
});
|
||||||
|
|
||||||
{% ifunequal params.offset "0" %}
|
var prevSelector = document.getElementById('prev-selector');
|
||||||
document.getElementById('prev-selector').addEventListener('click', function () {
|
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));
|
ow.value=(parseInt(ow.value)-parseInt(lw.value));
|
||||||
console.log('Updated offset to ' + ow.value);
|
console.log('Updated offset to ' + ow.value);
|
||||||
form.submit();
|
form.submit();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
{% endifunequal %}
|
}
|
||||||
|
|
||||||
document.getElementById('next-selector').addEventListener('click', function () {
|
document.getElementById('next-selector').addEventListener('click', function () {
|
||||||
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
ow.value=(parseInt(ow.value)+parseInt(lw.value));
|
||||||
|
|
|
@ -58,7 +58,7 @@
|
||||||
<!-- big-links: put any main navigation links into this block -->
|
<!-- big-links: put any main navigation links into this block -->
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
<div if="#content">
|
<div id="content">
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<!-- content: put your main page content into this block -->
|
<!-- content: put your main page content into this block -->
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
[cheshire.core :refer [generate-string parse-string]]
|
[cheshire.core :refer [generate-string parse-string]]
|
||||||
[clojure.java.jdbc :as jdbc]
|
[clojure.java.jdbc :as jdbc]
|
||||||
[conman.core :as conman]
|
[conman.core :as conman]
|
||||||
|
[hugsql.core :as hugsql]
|
||||||
[mount.core :refer [defstate]]
|
[mount.core :refer [defstate]]
|
||||||
[youyesyet.config :refer [env]])
|
[youyesyet.config :refer [env]])
|
||||||
(:import org.postgresql.util.PGobject
|
(:import org.postgresql.util.PGobject
|
||||||
|
@ -23,6 +24,7 @@
|
||||||
:stop (conman/disconnect! *db*))
|
:stop (conman/disconnect! *db*))
|
||||||
|
|
||||||
(conman/bind-connection *db* "sql/queries.auto.sql" "sql/queries.sql")
|
(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]
|
(defn to-date [^java.sql.Date sql-date]
|
||||||
(-> sql-date (.getTime) (java.util.Date.)))
|
(-> sql-date (.getTime) (java.util.Date.)))
|
||||||
|
|
|
@ -13,8 +13,9 @@
|
||||||
[youyesyet.routes.auto :refer [auto-selmer-routes]]
|
[youyesyet.routes.auto :refer [auto-selmer-routes]]
|
||||||
[youyesyet.routes.auto-json :refer [auto-rest-routes]]
|
[youyesyet.routes.auto-json :refer [auto-rest-routes]]
|
||||||
[youyesyet.routes.issue-experts :refer [issue-expert-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.oauth :refer [oauth-routes]]
|
||||||
|
[youyesyet.routes.rest :refer [rest-routes]]
|
||||||
[youyesyet.routes.roles :refer [roles-routes]]
|
[youyesyet.routes.roles :refer [roles-routes]]
|
||||||
[youyesyet.routes.services :refer [service-routes]]
|
[youyesyet.routes.services :refer [service-routes]]
|
||||||
[youyesyet.env :refer [defaults]]))
|
[youyesyet.env :refer [defaults]]))
|
||||||
|
@ -70,6 +71,9 @@
|
||||||
(-> #'home-routes
|
(-> #'home-routes
|
||||||
(wrap-routes middleware/wrap-csrf)
|
(wrap-routes middleware/wrap-csrf)
|
||||||
(wrap-routes middleware/wrap-formats))
|
(wrap-routes middleware/wrap-formats))
|
||||||
|
(-> #'logged-in-routes
|
||||||
|
(wrap-routes middleware/wrap-csrf)
|
||||||
|
(wrap-routes middleware/wrap-formats))
|
||||||
(-> #'roles-routes
|
(-> #'roles-routes
|
||||||
(wrap-routes middleware/wrap-csrf)
|
(wrap-routes middleware/wrap-csrf)
|
||||||
(wrap-routes middleware/wrap-formats))
|
(wrap-routes middleware/wrap-formats))
|
||||||
|
|
|
@ -68,18 +68,18 @@
|
||||||
;; than me so there's almost certainly a reason it doesn't.
|
;; than me so there's almost certainly a reason it doesn't.
|
||||||
[template session & [params]]
|
[template session & [params]]
|
||||||
(let [user (:user session)]
|
(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
|
(content-type
|
||||||
(ok
|
(ok
|
||||||
(parser/render-file
|
(parser/render-file
|
||||||
template
|
template
|
||||||
(assoc params
|
(merge params
|
||||||
:page template
|
{:page template
|
||||||
:csrf-token *anti-forgery-token*
|
:csrf-token *anti-forgery-token*
|
||||||
:user user
|
:user user
|
||||||
:user-roles (get-user-roles user)
|
:user-roles (get-user-roles user)
|
||||||
:site-title (:site-title env)
|
:site-title (:site-title env)
|
||||||
:version (System/getProperty "youyesyet.version"))))
|
:version (System/getProperty "youyesyet.version")})))
|
||||||
"text/html; charset=utf-8")))
|
"text/html; charset=utf-8")))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
(ns
|
(ns
|
||||||
youyesyet.routes.auto
|
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
|
(:require
|
||||||
[adl-support.core :as support]
|
[adl-support.core :as support]
|
||||||
[clojure.java.io :as io]
|
[clojure.java.io :as io]
|
||||||
|
@ -45,18 +45,22 @@
|
||||||
#{:locality :address :phone :postcode :longitude :district_id
|
#{:locality :address :phone :postcode :longitude :district_id
|
||||||
:id :latitude}
|
:id :latitude}
|
||||||
(keys params))
|
(keys params))
|
||||||
|
(do
|
||||||
|
(log/debug (db/search-strings-addresses-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/search-strings-addresses db/*db* params)
|
(db/search-strings-addresses db/*db* params)
|
||||||
:message
|
:message
|
||||||
"Error while searching address records"
|
"Error while searching address records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while searching address records"]})
|
{:warnings ["Error while searching address records"]}))
|
||||||
|
(do
|
||||||
|
(log/debug (db/list-addresses-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/list-addresses db/*db* {})
|
(db/list-addresses db/*db* {})
|
||||||
:message
|
:message
|
||||||
"Error while fetching address records"
|
"Error while fetching address records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while fetching address records"]}))]
|
{:warnings ["Error while fetching address records"]})))]
|
||||||
(if (:warnings records) records {:records records}))))))
|
(if (:warnings records) records {:records records}))))))
|
||||||
|
|
||||||
(defn
|
(defn
|
||||||
|
@ -119,18 +123,22 @@
|
||||||
#{:access-token-uri :request-token-uri :authorize-uri :id
|
#{:access-token-uri :request-token-uri :authorize-uri :id
|
||||||
:consumer-secret :consumer-key}
|
:consumer-secret :consumer-key}
|
||||||
(keys params))
|
(keys params))
|
||||||
|
(do
|
||||||
|
(log/debug (db/search-strings-authorities-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/search-strings-authorities db/*db* params)
|
(db/search-strings-authorities db/*db* params)
|
||||||
:message
|
:message
|
||||||
"Error while searching authority records"
|
"Error while searching authority records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while searching authority records"]})
|
{:warnings ["Error while searching authority records"]}))
|
||||||
|
(do
|
||||||
|
(log/debug (db/list-authorities-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/list-authorities db/*db* {})
|
(db/list-authorities db/*db* {})
|
||||||
:message
|
:message
|
||||||
"Error while fetching authority records"
|
"Error while fetching authority records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while fetching authority records"]}))]
|
{:warnings ["Error while fetching authority records"]})))]
|
||||||
(if (:warnings records) records {:records records}))))))
|
(if (:warnings records) records {:records records}))))))
|
||||||
|
|
||||||
(defn
|
(defn
|
||||||
|
@ -179,18 +187,22 @@
|
||||||
#{:email :phone :roles :username :fullname :bio :elector_id
|
#{:email :phone :roles :username :fullname :bio :elector_id
|
||||||
:expertise :id :avatar :address_id :authority_id :authorised}
|
:expertise :id :avatar :address_id :authority_id :authorised}
|
||||||
(keys params))
|
(keys params))
|
||||||
|
(do
|
||||||
|
(log/debug (db/search-strings-canvassers-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/search-strings-canvassers db/*db* params)
|
(db/search-strings-canvassers db/*db* params)
|
||||||
:message
|
:message
|
||||||
"Error while searching canvasser records"
|
"Error while searching canvasser records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while searching canvasser records"]})
|
{:warnings ["Error while searching canvasser records"]}))
|
||||||
|
(do
|
||||||
|
(log/debug (db/list-canvassers-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/list-canvassers db/*db* {})
|
(db/list-canvassers db/*db* {})
|
||||||
:message
|
:message
|
||||||
"Error while fetching canvasser records"
|
"Error while fetching canvasser records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while fetching canvasser records"]}))]
|
{:warnings ["Error while fetching canvasser records"]})))]
|
||||||
(if (:warnings records) records {:records records}))))))
|
(if (:warnings records) records {:records records}))))))
|
||||||
|
|
||||||
(defn
|
(defn
|
||||||
|
@ -296,18 +308,22 @@
|
||||||
[records
|
[records
|
||||||
(if
|
(if
|
||||||
(some #{:name :id} (keys params))
|
(some #{:name :id} (keys params))
|
||||||
|
(do
|
||||||
|
(log/debug (db/search-strings-districts-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/search-strings-districts db/*db* params)
|
(db/search-strings-districts db/*db* params)
|
||||||
:message
|
:message
|
||||||
"Error while searching district records"
|
"Error while searching district records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while searching district records"]})
|
{:warnings ["Error while searching district records"]}))
|
||||||
|
(do
|
||||||
|
(log/debug (db/list-districts-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/list-districts db/*db* {})
|
(db/list-districts db/*db* {})
|
||||||
:message
|
:message
|
||||||
"Error while fetching district records"
|
"Error while fetching district records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while fetching district records"]}))]
|
{:warnings ["Error while fetching district records"]})))]
|
||||||
(if (:warnings records) records {:records records}))))))
|
(if (:warnings records) records {:records records}))))))
|
||||||
|
|
||||||
(defn
|
(defn
|
||||||
|
@ -353,18 +369,22 @@
|
||||||
[records
|
[records
|
||||||
(if
|
(if
|
||||||
(some #{:id :address_id :sub-address} (keys params))
|
(some #{:id :address_id :sub-address} (keys params))
|
||||||
|
(do
|
||||||
|
(log/debug (db/search-strings-dwellings-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/search-strings-dwellings db/*db* params)
|
(db/search-strings-dwellings db/*db* params)
|
||||||
:message
|
:message
|
||||||
"Error while searching dwelling records"
|
"Error while searching dwelling records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while searching dwelling records"]})
|
{:warnings ["Error while searching dwelling records"]}))
|
||||||
|
(do
|
||||||
|
(log/debug (db/list-dwellings-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/list-dwellings db/*db* {})
|
(db/list-dwellings db/*db* {})
|
||||||
:message
|
:message
|
||||||
"Error while fetching dwelling records"
|
"Error while fetching dwelling records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while fetching dwelling records"]}))]
|
{:warnings ["Error while fetching dwelling records"]})))]
|
||||||
(if (:warnings records) records {:records records}))))))
|
(if (:warnings records) records {:records records}))))))
|
||||||
|
|
||||||
(defn
|
(defn
|
||||||
|
@ -426,18 +446,22 @@
|
||||||
(some
|
(some
|
||||||
#{:email :phone :name :dwelling_id :id :gender}
|
#{:email :phone :name :dwelling_id :id :gender}
|
||||||
(keys params))
|
(keys params))
|
||||||
|
(do
|
||||||
|
(log/debug (db/search-strings-electors-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/search-strings-electors db/*db* params)
|
(db/search-strings-electors db/*db* params)
|
||||||
:message
|
:message
|
||||||
"Error while searching elector records"
|
"Error while searching elector records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while searching elector records"]})
|
{:warnings ["Error while searching elector records"]}))
|
||||||
|
(do
|
||||||
|
(log/debug (db/list-electors-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/list-electors db/*db* {})
|
(db/list-electors db/*db* {})
|
||||||
:message
|
:message
|
||||||
"Error while fetching elector records"
|
"Error while fetching elector records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while fetching elector records"]}))]
|
{:warnings ["Error while fetching elector records"]})))]
|
||||||
(if (:warnings records) records {:records records}))))))
|
(if (:warnings records) records {:records records}))))))
|
||||||
|
|
||||||
(defn
|
(defn
|
||||||
|
@ -548,18 +572,22 @@
|
||||||
(some
|
(some
|
||||||
#{:date :name :time :teams :cancelled :decription :id}
|
#{:date :name :time :teams :cancelled :decription :id}
|
||||||
(keys params))
|
(keys params))
|
||||||
|
(do
|
||||||
|
(log/debug (db/search-strings-events-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/search-strings-events db/*db* params)
|
(db/search-strings-events db/*db* params)
|
||||||
:message
|
:message
|
||||||
"Error while searching event records"
|
"Error while searching event records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while searching event records"]})
|
{:warnings ["Error while searching event records"]}))
|
||||||
|
(do
|
||||||
|
(log/debug (db/list-events-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/list-events db/*db* {})
|
(db/list-events db/*db* {})
|
||||||
:message
|
:message
|
||||||
"Error while fetching event records"
|
"Error while fetching event records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while fetching event records"]}))]
|
{:warnings ["Error while fetching event records"]})))]
|
||||||
(if (:warnings records) records {:records records}))))))
|
(if (:warnings records) records {:records records}))))))
|
||||||
|
|
||||||
(defn
|
(defn
|
||||||
|
@ -583,18 +611,23 @@
|
||||||
(some
|
(some
|
||||||
#{:closed :date :id :notes :request_id :actor}
|
#{:closed :date :id :notes :request_id :actor}
|
||||||
(keys params))
|
(keys params))
|
||||||
|
(do
|
||||||
|
(log/debug (db/search-strings-followupactions-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/search-strings-followupactions db/*db* params)
|
(db/search-strings-followupactions db/*db* params)
|
||||||
:message
|
:message
|
||||||
"Error while searching followupaction records"
|
"Error while searching followupaction records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while searching followupaction records"]})
|
{:warnings ["Error while searching followupaction records"]}))
|
||||||
|
(do
|
||||||
|
(log/debug (db/list-followupactions-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/list-followupactions db/*db* {})
|
(db/list-followupactions db/*db* {})
|
||||||
:message
|
:message
|
||||||
"Error while fetching followupaction records"
|
"Error while fetching followupaction records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while fetching followupaction records"]}))]
|
{:warnings
|
||||||
|
["Error while fetching followupaction records"]})))]
|
||||||
(if (:warnings records) records {:records records}))))))
|
(if (:warnings records) records {:records records}))))))
|
||||||
|
|
||||||
(defn
|
(defn
|
||||||
|
@ -669,18 +702,23 @@
|
||||||
[records
|
[records
|
||||||
(if
|
(if
|
||||||
(some #{:id} (keys params))
|
(some #{:id} (keys params))
|
||||||
|
(do
|
||||||
|
(log/debug (db/search-strings-followupmethods-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/search-strings-followupmethods db/*db* params)
|
(db/search-strings-followupmethods db/*db* params)
|
||||||
:message
|
:message
|
||||||
"Error while searching followupmethod records"
|
"Error while searching followupmethod records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while searching followupmethod records"]})
|
{:warnings ["Error while searching followupmethod records"]}))
|
||||||
|
(do
|
||||||
|
(log/debug (db/list-followupmethods-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/list-followupmethods db/*db* {})
|
(db/list-followupmethods db/*db* {})
|
||||||
:message
|
:message
|
||||||
"Error while fetching followupmethod records"
|
"Error while fetching followupmethod records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while fetching followupmethod records"]}))]
|
{:warnings
|
||||||
|
["Error while fetching followupmethod records"]})))]
|
||||||
(if (:warnings records) records {:records records}))))))
|
(if (:warnings records) records {:records records}))))))
|
||||||
|
|
||||||
(defn
|
(defn
|
||||||
|
@ -730,18 +768,24 @@
|
||||||
(some
|
(some
|
||||||
#{:issue_id :visit_id :elector_id :id :method_id}
|
#{:issue_id :visit_id :elector_id :id :method_id}
|
||||||
(keys params))
|
(keys params))
|
||||||
|
(do
|
||||||
|
(log/debug (db/search-strings-followuprequests-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/search-strings-followuprequests db/*db* params)
|
(db/search-strings-followuprequests db/*db* params)
|
||||||
:message
|
:message
|
||||||
"Error while searching followuprequest records"
|
"Error while searching followuprequest records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while searching followuprequest records"]})
|
{:warnings
|
||||||
|
["Error while searching followuprequest records"]}))
|
||||||
|
(do
|
||||||
|
(log/debug (db/list-followuprequests-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/list-followuprequests db/*db* {})
|
(db/list-followuprequests db/*db* {})
|
||||||
:message
|
:message
|
||||||
"Error while fetching followuprequest records"
|
"Error while fetching followuprequest records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while fetching followuprequest records"]}))]
|
{:warnings
|
||||||
|
["Error while fetching followuprequest records"]})))]
|
||||||
(if (:warnings records) records {:records records}))))))
|
(if (:warnings records) records {:records records}))))))
|
||||||
|
|
||||||
(defn
|
(defn
|
||||||
|
@ -843,18 +887,22 @@
|
||||||
[records
|
[records
|
||||||
(if
|
(if
|
||||||
(some #{:id} (keys params))
|
(some #{:id} (keys params))
|
||||||
|
(do
|
||||||
|
(log/debug (db/search-strings-genders-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/search-strings-genders db/*db* params)
|
(db/search-strings-genders db/*db* params)
|
||||||
:message
|
:message
|
||||||
"Error while searching gender records"
|
"Error while searching gender records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while searching gender records"]})
|
{:warnings ["Error while searching gender records"]}))
|
||||||
|
(do
|
||||||
|
(log/debug (db/list-genders-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/list-genders db/*db* {})
|
(db/list-genders db/*db* {})
|
||||||
:message
|
:message
|
||||||
"Error while fetching gender records"
|
"Error while fetching gender records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while fetching gender records"]}))]
|
{:warnings ["Error while fetching gender records"]})))]
|
||||||
(if (:warnings records) records {:records records}))))))
|
(if (:warnings records) records {:records records}))))))
|
||||||
|
|
||||||
(defn
|
(defn
|
||||||
|
@ -902,18 +950,22 @@
|
||||||
(some
|
(some
|
||||||
#{:locality :option_id :visit_id :elector_id :id}
|
#{:locality :option_id :visit_id :elector_id :id}
|
||||||
(keys params))
|
(keys params))
|
||||||
|
(do
|
||||||
|
(log/debug (db/search-strings-intentions-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/search-strings-intentions db/*db* params)
|
(db/search-strings-intentions db/*db* params)
|
||||||
:message
|
:message
|
||||||
"Error while searching intention records"
|
"Error while searching intention records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while searching intention records"]})
|
{:warnings ["Error while searching intention records"]}))
|
||||||
|
(do
|
||||||
|
(log/debug (db/list-intentions-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/list-intentions db/*db* {})
|
(db/list-intentions db/*db* {})
|
||||||
:message
|
:message
|
||||||
"Error while fetching intention records"
|
"Error while fetching intention records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while fetching intention records"]}))]
|
{:warnings ["Error while fetching intention records"]})))]
|
||||||
(if (:warnings records) records {:records records}))))))
|
(if (:warnings records) records {:records records}))))))
|
||||||
|
|
||||||
(defn
|
(defn
|
||||||
|
@ -999,18 +1051,22 @@
|
||||||
[records
|
[records
|
||||||
(if
|
(if
|
||||||
(some #{:experts :brief :id :current :url} (keys params))
|
(some #{:experts :brief :id :current :url} (keys params))
|
||||||
|
(do
|
||||||
|
(log/debug (db/search-strings-issues-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/search-strings-issues db/*db* params)
|
(db/search-strings-issues db/*db* params)
|
||||||
:message
|
:message
|
||||||
"Error while searching issue records"
|
"Error while searching issue records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while searching issue records"]})
|
{:warnings ["Error while searching issue records"]}))
|
||||||
|
(do
|
||||||
|
(log/debug (db/list-issues-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/list-issues db/*db* {})
|
(db/list-issues db/*db* {})
|
||||||
:message
|
:message
|
||||||
"Error while fetching issue records"
|
"Error while fetching issue records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while fetching issue records"]}))]
|
{:warnings ["Error while fetching issue records"]})))]
|
||||||
(if (:warnings records) records {:records records}))))))
|
(if (:warnings records) records {:records records}))))))
|
||||||
|
|
||||||
(defn
|
(defn
|
||||||
|
@ -1067,18 +1123,22 @@
|
||||||
[records
|
[records
|
||||||
(if
|
(if
|
||||||
(some #{:id} (keys params))
|
(some #{:id} (keys params))
|
||||||
|
(do
|
||||||
|
(log/debug (db/search-strings-options-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/search-strings-options db/*db* params)
|
(db/search-strings-options db/*db* params)
|
||||||
:message
|
:message
|
||||||
"Error while searching option records"
|
"Error while searching option records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while searching option records"]})
|
{:warnings ["Error while searching option records"]}))
|
||||||
|
(do
|
||||||
|
(log/debug (db/list-options-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/list-options db/*db* {})
|
(db/list-options db/*db* {})
|
||||||
:message
|
:message
|
||||||
"Error while fetching option records"
|
"Error while fetching option records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while fetching option records"]}))]
|
{:warnings ["Error while fetching option records"]})))]
|
||||||
(if (:warnings records) records {:records records}))))))
|
(if (:warnings records) records {:records records}))))))
|
||||||
|
|
||||||
(defn
|
(defn
|
||||||
|
@ -1124,18 +1184,22 @@
|
||||||
[records
|
[records
|
||||||
(if
|
(if
|
||||||
(some #{:name :id :members} (keys params))
|
(some #{:name :id :members} (keys params))
|
||||||
|
(do
|
||||||
|
(log/debug (db/search-strings-roles-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/search-strings-roles db/*db* params)
|
(db/search-strings-roles db/*db* params)
|
||||||
:message
|
:message
|
||||||
"Error while searching role records"
|
"Error while searching role records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while searching role records"]})
|
{:warnings ["Error while searching role records"]}))
|
||||||
|
(do
|
||||||
|
(log/debug (db/list-roles-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/list-roles db/*db* {})
|
(db/list-roles db/*db* {})
|
||||||
:message
|
:message
|
||||||
"Error while fetching role records"
|
"Error while fetching role records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while fetching role records"]}))]
|
{:warnings ["Error while fetching role records"]})))]
|
||||||
(if (:warnings records) records {:records records}))))))
|
(if (:warnings records) records {:records records}))))))
|
||||||
|
|
||||||
(defn
|
(defn
|
||||||
|
@ -1194,18 +1258,22 @@
|
||||||
#{:name :organisers :longitude :district_id :id :latitude
|
#{:name :organisers :longitude :district_id :id :latitude
|
||||||
:members}
|
:members}
|
||||||
(keys params))
|
(keys params))
|
||||||
|
(do
|
||||||
|
(log/debug (db/search-strings-teams-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/search-strings-teams db/*db* params)
|
(db/search-strings-teams db/*db* params)
|
||||||
:message
|
:message
|
||||||
"Error while searching team records"
|
"Error while searching team records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while searching team records"]})
|
{:warnings ["Error while searching team records"]}))
|
||||||
|
(do
|
||||||
|
(log/debug (db/list-teams-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/list-teams db/*db* {})
|
(db/list-teams db/*db* {})
|
||||||
:message
|
:message
|
||||||
"Error while fetching team records"
|
"Error while fetching team records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while fetching team records"]}))]
|
{:warnings ["Error while fetching team records"]})))]
|
||||||
(if (:warnings records) records {:records records}))))))
|
(if (:warnings records) records {:records records}))))))
|
||||||
|
|
||||||
(defn
|
(defn
|
||||||
|
@ -1284,18 +1352,22 @@
|
||||||
[records
|
[records
|
||||||
(if
|
(if
|
||||||
(some #{:canvasser_id :date :id :address_id} (keys params))
|
(some #{:canvasser_id :date :id :address_id} (keys params))
|
||||||
|
(do
|
||||||
|
(log/debug (db/search-strings-visits-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/search-strings-visits db/*db* params)
|
(db/search-strings-visits db/*db* params)
|
||||||
:message
|
:message
|
||||||
"Error while searching visit records"
|
"Error while searching visit records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while searching visit records"]})
|
{:warnings ["Error while searching visit records"]}))
|
||||||
|
(do
|
||||||
|
(log/debug (db/list-visits-sqlvec params))
|
||||||
(support/do-or-log-error
|
(support/do-or-log-error
|
||||||
(db/list-visits db/*db* {})
|
(db/list-visits db/*db* {})
|
||||||
:message
|
:message
|
||||||
"Error while fetching visit records"
|
"Error while fetching visit records"
|
||||||
:error-return
|
:error-return
|
||||||
{:warnings ["Error while fetching visit records"]}))]
|
{:warnings ["Error while fetching visit records"]})))]
|
||||||
(if (:warnings records) records {:records records}))))))
|
(if (:warnings records) records {:records records}))))))
|
||||||
|
|
||||||
(defn
|
(defn
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
(ns
|
(ns
|
||||||
youyesyet.routes.auto-json
|
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
|
(:require
|
||||||
[adl-support.core :as support]
|
[adl-support.core :as support]
|
||||||
[clojure.core.memoize :as memo]
|
[clojure.core.memoize :as memo]
|
||||||
|
|
|
@ -48,11 +48,6 @@
|
||||||
(if (.exists motd) (slurp motd) "")))
|
(if (.exists motd) (slurp motd) "")))
|
||||||
|
|
||||||
|
|
||||||
(defn app-page [request]
|
|
||||||
(layout/render "app.html" {:title "Canvasser app"
|
|
||||||
:user (:user (:session request))}))
|
|
||||||
|
|
||||||
|
|
||||||
(defn about-page []
|
(defn about-page []
|
||||||
(layout/render "about.html" {} {:title
|
(layout/render "about.html" {} {:title
|
||||||
(str "About " (:site-title env))
|
(str "About " (:site-title env))
|
||||||
|
@ -126,11 +121,6 @@
|
||||||
:authorities (db-core/list-authorities db-core/*db*)}))))
|
:authorities (db-core/list-authorities db-core/*db*)}))))
|
||||||
|
|
||||||
|
|
||||||
(defn handle-logout
|
|
||||||
[request]
|
|
||||||
(dissoc (response/found "home") :user :roles))
|
|
||||||
|
|
||||||
|
|
||||||
(defroutes home-routes
|
(defroutes home-routes
|
||||||
(GET "/" [] (home-page))
|
(GET "/" [] (home-page))
|
||||||
(GET "/home" [] (home-page))
|
(GET "/home" [] (home-page))
|
||||||
|
@ -139,10 +129,7 @@
|
||||||
(POST "/call-me" request (call-me-page request))
|
(POST "/call-me" request (call-me-page request))
|
||||||
(GET "/login" request (login-page request))
|
(GET "/login" request (login-page request))
|
||||||
(POST "/login" request (login-page request))
|
(POST "/login" request (login-page request))
|
||||||
(GET "/logout" request (handle-logout request))
|
|
||||||
(GET "/notyet" [] (layout/render "notyet.html" {}
|
(GET "/notyet" [] (layout/render "notyet.html" {}
|
||||||
{:title "Can we persuade you?"}))
|
{:title "Can we persuade you?"}))
|
||||||
(GET "/supporter" [] (layout/render "supporter.html" {}
|
(GET "/supporter" [] (layout/render "supporter.html" {}
|
||||||
{:title "Have you signed up as a canvasser yet?"}))
|
{: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))))
|
|
||||||
|
|
127
src/clj/youyesyet/routes/logged_in.clj
Normal file
127
src/clj/youyesyet/routes/logged_in.clj
Normal 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)))
|
||||||
|
)
|
|
@ -55,7 +55,7 @@
|
||||||
|
|
||||||
(defn canvassers-page
|
(defn canvassers-page
|
||||||
[request]
|
[request]
|
||||||
(layout/render "roles/canvasser.html" request {}))
|
(layout/render "roles/canvasser.html" (:session request) {}))
|
||||||
|
|
||||||
|
|
||||||
(defn team-organisers-page
|
(defn team-organisers-page
|
||||||
|
|
Loading…
Reference in a new issue