diff options
author | Benjamin Barenblat <benjamin@barenblat.name> | 2016-08-18 15:45:09 -0400 |
---|---|---|
committer | Benjamin Barenblat <benjamin@barenblat.name> | 2016-08-18 15:45:09 -0400 |
commit | 37334313f0e049c31e12e1cf841de6089dfa6ed2 (patch) | |
tree | 4dd41348d7e205e6486d52355f9502b8b97c7d6c | |
parent | 65eb70a72630062ac543acd0121a3db12725ff32 (diff) |
Set checkbox state based on database
-rw-r--r-- | main.ur | 4 | ||||
-rw-r--r-- | prepopulate.sql | 10 |
2 files changed, 8 insertions, 6 deletions
@@ -16,6 +16,7 @@ open Mdl table nextAction : { Nam : string, + Done : bool, } (* Forces JavaScript to be enabled on the given page, so as to pull in external @@ -24,12 +25,13 @@ val forceJavaScript = <xml><script code={return ()} /></xml> fun renderNextAction action = c <- fresh; + done <- source action.Done; return <xml> <li class="mdl-list__item"> <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} class="mdl-checkbox__input" /> + <ccheckbox id={c} source={done} class="mdl-checkbox__input" /> </label> </span> {[action.Nam]} diff --git a/prepopulate.sql b/prepopulate.sql index 4d3437b..f50d17f 100644 --- a/prepopulate.sql +++ b/prepopulate.sql @@ -12,9 +12,9 @@ -- License for the specific language governing permissions and limitations under -- the License. -INSERT INTO uw_Main_nextAction (uw_nam) +INSERT INTO uw_Main_nextAction (uw_nam, uw_done) VALUES - ("Print cover for TPS report"), - ("Collect information for TPS report"), - ("Generate charts for TPS report"), - ("Lorem ipsum dolor sit amet"); + ("Print cover for TPS report", 1), + ("Collect information for TPS report", 0), + ("Generate charts for TPS report", 0), + ("Lorem ipsum dolor sit amet", 0); |