Compare commits

..

1 commit

Author SHA1 Message Date
Simon Brooke ef786024d7 Merge tag 'youyesyet-0.2.2' 2019-05-02 16:35:01 +01:00
26 changed files with 179 additions and 10309 deletions

View file

@ -1,79 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/clj">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="target/cljsbuild">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="test/clj">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="env/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="env/dev/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/classes" path="src/cljc">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry exported="true" kind="lib" path="classes">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="target/generated-sources/annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="target/generated-test-sources/test-annotations">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
<attribute name="m2e-apt" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

10
.gitignore vendored
View file

@ -11,13 +11,11 @@ pom.xml.asc
/resources/public/vendor /resources/public/vendor
/bower_components/ /bower_components/
/resources/public/js/lib/ /resources/public/js/lib/
.clj-kondo/
.lein-deps-sum .lein-deps-sum
.lein-repl-history .lein-repl-history
.lein-plugins/ .lein-plugins/
.lein-failures .lein-failures
.lein-env .lein-env
.lsp/
.nrepl-port .nrepl-port
/node_modules/ /node_modules/
.DS_Store .DS_Store
@ -51,11 +49,3 @@ youyesyet\.dump\.20180816
*.tar *.tar
src/clj/youyesyet/cache\.clj src/clj/youyesyet/cache\.clj
.lsp/sqlite.db
.settings/
.classpath
.project

View file

@ -1,40 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>youyesyet</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>ccw.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>ccw.nature</nature>
</natures>
<filteredResources>
<filter>
<id>1621149723161</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>

View file

@ -1,9 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.processAnnotations=disabled
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.5

View file

@ -10,7 +10,7 @@ generated using Luminus version "2.9.11.05"
## Status ## Status
Alpha level code. Most of it works, but it's a bit fragile. Very early pre-alpha; user interface mostly works (enough to demonstrate), back end is hardly started.
## What is it supposed to do? ## What is it supposed to do?
@ -36,19 +36,6 @@ Where *username* is the username required to access the database, and *thisisnot
It will be helpful for you to have the [Zenhub](https://www.zenhub.com/) plugin in your browser, either Firefox or Chrome, as I'm using it for project planning. It will be helpful for you to have the [Zenhub](https://www.zenhub.com/) plugin in your browser, either Firefox or Chrome, as I'm using it for project planning.
## Build procedure
YouYesYet is build on the [Application Description Language](https://github.com/simon-brooke/adl) framework, which is also mine and not widely used. Application Description Language is a very high level descriptor language for applications, which allows a huge amount of code to be automatically generated. This generated code is **not** checked into the repository; instead, you must regenerate it before you can build.
Consequently, to get a build running:
1. clone the repository, if you have not already done so;
2. within your cloned repository, check out a branch (usually `develop` or `master`);
3. if you have previously built the project within your cloned repository, run `lein clean`;
4. **this is the important bit** run `lein adl` to generate much of the application code;
5. run `lein run` to start your development server;
6. if you want to do client debugging, you'll want to run `figwheel` in a separate process, but also from the same cloned repository directory; I normally do this by opening a second terminal and invoking `lein figwheel`.
## Further Reading ## Further Reading
If you're thinking of joining in development on this I'd strongly recommend you get hold of a copy of [Dmitry Sotnikov](https://github.com/yogthos)'s [Web Development with Clojure, Second Edition](https://pragprog.com/book/dswdcloj2/web-development-with-clojure-second-edition). If you're thinking of joining in development on this I'd strongly recommend you get hold of a copy of [Dmitry Sotnikov](https://github.com/yogthos)'s [Web Development with Clojure, Second Edition](https://pragprog.com/book/dswdcloj2/web-development-with-clojure-second-edition).
@ -200,4 +187,5 @@ Copyright © 2016 Simon Brooke for the Radical Independence Campaign.
Licensed under the GNU General Public License, version 2.0 or (at your option) any later version. Licensed under the GNU General Public License, version 2.0 or (at your option) any later version.
**NOTE THAT** files which are directly created by the Luminus template do not currently have a GPL header **NOTE THAT** files which are directly created by the Luminus template do not currently have a GPL header
at the top; files which are new in this project or which have been substantially modified for this project should have a GPL header at the top. at the top; files which are new in this project or which have been substantially modified for this project
do have a GPL header at the top.

View file

@ -30,6 +30,6 @@
(.bind "java:comp/env/jdbc/testdb" (.bind "java:comp/env/jdbc/testdb"
(doto (org.postgresql.ds.PGSimpleDataSource.) (doto (org.postgresql.ds.PGSimpleDataSource.)
(.setServerName "localhost") (.setServerName "localhost")
(.setDatabaseName "loriner") ;; "youyesyet_dev") (.setDatabaseName "youyesyet_dev")
(.setUser "youyesyet") (.setUser "youyesyet")
(.setPassword "thisisnotsecure")))) (.setPassword "thisisnotsecure"))))

View file

@ -1,61 +1,55 @@
(defproject youyesyet "0.2.3-SNAPSHOT" (defproject youyesyet "0.2.2"
:description "Canvassing tool for referenda" :description "Canvassing tool for referenda"
:license {:name "GNU General Public License,version 2.0 or (at your option) any later version" :license {:name "GNU General Public License,version 2.0 or (at your option) any later version"
:url "https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html"} :url "https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html"}
:url "https://github.com/simon-brooke/youyesyet" :url "https://github.com/simon-brooke/youyesyet"
;; NOTE: lein-ancient failed on 20220616; it will have to be done soon if the project is to
;; procede, but I need to fix regressions first.
:dependencies [[adl-support "0.1.6"] :dependencies [[adl-support "0.1.6"]
[binaryage/devtools "1.0.3"]
[bouncer "1.0.1"] [bouncer "1.0.1"]
[ch.qos.logback/logback-classic "1.2.3"] [ch.qos.logback/logback-classic "1.2.3"]
[clj-oauth "1.5.5"] [clj-oauth "1.5.5"]
;; [cljsjs/react-leaflet "1.6.5-0"] [cljsjs/react-leaflet "1.6.5-0"]
;; [cljsjs/react-leaflet "2.4.0-0"] is available but doesn't seem to work fully ;; [cljsjs/react-leaflet "2.0.1-0"] is available but doesn't seem to work fully
[cljsjs/leaflet "1.5.1-0"] ;; leaflet-reagent-reframe uses this and it works with Firefox!
[cljs-ajax "0.8.0"] [cljs-ajax "0.8.0"]
[com.andrewmcveigh/cljs-time "0.5.2"] [com.andrewmcveigh/cljs-time "0.5.2"]
[clojure.java-time "0.3.2"] [clojure.java-time "0.3.2"]
[com.cemerick/url "0.1.1"] [com.cemerick/url "0.1.1"]
[compojure "1.6.1"] [compojure "1.6.1"]
[conman "0.8.3"] [conman "0.8.3"]
[cprop "0.1.14"] [cprop "0.1.13"]
[day8.re-frame/http-fx "0.1.6"] [day8.re-frame/http-fx "0.1.6"]
[korma "0.4.3"] [korma "0.4.3"]
[lib-noir "0.9.9" :exclusions [org.clojure/tools.reader]] [lib-noir "0.9.9" :exclusions [org.clojure/tools.reader]]
[luminus/ring-ttl-session "0.3.3"] [luminus/ring-ttl-session "0.3.2"]
[luminus-nrepl "0.1.6"] [luminus-nrepl "0.1.6"]
[luminus-migrations "0.6.6"] [luminus-migrations "0.6.5"]
[luminus-immutant "0.2.5"] [luminus-immutant "0.2.5"]
[markdown-clj "1.10.0"] [markdown-clj "1.0.8"]
[metosin/compojure-api "1.1.13"] [metosin/compojure-api "1.1.12"]
[metosin/ring-http-response "0.9.1"] [metosin/ring-http-response "0.9.1"]
[migratus "1.2.7"] [migratus "1.2.3"]
[mount "0.1.16"] [mount "0.1.16"]
[org.clojure/clojure "1.9.0"] [org.clojure/clojure "1.9.0"]
[org.clojure/clojurescript "1.10.520" :scope "provided"] [org.clojure/clojurescript "1.10.520" :scope "provided"]
[org.clojure/core.memoize "0.8.2"] [org.clojure/core.memoize "0.7.1"]
;;[org.clojure/spec.alpha "0.2.168"] ;;[org.clojure/spec.alpha "0.2.168"]
[org.clojure/tools.cli "0.4.2"] [org.clojure/tools.cli "0.4.2"]
[org.clojure/tools.logging "0.5.0"] [org.clojure/tools.logging "0.4.1"]
[org.postgresql/postgresql "42.2.8"] [org.postgresql/postgresql "42.2.5"]
[org.webjars/bootstrap "4.3.1"] [org.webjars/bootstrap "4.3.1"]
[org.webjars/font-awesome "5.11.2"] [org.webjars/font-awesome "5.8.1"]
[org.webjars.bower/tether "1.4.4"] [org.webjars.bower/tether "1.4.4"]
[postgre-types "0.0.4"] [postgre-types "0.0.4"]
[re-frame "0.10.9"] [re-frame "0.10.6"]
[reagent "0.8.1"] [reagent "0.8.1"]
[reagent-utils "0.3.3"] [reagent-utils "0.3.2"]
[recalcitrant "0.1.2"]
[ring-middleware-format "0.7.4"] [ring-middleware-format "0.7.4"]
[ring/ring-defaults "0.3.2"] [ring/ring-defaults "0.3.2"]
[ring/ring-servlet "1.7.1"] [ring/ring-servlet "1.7.1"]
[ring-webjars "0.2.0"] [ring-webjars "0.2.0"]
[secretary "1.2.3"] [secretary "1.2.3"]
[selmer "1.12.40"]] [selmer "1.12.12"]]
:deploy-repositories [["releases" :clojars] :deploy-repositories [["releases" :clojars]
["snapshots" :clojars]] ["snapshots" :clojars]]
@ -70,9 +64,9 @@
:main ^:skip-aot youyesyet.core :main ^:skip-aot youyesyet.core
:migratus {:store :database :db ~(get (System/getenv) "DATABASE_URL")} :migratus {:store :database :db ~(get (System/getenv) "DATABASE_URL")}
:plugins [[lein-adl "0.1.8-SNAPSHOT"] :plugins [[lein-adl "0.1.7"]
[lein-cljsbuild "1.1.7"] [lein-cljsbuild "1.1.7"]
[lein-codox "0.10.7"] [lein-codox "0.10.7-multilang"]
[lein-cprop "1.0.3"] [lein-cprop "1.0.3"]
[lein-kibit "0.1.6"] [lein-kibit "0.1.6"]
[lein-less "1.7.5"] [lein-less "1.7.5"]
@ -159,15 +153,15 @@
[ring/ring-devel "1.7.1"] [ring/ring-devel "1.7.1"]
[org.webjars/webjars-locator-jboss-vfs "0.1.0"] [org.webjars/webjars-locator-jboss-vfs "0.1.0"]
[luminus-immutant "0.2.5"] [luminus-immutant "0.2.5"]
[pjstadig/humane-test-output "0.10.0"] [pjstadig/humane-test-output "0.9.0"]
[binaryage/devtools "0.9.10"] [binaryage/devtools "0.9.10"]
[com.cemerick/piggieback "0.2.2"] [com.cemerick/piggieback "0.2.2"]
[directory-naming/naming-java "0.8"] [directory-naming/naming-java "0.8"]
[doo "0.1.11"] [doo "0.1.11"]
[figwheel-sidecar "0.5.19"]] [figwheel-sidecar "0.5.18"]]
:plugins [[com.jakemccrary/lein-test-refresh "0.23.0"] :plugins [[com.jakemccrary/lein-test-refresh "0.23.0"]
[lein-doo "0.1.10"] [lein-doo "0.1.10"]
[lein-figwheel "0.5.19"] [lein-figwheel "0.5.16"]
[org.clojure/clojurescript "1.10.520"]] [org.clojure/clojurescript "1.10.520"]]
:cljsbuild {:builds :cljsbuild {:builds
{:app {:app

Binary file not shown.

After

Width:  |  Height:  |  Size: 333 B

View file

@ -2,9 +2,9 @@
{% block head %} {% block head %}
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/> <meta name="viewport" content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" type="text/css" href="/css/yyy-common.css" /> <link rel="stylesheet" type="text/css" href="css/yyy-common.css" />
<link rel="stylesheet" type="text/css" href="/css/yyy-app.css" /> <link rel="stylesheet" type="text/css" href="css/yyy-app.css" />
<link rel="stylesheet" type="text/css" href="/css/spinner.css" /> <link rel="stylesheet" type="text/css" href="css/spinner.css" />
<link href="https://fonts.googleapis.com/css?family=Archivo+Black|Archivo+Narrow" rel="stylesheet"/> <link href="https://fonts.googleapis.com/css?family=Archivo+Black|Archivo+Narrow" rel="stylesheet"/>
<title>{{site-title}}: {{title}}</title> <title>{{site-title}}: {{title}}</title>
{% endblock %} {% endblock %}
@ -42,13 +42,13 @@
{% endblock %} {% endblock %}
{% block extra-tail %} {% block extra-tail %}
<!-- scripts and styles --> <!-- scripts and styles -->
<!-- ATTENTION \/ -->
<!-- ATTENTION /\ -->
<!-- Leaflet --> <!-- Leaflet -->
<link rel="stylesheet" href="js/lib/node_modules/leaflet/dist/leaflet.css" /> <link rel="stylesheet" href="js/lib/node_modules/leaflet/dist/leaflet.css" />
<script src="js/lib/node_modules/leaflet/dist/leaflet.js"></script> {% script "js/lib/node_modules/signature_pad/dist/signature_pad.min.js" %}
<!-- Signature pad --> {% script "js/lib/node_modules/leaflet/dist/leaflet.js" %}
<script src="js/lib/node_modules/signature_pad/dist/signature_pad.min.js"></script> {% script "/js/app.js" %}
<!-- our actual app -->
<script src="js/app.js"></script>
{% endblock %} {% endblock %}

View file

@ -17,9 +17,6 @@
<!-- extra-head: put any additional markup to go into the head of your document into this block --> <!-- extra-head: put any additional markup to go into the head of your document into this block -->
<!-- e.g. script tags, link tags --> <!-- e.g. script tags, link tags -->
{% endblock %} {% endblock %}
{% if servlet-context %}
<!-- Servlet context is {{servlet-context}} -->
{% endif %}
</head> </head>
<body> <body>
{% block whole-page %} {% block whole-page %}
@ -27,20 +24,20 @@
{% block top %} {% block top %}
<header> <header>
<div id="nav"> <div id="nav">
<img id="nav-icon" src="/img/threelines.png" alt="Menu"/> <img id="nav-icon" src="{{servlet-context}}/img/threelines.png" alt="Menu"/>
<menu id="nav-menu" class="nav"> <menu id="nav-menu" class="nav">
<li class=""><a href="/">Home</a></li> <li class=""><a href="{{servlet-context}}/home">Home</a></li>
<li class=""><a href="https://library.projecthope.scot/">Library</a></li> <li class=""><a href="https://library.projecthope.scot/">Library</a></li>
{% if user %} {% if user %}
<li class=""><a href="roles">Roles</a></li> <li class=""><a href="{{servlet-context}}/roles">Roles</a></li>
<li class=""><a href="logout">Logout</a></li> <li class=""><a href="{{servlet-context}}/logout">Logout</a></li>
{% else %} {% else %}
<li class=""><a href="register">Register</a></li> <li class=""><a href="{{servlet-context}}/register">Register</a></li>
<li class=""><a href="login">Login</a></li> <li class=""><a href="{{servlet-context}}/login">Login</a></li>
{% endif %} {% endif %}
<li class=""><a href="about">About</a></li> <li class=""><a href="{{servlet-context}}/about">About</a></li>
{% if user %} {% if user %}
<li id="user"><a href="profile">Logged in as {{user.username}}</a></li> <li id="user"><a href="{{servlet-context}}/profile">Logged in as {{user.username}}</a></li>
{% endif %} {% endif %}
</menu> </menu>
</div> </div>
@ -90,17 +87,17 @@
<!-- foot: override this block if you don't want the standard footer --> <!-- foot: override this block if you don't want the standard footer -->
<footer> <footer>
<div id="credits"> <div id="credits">
<div> <!-- div>
<img src="/img/credits/ric-logo.png" width="24" height="24"/> <img src="{{servlet-context}}/img/credits/ric-logo.png" width="24" height="24"/>
A project of the A project of the
<a href="https://radical.scot/">Radical Independence Campaign</a> || <a href="https://radical.scot/">Radical Independence Campaign</a> ||
Version {{version}} Version {{version}}
</div> </div -->
<div> <div>
<img height="16" width="16" alt="Clojure" src="/img/credits/luminus-logo.png"/>Built with <a href="http://www.luminusweb.net/">LuminusWeb</a> || <img height="16" width="16" alt="Clojure" src="{{servlet-context}}/img/credits/luminus-logo.png"/>Built with <a href="http://www.luminusweb.net/">LuminusWeb</a> ||
<img height="16" width="16" alt="Clojure" src="/img/credits/clojure-icon.gif"/> Powered by <a href="http://clojure.org">Clojure</a> || <img height="16" width="16" alt="Clojure" src="{{servlet-context}}/img/credits/clojure-icon.gif"/> Powered by <a href="http://clojure.org">Clojure</a> ||
<img height="16" width="16" alt="GitHub" src="/img/credits/github-logo-transparent.png"/>Find me/fork me on <a href="https://github.com/simon-brooke/youyesyet">Github</a> || <img height="16" width="16" alt="GitHub" src="{{servlet-context}}/img/credits/github-logo-transparent.png"/>Find me/fork me on <a href="https://github.com/simon-brooke/youyesyet">Github</a> ||
<img height="16" width="16" alt="Free Software Foundation" src="/img/credits/gnu.small.png"/>Licensed under the <a href="http://www.gnu.org/licenses/gpl-2.0.html">GNU General Public License version 2.0</a> <img height="16" width="16" alt="Free Software Foundation" src="{{servlet-context}}/img/credits/gnu.small.png"/>Licensed under the <a href="http://www.gnu.org/licenses/gpl-2.0.html">GNU General Public License version 2.0</a>
</div> </div>
</div> </div>
</footer> </footer>

View file

@ -11,7 +11,7 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<form action="login" method="post"> <form action="{{servlet-context}}/login" method="post">
{% csrf-field %} {% csrf-field %}
<input type="hidden" name="redirect-to" value="{{servlet-context}}/roles"/> <input type="hidden" name="redirect-to" value="{{servlet-context}}/roles"/>
<h2> <h2>

View file

@ -22,8 +22,7 @@
"Primary connection to the main database. TODO: this does not yet enable "Primary connection to the main database. TODO: this does not yet enable
sharding." sharding."
:start (conman/connect! {:jdbc-url-env (env :database-url) :start (conman/connect! {:jdbc-url-env (env :database-url)
;; :jdbc-url "jdbc:postgresql://127.0.0.1/youyesyet_dev?user=youyesyet&password=thisisnotsecure" :jdbc-url "jdbc:postgresql://127.0.0.1/youyesyet_dev?user=youyesyet&password=thisisnotsecure"
:jdbc-url "jdbc:postgresql://127.0.0.1/loriner?user=youyesyet&password=thisisnotsecure"
:driver-class-name "org.postgresql.Driver"}) :driver-class-name "org.postgresql.Driver"})
:stop (conman/disconnect! *db*)) :stop (conman/disconnect! *db*))

View file

@ -2,7 +2,6 @@
youyesyet.middleware youyesyet.middleware
(:require [clojure.tools.logging :as log] (:require [clojure.tools.logging :as log]
[ring.middleware.anti-forgery :refer [wrap-anti-forgery]] [ring.middleware.anti-forgery :refer [wrap-anti-forgery]]
[ring.middleware.content-type :refer [wrap-content-type]]
[ring.middleware.defaults :refer [site-defaults wrap-defaults]] [ring.middleware.defaults :refer [site-defaults wrap-defaults]]
[ring.middleware.format :refer [wrap-restful-format]] [ring.middleware.format :refer [wrap-restful-format]]
[ring.middleware.webjars :refer [wrap-webjars]] [ring.middleware.webjars :refer [wrap-webjars]]
@ -30,11 +29,7 @@
(do (do
(log/debug "Taking '" (:app-context env) "' as *app-context* from env") (log/debug "Taking '" (:app-context env) "' as *app-context* from env")
(:app-context env)))] (:app-context env)))]
(handler (assoc (handler (assoc request :servlet-context *app-context*)))))
request
;; bind both possible keys just to save grief
:selmer/context *app-context*
:servlet-context *app-context*)))))
(defn wrap-internal-error [handler] (defn wrap-internal-error [handler]
@ -88,6 +83,5 @@
(assoc-in [:security :anti-forgery] false) (assoc-in [:security :anti-forgery] false)
(assoc-in [:session :store] (ttl-memory-store (* 60 30))))) (assoc-in [:session :store] (ttl-memory-store (* 60 30)))))
wrap-context wrap-context
wrap-content-type
wrap-internal-error)) wrap-internal-error))

View file

@ -1,16 +1,19 @@
(ns ^{:doc "Routes/pages available to unauthenticated users." (ns ^{:doc "Routes/pages available to unauthenticated users."
:author "Simon Brooke"} youyesyet.routes.home :author "Simon Brooke"} youyesyet.routes.home
(:require [clojure.java.io :as io] (:require [adl-support.utils :refer [safe-name]]
[clojure.java.io :as io]
[clojure.string :as s]
[clojure.tools.logging :as log] [clojure.tools.logging :as log]
[clojure.walk :refer [keywordize-keys]] [clojure.walk :refer [keywordize-keys]]
[markdown.core :refer [md-to-html-string]] [markdown.core :refer [md-to-html-string]]
[noir.util.route :as route]
[ring.util.http-response :as response] [ring.util.http-response :as response]
[youyesyet.config :refer [env]] [youyesyet.config :refer [env]]
[youyesyet.db.core :as db-core] [youyesyet.db.core :as db-core]
[youyesyet.layout :as layout] [youyesyet.layout :as layout]
[youyesyet.oauth :as oauth] [youyesyet.oauth :as oauth]
[youyesyet.routes.utils :refer [with-servlet-context]] [compojure.core :refer [defroutes GET POST]]
[compojure.core :refer [defroutes GET POST]])) ))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; ;;;;
@ -45,41 +48,27 @@
(if (.exists motd) (slurp motd) ""))) (if (.exists motd) (slurp motd) "")))
(defn about-page (defn about-page []
"Render a page describing the app and its purpose."
[request]
(layout/render "md.html" {:title (layout/render "md.html" {:title
(str "About " (:site-title env)) (str "About " (:site-title env))
:servlet-context (:servlet-context request)
:content (md-to-html-string (slurp (io/resource "about.md")))})) :content (md-to-html-string (slurp (io/resource "about.md")))}))
(defn call-me-page (defn call-me-page [request]
"Render a page requesting a call to a particular elector from a member of the
telephone canvassing team."
[request]
(if (if
request request
(do (do
;; do something to store it in the database ;; do something to store it in the database
(layout/render (layout/render "call-me-accepted.html" (:session request) (:params request)))
"call-me-accepted.html"
(:session request)
(assoc (:params request) :servlet-context (:servlet-context request)))
(layout/render "call-me.html" (:session request) (layout/render "call-me.html" (:session request)
(with-servlet-context {:title "Please call me!" {:title "Please call me!"
;; TODO: Issues need to be fetched from the database ;; TODO: Issues need to be fetched from the database
:concerns (db-core/list-issues db-core/*db* {})} :concerns (db-core/list-issues db-core/*db* {})})))
request)))))
(defn home-page (defn home-page []
"Render the default page." (layout/render "home.html" {:title "You yes yet?"
[request] :motd (md-to-html-string (motd))}))
(layout/render "home.html" (with-servlet-context
{:title "You yes yet?"
:motd (md-to-html-string (motd))}
request)))
(defn login-page (defn login-page
@ -88,7 +77,7 @@
(let [params (keywordize-keys (:params request)) (let [params (keywordize-keys (:params request))
session (:session request) session (:session request)
username (:username params) username (:username params)
user (when username (db-core/get-canvasser-by-username db-core/*db* {:username username})) user (if username (db-core/get-canvasser-by-username db-core/*db* {:username username}))
password (:password params) password (:password params)
redirect-to (or redirect-to (or
(:redirect-to params) (:redirect-to params)
@ -119,37 +108,27 @@
username username
(layout/render (layout/render
"login.html" "login.html"
(with-servlet-context
{:title (str "User " username " is unknown") {:title (str "User " username " is unknown")
:redirect-to redirect-to :redirect-to redirect-to
:warnings ["Your user name was not recognised or your password did not match"]} :warnings ["Your user name was not recognised or your password did not match"]})
request))
;; if we've no username, just invite the user to log in ;; if we've no username, just invite the user to log in
:else true
(layout/render (layout/render
"login.html" "login.html"
(with-servlet-context
{:title "Please log in" {:title "Please log in"
:redirect-to redirect-to :redirect-to redirect-to
:authorities (db-core/list-authorities db-core/*db*)} :authorities (db-core/list-authorities db-core/*db*)}))))
request)))))
(defroutes home-routes (defroutes home-routes
(GET "/" [request] (home-page request)) (GET "/" [] (home-page))
(GET "/home" [request] (home-page request)) (GET "/home" [] (home-page))
(GET "/about" [request] (about-page request)) (GET "/about" [] (about-page))
(GET "/call-me" [request] (call-me-page request)) (GET "/call-me" [] (call-me-page nil))
(POST "/call-me" request (call-me-page request)) (POST "/call-me" request (call-me-page request))
(GET "/login" request (login-page request)) (GET "/login" request (login-page request))
(POST "/login" request (login-page request)) (POST "/login" request (login-page request))
(GET "/notyet" [request] (layout/render (GET "/notyet" [] (layout/render "notyet.html"
"notyet.html" {:title "Can we persuade you?"}))
(with-servlet-context (GET "/supporter" [] (layout/render "supporter.html"
{:title "Can we persuade you?"} {:title "Have you signed up as a canvasser yet?"})))
request)))
(GET "/supporter" [request] (layout/render
"supporter.html"
(with-servlet-context
{:title "Have you signed up as a canvasser yet?"}
request))))

View file

@ -1,15 +1,23 @@
(ns ^{:doc "Manually maintained routes which handle data transfer to/from the canvasser app." (ns ^{:doc "Manually maintained routes which handle data transfer to/from the canvasser app."
:author "Simon Brooke"} youyesyet.routes.rest :author "Simon Brooke"} youyesyet.routes.rest
(:require [adl-support.core :refer [massage-params]] (:require [adl-support.rest-support :refer :all]
[adl-support.rest-support :refer [do-or-server-fail valid-user-or-forbid with-params-or-error]] [adl-support.core :refer [massage-params do-or-log-error
do-or-return-reason]]
[clojure.core.memoize :as memo] [clojure.core.memoize :as memo]
[clojure.data.json :as json] [clojure.data.json :as json]
[clojure.java.io :as io]
[clojure.string :as s]
[clojure.tools.logging :as log] [clojure.tools.logging :as log]
[compojure.core :refer [defroutes GET]] [clojure.walk :refer [keywordize-keys]]
[compojure.core :refer [defroutes GET POST]]
[java-time :as jt] [java-time :as jt]
[mount.core :as mount]
[noir.response :as nresponse]
[noir.util.route :as route] [noir.util.route :as route]
[ring.util.http-response :as response]
[youyesyet.locality :as l] [youyesyet.locality :as l]
[youyesyet.db.core :as db] [youyesyet.db.core :as db]
[youyesyet.utils :refer :all]
)) ))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View file

@ -3,20 +3,20 @@
(:require [adl-support.core :as support] (:require [adl-support.core :as support]
[adl-support.utils :refer [safe-name]] [adl-support.utils :refer [safe-name]]
[clojure.tools.logging :as log] [clojure.tools.logging :as log]
[clojure.walk :refer [keywordize-keys]]
[compojure.core :refer [defroutes GET POST]] [compojure.core :refer [defroutes GET POST]]
[noir.util.route :as route] [noir.util.route :as route]
[ring.util.http-response :as response] [ring.util.http-response :as response]
[youyesyet.config :refer [env]]
[youyesyet.db.core :as db-core] [youyesyet.db.core :as db-core]
[youyesyet.routes.issue-experts :as expert] [youyesyet.routes.issue-experts :as expert]
[youyesyet.layout :as layout] [youyesyet.layout :as layout]
[youyesyet.oauth :as oauth] [youyesyet.oauth :as oauth]
[youyesyet.routes.auto :as auto] [youyesyet.routes.auto :as auto]))
[youyesyet.routes.utils :refer [with-servlet-context]]))
(defn roles-page (defn roles-page [request]
"Render the routing page for the roles the currently logged in user is member of." "Render the routing page for the roles the currently logged in user is member of."
[request]
(let (let
[session (:session request) [session (:session request)
user (-> request :session :user) user (-> request :session :user)
@ -29,7 +29,6 @@
(layout/render (layout/render
"roles.html" "roles.html"
{:title (str "Welcome " (:fullname user) ", what do you want to do?") {:title (str "Welcome " (:fullname user) ", what do you want to do?")
:servlet-context (:servlet-context request)
:user user :user user
:roles (map #(assoc % :link (safe-name (:name %) :sql)) roles)}) :roles (map #(assoc % :link (safe-name (:name %) :sql)) roles)})
(assoc (response/found "/login") :session (dissoc session :user))))) (assoc (response/found "/login") :session (dissoc session :user)))))
@ -39,7 +38,7 @@
[request] [request]
(layout/render (layout/render
(support/resolve-template "application-index.html") (support/resolve-template "application-index.html")
(with-servlet-context {:title "Administrative menu"} request))) {:title "Administrative menu"}))
(defn analysts-page (defn analysts-page
@ -49,21 +48,21 @@
[request] [request]
(layout/render (layout/render
(support/resolve-template "application-index.html") (support/resolve-template "application-index.html")
(with-servlet-context {:title "Administrative menu"} request))) {:title "Administrative menu"}))
(defn canvassers-page (defn canvassers-page
[request] [request]
(layout/render (layout/render
"roles/canvasser.html" "roles/canvasser.html"
(with-servlet-context {} request))) {}))
(defn team-organisers-page (defn team-organisers-page
[request] [request]
(layout/render (layout/render
"roles/team-orgenisers.html" "roles/team-orgenisers.html"
(with-servlet-context {} request))) {}))
(defroutes roles-routes (defroutes roles-routes

View file

@ -1,12 +0,0 @@
(ns youyesyet.routes.utils)
(defn with-servlet-context
"Returns a map like `m` into which the servlet context from `request`,
expected to be a request map, has been merged. When an app is served from
Tomcat, there will be a `:servlet-context` key in the map, and it matters;
when served from Jetty or other lightweight servlet containers, there won't
be. TODO: should probably be moved (or copied) to adl-support."
[m request]
(if (:servlet-context m)
(assoc m :servlet-context (:servlet-context request))
m))

View file

@ -1,16 +1,14 @@
(ns ^{:doc "Canvasser app navigation and routing." (ns ^{:doc "Canvasser app navigation and routing."
:author "Simon Brooke"} :author "Simon Brooke"}
youyesyet.canvasser-app.core youyesyet.canvasser-app.core
(:require [ajax.core :refer [GET POST]] (:require cljsjs.react-leaflet
[cljsjs.leaflet] [ajax.core :refer [GET POST]]
[devtools.core :as devtools]
[goog.events :as events] [goog.events :as events]
[goog.history.EventType :as HistoryEventType] [goog.history.EventType :as HistoryEventType]
[markdown.core :refer [md->html]] [markdown.core :refer [md->html]]
[reagent.core :as r] [reagent.core :as r]
[re-frame.core :as rf] [re-frame.core :as rf]
[re-frame.fx] [re-frame.fx]
[recalcitrant.core :refer [error-boundary]] ;; may not be needed here
[secretary.core :as secretary] [secretary.core :as secretary]
[youyesyet.canvasser-app.ajax :refer [load-interceptors!]] [youyesyet.canvasser-app.ajax :refer [load-interceptors!]]
[youyesyet.canvasser-app.gis :refer [get-current-location]] [youyesyet.canvasser-app.gis :refer [get-current-location]]
@ -51,11 +49,6 @@
;;;; ;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; install tools to aid debugging in Chrome/Chromium.
(devtools/install!)
;;; So that we can do debug logging! ;;; So that we can do debug logging!
(enable-console-print!) (enable-console-print!)
@ -128,22 +121,20 @@
(if content [content] (if content [content]
[:div.error (str "No content in page " @(rf/subscribe [:page]))]) [:div.error (str "No content in page " @(rf/subscribe [:page]))])
[:footer [:footer
(if-not (empty? error) [:div.error {:style [:display (if (empty? error) :none :block)]} (apply str error)]
[:div.error
error])
(if-not (empty? feedback)
[:div.feedback [:div.feedback
(apply str (map #(h/feedback-messages %) (distinct feedback)))]) {:style [:display (if (empty? feedback) :none :block)]}
;; (if-not (empty? outqueue) (apply str (map #(h/feedback-messages %) (distinct feedback)))]
;; [:div.queue (str (count outqueue) " items queued to send")]) [:div.queue (if
]])) (nil? outqueue) ""
(str (count outqueue) " items queued to send"))]]]))
;; ------------------------- ;; -------------------------
;; Routes ;; Routes
(secretary/set-config! :prefix "#") (secretary/set-config! :prefix "#")
(secretary/defroute "/" [] (secretary/defroute "/" []
(ui/log-and-dispatch [:set-active-page :about])) (ui/log-and-dispatch [:set-active-page :map]))
(secretary/defroute "/about" [] (secretary/defroute "/about" []
(ui/log-and-dispatch [:set-active-page :about])) (ui/log-and-dispatch [:set-active-page :about]))
@ -161,7 +152,7 @@
(secretary/defroute "/elector" [] (secretary/defroute "/elector" []
(ui/log-and-dispatch [:set-active-page :elector])) (ui/log-and-dispatch [:set-active-page :elector]))
(secretary/defroute "/elector/:elector" {elector-id :elector} (secretary/defroute "/elector/:elector/:consent" {elector-id :elector}
(ui/log-and-dispatch [:set-elector-and-page {:elector-id elector-id :page :elector}])) (ui/log-and-dispatch [:set-elector-and-page {:elector-id elector-id :page :elector}]))
(secretary/defroute "/elector/:elector/:consent" {elector-id :elector consent :consent} (secretary/defroute "/elector/:elector/:consent" {elector-id :elector consent :consent}
@ -222,7 +213,7 @@
(rf/dispatch [:fetch-options]) (rf/dispatch [:fetch-options])
(rf/dispatch [:fetch-issues]) (rf/dispatch [:fetch-issues])
(rf/dispatch [:fetch-followupmethods]) (rf/dispatch [:fetch-followupmethods])
;; (rf/dispatch [:dispatch-later [{:ms 60000 :dispatch [:process-queue]}]]) (rf/dispatch [:dispatch-later [{:ms 60000 :dispatch [:process-queue]}]])
(load-interceptors!) (load-interceptors!)
(hook-browser-navigation!) (hook-browser-navigation!)
(mount-components)) (mount-components))

View file

@ -45,23 +45,13 @@
(.getCurrentPosition (.getCurrentPosition
(.-geolocation js/navigator) (.-geolocation js/navigator)
(fn [position] (fn [position]
(let [view @(subscribe [:view]) (let [lat (.-latitude (.-coords position))
lat (.-latitude (.-coords position))
lng (.-longitude (.-coords position))] lng (.-longitude (.-coords position))]
(js/console.log (str "Current location is: " lat ", " lng)) (js/console.log (str "Current location is: " lat ", " lng))
(if
(and view (float? lat) (float? lng))
(do
(dispatch [:set-latitude lat]) (dispatch [:set-latitude lat])
(dispatch [:set-longitude lng]) (dispatch [:set-longitude lng])
(.panTo view (.latLng js/L lat lng)) (.panTo @(subscribe [:view]) (.latLng js/L lat lng))
(locality lat lng)) (locality lat lng))))
(do
(js/console.log
(if view
(str "Geolocation failed lat: '" lat "'; lng '" lng "'")
"No value for subscription to [:view]"))
0)))))
(do (do
(js/console.log "Geolocation not available") (js/console.log "Geolocation not available")
0)) 0))
@ -94,14 +84,12 @@
so back links work." so back links work."
[id] [id]
(js/console.log (str "Click handler for address #" id)) (js/console.log (str "Click handler for address #" id))
;; (let [view @(subscribe [:view]) (let [view @(subscribe [:view])
;; centre (.getCenter view)] centre (.getCenter view)]
;; (dispatch [:set-zoom (.getZoom view)]) (dispatch [:set-zoom (.getZoom view)])
;; (dispatch [:set-latitude (.-lat centre)]) (dispatch [:set-latitude (.-lat centre)])
;; (dispatch [:set-longitude (.-lng centre)])) (dispatch [:set-longitude (.-lng centre)]))
(js/console.log (str "Navigating to " "#building/" id)) (set! window.location.href (str "#building/" id)))
(set! window.location.href (str "#building/" id))
)
(defn add-map-pin (defn add-map-pin

View file

@ -64,8 +64,8 @@
(apply 'do forms))) (apply 'do forms)))
(defn compose-packet (defn compose-packet
"Convert this `item` into a URI which can be sent as a GET call"
[item] [item]
"Convert this `item` into a URI which can be sent as a GET call"
(assoc (assoc
(url js/window.location) (url js/window.location)
:path (str "/rest/" (name (:action item))) :path (str "/rest/" (name (:action item)))
@ -74,11 +74,9 @@
(def feedback-messages (def feedback-messages
"Messages used as feedback to the user"
{:fetch-locality "Fetching local data." {:fetch-locality "Fetching local data."
:send-request "Request has been queued." :send-request "Request has been queued."
:send-intention-and-visit "Voting intention has been sent" :send-intention-and-visit "Voting intention has been sent"
:bad-address "No valid address has been selected"
}) })
@ -120,10 +118,9 @@
(remove-from-key db :outqueue x)) (remove-from-key db :outqueue x))
(defn coerce-to-number (defn coerce-to-number [v]
"If it is possible to do so, coerce `v` to a number. "If it is possible to do so, coerce `v` to a number.
NOTE: I tried to do this in *cljc*, but it did not work. Leave it alone." NOTE: I tried to do this in *cljc*, but it did not work. Leave it alone."
[v]
(if (number? v) v (if (number? v) v
(try (try
(read-string (str v)) (read-string (str v))
@ -381,7 +378,7 @@
(assoc (clear-messages db) :page k) (assoc (clear-messages db) :page k)
db))) db)))
;; TEMP: this is what doesn't seem to be being called
(reg-event-db (reg-event-db
:set-address :set-address
(fn [db [_ address-id]] (fn [db [_ address-id]]

View file

@ -59,7 +59,7 @@
(reg-sub (reg-sub
:error :error
(fn [db _] (fn [db _]
(apply str (:error db)))) (:error db)))
(reg-sub (reg-sub
:feedback :feedback

View file

@ -38,8 +38,6 @@
[] []
(let [address @(subscribe [:address]) (let [address @(subscribe [:address])
dwellings (:dwellings address)] dwellings (:dwellings address)]
(js/console.log (str "Address: address"))
(if address
[:div [:div
[:h1 (str "Flats at " (:address address))] [:h1 (str "Flats at " (:address address))]
[:div.container {:id "main-container"} [:div.container {:id "main-container"}
@ -53,4 +51,4 @@
:target (str "#/dwelling/" (:id dwelling))) ) :target (str "#/dwelling/" (:id dwelling))) )
(sort-by (sort-by
:sub_address :sub_address
(:dwellings address)))]]]))) (:dwellings address)))]]]))

View file

@ -1,10 +1,8 @@
(ns ^{:doc "Canvasser app map view panel." (ns ^{:doc "Canvasser app map view panel."
:author "Simon Brooke"} :author "Simon Brooke"}
youyesyet.canvasser-app.views.map youyesyet.canvasser-app.views.map
(:require [cljsjs.leaflet] (:require [re-frame.core :refer [reg-sub subscribe dispatch dispatch-sync]]
[re-frame.core :refer [reg-sub subscribe dispatch dispatch-sync]]
[reagent.core :as reagent] [reagent.core :as reagent]
[recalcitrant.core :refer [error-boundary]]
[youyesyet.canvasser-app.gis :refer [refresh-map-pins get-current-location]])) [youyesyet.canvasser-app.gis :refer [refresh-map-pins get-current-location]]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -50,7 +48,7 @@
;;; thought. ;;; thought.
;; which provider to use ;; which provider to use
(def ^:dynamic *map-provider* :osm) (def ^dynamic *map-provider* :osm)
(def osm-url "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png") (def osm-url "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png")
(def osm-attrib "Map data &copy; <a href='http://openstreetmap.org'>OpenStreetMap</a> contributors") (def osm-attrib "Map data &copy; <a href='http://openstreetmap.org'>OpenStreetMap</a> contributors")
@ -60,8 +58,7 @@
"Did-mount function loading map tile data from MapBox (proprietary)." "Did-mount function loading map tile data from MapBox (proprietary)."
[] []
(get-current-location) (get-current-location)
(let [view (.setView (let [view (.setView (.map js/L "map" (clj->js {:zoomControl "false"})) #js [55.82 -4.25] 40)]
(.map js/L "map" (clj->js {:zoomControl "false"})))]
;; NEED TO REPLACE FIXME with your mapID! ;; NEED TO REPLACE FIXME with your mapID!
(.addTo (.tileLayer js/L "http://{s}.tiles.mapbox.com/v3/FIXME/{z}/{x}/{y}.png" (.addTo (.tileLayer js/L "http://{s}.tiles.mapbox.com/v3/FIXME/{z}/{x}/{y}.png"
(clj->js {:attribution "Map data &copy; [...]" (clj->js {:attribution "Map data &copy; [...]"
@ -72,7 +69,7 @@
(defn map-did-mount-osm (defn map-did-mount-osm
"Did-mount function loading map tile data from Open Street Map." "Did-mount function loading map tile data from Open Street Map."
[] []
(get-current-location) ;; - [Violation] Only request geolocation information in response to a user gesture. (get-current-location)
(let [view (.setView (let [view (.setView
(.map js/L (.map js/L
"map" "map"
@ -113,6 +110,6 @@
(defn panel (defn panel
"A reagent class for the map object." "A reagent class for the map object."
[] []
;; (get-current-location) (get-current-location)
(reagent/create-class {:reagent-render map-render (reagent/create-class {:reagent-render map-render
:component-did-mount map-did-mount})) :component-did-mount map-did-mount}))

View file

@ -1,14 +0,0 @@
{
"folders": [
{
"path": "."
},
{
"path": "../adl-support"
},
{
"path": "../Selmer"
}
],
"settings": {}
}

View file

@ -242,7 +242,7 @@ version="0.1.1">
<property type="real" name="longitude" column="longitude"> <property type="real" name="longitude" column="longitude">
<prompt prompt="Longitude" locale="en_GB.UTF-8"/> <prompt prompt="Longitude" locale="en_GB.UTF-8"/>
</property> </property>
<property type="list" name="dwellings" entity="dwellings" farkey="address_id"/> <property type="list" name="dwellings" entity="dwellings"/>
<property type="integer" name="locality" column="locality"> <property type="integer" name="locality" column="locality">
<documentation>Locality indexing; see issue #44. Note that <documentation>Locality indexing; see issue #44. Note that
this property should be generated automatically from the this property should be generated automatically from the
@ -320,7 +320,7 @@ version="0.1.1">
<prompt prompt="Canvasser" locale="en_GB.UTF-8"/> <prompt prompt="Canvasser" locale="en_GB.UTF-8"/>
</property> </property>
<property required="true" type="timestamp" name="date" <property required="true" type="timestamp" name="date"
column="date" default="now()" distinct="user"> column="date" default="CURRENT_TIMESTAMP" distinct="user">
<prompt prompt="Date" locale="en_GB.UTF-8"/> <prompt prompt="Date" locale="en_GB.UTF-8"/>
</property> </property>
<permission group="canvassers" permission="noedit"> <permission group="canvassers" permission="noedit">
@ -1000,7 +1000,7 @@ version="0.1.1">
column="actor" entity="canvassers" farkey="id"> column="actor" entity="canvassers" farkey="id">
<prompt prompt="Actor" locale="en_GB.UTF-8"/> <prompt prompt="Actor" locale="en_GB.UTF-8"/>
</property> </property>
<property default="now()" type="timestamp" <property default="CURRENT_TIMESTAMP" type="timestamp"
name="date" column="date" distinct="user"> name="date" column="date" distinct="user">
<prompt prompt="Date" locale="en_GB.UTF-8"/> <prompt prompt="Date" locale="en_GB.UTF-8"/>
</property> </property>

File diff suppressed because it is too large Load diff