From 3850753743c4aa3ebc61e3fb12254861de0f3ea2 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 15 Mar 2017 17:27:03 +0000 Subject: [PATCH 01/31] Minor fix to .gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7ff653c..99b78ef 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,5 @@ pom.xml.asc .nrepl-port /node_modules/ .DS_Store -*-init.clj \ No newline at end of file +*-init.clj +profiles\.clj From d83a7924e2e5c571d95efec8969c0d57b5f6a9b8 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 15 Mar 2017 20:13:22 +0000 Subject: [PATCH 02/31] #21: Tables created Sorted out the migratus stuff so that it actually works, and added a bit to README to say how to get the database initialised; added a new migration to add the roles and teams table. --- README.md | 17 +- .../entity-relationship-diagram.svg | 535 ++++++++++++++---- .../20161014170335-basic-setup.up.sql | 39 +- .../20170315190500-roles-and-teams.down.sql | 11 + .../20170315190500-roles-and-teams.up.sql | 35 ++ src/clj/youyesyet/db/schema.clj | 95 +++- 6 files changed, 574 insertions(+), 158 deletions(-) create mode 100644 resources/migrations/20170315190500-roles-and-teams.down.sql create mode 100644 resources/migrations/20170315190500-roles-and-teams.up.sql diff --git a/README.md b/README.md index 5900935..a5f923c 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ I've put a [dummy site](http://www.journeyman.cc/~simon/tmp/yyy-dummy/index.html ## Prerequisites -You will need [Leiningen][1] 2.0 or above installed. The database required must be [Postgres][2]. +You will need [Leiningen][1] 2.0 or above installed. The database required must be [Postgres][2] 9.3 or above. [1]: https://github.com/technomancy/leiningen [2]: https://www.postgresql.org/ @@ -38,12 +38,27 @@ You'll also need to create your own local copy of *profiles.clj*, which should c Where *username* is the username required to access the database, and *thisisnotsecure* is the password which authenticates that username. +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. + ## 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). You should also read the [User-Oriented Specification](doc/specification/userspec.md) and any other documentation which appears under the *doc/specification* hierarchy. + +## Getting the database up + +Do get the database initialised, run + + createdb youyesyet_dev + +followed by + + lein migratus migrate + +**NOTE THAT** in the namespace *youyesyet.db.schema*, there are a series of functions *create-xxx-table!*. These are a snare and a delusion; they are how I originally bootstrapped the database, but are no longer used (and should probably be deleted). The database is now constructed using [migratus](https://github.com/yogthos/migratus). + ## Running To start a web server for the application, run: diff --git a/doc/specification/entity-relationship-diagram.svg b/doc/specification/entity-relationship-diagram.svg index 6aafafc..0de6cf0 100644 --- a/doc/specification/entity-relationship-diagram.svg +++ b/doc/specification/entity-relationship-diagram.svg @@ -25,16 +25,16 @@ borderopacity="1.0" inkscape:pageopacity="0.0" inkscape:pageshadow="2" - inkscape:zoom="0.98994949" - inkscape:cx="473.75864" - inkscape:cy="409.50744" + inkscape:zoom="1.979899" + inkscape:cx="833.70674" + inkscape:cy="324.89697" inkscape:document-units="px" inkscape:current-layer="layer1" showgrid="true" inkscape:window-width="1920" - inkscape:window-height="996" - inkscape:window-x="0" - inkscape:window-y="28" + inkscape:window-height="1058" + inkscape:window-x="1920" + inkscape:window-y="0" inkscape:window-maximized="1"> image/svg+xml - + @@ -57,6 +57,13 @@ inkscape:groupmode="layer" id="layer1" transform="translate(0,-308.26772)"> + - - - + id="g4369"> + + + + + - - - + id="g4402"> + + + + + - - Option - - - + id="g4356" + transform="translate(-170.71578,120.20815)"> + + Option + sodipodi:nodetypes="ccccc" /> - @@ -580,7 +572,7 @@ sodipodi:nodetypes="cccc" /> @@ -598,16 +590,10 @@ sodipodi:nodetypes="ccc" /> - + sodipodi:nodetypes="cccccc" /> Version: 0.1Version: 0.2Date: 20161014Date: 20170315Copyright: (c) 2016 Simon Brooke for Radical Independence Campaign + inkscape:connector-curvature="0" + sodipodi:nodetypes="ccccc" /> Visited + y="498.31903" + style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:10px;line-height:125%;font-family:Arial;-inkscape-font-specification:'Arial, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start">Visited Requested - For To + + + Team + + + + Organiser-ship + TeamMembership + + + + + + + + + + + Has + Has + of + of + + + + + + + + For + + RoleMembership + + + Role + + + + + + + + Is + Includes + + + + + + + diff --git a/resources/migrations/20161014170335-basic-setup.up.sql b/resources/migrations/20161014170335-basic-setup.up.sql index 8468728..0719e57 100644 --- a/resources/migrations/20161014170335-basic-setup.up.sql +++ b/resources/migrations/20161014170335-basic-setup.up.sql @@ -68,7 +68,7 @@ SET default_with_oids = false; -- Name: addresses; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace: -- -CREATE TABLE addresses ( +CREATE TABLE IF NOT EXISTS addresses ( id integer NOT NULL, address character varying(256) NOT NULL, postcode character varying(16), @@ -106,7 +106,7 @@ ALTER SEQUENCE addresses_id_seq OWNED BY addresses.id; -- Name: authorities; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace: -- -CREATE TABLE authorities ( +CREATE TABLE IF NOT EXISTS authorities ( id character varying(32) NOT NULL ); --;; @@ -117,8 +117,9 @@ ALTER TABLE public.authorities OWNER TO youyesyet; -- Name: canvassers; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace: -- -CREATE TABLE canvassers ( - id character varying(32) NOT NULL, +CREATE TABLE IF NOT EXISTS canvassers ( + id serial, + username character varying(32) NOT NULL, fullname character varying(64) NOT NULL, elector_id integer, address_id integer NOT NULL, @@ -135,7 +136,7 @@ ALTER TABLE public.canvassers OWNER TO youyesyet; -- Name: districts; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace: -- -CREATE TABLE districts ( +CREATE TABLE IF NOT EXISTS districts ( id integer NOT NULL, name character varying(64) NOT NULL ); @@ -147,7 +148,7 @@ ALTER TABLE public.districts OWNER TO youyesyet; -- Name: electors; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace: -- -CREATE TABLE electors ( +CREATE TABLE IF NOT EXISTS electors ( id integer NOT NULL, name character varying(64) NOT NULL, address_id integer NOT NULL, @@ -162,10 +163,10 @@ ALTER TABLE public.electors OWNER TO youyesyet; -- Name: followupactions; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace: -- -CREATE TABLE followupactions ( +CREATE TABLE IF NOT EXISTS followupactions ( id integer NOT NULL, request_id integer NOT NULL, - actor character varying(32) NOT NULL, + actor integer NOT NULL, date timestamp with time zone DEFAULT now() NOT NULL, notes text, closed boolean @@ -199,7 +200,7 @@ ALTER SEQUENCE followupactions_id_seq OWNED BY followupactions.id; -- Name: followupmethods; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace: -- -CREATE TABLE followupmethods ( +CREATE TABLE IF NOT EXISTS followupmethods ( id character varying(32) NOT NULL ); --;; @@ -218,7 +219,7 @@ insert into followupmethods values ('Post'); --;; -CREATE TABLE followuprequests ( +CREATE TABLE IF NOT EXISTS followuprequests ( id integer NOT NULL, elector_id integer NOT NULL, visit_id integer NOT NULL, @@ -258,8 +259,8 @@ ALTER SEQUENCE followuprequests_id_seq OWNED BY followuprequests.id; -- Name: issueexpertise; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace: -- -CREATE TABLE issueexpertise ( - canvasser_id character varying(32) NOT NULL, +CREATE TABLE IF NOT EXISTS issueexpertise ( + canvasser_id integer NOT NULL, issue_id character varying(32) NOT NULL, method_id character varying(32) NOT NULL ); @@ -273,7 +274,7 @@ ALTER TABLE public.issueexpertise OWNER TO youyesyet; -- Name: issues; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace: -- -CREATE TABLE issues ( +CREATE TABLE IF NOT EXISTS issues ( id character varying(32) NOT NULL, url character varying(256) ); @@ -287,7 +288,7 @@ ALTER TABLE public.issues OWNER TO youyesyet; -- Name: options; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace: -- -CREATE TABLE options ( +CREATE TABLE IF NOT EXISTS options ( id character varying(32) NOT NULL ); --;; @@ -300,7 +301,7 @@ ALTER TABLE public.options OWNER TO youyesyet; -- Name: schema_migrations; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace: -- -CREATE TABLE schema_migrations ( +CREATE TABLE IF NOT EXISTS schema_migrations ( id bigint NOT NULL ); --;; @@ -313,10 +314,10 @@ ALTER TABLE public.schema_migrations OWNER TO youyesyet; -- Name: visits; Type: TABLE; Schema: public; Owner: youyesyet; Tablespace: -- -CREATE TABLE visits ( +CREATE TABLE IF NOT EXISTS visits ( id integer NOT NULL, address_id integer NOT NULL, - canvasser_id character varying(32) NOT NULL, + canvasser_id integer NOT NULL, date timestamp with time zone DEFAULT now() NOT NULL ); --;; @@ -484,8 +485,8 @@ ALTER TABLE ONLY options -- Name: schema_migrations_id_key; Type: CONSTRAINT; Schema: public; Owner: youyesyet; Tablespace: -- -ALTER TABLE ONLY schema_migrations - ADD CONSTRAINT schema_migrations_id_key UNIQUE (id); +--ALTER TABLE ONLY schema_migrations +-- ADD CONSTRAINT schema_migrations_id_key UNIQUE (id); --;; diff --git a/resources/migrations/20170315190500-roles-and-teams.down.sql b/resources/migrations/20170315190500-roles-and-teams.down.sql new file mode 100644 index 0000000..34e0add --- /dev/null +++ b/resources/migrations/20170315190500-roles-and-teams.down.sql @@ -0,0 +1,11 @@ +drop table teammemberships; + +drop index ix_teams_name; + +drop table teams; + +drop table rolememberships; + +drop index ix_roles_name; + +drop table roles; diff --git a/resources/migrations/20170315190500-roles-and-teams.up.sql b/resources/migrations/20170315190500-roles-and-teams.up.sql new file mode 100644 index 0000000..7708d4e --- /dev/null +++ b/resources/migrations/20170315190500-roles-and-teams.up.sql @@ -0,0 +1,35 @@ +create table if not exists roles ( + id serial primary key, + name varchar(64) not null +); + +create unique index ix_roles_name on roles(name); + +create table if not exists rolememberships ( + role_id integer not null references roles(id), + canvasser_id integer not null references canvassers(id) +); + +create table if not exists teams ( + id serial primary key, + name varchar(64) not null, + district_id integer not null references districts(id), + latitude real, + longitude real +); + +create unique index ix_teams_name on teams(name); + +create table if not exists teammemberships ( + team_id integer not null references teams(id), + canvasser_id integer not null references canvassers(id) +); + + +alter table roles owner to youyesyet; + +alter table rolememberships owner to youyesyet; + +alter table teams owner to youyesyet; + +alter table teammemberships owner to youyesyet; diff --git a/src/clj/youyesyet/db/schema.clj b/src/clj/youyesyet/db/schema.clj index 1ff1da1..c999486 100644 --- a/src/clj/youyesyet/db/schema.clj +++ b/src/clj/youyesyet/db/schema.clj @@ -34,26 +34,6 @@ ;;; 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) @@ -186,7 +166,7 @@ (kc/entity-fields :id :fullname :phone :email :is_admin :authorised) (kc/has-one elector) (kc/has-one address) - (kc/has-one canvasser {:fk :introduced_by}) +;; (kc/has-one canvasser {:fk :introduced_by}) (kc/has-one authority)) @@ -244,7 +224,7 @@ yyydb/*db* (sql/create-table-ddl :optionsdistricts - [:option_id"varchar(32) not null references options(option)"] + [:option_id "varchar(32) not null references options(option)"] [:district_id "integer not null references districts(id)"]))) @@ -395,6 +375,73 @@ (kc/has-one canvasser {:fk :actor})) + +(defn create-role-table! + "Create a table to record roles. I'm not even yet certain that this is strictly necessary, + but it allows us to record the fact that different users (canvassers) have different roles + in the system." + [] + (sql/db-do-commands + yyydb/*db* + (sql/create-table-ddl + :roles + [:id "serial primary key"] + [:name "varchar(64) not null"]))) + + +(defn create-role-membership-table! + "Create a link table to record membership of roles." + [] + (sql/db-do-commands + yyydb/*db* + (sql/create-table-ddl + :rolememberships + [:role_id "integer not null references role(id)"] + [:canvasser_id "integer not null references canvasser(id)"]))) + + +(kc/defentity role + (kc/table :roles) + (kc/database yyydb/*db*) + (kc/entity-fields :id :name) + (kc/many-to-many canvasser :rolememberships)) + + +(defn create-team-table! + "Create a table to record teams." + [] + (sql/db-do-commands + yyydb/*db* + (sql/create-table-ddl + :teams + [:id "serial primary key"] + [:name "varchar(64) not null"] + ;; the electoral district within which this address exists + [:district_id "integer references districts(id)"] + ;; nominal home location of this team + [:latitude :real] + [:longitude :real]))) + + +(defn create-team-membership-table! + "Create a link table to record membership of team." + [] + (sql/db-do-commands + yyydb/*db* + (sql/create-table-ddl + :teammemberships + [:team_id "integer not null references team(id)"] + [:canvasser_id "integer not null references canvasser(id)"]))) + + +(kc/defentity team + (kc/table :teams) + (kc/database yyydb/*db*) + (kc/entity-fields :id :name :latitude :longitude) + (kc/has-one district) + (kc/many-to-many canvasser :teammemberships)) + + (defn init-db! [] "Initialised the whole database." (create-districts-table!) @@ -409,4 +456,8 @@ (create-issue-expertise-table!) (create-followup-requests-table!) (create-followup-actions-table!) + (create-role-table!) + (create-role-membership-table!) + (create-team-table!) + (create-team-membership-table!) ) From 0db6a2b918630a5cc638aef1644034404384ab91 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 15 Mar 2017 20:15:49 +0000 Subject: [PATCH 03/31] #21: Oops! Forgot the organisers Also tidied up the 'add-user-table' migration, which was actually just part of the how-to-get-started-with-migratus stuff and we don't need. --- .../migrations/20161010155448-add-users-table.down.sql | 1 - .../migrations/20161010155448-add-users-table.up.sql | 9 --------- .../migrations/20170315190500-roles-and-teams.down.sql | 2 ++ .../migrations/20170315190500-roles-and-teams.up.sql | 4 ++++ 4 files changed, 6 insertions(+), 10 deletions(-) delete mode 100644 resources/migrations/20161010155448-add-users-table.down.sql delete mode 100644 resources/migrations/20161010155448-add-users-table.up.sql diff --git a/resources/migrations/20161010155448-add-users-table.down.sql b/resources/migrations/20161010155448-add-users-table.down.sql deleted file mode 100644 index cc1f647..0000000 --- a/resources/migrations/20161010155448-add-users-table.down.sql +++ /dev/null @@ -1 +0,0 @@ -DROP TABLE users; diff --git a/resources/migrations/20161010155448-add-users-table.up.sql b/resources/migrations/20161010155448-add-users-table.up.sql deleted file mode 100644 index 05ad4af..0000000 --- a/resources/migrations/20161010155448-add-users-table.up.sql +++ /dev/null @@ -1,9 +0,0 @@ -CREATE TABLE users -(id VARCHAR(20) PRIMARY KEY, - first_name VARCHAR(30), - last_name VARCHAR(30), - email VARCHAR(30), - admin BOOLEAN, - last_login TIME, - is_active BOOLEAN, - pass VARCHAR(300)); diff --git a/resources/migrations/20170315190500-roles-and-teams.down.sql b/resources/migrations/20170315190500-roles-and-teams.down.sql index 34e0add..a8bdb6a 100644 --- a/resources/migrations/20170315190500-roles-and-teams.down.sql +++ b/resources/migrations/20170315190500-roles-and-teams.down.sql @@ -1,5 +1,7 @@ drop table teammemberships; +drop table teamorganiserships; + drop index ix_teams_name; drop table teams; diff --git a/resources/migrations/20170315190500-roles-and-teams.up.sql b/resources/migrations/20170315190500-roles-and-teams.up.sql index 7708d4e..7ff7ffc 100644 --- a/resources/migrations/20170315190500-roles-and-teams.up.sql +++ b/resources/migrations/20170315190500-roles-and-teams.up.sql @@ -25,6 +25,10 @@ create table if not exists teammemberships ( canvasser_id integer not null references canvassers(id) ); +create table if not exists teamorganiserships ( + team_id integer not null references teams(id), + canvasser_id integer not null references canvassers(id) +); alter table roles owner to youyesyet; From a46f55e50e9cf6fc15086677a366cdeda4ca7003 Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Thu, 16 Mar 2017 08:22:07 +0000 Subject: [PATCH 04/31] #22: This isn't even nearly working... But it's starting to work! --- resources/public/css/yyy-static.css | 4 ++-- resources/templates/home.html | 28 ++++++++++++++++++------- src/cljs/youyesyet/core.cljs | 32 +++++++++++++++++++++-------- 3 files changed, 46 insertions(+), 18 deletions(-) diff --git a/resources/public/css/yyy-static.css b/resources/public/css/yyy-static.css index 0587468..a61993e 100644 --- a/resources/public/css/yyy-static.css +++ b/resources/public/css/yyy-static.css @@ -160,7 +160,7 @@ th { #main-container{ } -#back-link { +#back-link, .back-link { min-width: 8em; padding: 0.25em 1em; background-color: gray; @@ -170,7 +170,7 @@ th { border-bottom-right-radius: 0.5em; } -#back-link:hover, #back-link:active { +#back-link:hover, #back-link:active, .back-link:hover, .back-link:active, { text-decoration: none; background-color: rgb(160, 160, 160); } diff --git a/resources/templates/home.html b/resources/templates/home.html index 31a313d..37db8b6 100644 --- a/resources/templates/home.html +++ b/resources/templates/home.html @@ -1,11 +1,29 @@ - - - Welcome to YouYesYet + + + + + You Yes Yet? +
+ + +

+ You yes yet? +

+
@@ -29,10 +47,6 @@
- {% script "/vendor/leaflet/dist/leaflet.js" %} - {% style "/assets/bootstrap/css/bootstrap.min.css" %} - {% style "/assets/font-awesome/css/font-awesome.min.css" %} - {% style "/css/screen.css" %} + + + + + {% script "/js/app.js" %} + + + + + + diff --git a/resources/templates/base-authenticated.html b/resources/templates/base-authenticated.html new file mode 100644 index 0000000..7b2d418 --- /dev/null +++ b/resources/templates/base-authenticated.html @@ -0,0 +1,42 @@ + + + + + + + + + {{title}} + + +
+ + +

+ {{title}} +

+
+ +
+ +
+ {{content}} +
+
+ + + + + + diff --git a/resources/templates/base-unauthenticated.html b/resources/templates/base-unauthenticated.html new file mode 100644 index 0000000..d1382fc --- /dev/null +++ b/resources/templates/base-unauthenticated.html @@ -0,0 +1,40 @@ + + + + + + + + + {{title}} + + +
+ + +

+ {{title}} +

+
+ +
+ +
+ {% block content %} + {% endblock %} +
+
+ + diff --git a/resources/templates/home.html b/resources/templates/home.html index 5c334b5..f89b6ae 100644 --- a/resources/templates/home.html +++ b/resources/templates/home.html @@ -1,53 +1,12 @@ - - - - - - - - - You Yes Yet? - - - -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+{% extends "base-unauthenticated.html" %} +{% block big-links %} + - -
- - - - - - - - - - {% script "/js/app.js" %} - - - - - - + +{% endblock %} +{% block content %} +froboz +{% endblock %} diff --git a/src/clj/youyesyet/routes/home.clj b/src/clj/youyesyet/routes/home.clj index 7fbf9f7..e2bffa7 100644 --- a/src/clj/youyesyet/routes/home.clj +++ b/src/clj/youyesyet/routes/home.clj @@ -5,11 +5,14 @@ [ring.util.http-response :as response] [clojure.java.io :as io])) +(defn app-page [] + (layout/render "app.html")) + (defn home-page [] - (layout/render "home.html")) + (layout/render "home.html" {:title "You Yes Yet?"})) (defroutes home-routes (GET "/" [] (home-page)) + (GET "/app" [] (app-page)) (GET "/docs" [] (-> (response/ok (-> "docs/docs.md" io/resource slurp)) (response/header "Content-Type" "text/plain; charset=utf-8")))) - diff --git a/src/cljc/youyesyet/ui_utils.cljc b/src/cljc/youyesyet/ui_utils.cljc new file mode 100644 index 0000000..3139020 --- /dev/null +++ b/src/cljc/youyesyet/ui_utils.cljc @@ -0,0 +1 @@ +;; Ultimately it's the goal to use the same UI utils for both main site and single page app. From e5d399b86d91c420c605abf67cf101683f0d09a6 Mon Sep 17 00:00:00 2001 From: Simon Brooke Date: Sun, 19 Mar 2017 23:28:27 +0000 Subject: [PATCH 16/31] Significant progress, but a long way from finished. --- resources/public/css/screen.css | 68 ------- resources/public/css/yyy-app.css | 173 ++++++++++++++++++ .../css/{yyy-static.css => yyy-common.css} | 157 +--------------- resources/public/css/yyy-site.css | 170 +++++++++++++++++ resources/templates/app.html | 3 +- resources/templates/base-unauthenticated.html | 19 +- resources/templates/call-me-accepted.html | 41 +++++ resources/templates/call-me.html | 37 ++++ resources/templates/home.html | 7 +- resources/templates/notyet.html | 12 ++ resources/templates/supporter.html | 12 ++ src/clj/youyesyet/layout.clj | 3 +- src/clj/youyesyet/routes/home.clj | 18 +- src/cljs/youyesyet/views/about.cljs | 10 +- 14 files changed, 496 insertions(+), 234 deletions(-) delete mode 100644 resources/public/css/screen.css create mode 100644 resources/public/css/yyy-app.css rename resources/public/css/{yyy-static.css => yyy-common.css} (73%) create mode 100644 resources/public/css/yyy-site.css create mode 100644 resources/templates/call-me-accepted.html create mode 100644 resources/templates/call-me.html create mode 100644 resources/templates/notyet.html create mode 100644 resources/templates/supporter.html diff --git a/resources/public/css/screen.css b/resources/public/css/screen.css deleted file mode 100644 index 534309c..0000000 --- a/resources/public/css/screen.css +++ /dev/null @@ -1,68 +0,0 @@ -html, -body { - font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; - height: 100%; -} -.navbar { - margin-bottom: 10px; -} -.navbar-brand { - float: none; -} -.navbar-nav .nav-item { - float: none; -} -.navbar-divider, -.navbar-nav .nav-item+.nav-item, -.navbar-nav .nav-link + .nav-link { - margin-left: 0; -} -@media (min-width: 34em) { - .navbar-brand { - float: left; - } - .navbar-nav .nav-item { - float: left; - } - .navbar-divider, - .navbar-nav .nav-item+.nav-item, - .navbar-nav .nav-link + .nav-link { - margin-left: 1rem; - } -} - -@-moz-keyframes three-quarters-loader { - 0% { - -moz-transform: rotate(0deg); - transform: rotate(0deg); - } - 100% { - -moz-transform: rotate(360deg); - transform: rotate(360deg); - } -} -@-webkit-keyframes three-quarters-loader { - 0% { - -webkit-transform: rotate(0deg); - transform: rotate(0deg); - } - 100% { - -webkit-transform: rotate(360deg); - transform: rotate(360deg); - } -} -@keyframes three-quarters-loader { - 0% { - -moz-transform: rotate(0deg); - -ms-transform: rotate(0deg); - -webkit-transform: rotate(0deg); - transform: rotate(0deg); - } - 100% { - -moz-transform: rotate(360deg); - -ms-transform: rotate(360deg); - -webkit-transform: rotate(360deg); - transform: rotate(360deg); - } -} - diff --git a/resources/public/css/yyy-app.css b/resources/public/css/yyy-app.css new file mode 100644 index 0000000..8a46cd2 --- /dev/null +++ b/resources/public/css/yyy-app.css @@ -0,0 +1,173 @@ +/** + * Additional CSS for the main site. Navigation works differently between + * app and the main site; in the app it's driven by React, while in + * the main site it's CSS. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. + */ + + +/* desktops and laptops, primarily. Adapted to mouse; targets may be small */ +@media all and (min-device-width: 1025px) { + /* top-of-page navigation, not editable, provided by Smeagol */ + #nav{ + margin: 0; + padding: 0; + top: 0; + width: 100%; + _position: absolute; + _top: expression(document.documentElement.scrollTop); + z-index: 149; + background:rgba(7,27,51,0.8); + } + + /* only needed for fly-out menu effect on tablet and phone stylesheets */ + #nav-icon { + display: none; + } + + #nav-menu { + margin: 0; + padding: 0; + } + + #nav menu li { + padding: 0; + margin: 0; + display: inline; + } + + #nav menu li a { + color: white; + text-decoration: none; + font-weight: bold; + padding: 0.1em 0.75em; + margin: 0; + } + + #nav menu li.active a { background: gray;} + li.nav-item a:hover { background: rgb( 240, 240, 240) } + li.nav-item a:active { background: gray; color: white; } + + #nav menu li#user { + padding: 0 1em; + float: right; + } +} + +/* tablets, primarily. Adapted to touch; targets are larger */ +@media all and (min-device-width: 769px) and (max-device-width: 1024px) { + #nav{ + margin: 0; + padding: 0; + position: fixed; + z-index: 149; + color: silver; + background:rgba(40,40,40,0.9); + } + + #nav a { + color: white; + text-decoration: none; + font-weight: bold; + } + + #nav:hover #nav-menu { + display: block; + list-style-type: none; + width: 100%; + } + + #nav-icon { + padding: 0; + } + + #nav-menu { + display: none; + } + + #nav menu li { + padding: 0.5em 2em 0.5em 0.5em; + margin: 0.5 em; + font-size: 150%; + } + + #nav menu li a { + } + + #nav ul li.active a { background: silver;} + li.nav-item a:hover { background: rgb( 240, 240, 240) } + li.nav-item a:active { background: gray; color: white; } + + #nav menu #user { + text-decoration: none; + font-weight: bold; + margin: 0; + } +} + +/* phones, and, indeed, smaller phones. Adapted to touch; display radically + * decluttered */ +@media all and (max-device-width: 768px) { + #nav{ + margin: 0; + padding: 0; + position: fixed; + z-index: 149; + color: silver; + background:rgba(40,40,40,0.9); + } + + #nav:hover #nav-menu { + display: block; + list-style-type: none; + width: 100%; + } + + #nav a { + color: white; + text-decoration: none; + font-weight: bold; + } + + #nav-icon { + padding: 0; + } + + #nav-menu { + list-style-type: none; + display: none; + } + + #nav menu li { + padding: 0.5em 2em 0.5em 0.5em; + margin: 0.5 em; + font-size: 150%; + } + + #nav menu li a { + } + + #nav ul li.active a { background: silver;} + li.nav-item a:hover { background: rgb( 240, 240, 240) } + li.nav-item a:active { background: gray; color: white; } + + #nav menu #user { + text-decoration: none; + font-weight: bold; + margin: 0; + } +} diff --git a/resources/public/css/yyy-static.css b/resources/public/css/yyy-common.css similarity index 73% rename from resources/public/css/yyy-static.css rename to resources/public/css/yyy-common.css index 515088f..383b77e 100644 --- a/resources/public/css/yyy-static.css +++ b/resources/public/css/yyy-common.css @@ -201,11 +201,13 @@ th { } -/* left bar for all pages in the Wiki - editable, provided by users. Within main-container */ -#side-bar { - width: 17%; - height: 100%; - float: left; +#big-links { + width: 100%; + min-height: 3.5em; +} + +#content { + clear: both; } /* cookies information box, fixed, in right margin, just above footer */ @@ -337,62 +339,11 @@ th { /* desktops and laptops, primarily. Adapted to mouse; targets may be small */ @media all and (min-device-width: 1025px) { - /* content of the current page in the Wiki - editable, provided by users. Within main-container */ #content { - border: thin solid silver; width: 80%; float: right; padding-bottom: 5em; } - - #phone-side-bar, #phone-credits { - display: none; - } - - /* top-of-page navigation, not editable, provided by Smeagol */ - #nav{ - margin: 0; - padding: 0; - top: 0; - width: 100%; - _position: absolute; - _top: expression(document.documentElement.scrollTop); - z-index: 149; - background:rgba(7,27,51,0.8); - } - - /* only needed for fly-out menu effect on tablet and phone stylesheets */ - #nav-icon { - display: none; - } - - #nav-menu { - margin: 0; - padding: 0; - } - - #nav menu li { - padding: 0; - margin: 0; - display: inline; - } - - #nav menu li a { - color: white; - text-decoration: none; - font-weight: bold; - padding: 0.1em 0.75em; - margin: 0; - } - - #nav menu li.active a { background: gray;} - li.nav-item a:hover { background: rgb( 240, 240, 240) } - li.nav-item a:active { background: gray; color: white; } - - #nav menu li#user { - padding: 0 1em; - float: right; - } } /* tablets, primarily. Adapted to touch; targets are larger */ @@ -410,54 +361,6 @@ th { float: right; padding-bottom: 5em; } - - #nav{ - margin: 0; - padding: 0; - position: fixed; - z-index: 149; - color: silver; - background:rgba(40,40,40,0.9); - } - - #nav a { - color: white; - text-decoration: none; - font-weight: bold; - } - - #nav:hover #nav-menu { - display: block; - list-style-type: none; - width: 100%; - } - - #nav-icon { - padding: 0; - } - - #nav-menu, #phone-side-bar { - display: none; - } - - #nav menu li { - padding: 0.5em 2em 0.5em 0.5em; - margin: 0.5 em; - font-size: 150%; - } - - #nav menu li a { - } - - #nav ul li.active a { background: silver;} - li.nav-item a:hover { background: rgb( 240, 240, 240) } - li.nav-item a:active { background: gray; color: white; } - - #nav menu #user { - text-decoration: none; - font-weight: bold; - margin: 0; - } } /* phones, and, indeed, smaller phones. Adapted to touch; display radically @@ -499,50 +402,4 @@ th { #cookies { display: none; } - - #nav{ - margin: 0; - padding: 0; - position: fixed; - z-index: 149; - color: silver; - background:rgba(40,40,40,0.9); - } - - #nav a { - color: white; - text-decoration: none; - font-weight: bold; - } - - #nav-icon { - padding: 0; - } - - #nav-menu { - list-style-type: none; - } - - #nav menu li { - padding: 0.5em 2em 0.5em 0.5em; - margin: 0.5 em; - font-size: 150%; - } - - #nav menu li a { - } - - #nav ul li.active a { background: silver;} - li.nav-item a:hover { background: rgb( 240, 240, 240) } - li.nav-item a:active { background: gray; color: white; } - - #nav menu #user { - text-decoration: none; - font-weight: bold; - margin: 0; - } - - #side-bar { - display: none; - } } diff --git a/resources/public/css/yyy-site.css b/resources/public/css/yyy-site.css new file mode 100644 index 0000000..0f25301 --- /dev/null +++ b/resources/public/css/yyy-site.css @@ -0,0 +1,170 @@ +/** + * Additional CSS for the app. Navigation works differently between + * app and the main site; in the app it's driven by React, while in + * the main site it's CSS. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, + * USA. + * + * # The Stylesheet + * + * ## html elements generally in alphabetic order + */ + + +/* desktops and laptops, primarily. Adapted to mouse; targets may be small */ +@media all and (min-device-width: 1025px) { + /* top-of-page navigation, not editable, provided by Smeagol */ + #nav{ + margin: 0; + padding: 0; + top: 0; + width: 100%; + _position: absolute; + _top: expression(document.documentElement.scrollTop); + z-index: 149; + background:rgba(7,27,51,0.8); + } + + /* only needed for fly-out menu effect on tablet and phone stylesheets */ + #nav-icon { + display: none; + } + + #nav-menu { + margin: 0; + padding: 0; + } + + #nav menu li { + padding: 0; + margin: 0; + display: inline; + } + + #nav menu li a { + color: white; + text-decoration: none; + font-weight: bold; + padding: 0.1em 0.75em; + margin: 0; + } + + #nav menu li.active a { background: gray;} + li.nav-item a:hover { background: rgb( 240, 240, 240) } + li.nav-item a:active { background: gray; color: white; } + + #nav menu li#user { + padding: 0 1em; + float: right; + } +} + +/* tablets, primarily. Adapted to touch; targets are larger */ +@media all and (min-device-width: 769px) and (max-device-width: 1024px) { + #nav{ + margin: 0; + padding: 0; + position: fixed; + z-index: 149; + color: silver; + background:rgba(40,40,40,0.9); + } + + #nav a { + color: white; + text-decoration: none; + font-weight: bold; + } + + #nav:hover #nav-menu { + display: block; + list-style-type: none; + width: 100%; + } + + #nav-icon { + padding: 0; + } + + #nav-menu, #phone-side-bar { + display: none; + } + + #nav menu li { + padding: 0.5em 2em 0.5em 0.5em; + margin: 0.5 em; + font-size: 150%; + } + + #nav menu li a { + } + + #nav ul li.active a { background: silver;} + li.nav-item a:hover { background: rgb( 240, 240, 240) } + li.nav-item a:active { background: gray; color: white; } + + #nav menu #user { + text-decoration: none; + font-weight: bold; + margin: 0; + } +} + +/* phones, and, indeed, smaller phones. Adapted to touch; display radically + * decluttered */ +@media all and (max-device-width: 768px) { + #nav{ + margin: 0; + padding: 0; + position: fixed; + z-index: 149; + color: silver; + background:rgba(40,40,40,0.9); + } + + #nav a { + color: white; + text-decoration: none; + font-weight: bold; + } + + #nav-icon { + padding: 0; + } + + #nav-menu { + list-style-type: none; + } + + #nav menu li { + padding: 0.5em 2em 0.5em 0.5em; + margin: 0.5 em; + font-size: 150%; + } + + #nav menu li a { + } + + #nav ul li.active a { background: silver;} + li.nav-item a:hover { background: rgb( 240, 240, 240) } + li.nav-item a:active { background: gray; color: white; } + + #nav menu #user { + text-decoration: none; + font-weight: bold; + margin: 0; + } +} diff --git a/resources/templates/app.html b/resources/templates/app.html index 5c334b5..f313066 100644 --- a/resources/templates/app.html +++ b/resources/templates/app.html @@ -3,7 +3,8 @@ - + + You Yes Yet? diff --git a/resources/templates/base-unauthenticated.html b/resources/templates/base-unauthenticated.html index d1382fc..c243d01 100644 --- a/resources/templates/base-unauthenticated.html +++ b/resources/templates/base-unauthenticated.html @@ -3,8 +3,8 @@ - - + + {{title}} @@ -36,5 +36,20 @@ {% endblock %}
+