diff --git a/README.md b/README.md
index f21afe9..74f4f00 100644
--- a/README.md
+++ b/README.md
@@ -43,6 +43,20 @@ If you're thinking of joining in development on this I'd strongly recommend you
You should also read the [User-Oriented Specification](doc/specification/userspec.md) and any other documentation which appears under the *doc/specification* hierarchy.
+## Building this
+
+This application is built using [Application Description Language](); the intention is that soon Application Description Language will run as a Leiningen plugin, but that does not yet work.
+
+So first you must check out the Application Description Language repository as well as this repository, ideally within a a common directory;
+
+then:
+
+ cd adl
+ lein uberjar
+ java -jar target/adl-1.4.4-SNAPSHOT-standalone.jar --path ../youyesyet/ ../youyesyet/youyesyet.adl.xml
+
+This will generate a large number of the source files required by YouYesYet, **including** the database initialisation scripts.
+
## Getting the database up
You'll need a file *profiles.clj*, with content similar to the following; it's not in the repository because it contains passwords.
@@ -62,8 +76,16 @@ Do get the database initialised, run
I'm no longer using Migratus as I'm using [Application Description Language]()
to generate the majority of the application, and, as changes are made to the application
description, new database schemas are generated. The database initialisation script will
-be found at `resources/sql/youyesyet.postgres.sql`. Reference data initialisation scripts
-will in due course be stored in the same directory.
+be found at `resources/sql/youyesyet.postgres.sql`. Manually maintained overrides are found in
+`resources/sql/youyesyet.postgres.overrides.sql`. So to initialise the database, invoke
+
+ psql youyesyet_dev < resources/sql/youyesyet.postgres.sql
+
+followed by
+
+ psql youyesyet_dev < resources/sql/youyesyet.postgres.overrides.sql
+
+Reference data initialisation scripts will in due course be stored in the same directory.
Once we have a more or less finished application it may be worth going back to
[Migratus](https://github.com/yogthos/migratus); I might have a go at generating migrations from
@@ -75,20 +97,25 @@ To run in a dev environment, checkout the *develop* branch
To download and install Javascript delendencies, run
+ cd youyesyet
lein npm install
To start a development web server for the application, run:
- lein run
+Then
-If you're wanting to work on cljs development, you need two terminal sessions. In one run
+ lein repl
- lein run
+Wait for the clojure `user=>` prompt to appear, and enter
-as above; in the other, run
+ (mount/start)
+
+This will get the application running for development; ideally, open a new terminal and invoke
lein figwheel
+which will aid in work on the ClojureScript components.
+
## Running in a production environment
Doesn't really work yet; if you want to try it, see [Bug #36](https://github.com/simon-brooke/youyesyet/issues/36) and check out the associated feature branch.
diff --git a/resources/sql/queries.sql b/resources/sql/queries.sql
index 0705af8..855342f 100644
--- a/resources/sql/queries.sql
+++ b/resources/sql/queries.sql
@@ -53,6 +53,7 @@ FROM followuprequests as request,
where not exists (select * from followupactions as action
where action.request_id = request.id
and action.closed = true)
+and request.locked_by is null
and request.elector_id = electors.id
and request.visit_id = visits.id
and visits.address_id = addresses.id
diff --git a/resources/sql/youyesyet.postgres.overrides.sql b/resources/sql/youyesyet.postgres.overrides.sql
index d0c7a9b..f716dbf 100644
--- a/resources/sql/youyesyet.postgres.overrides.sql
+++ b/resources/sql/youyesyet.postgres.overrides.sql
@@ -30,6 +30,7 @@ SELECT electors.name ||', '|| addresses.address ||', '|| addresses.postcode ||',
followupactions.request_id,
canvassers.username ||', '|| canvassers.fullname ||', '|| addresses.address ||', '|| addresses.postcode ||', '|| canvassers.phone ||', '|| canvassers.email AS actor_expanded,
followupactions.actor,
+ canvassers.fullname AS actor_name,
followupactions.date,
followupactions.notes,
followupactions.closed,
@@ -43,3 +44,10 @@ WHERE followupactions.request_id = followuprequests.id
AND followupactions.actor = canvassers.id
;
GRANT SELECT ON lv_followupactions TO canvassers, issueexperts;
+
+
+------------------------------------------------------------------------
+-- request locking
+------------------------------------------------------------------------
+ALTER TABLE followuprequests ADD COLUMN locked_by INTEGER REFERENCES canvassers(id) ON DELETE SET NULL;
+ALTER TABLE followuprequests ADD COLUMN locked TIMESTAMP;
diff --git a/resources/templates/issue-expert/list.html b/resources/templates/issue-expert/list.html
index 8e1921b..5d929da 100644
--- a/resources/templates/issue-expert/list.html
+++ b/resources/templates/issue-expert/list.html
@@ -1,5 +1,9 @@
{% extends "base.html" %}
+{% block extra-head %}
+
+{% endblock %}
+
{% block back-links %}