From f7c76115fd61d55089860172d9320793a32835d8 Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Tue, 24 Jul 2018 11:38:10 +0100 Subject: [PATCH 1/2] Minor fixes re: pins on map --- resources/templates/login.html | 1 + src/cljc/youyesyet/locality.cljc | 6 +++++- src/cljs/youyesyet/canvasser_app/gis.cljs | 15 +++++---------- .../youyesyet/canvasser_app/views/building.cljs | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/resources/templates/login.html b/resources/templates/login.html index 25550d0..dca783e 100644 --- a/resources/templates/login.html +++ b/resources/templates/login.html @@ -13,6 +13,7 @@ {% block content %}
{% csrf-field %} +

Or use a test username and password

diff --git a/src/cljc/youyesyet/locality.cljc b/src/cljc/youyesyet/locality.cljc index 45c9872..3fe8600 100644 --- a/src/cljc/youyesyet/locality.cljc +++ b/src/cljc/youyesyet/locality.cljc @@ -23,6 +23,9 @@ ;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;; Specified here: +;;;; https://github.com/simon-brooke/youyesyet/blob/master/doc/specification/scaling.md#searching-the-database-for-localities + ;;;; See also resources/sql/locality-trigger.sql (defn locality @@ -36,6 +39,7 @@ (int ;; we're interested in localities West of Greenwich. (* longitude 100))))) + (defn neighbouring-localities "Return this locality with the localities immediately north east, north, north west, east, west, south west, @@ -53,4 +57,4 @@ (+ locality 100) (+ locality 101))) -(neighbouring-localities 5482391) + diff --git a/src/cljs/youyesyet/canvasser_app/gis.cljs b/src/cljs/youyesyet/canvasser_app/gis.cljs index 64fbc18..0f694b8 100644 --- a/src/cljs/youyesyet/canvasser_app/gis.cljs +++ b/src/cljs/youyesyet/canvasser_app/gis.cljs @@ -109,22 +109,17 @@ (defn map-remove-pins "Remove all pins from this map `view`. Side-effecty; liable to be problematic." [view] - (if - view - (let [layers (.eachLayer view (fn [l] l))] - (doall - (map - #(if - (instance? js/L.Marker %) - (.removeLayer view %)) - layers)))) + (.eachLayer view + #(if + (instance? js/L.Marker %) + (.removeLayer view %))) view) (defn refresh-map-pins "Refresh the map pins on this map. Side-effecty; liable to be problematic." [] - (let [view @(subscribe [:view]) ;; (map-remove-pins @(subscribe [:view])) + (let [view (map-remove-pins @(subscribe [:view])) addresses @(subscribe [:addresses])] (if view diff --git a/src/cljs/youyesyet/canvasser_app/views/building.cljs b/src/cljs/youyesyet/canvasser_app/views/building.cljs index 5396b2e..d2cac79 100644 --- a/src/cljs/youyesyet/canvasser_app/views/building.cljs +++ b/src/cljs/youyesyet/canvasser_app/views/building.cljs @@ -47,8 +47,8 @@ (fn [dwelling] (ui/big-link - (:sub-address dwelling) + (:sub_address dwelling) :target (str "#/dwelling/" (:id dwelling))) ) (sort-by - :sub-address + :sub_address (:dwellings address)))]]])) From f3f46b8e2f7454f6d8d227ecb20dd024b77ef532 Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Tue, 24 Jul 2018 14:54:00 +0100 Subject: [PATCH 2/2] Very small fixes found on Knave The good news: the dev environment does work on Windows. Bad news: the broadband in the office is so slow it's unusable. --- project.clj | 2 +- resources/motd.md | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/project.clj b/project.clj index 7868e2b..a249f56 100644 --- a/project.clj +++ b/project.clj @@ -3,7 +3,7 @@ :description "Canvassing tool for referenda" :url "https://github.com/simon-brooke/youyesyet" - :dependencies [[adl-support "0.1.0-SNAPSHOT"] + :dependencies [[adl-support "0.1.3"] [bouncer "1.0.1"] [ch.qos.logback/logback-classic "1.2.2"] [clj-oauth "1.5.5"] diff --git a/resources/motd.md b/resources/motd.md index 84d757b..f6de732 100644 --- a/resources/motd.md +++ b/resources/motd.md @@ -3,3 +3,7 @@ ### Alpha test code This is a voter intention information system intended to be used by the 'Yes' side in the next Scottish independence referendum. For more information, see [About](about). + +### App not working in Firefox + +This is a known issue; I apologise. It will be fixed.