Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added MLstate pre-defined user.

  • Loading branch information...
commit 15cbfd0aea033c8463cb62fe99244da2ed1140d9 1 parent 81096c1
@akoprow akoprow authored
View
20 src/data.opa
@@ -8,6 +8,7 @@ package mlstate.twopenny
/** Users in the system **/
db /users : stringmap(User.t)
db /users[_]/photo full
+db /users[_]/wallpaper full
/** Messages posted by users **/
// msg_ref -> msg
@@ -34,3 +35,22 @@ db /user_mentions : User.map(Date.map(Msg.ref))
}}
+
+init_data_store() =
+ match ?/users["mlstate"] with
+ | {none} ->
+ mlstate : User.t =
+ { name = "OPA by MLstate"
+ ; location = "Paris, France"
+ ; motto = "MLstate, creators of the OPA platform for web-development"
+ ; email = Email.of_string("contact@mlstate.com")
+ ; url = "http://mlstate.com"
+ ; photo = some({png = @static_binary_content("img/mlstate.png")})
+ ; passwd = ""
+ ; wallpaper = some({png = @static_binary_content("img/mlstate-bg.png")})
+ }
+ /users["mlstate"] <- mlstate
+ | _ ->
+ void
+
+_ = init_data_store()
View
BIN  src/img/mlstate-bg.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  src/img/mlstate.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
13 src/user.opa
@@ -5,14 +5,11 @@
package mlstate.twopenny
-type User.photo =
- { small : image
- ; full : image
- }
-
type User.t =
/** Name of the user (this is not the login) **/
{ name : string
+ /** User's location **/
+ ; location : string
/** A short self-presentation of the user **/
; motto : string
/* FIXME actually I want [Url.url] not [string] below but I don't know
@@ -26,8 +23,10 @@ type User.t =
; email : Email.email
/** User's password (actually an MD5 hash of the password) **/
; passwd : string
- /** User's photo **/
- ; photo : option(User.photo)
+ /** User's profile photo **/
+ ; photo : option(image)
+ /** User's wallpaper **/
+ ; wallpaper : option(image)
}
type User.ref = private(string)
Please sign in to comment.
Something went wrong with that request. Please try again.