From 095bf921806b23213775180428c2bd230cb9adff Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Sat, 17 Sep 2016 20:55:07 -0400 Subject: Add basic modal new-next-action dialogue --- Makefile | 1 + main.ur | 57 +++++++++++++++++++++++++++++++++++++++++++++++++-------- mdl/mdl.ur | 11 +++++++++++ ugtd.css | 20 ++++++++++++++++++++ ugtd.urp | 1 + 5 files changed, 82 insertions(+), 8 deletions(-) create mode 100644 ugtd.css diff --git a/Makefile b/Makefile index 715f208..1546b36 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,7 @@ all: ugtd ugtd.db ugtd initialize.sql: \ ugtd.urp \ + ugtd.css \ mdl/lib.urp \ mdl/mdlFfi.urs mdl/mdlFfi.js \ mdl/mdlClasses.urp \ diff --git a/main.ur b/main.ur index 970171e..dd43f47 100644 --- a/main.ur +++ b/main.ur @@ -48,9 +48,16 @@ fun renderNextAction action = +style hidden +style visible + +datatype mode = NextActions | NewNextAction + val main = actionItems <- queryX1' (SELECT * FROM nextAction) renderNextAction; setHeader (blessResponseHeader "X-UA-Compatible") "IE=edge"; + mode <- source NextActions; + newNextActionDescription <- Mdl.Textbox.make "Description"; return (* TODO(bbaren): Write a meta-description tag. *) @@ -70,18 +77,52 @@ val main = {forceJavaScript} + + -
-
-
- Next actions +
visible + | _ => hidden) + }> +
+
+ +
+ New action +
+ (*
+
+
+ {newNextActionDescription}
-
-
    - {actionItems} -
+
+
visible + | _ => hidden) + }> +
+
+
+ Next actions +
+
+
+
    + {actionItems} +
+ +
diff --git a/mdl/mdl.ur b/mdl/mdl.ur index 7900822..5f68ab1 100644 --- a/mdl/mdl.ur +++ b/mdl/mdl.ur @@ -15,6 +15,17 @@ specific language governing permissions and limitations under the License. *) structure Classes = MdlClasses open Classes +structure Textbox = struct + fun make (placeholder : string) : transaction xbody = + id <- fresh; + return +
+ + +
+
+end + structure Toast = struct val make : transaction {Placeholder: xbody, Show: string -> transaction unit} = diff --git a/ugtd.css b/ugtd.css new file mode 100644 index 0000000..6bd370b --- /dev/null +++ b/ugtd.css @@ -0,0 +1,20 @@ +/* Copyright 2016 Benjamin Barenblat + +Licensed under the Apache License, Version 2.0 (the “License”); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed +under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. */ + +header .mdl-button { + color: inherit; +} + +.Main_hidden { + display: none; +} diff --git a/ugtd.urp b/ugtd.urp index e7cfe83..218d4b9 100644 --- a/ugtd.urp +++ b/ugtd.urp @@ -6,6 +6,7 @@ allow url https://fonts.googleapis.com/* allow url https://code.getmdl.io/* database dbname=ugtd.db dbms sqlite +file /ugtd.css ugtd.css library mdl script https://storage.googleapis.com/code.getmdl.io/1.1.3/material.min.js sql initialize.sql -- cgit v1.2.3