summaryrefslogtreecommitdiff
path: root/main.ur
diff options
context:
space:
mode:
Diffstat (limited to 'main.ur')
-rw-r--r--main.ur12
1 files changed, 10 insertions, 2 deletions
diff --git a/main.ur b/main.ur
index cb2fe15..79e5f2b 100644
--- a/main.ur
+++ b/main.ur
@@ -15,14 +15,18 @@ specific language governing permissions and limitations under the License. *)
open Mdl
table nextAction : {
+ Id : int,
Nam : string,
Done : bool,
-}
+} PRIMARY KEY Id
(* Forces JavaScript to be enabled on the given page, so as to pull in external
scripts specified in the .urp file. *)
val forceJavaScript = <xml><script code={return ()} /></xml>
+fun markNextActionStatus id done =
+ dml (UPDATE nextAction SET Done = {[done]} WHERE Id = {[id]})
+
fun renderNextAction action =
c <- fresh;
done <- source action.Done;
@@ -31,7 +35,11 @@ fun renderNextAction action =
<span class="mdl-list__item-primary-content">
<span class="mdl-list__item-icon">
<label class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect" for={c}>
- <ccheckbox id={c} source={done} class="mdl-checkbox__input" />
+ <ccheckbox id={c} source={done} class="mdl-checkbox__input"
+ onchange={
+ b <- get done;
+ rpc (markNextActionStatus action.Id b)
+ } />
</label>
</span>
{[action.Nam]}