Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
Simon Brooke 2018-07-24 17:53:08 +01:00
commit 913beffb61
5 changed files with 17 additions and 13 deletions

View file

@ -3,3 +3,7 @@
### Alpha test code ### 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). 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.

View file

@ -13,6 +13,7 @@
{% block content %} {% block content %}
<form action="{{servlet-context}}/login" method="post"> <form action="{{servlet-context}}/login" method="post">
{% csrf-field %} {% csrf-field %}
<input type="hidden" name="redirect-to" value="{{servlet-context}}/roles"/>
<h2> <h2>
Or use a test username and password Or use a test username and password
</h2> </h2>

View file

@ -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 ;;;; See also resources/sql/locality-trigger.sql
(defn locality (defn locality
@ -36,6 +39,7 @@
(int ;; we're interested in localities West of Greenwich. (int ;; we're interested in localities West of Greenwich.
(* longitude 100))))) (* longitude 100)))))
(defn neighbouring-localities (defn neighbouring-localities
"Return this locality with the localities immediately "Return this locality with the localities immediately
north east, north, north west, east, west, south west, north east, north, north west, east, west, south west,
@ -53,4 +57,4 @@
(+ locality 100) (+ locality 100)
(+ locality 101))) (+ locality 101)))
(neighbouring-localities 5482391)

View file

@ -109,22 +109,17 @@
(defn map-remove-pins (defn map-remove-pins
"Remove all pins from this map `view`. Side-effecty; liable to be problematic." "Remove all pins from this map `view`. Side-effecty; liable to be problematic."
[view] [view]
(if (.eachLayer view
view
(let [layers (.eachLayer view (fn [l] l))]
(doall
(map
#(if #(if
(instance? js/L.Marker %) (instance? js/L.Marker %)
(.removeLayer view %)) (.removeLayer view %)))
layers))))
view) view)
(defn refresh-map-pins (defn refresh-map-pins
"Refresh the map pins on this map. Side-effecty; liable to be problematic." "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])] addresses @(subscribe [:addresses])]
(if (if
view view

View file

@ -47,8 +47,8 @@
(fn (fn
[dwelling] [dwelling]
(ui/big-link (ui/big-link
(:sub-address dwelling) (:sub_address dwelling)
:target (str "#/dwelling/" (:id dwelling))) ) :target (str "#/dwelling/" (:id dwelling))) )
(sort-by (sort-by
:sub-address :sub_address
(:dwellings address)))]]])) (:dwellings address)))]]]))