diff options
author | Benjamin Barenblat <bbaren@mit.edu> | 2013-05-02 21:21:22 -0400 |
---|---|---|
committer | Benjamin Barenblat <bbaren@mit.edu> | 2013-05-02 21:21:22 -0400 |
commit | e578da5c4f19af7446a48a9d78f45de51383d4ac (patch) | |
tree | 5d2b106748fda2c031d2400fc5ce81c2fb69405a /forum/author.urs | |
parent | 53a2c4d4a18c2f5903961bce7bc61cf19336157f (diff) |
Forum: Add upvote button
Diffstat (limited to 'forum/author.urs')
-rw-r--r-- | forum/author.urs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/forum/author.urs b/forum/author.urs index 1f394f0..db6e7a8 100644 --- a/forum/author.urs +++ b/forum/author.urs @@ -43,9 +43,17 @@ val sql_username : sql_injectable username (******************************** Converting *********************************) val name : usernameOrAnonymous -> option username +val nameError : usernameOrAnonymous -> username val orAnonymous : username -> usernameOrAnonymous +val whenIdentified : ctx ::: {Unit} -> use ::: {Type} -> + usernameOrAnonymous -> xml ctx use [] -> xml ctx use [] + +val whenIdentified' : ctx ::: {Unit} -> use ::: {Type} -> + usernameOrAnonymous -> (username -> xml ctx use []) + -> xml ctx use [] + (* Converts a 'usernameOrAnonymous' to an 'option' tag. If anonymous, produces empty XML. *) val toOptionTag : use ::: {Type} -> usernameOrAnonymous -> xml select use [] |