Permalink
Browse files

packages

  • Loading branch information...
1 parent d6bd6ef commit 0cd193dd1186e24ef59d3c1b3e63f8c1f11aa774 @trecouvr committed Nov 8, 2011
View
@@ -1,5 +1,7 @@
+package easycount.data
+
import stdlib.core.date
View
@@ -1,8 +1,11 @@
+package easycount.facture.form
+import stdlib.widgets.formbuilder
-
+import easycount.data
+import easycount.user.session
NewFactureForm = {{
View
@@ -1,5 +1,6 @@
+package easycount.data
@@ -20,11 +21,10 @@ Group_Data = {{
can_view(ref : Group.ref, ref_user : User.ref) : bool =
List.exists(_ == ref_user, /groups[ref]/users)
- add(name : string) : outcome(Group.t,string) =
+ add(name : string, user_ref : User.ref) : outcome(Group.t,string) =
if Db.exists(@/groups[name]) then
{failure = "Name already used"}
else
- user_ref = User.current_user_ref()
new_group = {empty with ~name users=[user_ref]}
do /groups[name] <- new_group
groups = /users[user_ref]/groups
View
@@ -1,6 +1,11 @@
+package easycount.group.form
+import stdlib.widgets.formbuilder
+
+import easycount.data
+import easycount.user.session
@@ -15,7 +20,7 @@ NewGroupForm = {{
process(edit : (Group.t->void))(_) : void =
name = Option.default("",WFormBuilder.get_field_value(name))
notice =
- match Group_Data.add(name) with
+ match Group_Data.add(name,User.current_user_ref()) with
| {~success} -> do edit(success) "Group added"
| {~failure} -> failure
end
View
@@ -1,9 +1,19 @@
+package easycount.group.view
+import stdlib.widgets.bootstrap
+
+import nostdlib.tablebuilder
import easycount.chart
+import easycount.data
+import easycount.user.session
+import easycount.group.form
+import easycount.facture.form
+
Group_View_Group = {{
+ WB = WBootstrap
id_notifications : string = "id_notifications"
View
@@ -4,6 +4,15 @@ import stdlib.themes.bootstrap
import stdlib.widgets.bootstrap
WB = WBootstrap
+
+import easycount.user.view
+import easycount.user.form
+import easycount.user.session
+import easycount.group.view
+import easycount.group.form
+
+
+
page_onready(get_content : ->xhtml) : xhtml =
id = Dom.fresh_id()
<div id=#{id} onready={_->Dom.transform([#{id} <- get_content()])}></div>
View
@@ -1,6 +1,6 @@
-
+package easycount.data
User_Data = {{
View
@@ -1,5 +1,13 @@
+
+package easycount.user.form
+
import stdlib.web.client
+import stdlib.widgets.formbuilder
+
+import easycount.data
+import easycount.user.session
+
LoginUserForm = {{
username = WFormBuilder.mk_field("Username:", WFormBuilder.text_field)
View
@@ -1,5 +1,8 @@
+package easycount.user.form
+
+
import stdlib.widgets.formbuilder
NewUserForm = {{
View
@@ -1,4 +1,9 @@
+package easycount.user.session
+
+import easycount.data
+
+
type User.state =
{disconnect} /
View
@@ -1,10 +1,16 @@
+package easycount.user.view
+
+import stdlib.widgets.bootstrap
import nostdlib.tablebuilder
+import easycount.group.form
+import easycount.data
+import easycount.user.session
User_View_Account = {{
-
+ WB = WBootstrap
/**
Get all groups the current user is in.

0 comments on commit 0cd193d

Please sign in to comment.