Merge branch 'feature/9' into feature/clientframework
This commit is contained in:
commit
250e0e6887
47
project.clj
47
project.clj
|
@ -5,35 +5,36 @@
|
|||
|
||||
:dependencies [[org.clojure/clojure "1.8.0"]
|
||||
[org.clojure/clojurescript "1.9.229" :scope "provided"]
|
||||
[ring/ring-servlet "1.5.0"]
|
||||
[ring/ring-servlet "1.5.1"]
|
||||
[clj-oauth "1.5.5"]
|
||||
[ch.qos.logback/logback-classic "1.1.8"]
|
||||
[re-frame "0.9.1"]
|
||||
[ch.qos.logback/logback-classic "1.2.2"]
|
||||
[re-frame "0.9.2"]
|
||||
[cljs-ajax "0.5.8"]
|
||||
[secretary "1.2.3"]
|
||||
[reagent-utils "0.2.0"]
|
||||
[reagent "0.6.0"]
|
||||
[reagent-utils "0.2.1"]
|
||||
[reagent "0.6.1"]
|
||||
[korma "0.4.3"]
|
||||
[selmer "1.10.3"]
|
||||
[markdown-clj "0.9.91"]
|
||||
[ring-middleware-format "0.7.0"]
|
||||
[metosin/ring-http-response "0.8.0"]
|
||||
[bouncer "1.0.0"]
|
||||
[org.webjars/bootstrap "4.0.0-alpha.5"]
|
||||
[selmer "1.10.6"]
|
||||
[markdown-clj "0.9.98"]
|
||||
[ring-middleware-format "0.7.2"]
|
||||
[metosin/ring-http-response "0.8.2"]
|
||||
[bouncer "1.0.1"]
|
||||
[org.webjars/bootstrap "4.0.0-alpha.6-1"]
|
||||
[org.webjars/font-awesome "4.7.0"]
|
||||
[org.webjars.bower/tether "1.3.7"]
|
||||
[org.webjars.bower/tether "1.4.0"]
|
||||
[org.clojure/tools.logging "0.3.1"]
|
||||
[compojure "1.5.1"]
|
||||
[compojure "1.5.2"]
|
||||
[metosin/compojure-api "1.1.10"]
|
||||
[ring-webjars "0.1.1"]
|
||||
[ring/ring-defaults "0.2.1"]
|
||||
[ring/ring-defaults "0.2.3"]
|
||||
[luminus/ring-ttl-session "0.3.1"]
|
||||
[mount "0.1.11"]
|
||||
[cprop "0.1.9"]
|
||||
[cprop "0.1.10"]
|
||||
[org.clojure/tools.cli "0.3.5"]
|
||||
[migratus "0.8.32"]
|
||||
[migratus "0.8.33"]
|
||||
[luminus-nrepl "0.1.4"]
|
||||
[luminus-migrations "0.2.9"]
|
||||
[conman "0.6.2"]
|
||||
[luminus-migrations "0.3.0"]
|
||||
[conman "0.6.3"]
|
||||
[org.postgresql/postgresql "9.4.1212"]
|
||||
]
|
||||
|
||||
|
@ -111,16 +112,16 @@
|
|||
|
||||
:project/dev {:dependencies [[prone "1.1.4"]
|
||||
[ring/ring-mock "0.3.0"]
|
||||
[ring/ring-devel "1.5.0"]
|
||||
[ring/ring-devel "1.5.1"]
|
||||
[luminus-jetty "0.1.4"]
|
||||
[pjstadig/humane-test-output "0.8.1"]
|
||||
[org.clojure/core.cache "0.6.5"]
|
||||
[org.apache.httpcomponents/httpcore "4.4.5"]
|
||||
[org.apache.httpcomponents/httpcore "4.4.6"]
|
||||
[clj-webdriver/clj-webdriver "0.7.2"]
|
||||
[org.seleniumhq.selenium/selenium-server "3.0.1"]
|
||||
[org.seleniumhq.selenium/selenium-server "3.3.1"]
|
||||
[doo "0.1.7"]
|
||||
[binaryage/devtools "0.8.3"]
|
||||
[figwheel-sidecar "0.5.8"]
|
||||
[binaryage/devtools "0.9.2"]
|
||||
[figwheel-sidecar "0.5.9"]
|
||||
[com.cemerick/piggieback "0.2.2-SNAPSHOT"]
|
||||
[directory-naming/naming-java "0.8"]]
|
||||
:plugins [[com.jakemccrary/lein-test-refresh "0.14.0"]
|
||||
|
|
|
@ -34,6 +34,11 @@
|
|||
</div>
|
||||
|
||||
<!-- scripts and styles -->
|
||||
<!-- ATTENTION \/ -->
|
||||
<!-- Leaflet -->
|
||||
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css" />
|
||||
<script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
|
||||
<!-- ATTENTION /\ -->
|
||||
|
||||
<script type="text/javascript">
|
||||
var context = "{{servlet-context}}";
|
||||
|
|
|
@ -34,6 +34,26 @@
|
|||
;;; redundant, and if they are the namespace probably needs to be renamed to 'entities'.
|
||||
;;; See also resources/migrations/20161014170335-basic-setup.up.sql
|
||||
|
||||
(defn create-districts-table!
|
||||
"Create a table to hold the electoral districts in which electors are registered.
|
||||
Note that, as this app is being developed for the independence referendum in which
|
||||
polling is across the whole of Scotland, this part of the design isn't fully thought
|
||||
through; if later adapted to general or local elections, some breakdown or hierarchy
|
||||
of polling districts into constituencies will be required."
|
||||
[]
|
||||
(sql/db-do-commands
|
||||
yyydb/*db*
|
||||
(sql/create-table-ddl
|
||||
:districts
|
||||
;; it may be necessary to have a serial abstract primary key but I suspect
|
||||
;; polling districts already have numbers assigned by the Electoral Commission and
|
||||
;; it would be sensible to use those. TODO: check.
|
||||
[:id "integer not null primary key"]
|
||||
[:name "varchar(64) not null"]
|
||||
;; TODO: it would make sense to hold polygon data for polling districts so we can reflect
|
||||
;; them on the map, but I haven't thought through how to do that yet.
|
||||
)))
|
||||
|
||||
|
||||
(kc/defentity district
|
||||
(kc/pk :id)
|
||||
|
|
|
@ -44,4 +44,4 @@
|
|||
:return Long
|
||||
:header-params [x :- Long, y :- Long]
|
||||
:summary "x^y with header-parameters"
|
||||
(ok (long (Math/pow x y))))))
|
||||
(ok (long (Math/pow x y)))))))
|
||||
|
|
|
@ -57,6 +57,7 @@
|
|||
(defn home-page []
|
||||
[:div.container {:id "main-container"}
|
||||
(big-link "About" "#/about")
|
||||
(big-link "Map" "#/map")
|
||||
[:div.jumbotron
|
||||
[:h1 "Welcome to youyesyet"]
|
||||
[:p "Time to start building your site!"]
|
||||
|
|
|
@ -44,7 +44,11 @@
|
|||
;; which provider to use
|
||||
(def *map-provider* :osm)
|
||||
|
||||
(def osm-url "http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png")
|
||||
(def osm-attrib "Map data © <a href='http://openstreetmap.org'>OpenStreetMap</a> contributors")
|
||||
|
||||
|
||||
;; My gods mapbox is user-hostile!
|
||||
(defn map-did-mount-mapbox
|
||||
"Did-mount function loading map tile data from MapBox (proprietary)."
|
||||
[]
|
||||
|
@ -60,8 +64,8 @@
|
|||
"Did-mount function loading map tile data from Open Street Map (open)."
|
||||
[]
|
||||
(let [map (.setView (.map js/L "map") #js [55.86 -4.25] 13)]
|
||||
(.addTo (.tileLayer js/L "http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png"
|
||||
(clj->js {:attribution "Map data © <a href=\"http://openstreetmap.org\">OpenStreetMap</a> contributors"
|
||||
(.addTo (.tileLayer js/L osm-url
|
||||
(clj->js {:attribution osm-attrib
|
||||
:maxZoom 18}))
|
||||
map)))
|
||||
|
||||
|
@ -79,7 +83,7 @@
|
|||
(defn map-render
|
||||
"Render the actual div containing the map."
|
||||
[]
|
||||
[:div#map {:style {:height "360px"}}])
|
||||
[:div#map {:style {:height "500px"}}])
|
||||
|
||||
|
||||
(defn map-div
|
||||
|
|
Loading…
Reference in a new issue