Fixed the pin-image regression
This commit is contained in:
parent
c575b52d01
commit
388bb3fb7d
|
@ -26,29 +26,16 @@
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div id="main-container" class="container">
|
<div id="main-container" class="container">
|
||||||
<div id="content">
|
<h2><span class="text-danger">Error: 502 Bad Gateway</span></h2>
|
||||||
|
<p>
|
||||||
<div class="container-fluid">
|
We are suffering an intermittent problem causing an occasional crash of
|
||||||
<div class="row-fluid">
|
the Project Hope canvassing application. We apologise for this, and are
|
||||||
<div class="col-lg-12">
|
working on a permanent fix.
|
||||||
<div class="centering text-center">
|
</p>
|
||||||
<div class="text-center">
|
<p>
|
||||||
<h2><span class="text-danger">Error: 502 Bad Gateway</span></h2>
|
The application will restart automatically
|
||||||
<p>
|
within five minutes, please take a short break.
|
||||||
We are suffering an intermittent problem causing an occasional crash of
|
</p>
|
||||||
the Project Hope canvassing application. We apologise for this, and are
|
|
||||||
working on a permanent fix.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
The application will restart automatically
|
|
||||||
within five minutes, please take a short break.
|
|
||||||
</p>
|
|
||||||
<hr>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<br clear="both"/>
|
<br clear="both"/>
|
||||||
|
|
|
@ -85,3 +85,12 @@ WHERE roles.id = ln_canvassers_roles.role_id
|
||||||
AND ln_canvassers_roles.canvasser_id = :id
|
AND ln_canvassers_roles.canvasser_id = :id
|
||||||
ORDER BY roles.name,
|
ORDER BY roles.name,
|
||||||
roles.id
|
roles.id
|
||||||
|
|
||||||
|
-- :name list-elector-intentions :? :*
|
||||||
|
-- :doc short form of `list-intentions-by-elector`, returning far less data,
|
||||||
|
-- for use in `youyesyet.routes.rest/get-local-data`, q.v.
|
||||||
|
SELECT intentions.id, intentions.option_id, visits.date
|
||||||
|
FROM intentions, visits
|
||||||
|
WHERE intentions.visit_id = visits.id
|
||||||
|
AND intentions.elector_id = :id
|
||||||
|
ORDER BY visits.date DESC
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
(fn [e]
|
(fn [e]
|
||||||
(assoc e
|
(assoc e
|
||||||
:intentions
|
:intentions
|
||||||
(db/list-intentions-by-elector db/*db* {:id (:id e)})))
|
(db/list-elector-intentions db/*db* {:id (:id e)})))
|
||||||
(db/list-electors-by-dwelling db/*db* {:id (:id d)}))))
|
(db/list-electors-by-dwelling db/*db* {:id (:id d)}))))
|
||||||
(db/list-dwellings-by-address db/*db* {:id (:id a)}))))
|
(db/list-dwellings-by-address db/*db* {:id (:id a)}))))
|
||||||
addresses)))
|
addresses)))
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
:author "Simon Brooke"}
|
:author "Simon Brooke"}
|
||||||
youyesyet.canvasser-app.gis
|
youyesyet.canvasser-app.gis
|
||||||
(:require [cljs.reader :refer [read-string]]
|
(:require [cljs.reader :refer [read-string]]
|
||||||
|
[clojure.string :refer [lower-case]]
|
||||||
[cemerick.url :refer (url url-encode)]
|
[cemerick.url :refer (url url-encode)]
|
||||||
[day8.re-frame.http-fx]
|
[day8.re-frame.http-fx]
|
||||||
[re-frame.core :refer [dispatch reg-event-db reg-event-fx subscribe]]
|
[re-frame.core :refer [dispatch reg-event-db reg-event-fx subscribe]]
|
||||||
|
@ -66,13 +67,14 @@
|
||||||
(set
|
(set
|
||||||
(remove
|
(remove
|
||||||
nil?
|
nil?
|
||||||
(map
|
(map :option_id
|
||||||
:intention
|
(mapcat
|
||||||
(mapcat :electors
|
:intentions
|
||||||
(:dwellings address)))))]
|
(mapcat :electors
|
||||||
|
(:dwellings address))))))]
|
||||||
(case (count intentions)
|
(case (count intentions)
|
||||||
0 "unknown-pin"
|
0 "unknown-pin"
|
||||||
1 (str (name (first intentions)) "-pin")
|
1 (lower-case (str (name (first intentions)) "-pin"))
|
||||||
"mixed-pin")))
|
"mixed-pin")))
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -181,6 +181,7 @@
|
||||||
;; TODO: why is this an `-fx`? Does it need to be?
|
;; TODO: why is this an `-fx`? Does it need to be?
|
||||||
(fn
|
(fn
|
||||||
[{db :db} [_ response]]
|
[{db :db} [_ response]]
|
||||||
|
(js/console.log (str ":process-locality: " response))
|
||||||
(js/console.log (str "Updating locality data: " (count response) " addresses " ))
|
(js/console.log (str "Updating locality data: " (count response) " addresses " ))
|
||||||
(refresh-map-pins)
|
(refresh-map-pins)
|
||||||
{:db (assoc
|
{:db (assoc
|
||||||
|
@ -194,7 +195,7 @@
|
||||||
(fn
|
(fn
|
||||||
[{db :db} [_ response]]
|
[{db :db} [_ response]]
|
||||||
;; TODO: signal something has failed? It doesn't matter very much, unless it keeps failing.
|
;; TODO: signal something has failed? It doesn't matter very much, unless it keeps failing.
|
||||||
(js/console.log "Failed to fetch locality data")
|
(js/console.log (str "Failed to fetch locality data" response))
|
||||||
;; loop to do it again
|
;; loop to do it again
|
||||||
(dispatch [:dispatch-later [{:ms 60000 :dispatch [:fetch-locality]}]])
|
(dispatch [:dispatch-later [{:ms 60000 :dispatch [:fetch-locality]}]])
|
||||||
{:db (assoc
|
{:db (assoc
|
||||||
|
|
Loading…
Reference in a new issue