-
Notifications
You must be signed in to change notification settings - Fork 89
Expand file tree
/
Copy pathdefault.cshtml
More file actions
147 lines (136 loc) · 5.34 KB
/
default.cshtml
File metadata and controls
147 lines (136 loc) · 5.34 KB
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
@using ServiceStack.Auth
@{
var userSession = base.SessionAs<CustomSession>();
if (base.Request.Verb == "POST")
{
var email = base.Request.FormData["email"];
if (!string.IsNullOrEmpty(email) && Db.SingleById<EmailRegistration>(email) == null)
{
Db.Insert(new EmailRegistration { Email = email });
}
}
}
<!doctype html>
<html lang="en-us">
<head>
<title>Reusability Demo</title>
<style type="text/css">
body { font: 13px/18px Arial; margin: 0; padding: 0 1%; width:47%; }
h2 { color: green; }
input[type=text], textarea { width: 250px; }
textarea { height: 70px; font-family: arial; }
label { font-weight: bold; }
</style>
</head>
<body>
<iframe id="receipts" src="/receipts" style="position:absolute;width:48%;top:53%;left:1%;height:44%;"></iframe>
<iframe id="mqstats" src="/mqstats" style="position:absolute;width:48%;top:1%;right:1%;height:50%;"></iframe>
<iframe id="mqdump" src="/mqdump" style="position:absolute;width:48%;top:53%;right:1%;height:44%;"></iframe>
<div id="mqdump-links" style="position:absolute;bottom:5px;right:1%;">
<a href="/mqdump/EmailMessage" target="mqdump">/mqdump/EmailMessage</a>
| <a href="/mqdump/CallFacebook" target="mqdump">/mqdump/CallFacebook</a>
| <a href="/mqdump/PostStatusTwitter" target="mqdump">/mqdump/PostStatusTwitter</a>
</div>
<div style="float:right">
<h2><a href="/">Broadcast SMessage to the world!</a></h2>
<h4>/smessage</h4>
<form action="/smessage" method="GET" target="smessage">
<input type="hidden" name="format" value="json" />
<dl>
<dd><input name="Subject" type="text" placeholder="Subject" value="Sent with SMessage" /></dd>
<dd>
<textarea name="Body" placeholder="Message Body"></textarea>
</dd>
<dd>
<label for="defer">Defer</label>
<input type="checkbox" id="defer" name="Defer" value="True" checked="checked" />
</dd>
<dd>
<button type="submit">Send</button>
</dd>
</dl>
</form>
<h4>/email</h4>
<form action="/email" method="GET" target="smessage">
<dl>
<dd><input name="To" type="text" placeholder="To" value="demis.bellot+1@gmail.com" /></dd>
<dd><input name="Subject" type="text" placeholder="Subject" value="Email Message Only" /></dd>
<dd>
<textarea name="Body" placeholder="Message Body"></textarea>
</dd>
<dd>
<button type="submit">Send</button>
</dd>
</dl>
</form>
<h4>/mqstats</h4>
<form action="/mqstats" method="GET" target="mqstats">
<dl>
<dd>
<label for="stop">Stop</label>
<input type="checkbox" id="stop" name="Stop" value="True" />
<label for="start">Start</label>
<input type="checkbox" id="start" name="Start" value="True" />
</dd>
<dd>
<button type="submit">Redis MQ Server</button>
</dd>
</dl>
</form>
</div>
<h2>Posting to Twitter streams</h2>
<ul>
@foreach (var twAuth in Db.Select<UserAuthDetails>(q => q.Provider == "twitter"))
{
<li><a href="http://twitter.com/@twAuth.UserName">@@@twAuth.UserName</a></li>
}
</ul>
@if (!userSession.IsAuthorized("twitter"))
{
<h3>
Register new Twitter user</h3>
<div id="twitter-signin">
<a href="/auth/twitter">
<img src="/Content/img/sign-in-with-twitter-l.png" alt="Sign-in with Twitter" /></a>
</div>
}
<h2>Posting to Facebook walls</h2>
<ul>
@foreach (var fbAuth in Db.Select<UserAuthDetails>(q => q.Provider == "facebook"))
{
<li><a href="http://www.facebook.com/@fbAuth.UserName">@fbAuth.UserName</a></li>
}
</ul>
@if (!userSession.IsAuthorized("facebook"))
{
<h3>
Register new Facebook user</h3>
<div id="facebook-signin">
<a href="/auth/facebook">
<img src="/Content/img/sign-in-with-facebook.png" alt="Sign-in with Facebook" /></a>
</div>
}
<h2>Send to Emails</h2>
<ul>
@foreach (var registration in Db.Select<EmailRegistration>())
{
<li>@registration.Email</li>
}
</ul>
<h3>Register new Email</h3>
<form action="/" method="POST">
<div>
<input name="email" type="text" placeholder="Email" />
</div>
<div class="actions">
<button type="submit">Add Email</button>
</div>
</form>
<h2 style="margin:2% 0 1% 0;">FORM Results: /smessage</h2>
<script type="text/javascript">
var $id = function (id) { return document.getElementById(id); }
</script>
<iframe id="smessage" src="about:blank" style="width:60%;height:100px;"
onload="$id('receipts').src=$id('receipts').src;$id('mqstats').src=$id('mqstats').src;$id('mqdump').src=$id('mqdump').src"></iframe>
</body>
</html>