-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpages.opa
107 lines (93 loc) · 2.43 KB
/
pages.opa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/*
* Twopenny. (C) MLstate - 2011
* @author Adam Koprowski
**/
package mlstate.twopenny
/**
* {1 HTML generation for Twopenny pages}
**/
Pages = {{
unimplemented =
<>
Coming soon... stay tuned
</>
empty_style = []
main_page() =
("Twopenny", unimplemented, empty_style)
@client show_new_message(~{newmsg}) =
Dom.transform([#msgs -<- Msg.render(newmsg, {new})])
@client setup_msg_updates(_) =
chan = Session.make_callback(show_new_message)
do MsgFactory.subscribe_to_all(chan)
do debug("subscribing to new messages")
void
@client setup_newmsg_box(user)(_) =
xhtml = WMsgBox.html("msgbox", Msg.create(user, _), MsgFactory.submit)
Dom.transform([#newmsg <- xhtml])
user_page(user_ref : User.ref) =
user_string = User.ref_to_string(user_ref)
content =
match User.get(user_ref) with
| {none} ->
<div class="error_page">
Sorry, but I know of no user <strong>{user_string}</>
</>
| {some=user} ->
<>
{User.get_header(user_ref, user)}
<div id=#newmsg onready={setup_newmsg_box(user_ref)} />
<div class="separator" />
<div id=#msgs onready={setup_msg_updates} />
</>
style = User.get_wallpaper_css(user_ref)
("Twopenny :: {user_string}", content, style)
label_page(label) =
("Twopenny :: {Label.to_string(label)}", unimplemented, empty_style)
}}
css = [ page_css, toolbar_css, msg_css, msg_box_css, user_css ]
page_css = css
body, html, #page {
width: 100%;
height: 100%;
}
body {
margin: 0px;
position: relative;
}
#page {
padding-top: 30px;
}
#main {
width: 800px;
margin: auto;
min-height: 700px;
padding: 15px;
border-left: 1px dotted black;
border-right: 1px dotted black;
background: #EEE;
opacity: .8;
}
h2 {
color: #777;
/* FIXME writing helvetica (small 'h') passes syntax checking and is interpreted
as un-typed CSS, so goes verbose to the page as font:helvetica;
Not cool! */
font-family: Helvetica;
font-size: 20px;
margin: 0px 0px 5px 0px;
}
.hidden {
display: none;
}
div.separator {
margin: 30px -15px;
border-top: 1px dotted black;
}
/* marking external links
a[rel="external"], a.external {
white-space: nowrap;
padding-right: 10px;
background: url('/img/link.png') no-repeat 100% 50%;
zoom: 1;
}
*/