-
Notifications
You must be signed in to change notification settings - Fork 2
/
system.rb
92 lines (81 loc) · 2.09 KB
/
system.rb
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
app = Vanilla::App.new(ENV['VANILLA_CONFIG'])
system = app.snip(:name => "system")
system.content = "You're in the system snip now. You probably want to {edit_link system,edit} it though."
system.main_template = <<-HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>{current_snip name}</title>
<script language="javascript" src="/javascripts/jquery.js"></script>
<script language="javascript" src="/javascripts/jquery.autogrow-textarea.js"></script>
<script language="javascript" src="/javascripts/vanilla.js"></script>
<link rel="stylesheet" type="text/css" media="screen" href="<%= url_to("system", "css.css") %>" />
</head>
<body>
<div id="content">
<div id="controls">
<strong><a href="/">home</a></strong>,
<%= new_link %> ::
<strong>{link_to_current_snip}</strong> →
{edit_link}
</div>
{current_snip}
</div>
</body>
</html>
HTML
system.login_template = <<-HTML
<html>
<head><link rel="stylesheet" type="text/css" media="screen" href="/system/css.css" /></head>
<body id="login">
<form action='' method='post'>
<h1>Login</h1><p class="message">MESSAGE</p>
<label>Name: <input type="text" name="login[username]"></input></label>
<label>Password: <input type="password" name="login[password]"></input></label>
<button>login</button>
</form>
</body>
</html>
HTML
system.css = <<-CSS
body {
font-family: Helvetica;
background-color: #666;
margin: 0;
padding: 0;
}
div#content {
width: 800px;
margin: 0 auto;
background-color: #fff;
padding: 1em;
}
div#controls {
font-size: 80%;
padding-bottom: 1em;
margin-bottom: 1em;
border-bottom: 1px solid #999;
}
textarea {
width: 100%;
}
textarea.content {
min-height: 10em;
}
pre {
background-color: #f6f6f6;
border: 1px solid #ccc;
padding: 1em;
}
a.new {
background-color: #f0f0f0;
text-decoration: none;
color: #999;
padding: 0.2em;
}
a.new:hover {
text-decoration: underline;
}
CSS
system.save