User profile page working.
This commit is contained in:
parent
b65223198c
commit
ab568365ef
46 changed files with 873 additions and 698 deletions
|
|
@ -1,7 +1,7 @@
|
|||
------------------------------------------------------------------------
|
||||
-- File queries.sql
|
||||
--
|
||||
-- autogenerated by adl.to-hugsql-queries at 2018-07-15T11:36:34.811Z
|
||||
-- autogenerated by adl.to-hugsql-queries at 2018-07-15T19:59:44.610Z
|
||||
--
|
||||
-- See [Application Description
|
||||
-- Language](https://github.com/simon-brooke/adl).
|
||||
|
|
@ -814,52 +814,52 @@ ORDER BY lv_visits.address_id,
|
|||
lv_visits.date,
|
||||
lv_visits.id
|
||||
|
||||
-- :name search-strings-addresses :? :1
|
||||
-- :name search-strings-addresses :? :*
|
||||
-- :doc selects existing address records having any string field matching the parameter of the same name by substring match
|
||||
SELECT DISTINCT * FROM lv_addresses
|
||||
WHERE false
|
||||
--~ (if (:address params) "OR address LIKE '%:address%'")
|
||||
--~ (if (:postcode params) "OR postcode LIKE '%:postcode%'")
|
||||
--~ (if (:phone params) "OR phone LIKE '%:phone%'")
|
||||
--~ (if (:district_id params) "OR district_id = :district_id")
|
||||
--~ (if (:latitude params) "OR latitude = :latitude")
|
||||
--~ (if (:longitude params) "OR longitude = :longitude")
|
||||
--~ (if (:locality params) "OR locality = :locality")
|
||||
--~ (if (:id params) "OR id = :id")
|
||||
--~ (if (:address params) (str "OR address LIKE '%" (:address params) "%'"))
|
||||
--~ (if (:postcode params) (str "OR postcode = :postcode"))
|
||||
--~ (if (:phone params) (str "OR phone LIKE '%" (:phone params) "%'"))
|
||||
--~ (if (:district_id params) (str "OR district_id_expanded LIKE '%" (:district_id params) "%'"))
|
||||
--~ (if (:latitude params) (str "OR latitude = :latitude"))
|
||||
--~ (if (:longitude params) (str "OR longitude = :longitude"))
|
||||
--~ (if (:locality params) (str "OR locality = :locality"))
|
||||
--~ (if (:id params) (str "OR id = :id"))
|
||||
ORDER BY lv_addresses.address,
|
||||
lv_addresses.postcode,
|
||||
lv_addresses.id
|
||||
--~ (if (:offset params) "OFFSET :offset ")
|
||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
||||
|
||||
-- :name search-strings-authorities :? :1
|
||||
-- :name search-strings-authorities :? :*
|
||||
-- :doc selects existing authority records having any string field matching the parameter of the same name by substring match
|
||||
SELECT DISTINCT * FROM lv_authorities
|
||||
WHERE false
|
||||
--~ (if (:request-token-uri params) "OR request_token_uri LIKE '%:request-token-uri%'")
|
||||
--~ (if (:access-token-uri params) "OR access_token_uri LIKE '%:access-token-uri%'")
|
||||
--~ (if (:authorize-uri params) "OR authorize_uri LIKE '%:authorize-uri%'")
|
||||
--~ (if (:consumer-key params) "OR consumer_key LIKE '%:consumer-key%'")
|
||||
--~ (if (:consumer-secret params) "OR consumer_secret LIKE '%:consumer-secret%'")
|
||||
--~ (if (:id params) "OR id LIKE '%:id%'")
|
||||
--~ (if (:request-token-uri params) (str "OR request_token_uri LIKE '%" (:request-token-uri params) "%'"))
|
||||
--~ (if (:access-token-uri params) (str "OR access_token_uri LIKE '%" (:access-token-uri params) "%'"))
|
||||
--~ (if (:authorize-uri params) (str "OR authorize_uri LIKE '%" (:authorize-uri params) "%'"))
|
||||
--~ (if (:consumer-key params) (str "OR consumer_key LIKE '%" (:consumer-key params) "%'"))
|
||||
--~ (if (:consumer-secret params) (str "OR consumer_secret LIKE '%" (:consumer-secret params) "%'"))
|
||||
--~ (if (:id params) (str "OR id LIKE '%" (:id params) "%'"))
|
||||
--~ (if (:offset params) "OFFSET :offset ")
|
||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
||||
|
||||
-- :name search-strings-canvassers :? :1
|
||||
-- :name search-strings-canvassers :? :*
|
||||
-- :doc selects existing canvasser records having any string field matching the parameter of the same name by substring match
|
||||
SELECT DISTINCT * FROM lv_canvassers
|
||||
WHERE false
|
||||
--~ (if (:username params) "OR username LIKE '%:username%'")
|
||||
--~ (if (:fullname params) "OR fullname LIKE '%:fullname%'")
|
||||
--~ (if (:avatar params) "OR avatar = :avatar")
|
||||
--~ (if (:bio params) "OR bio LIKE '%:bio%'")
|
||||
--~ (if (:elector_id params) "OR elector_id = :elector_id")
|
||||
--~ (if (:address_id params) "OR address_id = :address_id")
|
||||
--~ (if (:phone params) "OR phone LIKE '%:phone%'")
|
||||
--~ (if (:email params) "OR email LIKE '%:email%'")
|
||||
--~ (if (:authority_id params) "OR authority_id LIKE '%:authority_id%'")
|
||||
--~ (if (:authorised params) "OR authorised = :authorised")
|
||||
--~ (if (:id params) "OR id = :id")
|
||||
--~ (if (:username params) (str "OR username LIKE '%" (:username params) "%'"))
|
||||
--~ (if (:fullname params) (str "OR fullname LIKE '%" (:fullname params) "%'"))
|
||||
--~ (if (:avatar params) (str "OR avatar = :avatar"))
|
||||
--~ (if (:bio params) (str "OR bio LIKE '%" (:bio params) "%'"))
|
||||
--~ (if (:elector_id params) (str "OR elector_id_expanded LIKE '%" (:elector_id params) "%'"))
|
||||
--~ (if (:address_id params) (str "OR address_id_expanded LIKE '%" (:address_id params) "%'"))
|
||||
--~ (if (:phone params) (str "OR phone LIKE '%" (:phone params) "%'"))
|
||||
--~ (if (:email params) (str "OR email LIKE '%" (:email params) "%'"))
|
||||
--~ (if (:authority_id params) (str "OR authority_id_expanded LIKE '%" (:authority_id params) "%'"))
|
||||
--~ (if (:authorised params) (str "OR authorised = :authorised"))
|
||||
--~ (if (:id params) (str "OR id = :id"))
|
||||
ORDER BY lv_canvassers.username,
|
||||
lv_canvassers.fullname,
|
||||
lv_canvassers.address_id,
|
||||
|
|
@ -869,55 +869,55 @@ ORDER BY lv_canvassers.username,
|
|||
--~ (if (:offset params) "OFFSET :offset ")
|
||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
||||
|
||||
-- :name search-strings-districts :? :1
|
||||
-- :name search-strings-districts :? :*
|
||||
-- :doc selects existing district records having any string field matching the parameter of the same name by substring match
|
||||
SELECT DISTINCT * FROM lv_districts
|
||||
WHERE false
|
||||
--~ (if (:name params) "OR name LIKE '%:name%'")
|
||||
--~ (if (:id params) "OR id = :id")
|
||||
--~ (if (:name params) (str "OR name LIKE '%" (:name params) "%'"))
|
||||
--~ (if (:id params) (str "OR id = :id"))
|
||||
ORDER BY lv_districts.name,
|
||||
lv_districts.id
|
||||
--~ (if (:offset params) "OFFSET :offset ")
|
||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
||||
|
||||
-- :name search-strings-dwellings :? :1
|
||||
-- :name search-strings-dwellings :? :*
|
||||
-- :doc selects existing dwelling records having any string field matching the parameter of the same name by substring match
|
||||
SELECT DISTINCT * FROM lv_dwellings
|
||||
WHERE false
|
||||
--~ (if (:address_id params) "OR address_id = :address_id")
|
||||
--~ (if (:sub-address params) "OR sub_address LIKE '%:sub-address%'")
|
||||
--~ (if (:id params) "OR id = :id")
|
||||
--~ (if (:address_id params) (str "OR address_id_expanded LIKE '%" (:address_id params) "%'"))
|
||||
--~ (if (:sub-address params) (str "OR sub_address LIKE '%" (:sub-address params) "%'"))
|
||||
--~ (if (:id params) (str "OR id = :id"))
|
||||
ORDER BY lv_dwellings.address_id,
|
||||
lv_dwellings.sub_address,
|
||||
lv_dwellings.id
|
||||
--~ (if (:offset params) "OFFSET :offset ")
|
||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
||||
|
||||
-- :name search-strings-electors :? :1
|
||||
-- :name search-strings-electors :? :*
|
||||
-- :doc selects existing elector records having any string field matching the parameter of the same name by substring match
|
||||
SELECT DISTINCT * FROM lv_electors
|
||||
WHERE false
|
||||
--~ (if (:name params) "OR name LIKE '%:name%'")
|
||||
--~ (if (:dwelling_id params) "OR dwelling_id = :dwelling_id")
|
||||
--~ (if (:phone params) "OR phone LIKE '%:phone%'")
|
||||
--~ (if (:email params) "OR email LIKE '%:email%'")
|
||||
--~ (if (:gender params) "OR gender LIKE '%:gender%'")
|
||||
--~ (if (:id params) "OR id = :id")
|
||||
--~ (if (:name params) (str "OR name LIKE '%" (:name params) "%'"))
|
||||
--~ (if (:dwelling_id params) (str "OR dwelling_id_expanded LIKE '%" (:dwelling_id params) "%'"))
|
||||
--~ (if (:phone params) (str "OR phone LIKE '%" (:phone params) "%'"))
|
||||
--~ (if (:email params) (str "OR email LIKE '%" (:email params) "%'"))
|
||||
--~ (if (:gender params) (str "OR gender_expanded LIKE '%" (:gender params) "%'"))
|
||||
--~ (if (:id params) (str "OR id = :id"))
|
||||
ORDER BY lv_electors.name,
|
||||
lv_electors.id
|
||||
--~ (if (:offset params) "OFFSET :offset ")
|
||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
||||
|
||||
-- :name search-strings-events :? :1
|
||||
-- :name search-strings-events :? :*
|
||||
-- :doc selects existing event records having any string field matching the parameter of the same name by substring match
|
||||
SELECT DISTINCT * FROM lv_events
|
||||
WHERE false
|
||||
--~ (if (:name params) "OR name LIKE '%:name%'")
|
||||
--~ (if (:date params) "OR date = ':date'")
|
||||
--~ (if (:time params) "OR time = ':time'")
|
||||
--~ (if (:decription params) "OR decription LIKE '%:decription%'")
|
||||
--~ (if (:cancelled params) "OR cancelled = :cancelled")
|
||||
--~ (if (:id params) "OR id = :id")
|
||||
--~ (if (:name params) (str "OR name LIKE '%" (:name params) "%'"))
|
||||
--~ (if (:date params) (str "OR date = ':date'"))
|
||||
--~ (if (:time params) (str "OR time = ':time'"))
|
||||
--~ (if (:decription params) (str "OR decription LIKE '%" (:decription params) "%'"))
|
||||
--~ (if (:cancelled params) (str "OR cancelled = :cancelled"))
|
||||
--~ (if (:id params) (str "OR id = :id"))
|
||||
ORDER BY lv_events.name,
|
||||
lv_events.date,
|
||||
lv_events.time,
|
||||
|
|
@ -925,39 +925,39 @@ ORDER BY lv_events.name,
|
|||
--~ (if (:offset params) "OFFSET :offset ")
|
||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
||||
|
||||
-- :name search-strings-followupactions :? :1
|
||||
-- :name search-strings-followupactions :? :*
|
||||
-- :doc selects existing followupaction records having any string field matching the parameter of the same name by substring match
|
||||
SELECT DISTINCT * FROM lv_followupactions
|
||||
WHERE false
|
||||
--~ (if (:request_id params) "OR request_id = :request_id")
|
||||
--~ (if (:actor params) "OR actor = :actor")
|
||||
--~ (if (:date params) "OR date = ':date'")
|
||||
--~ (if (:notes params) "OR notes LIKE '%:notes%'")
|
||||
--~ (if (:closed params) "OR closed = :closed")
|
||||
--~ (if (:id params) "OR id = :id")
|
||||
--~ (if (:request_id params) (str "OR request_id_expanded LIKE '%" (:request_id params) "%'"))
|
||||
--~ (if (:actor params) (str "OR actor_expanded LIKE '%" (:actor params) "%'"))
|
||||
--~ (if (:date params) (str "OR date = ':date'"))
|
||||
--~ (if (:notes params) (str "OR notes LIKE '%" (:notes params) "%'"))
|
||||
--~ (if (:closed params) (str "OR closed = :closed"))
|
||||
--~ (if (:id params) (str "OR id = :id"))
|
||||
ORDER BY lv_followupactions.date,
|
||||
lv_followupactions.notes,
|
||||
lv_followupactions.id
|
||||
--~ (if (:offset params) "OFFSET :offset ")
|
||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
||||
|
||||
-- :name search-strings-followupmethods :? :1
|
||||
-- :name search-strings-followupmethods :? :*
|
||||
-- :doc selects existing followupmethod records having any string field matching the parameter of the same name by substring match
|
||||
SELECT DISTINCT * FROM lv_followupmethods
|
||||
WHERE false
|
||||
--~ (if (:id params) "OR id LIKE '%:id%'")
|
||||
--~ (if (:id params) (str "OR id LIKE '%" (:id params) "%'"))
|
||||
--~ (if (:offset params) "OFFSET :offset ")
|
||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
||||
|
||||
-- :name search-strings-followuprequests :? :1
|
||||
-- :name search-strings-followuprequests :? :*
|
||||
-- :doc selects existing followuprequest records having any string field matching the parameter of the same name by substring match
|
||||
SELECT DISTINCT * FROM lv_followuprequests
|
||||
WHERE false
|
||||
--~ (if (:elector_id params) "OR elector_id = :elector_id")
|
||||
--~ (if (:visit_id params) "OR visit_id = :visit_id")
|
||||
--~ (if (:issue_id params) "OR issue_id LIKE '%:issue_id%'")
|
||||
--~ (if (:method_id params) "OR method_id LIKE '%:method_id%'")
|
||||
--~ (if (:id params) "OR id = :id")
|
||||
--~ (if (:elector_id params) (str "OR elector_id_expanded LIKE '%" (:elector_id params) "%'"))
|
||||
--~ (if (:visit_id params) (str "OR visit_id_expanded LIKE '%" (:visit_id params) "%'"))
|
||||
--~ (if (:issue_id params) (str "OR issue_id_expanded LIKE '%" (:issue_id params) "%'"))
|
||||
--~ (if (:method_id params) (str "OR method_id_expanded LIKE '%" (:method_id params) "%'"))
|
||||
--~ (if (:id params) (str "OR id = :id"))
|
||||
ORDER BY lv_followuprequests.elector_id,
|
||||
lv_followuprequests.visit_id,
|
||||
lv_followuprequests.issue_id,
|
||||
|
|
@ -965,78 +965,78 @@ ORDER BY lv_followuprequests.elector_id,
|
|||
--~ (if (:offset params) "OFFSET :offset ")
|
||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
||||
|
||||
-- :name search-strings-genders :? :1
|
||||
-- :name search-strings-genders :? :*
|
||||
-- :doc selects existing gender records having any string field matching the parameter of the same name by substring match
|
||||
SELECT DISTINCT * FROM lv_genders
|
||||
WHERE false
|
||||
--~ (if (:id params) "OR id LIKE '%:id%'")
|
||||
--~ (if (:id params) (str "OR id LIKE '%" (:id params) "%'"))
|
||||
--~ (if (:offset params) "OFFSET :offset ")
|
||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
||||
|
||||
-- :name search-strings-intentions :? :1
|
||||
-- :name search-strings-intentions :? :*
|
||||
-- :doc selects existing intention records having any string field matching the parameter of the same name by substring match
|
||||
SELECT DISTINCT * FROM lv_intentions
|
||||
WHERE false
|
||||
--~ (if (:visit_id params) "OR visit_id = :visit_id")
|
||||
--~ (if (:elector_id params) "OR elector_id = :elector_id")
|
||||
--~ (if (:option_id params) "OR option_id LIKE '%:option_id%'")
|
||||
--~ (if (:locality params) "OR locality = :locality")
|
||||
--~ (if (:id params) "OR id = :id")
|
||||
--~ (if (:visit_id params) (str "OR visit_id_expanded LIKE '%" (:visit_id params) "%'"))
|
||||
--~ (if (:elector_id params) (str "OR elector_id_expanded LIKE '%" (:elector_id params) "%'"))
|
||||
--~ (if (:option_id params) (str "OR option_id_expanded LIKE '%" (:option_id params) "%'"))
|
||||
--~ (if (:locality params) (str "OR locality = :locality"))
|
||||
--~ (if (:id params) (str "OR id = :id"))
|
||||
--~ (if (:offset params) "OFFSET :offset ")
|
||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
||||
|
||||
-- :name search-strings-issues :? :1
|
||||
-- :name search-strings-issues :? :*
|
||||
-- :doc selects existing issue records having any string field matching the parameter of the same name by substring match
|
||||
SELECT DISTINCT * FROM lv_issues
|
||||
WHERE false
|
||||
--~ (if (:url params) "OR url LIKE '%:url%'")
|
||||
--~ (if (:current params) "OR current = :current")
|
||||
--~ (if (:brief params) "OR brief LIKE '%:brief%'")
|
||||
--~ (if (:id params) "OR id LIKE '%:id%'")
|
||||
--~ (if (:url params) (str "OR url LIKE '%" (:url params) "%'"))
|
||||
--~ (if (:current params) (str "OR current = :current"))
|
||||
--~ (if (:brief params) (str "OR brief LIKE '%" (:brief params) "%'"))
|
||||
--~ (if (:id params) (str "OR id LIKE '%" (:id params) "%'"))
|
||||
--~ (if (:offset params) "OFFSET :offset ")
|
||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
||||
|
||||
-- :name search-strings-options :? :1
|
||||
-- :name search-strings-options :? :*
|
||||
-- :doc selects existing option records having any string field matching the parameter of the same name by substring match
|
||||
SELECT DISTINCT * FROM lv_options
|
||||
WHERE false
|
||||
--~ (if (:id params) "OR id LIKE '%:id%'")
|
||||
--~ (if (:id params) (str "OR id LIKE '%" (:id params) "%'"))
|
||||
--~ (if (:offset params) "OFFSET :offset ")
|
||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
||||
|
||||
-- :name search-strings-roles :? :1
|
||||
-- :name search-strings-roles :? :*
|
||||
-- :doc selects existing role records having any string field matching the parameter of the same name by substring match
|
||||
SELECT DISTINCT * FROM lv_roles
|
||||
WHERE false
|
||||
--~ (if (:name params) "OR name LIKE '%:name%'")
|
||||
--~ (if (:id params) "OR id = :id")
|
||||
--~ (if (:name params) (str "OR name LIKE '%" (:name params) "%'"))
|
||||
--~ (if (:id params) (str "OR id = :id"))
|
||||
ORDER BY lv_roles.name,
|
||||
lv_roles.id
|
||||
--~ (if (:offset params) "OFFSET :offset ")
|
||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
||||
|
||||
-- :name search-strings-teams :? :1
|
||||
-- :name search-strings-teams :? :*
|
||||
-- :doc selects existing team records having any string field matching the parameter of the same name by substring match
|
||||
SELECT DISTINCT * FROM lv_teams
|
||||
WHERE false
|
||||
--~ (if (:name params) "OR name LIKE '%:name%'")
|
||||
--~ (if (:district_id params) "OR district_id = :district_id")
|
||||
--~ (if (:latitude params) "OR latitude = :latitude")
|
||||
--~ (if (:longitude params) "OR longitude = :longitude")
|
||||
--~ (if (:id params) "OR id = :id")
|
||||
--~ (if (:name params) (str "OR name LIKE '%" (:name params) "%'"))
|
||||
--~ (if (:district_id params) (str "OR district_id_expanded LIKE '%" (:district_id params) "%'"))
|
||||
--~ (if (:latitude params) (str "OR latitude = :latitude"))
|
||||
--~ (if (:longitude params) (str "OR longitude = :longitude"))
|
||||
--~ (if (:id params) (str "OR id = :id"))
|
||||
ORDER BY lv_teams.name,
|
||||
lv_teams.id
|
||||
--~ (if (:offset params) "OFFSET :offset ")
|
||||
--~ (if (:limit params) "LIMIT :limit" "LIMIT 100")
|
||||
|
||||
-- :name search-strings-visits :? :1
|
||||
-- :name search-strings-visits :? :*
|
||||
-- :doc selects existing visit records having any string field matching the parameter of the same name by substring match
|
||||
SELECT DISTINCT * FROM lv_visits
|
||||
WHERE false
|
||||
--~ (if (:address_id params) "OR address_id = :address_id")
|
||||
--~ (if (:canvasser_id params) "OR canvasser_id = :canvasser_id")
|
||||
--~ (if (:date params) "OR date = ':date'")
|
||||
--~ (if (:id params) "OR id = :id")
|
||||
--~ (if (:address_id params) (str "OR address_id_expanded LIKE '%" (:address_id params) "%'"))
|
||||
--~ (if (:canvasser_id params) (str "OR canvasser_id_expanded LIKE '%" (:canvasser_id params) "%'"))
|
||||
--~ (if (:date params) (str "OR date = ':date'"))
|
||||
--~ (if (:id params) (str "OR id = :id"))
|
||||
ORDER BY lv_visits.address_id,
|
||||
lv_visits.date,
|
||||
lv_visits.id
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
--
|
||||
-- auto-generated by [Application Description Language framework]
|
||||
--
|
||||
-- (https://github.com/simon-brooke/adl) at 20180715T113635.982Z
|
||||
-- (https://github.com/simon-brooke/adl) at 20180715T195945.839Z
|
||||
--
|
||||
-- A web-app intended to be used by canvassers
|
||||
-- campaigning for a 'Yes' vote in the second independence
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue