nitro 0.17.0 → 0.18.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +124 -0
- data/README +2 -2
- data/Rakefile +4 -12
- data/bin/nitro +1 -1
- data/bin/nitrogen +47 -31
- data/doc/AUTHORS +3 -3
- data/doc/RELEASES +50 -1
- data/examples/README +7 -0
- data/lib/nitro.rb +5 -4
- data/lib/nitro/{adapters → adapter}/cgi.rb +2 -4
- data/lib/nitro/{adapters → adapter}/fastcgi.rb +1 -1
- data/lib/nitro/{adapters → adapter}/webrick.rb +5 -10
- data/lib/nitro/buffering.rb +6 -0
- data/lib/nitro/{builders → builder}/atom.rb +1 -5
- data/lib/nitro/{builders → builder}/form.rb +1 -5
- data/lib/nitro/{builders → builder}/rss.rb +3 -1
- data/lib/nitro/{builders → builder}/table.rb +2 -4
- data/lib/nitro/{builders → builder}/xhtml.rb +3 -5
- data/lib/nitro/{builders → builder}/xml.rb +2 -4
- data/lib/nitro/caching.rb +6 -4
- data/lib/nitro/caching/output.rb +18 -11
- data/lib/nitro/context.rb +3 -1
- data/lib/nitro/controller.rb +29 -18
- data/lib/nitro/dispatcher.rb +2 -4
- data/lib/nitro/element.rb +2 -0
- data/lib/nitro/environment.rb +2 -4
- data/lib/nitro/errors.rb +69 -0
- data/lib/nitro/mail.rb +2 -4
- data/lib/nitro/markup.rb +20 -3
- data/lib/nitro/output.rb +5 -9
- data/lib/nitro/part.rb +2 -3
- data/lib/nitro/render.rb +49 -30
- data/lib/nitro/request.rb +2 -1
- data/lib/nitro/runner.rb +23 -12
- data/lib/nitro/scaffold.rb +5 -3
- data/lib/nitro/service.rb +22 -0
- data/lib/nitro/service/xmlrpc.rb +42 -0
- data/lib/nitro/session.rb +2 -4
- data/lib/nitro/template.rb +8 -10
- data/lib/nitro/testing.rb +0 -4
- data/proto/public/error.xhtml +27 -2
- data/test/nitro/{adapters → adapter}/raw_post1.bin +0 -0
- data/test/nitro/{adapters → adapter}/tc_cgi.rb +1 -1
- data/test/nitro/{adapters → adapter}/tc_webrick.rb +1 -1
- data/test/nitro/{builders → builder}/tc_atom.rb +1 -1
- data/test/nitro/{builders → builder}/tc_rss.rb +1 -1
- data/test/nitro/{builders → builder}/tc_table.rb +1 -1
- data/test/nitro/{builders → builder}/tc_xhtml.rb +1 -1
- data/test/nitro/{builders → builder}/tc_xml.rb +1 -1
- data/test/nitro/tc_caching.rb +18 -0
- data/test/nitro/tc_controller.rb +1 -1
- data/test/nitro/tc_mail.rb +3 -1
- metadata +33 -168
- data/examples/README.windows +0 -9
- data/examples/ajax/controller.rb +0 -21
- data/examples/ajax/public/index.xhtml +0 -72
- data/examples/ajax/public/js/ajax.js +0 -64
- data/examples/ajax/run.rb +0 -14
- data/examples/blog/README +0 -70
- data/examples/blog/conf/apache.conf +0 -30
- data/examples/blog/conf/apache.conf.new +0 -53
- data/examples/blog/conf/lhttpd.conf +0 -79
- data/examples/blog/conf/locales/de.yml +0 -4
- data/examples/blog/conf/locales/en.yml +0 -4
- data/examples/blog/log/README +0 -3
- data/examples/blog/log/apache.error_log +0 -6647
- data/examples/blog/log/rewrite_log +0 -161
- data/examples/blog/public/base.xsl +0 -153
- data/examples/blog/public/fcgi.rb +0 -5
- data/examples/blog/public/m/bubbles.gif +0 -0
- data/examples/blog/public/m/comments_curve.gif +0 -0
- data/examples/blog/public/m/down.gif +0 -0
- data/examples/blog/public/m/footer_bg.gif +0 -0
- data/examples/blog/public/m/garrow.gif +0 -0
- data/examples/blog/public/m/gbull.gif +0 -0
- data/examples/blog/public/m/grbull.gif +0 -0
- data/examples/blog/public/m/h1_bg.gif +0 -0
- data/examples/blog/public/m/header_bg.gif +0 -0
- data/examples/blog/public/m/nitro.gif +0 -0
- data/examples/blog/public/m/obull.gif +0 -0
- data/examples/blog/public/m/page_bg.gif +0 -0
- data/examples/blog/public/m/rss.gif +0 -0
- data/examples/blog/public/m/side_title_bg.gif +0 -0
- data/examples/blog/public/m/sidebar_bg.gif +0 -0
- data/examples/blog/public/style.css +0 -305
- data/examples/blog/run.rb +0 -43
- data/examples/blog/src/blog.rb +0 -21
- data/examples/blog/src/controller.rb +0 -151
- data/examples/blog/src/mailer.rb +0 -23
- data/examples/blog/src/models/blog.rb +0 -33
- data/examples/blog/src/models/content.rb +0 -18
- data/examples/blog/src/views/blog_entry_email.xhtml +0 -16
- data/examples/blog/src/views/comments.xhtml +0 -36
- data/examples/blog/src/views/entry_form.xhtml +0 -22
- data/examples/blog/src/views/error.xhtml +0 -56
- data/examples/blog/src/views/index.xhtml +0 -49
- data/examples/blog/src/views/login.xhtml +0 -26
- data/examples/blog/src/views/recent_posts.xhtml +0 -14
- data/examples/blog/src/views/view_entry.xhtml +0 -37
- data/examples/blog/src/views/view_entry.xml +0 -12
- data/examples/blog/src/xsl/base.xsl +0 -160
- data/examples/blog/src/xsl/style.xsl +0 -143
- data/examples/blog/test/tc_blog.rb +0 -43
- data/examples/flash/log/README +0 -3
- data/examples/flash/root/index.xhtml +0 -16
- data/examples/flash/root/show_inline_text.xhtml +0 -17
- data/examples/flash/run.rb +0 -7
- data/examples/no_xsl_blog/README +0 -24
- data/examples/no_xsl_blog/conf/apache.conf +0 -30
- data/examples/no_xsl_blog/conf/lhttpd.conf +0 -79
- data/examples/no_xsl_blog/conf/locales/de.yml +0 -4
- data/examples/no_xsl_blog/conf/locales/en.yml +0 -4
- data/examples/no_xsl_blog/lib/blog.rb +0 -16
- data/examples/no_xsl_blog/lib/blog/controller.rb +0 -116
- data/examples/no_xsl_blog/lib/blog/model.rb +0 -35
- data/examples/no_xsl_blog/lib/blog/template.rb +0 -138
- data/examples/no_xsl_blog/lib/content.rb +0 -47
- data/examples/no_xsl_blog/log/README +0 -3
- data/examples/no_xsl_blog/log/apache.error_log +0 -473
- data/examples/no_xsl_blog/public/comments.xhtml +0 -36
- data/examples/no_xsl_blog/public/entry_form.xhtml +0 -22
- data/examples/no_xsl_blog/public/fcgi.rb +0 -5
- data/examples/no_xsl_blog/public/index.xhtml +0 -39
- data/examples/no_xsl_blog/public/login.xhtml +0 -21
- data/examples/no_xsl_blog/public/m/bubbles.gif +0 -0
- data/examples/no_xsl_blog/public/m/comments_curve.gif +0 -0
- data/examples/no_xsl_blog/public/m/down.gif +0 -0
- data/examples/no_xsl_blog/public/m/footer_bg.gif +0 -0
- data/examples/no_xsl_blog/public/m/garrow.gif +0 -0
- data/examples/no_xsl_blog/public/m/gbull.gif +0 -0
- data/examples/no_xsl_blog/public/m/grbull.gif +0 -0
- data/examples/no_xsl_blog/public/m/h1_bg.gif +0 -0
- data/examples/no_xsl_blog/public/m/header_bg.gif +0 -0
- data/examples/no_xsl_blog/public/m/nitro.gif +0 -0
- data/examples/no_xsl_blog/public/m/obull.gif +0 -0
- data/examples/no_xsl_blog/public/m/page_bg.gif +0 -0
- data/examples/no_xsl_blog/public/m/rss.gif +0 -0
- data/examples/no_xsl_blog/public/m/side_title_bg.gif +0 -0
- data/examples/no_xsl_blog/public/m/sidebar_bg.gif +0 -0
- data/examples/no_xsl_blog/public/recent_posts.xhtml +0 -14
- data/examples/no_xsl_blog/public/style.css +0 -299
- data/examples/no_xsl_blog/public/view_entry.xhtml +0 -25
- data/examples/no_xsl_blog/public/view_entry.xml +0 -12
- data/examples/no_xsl_blog/run.rb +0 -35
- data/examples/tiny/README +0 -14
- data/examples/tiny/conf/apache.conf +0 -30
- data/examples/tiny/conf/lhttpd.conf +0 -79
- data/examples/tiny/log/README +0 -3
- data/examples/tiny/log/apache.error_log +0 -154
- data/examples/tiny/public/deep/dir/hello.xhtml +0 -3
- data/examples/tiny/public/fcgi.rb +0 -5
- data/examples/tiny/public/include.xhtml +0 -3
- data/examples/tiny/public/index.xhtml +0 -55
- data/examples/tiny/public/nitro.png +0 -0
- data/examples/tiny/public/upload.xhtml +0 -21
- data/examples/tiny/run.rb +0 -7
- data/examples/wee_style/README +0 -10
- data/examples/wee_style/run.rb +0 -50
- data/examples/why_wiki/README +0 -5
- data/examples/why_wiki/run.rb +0 -59
- data/proto/public/js/ajax.js +0 -63
@@ -1,26 +0,0 @@
|
|
1
|
-
<?xml version="1.0"?>
|
2
|
-
|
3
|
-
<x:page xmlns:x="http://www.navel.gr/xml/shader.xsd">
|
4
|
-
|
5
|
-
<x:cell id="main">
|
6
|
-
|
7
|
-
<p>
|
8
|
-
Please login as an author by entering the blog password.
|
9
|
-
<br />
|
10
|
-
The password is: <b>#{Blog.password}</b>.
|
11
|
-
</p>
|
12
|
-
|
13
|
-
<div class="error">#@error</div>
|
14
|
-
|
15
|
-
<form action="login" method="post">
|
16
|
-
<p>
|
17
|
-
<b>Password:</b><br />
|
18
|
-
<input type="password" name="password" value="#{Blog.password}" />
|
19
|
-
</p>
|
20
|
-
<input type="submit" value="Login" />
|
21
|
-
</form>
|
22
|
-
|
23
|
-
</x:cell>
|
24
|
-
|
25
|
-
</x:page>
|
26
|
-
|
@@ -1,37 +0,0 @@
|
|
1
|
-
<?xml version="1.0"?>
|
2
|
-
|
3
|
-
<x:page xmlns:x="http://www.navel.gr/xml/shader.xsd">
|
4
|
-
|
5
|
-
<x:cell id="main">
|
6
|
-
|
7
|
-
<div class="full-@entry">
|
8
|
-
<h2 class="date">#{@entry.create_time.strftime('%B %e, %G')}</h2>
|
9
|
-
<div class="post">
|
10
|
-
<h3 class="title">#{@entry.title}</h3>
|
11
|
-
#{@entry.body}
|
12
|
-
<div class="footer">
|
13
|
-
posted by gmosx at #{@entry.create_time.strftime('%R %p')}
|
14
|
-
<a href="#" onclick="document.getElementById('msg_entry').style.display='block'; return false">mail</a>
|
15
|
-
<div id="msg_entry">
|
16
|
-
<form action="mail_entry">
|
17
|
-
<input type="hidden" name="oid" value="#{@entry.oid}" />
|
18
|
-
<strong>Mail to:</strong>%nbsp;<input type="text" name="to" />%nbsp;
|
19
|
-
<input type="submit" value="Send" />
|
20
|
-
</form>
|
21
|
-
</div>
|
22
|
-
<?r if session[:owner] ?>
|
23
|
-
[<a href="del_entry?oid=#{@entry.oid}">del</a>]
|
24
|
-
<?r end ?>
|
25
|
-
</div>
|
26
|
-
</div>
|
27
|
-
</div>
|
28
|
-
|
29
|
-
<div id="comments">
|
30
|
-
<render href="comments" />
|
31
|
-
</div>
|
32
|
-
|
33
|
-
<p><a href="/">Home</a></p>
|
34
|
-
</x:cell>
|
35
|
-
|
36
|
-
</x:page>
|
37
|
-
|
@@ -1,12 +0,0 @@
|
|
1
|
-
<?xml version="1.0"?>
|
2
|
-
|
3
|
-
<entry>
|
4
|
-
<title>#{@entry.title}</title>
|
5
|
-
<date>#{@entry.create_time.strftime('%B %e, %G')}</date>
|
6
|
-
<body>#{@entry.body}</body>
|
7
|
-
<comments>
|
8
|
-
<?r for comment in @entry.comments ?>
|
9
|
-
<comment>#{comment.body}</comment>
|
10
|
-
<?r end ?>
|
11
|
-
</comments>
|
12
|
-
</entry>
|
@@ -1,160 +0,0 @@
|
|
1
|
-
<?xml version='1.0' ?>
|
2
|
-
|
3
|
-
<!--
|
4
|
-
author: gmosx
|
5
|
-
-->
|
6
|
-
|
7
|
-
<!DOCTYPE shader
|
8
|
-
[
|
9
|
-
<!ENTITY nbsp "<![CDATA[ ]]>">
|
10
|
-
<!ENTITY copy "<![CDATA[©]]>">
|
11
|
-
<!ENTITY euro "<![CDATA[€]]>">
|
12
|
-
<!ENTITY laquo "<![CDATA[«]]>">
|
13
|
-
<!ENTITY raquo "<![CDATA[»]]>">
|
14
|
-
]>
|
15
|
-
|
16
|
-
<xsl:stylesheet
|
17
|
-
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
18
|
-
xmlns:x="http://www.navel.gr/xml/shader.xsd"
|
19
|
-
exclude-result-prefixes="x"
|
20
|
-
version="1.0">
|
21
|
-
|
22
|
-
<!-- strip comments -->
|
23
|
-
<xsl:template match="comment()">
|
24
|
-
<!-- strip -->
|
25
|
-
</xsl:template>
|
26
|
-
|
27
|
-
<!-- only copy ruby/r processing instructions -->
|
28
|
-
|
29
|
-
<xsl:template match='processing-instruction("ruby")'>
|
30
|
-
<xsl:copy/>
|
31
|
-
</xsl:template>
|
32
|
-
<xsl:template match='processing-instruction("r")'>
|
33
|
-
<xsl:copy/>
|
34
|
-
</xsl:template>
|
35
|
-
<xsl:template match='processing-instruction("include")'>
|
36
|
-
<xsl:copy/>
|
37
|
-
</xsl:template>
|
38
|
-
|
39
|
-
<!-- copy other tags -->
|
40
|
-
<xsl:template match="@* | * | text()">
|
41
|
-
<xsl:copy>
|
42
|
-
<xsl:apply-templates select="@* | * | text() | processing-instruction()"/>
|
43
|
-
</xsl:copy>
|
44
|
-
</xsl:template>
|
45
|
-
|
46
|
-
<!-- root element -->
|
47
|
-
<xsl:template match="root">
|
48
|
-
<xsl:apply-templates/>
|
49
|
-
</xsl:template>
|
50
|
-
|
51
|
-
<!-- rendering errors -->
|
52
|
-
<xsl:template name='x:rendering-errors' match='x:rendering-errors'>
|
53
|
-
<ruby>unless @rendering_errors.empty?</ruby>
|
54
|
-
<div id="rendering-errors">
|
55
|
-
<h3>RENDERING ERRORS:</h3>
|
56
|
-
#{@rendering_errors.join('<br />')}
|
57
|
-
</div>
|
58
|
-
<ruby>end</ruby>
|
59
|
-
</xsl:template>
|
60
|
-
|
61
|
-
<!-- form errors temlate -->
|
62
|
-
<xsl:template name='x:form-errors' match='x:form-errors'>
|
63
|
-
<ruby>if errors = request.errors_to_a()</ruby>
|
64
|
-
<div class="errors"><b>ERRORS:</b><br />#{errors.join("<br />")}</div>
|
65
|
-
<ruby>end</ruby>
|
66
|
-
</xsl:template>
|
67
|
-
|
68
|
-
<xsl:template match='x:cell'>
|
69
|
-
<xsl:apply-templates/>
|
70
|
-
</xsl:template>
|
71
|
-
|
72
|
-
<xsl:template match="x:clear" name="x:clear">
|
73
|
-
<div class="clear">.</div>
|
74
|
-
</xsl:template>
|
75
|
-
|
76
|
-
<!-- admin ui -->
|
77
|
-
<xsl:template name='x:admin-ui' match='x:admin-ui'>
|
78
|
-
<ruby>if admin</ruby>
|
79
|
-
<span class="admin">
|
80
|
-
<xsl:apply-templates />
|
81
|
-
</span>
|
82
|
-
<ruby>end</ruby>
|
83
|
-
</xsl:template>
|
84
|
-
|
85
|
-
<!-- transaction form -->
|
86
|
-
<xsl:template name='x:form-pass-txid' match='x:form-pass-txid'>
|
87
|
-
<input type="hidden" name="txid">
|
88
|
-
<!-- gmosx: keep in one line! -->
|
89
|
-
<xsl:attribute name="value"><![CDATA[#{request['txid']}]]></xsl:attribute>
|
90
|
-
</input>
|
91
|
-
</xsl:template>
|
92
|
-
|
93
|
-
<xsl:template name="x:pager-first" match="x:pager-first">
|
94
|
-
<ruby>unless @pager.page == @pager.first_page</ruby>
|
95
|
-
<a>
|
96
|
-
<xsl:attribute name="href">#{@pager.target_uri(@pager.first_page)}</xsl:attribute>
|
97
|
-
<xsl:apply-templates />
|
98
|
-
</a>
|
99
|
-
<ruby>end</ruby>
|
100
|
-
</xsl:template>
|
101
|
-
|
102
|
-
<xsl:template name="x:pager-prev" match="x:pager-prev">
|
103
|
-
<ruby>unless @pager.page == @pager.first_page</ruby>
|
104
|
-
<a>
|
105
|
-
<xsl:attribute name="href">#{@pager.target_uri(@pager.previous_page)}</xsl:attribute>
|
106
|
-
<xsl:apply-templates />
|
107
|
-
</a>
|
108
|
-
<ruby>end</ruby>
|
109
|
-
</xsl:template>
|
110
|
-
|
111
|
-
<xsl:template name="x:pager-next" match="x:pager-next">
|
112
|
-
<ruby>unless @pager.page == @pager.last_page</ruby>
|
113
|
-
<a>
|
114
|
-
<xsl:attribute name="href">#{@pager.target_uri(@pager.next_page)}</xsl:attribute>
|
115
|
-
<xsl:apply-templates />
|
116
|
-
</a>
|
117
|
-
<ruby>end</ruby>
|
118
|
-
</xsl:template>
|
119
|
-
|
120
|
-
<xsl:template name="x:pager-last" match="x:pager-last">
|
121
|
-
<ruby>unless @pager.page == @pager.last_page</ruby>
|
122
|
-
<a>
|
123
|
-
<xsl:attribute name="href">#{@pager.target_uri(@pager.last_page)}</xsl:attribute>
|
124
|
-
<xsl:apply-templates />
|
125
|
-
</a>
|
126
|
-
<ruby>end</ruby>
|
127
|
-
</xsl:template>
|
128
|
-
|
129
|
-
<xsl:template name="x:pager-pages" match="x:pager-pages">
|
130
|
-
<ruby>
|
131
|
-
for i in @pager.nav_range()
|
132
|
-
if i == @pager.page
|
133
|
-
@out += %|<xsl:apply-templates select="x:pager-selected" />|
|
134
|
-
else
|
135
|
-
@out += %|<xsl:apply-templates select="x:pager-page" />|
|
136
|
-
end
|
137
|
-
end
|
138
|
-
</ruby>
|
139
|
-
</xsl:template>
|
140
|
-
|
141
|
-
<xsl:template name="x:pager-selected" match="x:pager-selected">
|
142
|
-
<xsl:apply-templates />
|
143
|
-
</xsl:template>
|
144
|
-
|
145
|
-
<xsl:template name="x:pager-page" match="x:pager-page">
|
146
|
-
<xsl:param name="index"><xsl:value-of select="@index"/></xsl:param>
|
147
|
-
<a>
|
148
|
-
<xsl:attribute name="href">#{@pager.target_uri(i)}</xsl:attribute>
|
149
|
-
<xsl:apply-templates />
|
150
|
-
</a>
|
151
|
-
</xsl:template>
|
152
|
-
|
153
|
-
<!-- caching -->
|
154
|
-
|
155
|
-
<xsl:template name='cache' match='cache'>
|
156
|
-
<ruby>cache do</ruby>
|
157
|
-
<xsl:apply-templates />
|
158
|
-
<ruby>end</ruby>
|
159
|
-
</xsl:template>
|
160
|
-
</xsl:stylesheet>
|
@@ -1,143 +0,0 @@
|
|
1
|
-
<?xml version="1.0"?>
|
2
|
-
|
3
|
-
<!--
|
4
|
-
A Simple Shader
|
5
|
-
|
6
|
-
* George Moschovitis <gm@navel.gr>
|
7
|
-
(c) 2004-2005 Navel, all rights reserved.
|
8
|
-
$Id: style.xsl 1 2005-04-11 11:04:30Z gmosx $
|
9
|
-
-->
|
10
|
-
|
11
|
-
<!DOCTYPE shader
|
12
|
-
[
|
13
|
-
<!ENTITY nbsp "<![CDATA[ ]]>">
|
14
|
-
<!ENTITY copy "<![CDATA[©]]>">
|
15
|
-
<!ENTITY euro "<![CDATA[€]]>">
|
16
|
-
<!ENTITY laquo "<![CDATA[«]]>">
|
17
|
-
<!ENTITY raquo "<![CDATA[»]]>">
|
18
|
-
]>
|
19
|
-
|
20
|
-
<xsl:stylesheet
|
21
|
-
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
22
|
-
xmlns:xl="http://www.w3.org/1999/xlink"
|
23
|
-
xmlns:x="http://www.navel.gr/xml/shader.xsd" version="1.0"
|
24
|
-
exclude-result-prefixes="x xl">
|
25
|
-
|
26
|
-
<xsl:include href="src/xsl/base.xsl" />
|
27
|
-
|
28
|
-
<xsl:output method="xml" indent="yes" encoding="iso-8859-1" />
|
29
|
-
|
30
|
-
<xsl:template name="x:head">
|
31
|
-
<head>
|
32
|
-
<title>#(@context.conf.name)</title>
|
33
|
-
<meta name="title" content="Blog" />
|
34
|
-
<meta name="description" content="Example" />
|
35
|
-
<meta name="keywords" content="nitro, example, blog" />
|
36
|
-
<meta name="category" content="example" />
|
37
|
-
<meta name="robots" content="index, follow" />
|
38
|
-
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
|
39
|
-
|
40
|
-
<xsl:apply-templates select="x:block[@id='meta']"/>
|
41
|
-
|
42
|
-
<base href="#(@context.host_url)/" />
|
43
|
-
<link href="/style.css" rel="stylesheet" type="text/css" media="screen" />
|
44
|
-
<link rel="alternate" type="application/rss+xml" title="Latest Entries" href="#{@context.host_url}/xml/list_entry" />
|
45
|
-
<link rel="alternate" type="application/rss+xml" title="Latest Comments" href="#{@context.host_url}/xml/list_comment" />
|
46
|
-
<xsl:apply-templates select="x:cell[@id='head']"/>
|
47
|
-
</head>
|
48
|
-
</xsl:template>
|
49
|
-
|
50
|
-
<xsl:template name="x:header">
|
51
|
-
<div id="header">
|
52
|
-
<h1><a href="/">#{@context.conf.name}</a></h1>
|
53
|
-
</div>
|
54
|
-
</xsl:template>
|
55
|
-
|
56
|
-
<xsl:template name="x:footer">
|
57
|
-
<div id="footer">
|
58
|
-
</div>
|
59
|
-
</xsl:template>
|
60
|
-
|
61
|
-
<xsl:template name="x:error" match="x:error">
|
62
|
-
<ruby>if @errors and __err__ = @errors[:<xsl:value-of select="@attr" />]</ruby>
|
63
|
-
<xsl:apply-templates />
|
64
|
-
<span class="error">#{__err__}</span>
|
65
|
-
<ruby>end</ruby>
|
66
|
-
</xsl:template>
|
67
|
-
|
68
|
-
<!--
|
69
|
-
can only include x:blocks, all other templates are ignored
|
70
|
-
-->
|
71
|
-
<xsl:template match="x:page">
|
72
|
-
<html>
|
73
|
-
<xsl:call-template name="x:head" />
|
74
|
-
<body>
|
75
|
-
|
76
|
-
<div id="page">
|
77
|
-
|
78
|
-
<xsl:call-template name="x:header" />
|
79
|
-
|
80
|
-
<xsl:apply-templates select="x:cell[@id='top']" />
|
81
|
-
|
82
|
-
<div class="block main">
|
83
|
-
<xsl:apply-templates select="x:cell[@id='main']" />
|
84
|
-
</div>
|
85
|
-
|
86
|
-
<div class="block side">
|
87
|
-
<h2>About</h2>
|
88
|
-
This is a simple blog powered by <a href="http://www.navel.gr/nitro">
|
89
|
-
Nitro</a> Web Engine. Have a look at the source code and enjoy the
|
90
|
-
power of Ruby.
|
91
|
-
|
92
|
-
<ruby>unless session[:owner]</ruby>
|
93
|
-
<p><a href="login">Login</a> as owner.</p>
|
94
|
-
<ruby>else</ruby>
|
95
|
-
<p><a href="logout">Logout</a>.</p>
|
96
|
-
<ruby>end</ruby>
|
97
|
-
|
98
|
-
<p>
|
99
|
-
<b>[[Language]]</b>: #{session[:LOCALE] || :en} (<a href="toggle_locale">change</a>)
|
100
|
-
</p>
|
101
|
-
|
102
|
-
<xsl:apply-templates select="x:cell[@id='side']" />
|
103
|
-
|
104
|
-
<h2>Linkage</h2>
|
105
|
-
<ul>
|
106
|
-
<li><a target="_new" href="http://www.navel.gr">Navel Ltd</a></li>
|
107
|
-
<li><a target="_new" href="http://www.navel.gr/nitro">Nitro Web Engine</a></li>
|
108
|
-
<li><a target="_new" href="http://www.ruby-lang.org">Ruby</a></li>
|
109
|
-
<li><a target="_new" href="http://www.blogger.com">Blogger</a></li>
|
110
|
-
<li><a target="_new" href="http://www.w3c.org">W3 Consortium</a></li>
|
111
|
-
</ul>
|
112
|
-
|
113
|
-
<br />
|
114
|
-
<ul class="rss">
|
115
|
-
<li><a href="xml/list_entry">Latest entries</a></li>
|
116
|
-
<li><a href="xml/list_comment">Latest comments</a></li>
|
117
|
-
</ul>
|
118
|
-
|
119
|
-
<br />
|
120
|
-
<p>
|
121
|
-
powered by:<br />
|
122
|
-
<div style="padding: 5px; background: #fff; text-align: center; border: 1px solid #ccc">
|
123
|
-
<a href="http://www.navel.gr/nitro"><img src="m/nitro.gif" style="border: none" /></a>
|
124
|
-
</div>
|
125
|
-
<br />
|
126
|
-
skin from <a href="http://www.blogger.com">Blogger.com</a>
|
127
|
-
</p>
|
128
|
-
</div>
|
129
|
-
|
130
|
-
<div class="clear">.</div>
|
131
|
-
|
132
|
-
<xsl:apply-templates select="x:cell[@id='bottom']" />
|
133
|
-
|
134
|
-
<xsl:call-template name="x:footer" />
|
135
|
-
</div>
|
136
|
-
|
137
|
-
<xsl:call-template name="x:rendering-errors" />
|
138
|
-
|
139
|
-
</body>
|
140
|
-
</html>
|
141
|
-
</xsl:template>
|
142
|
-
|
143
|
-
</xsl:stylesheet>
|
@@ -1,43 +0,0 @@
|
|
1
|
-
$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
|
2
|
-
$:.unshift File.join(File.dirname(__FILE__), '..', 'src')
|
3
|
-
|
4
|
-
require 'test/unit'
|
5
|
-
require 'ostruct'
|
6
|
-
|
7
|
-
require 'og'
|
8
|
-
require 'glue/validation'
|
9
|
-
require 'nitro/testing'
|
10
|
-
|
11
|
-
require 'blog'
|
12
|
-
|
13
|
-
class TC_Blog < Test::Unit::TestCase # :nodoc: all
|
14
|
-
include Nitro
|
15
|
-
|
16
|
-
def setup
|
17
|
-
@conf = Conf.new(
|
18
|
-
:dispatcher => Dispatcher.new(BlogController, :xml => 'text/xml')
|
19
|
-
)
|
20
|
-
end
|
21
|
-
|
22
|
-
def test_context
|
23
|
-
handle(
|
24
|
-
'/login',
|
25
|
-
request = { 'password' => Blog.password }
|
26
|
-
)
|
27
|
-
assert_redirect
|
28
|
-
assert_session_has(:owner)
|
29
|
-
assert_session_equal(:username, 'George Moschovitis')
|
30
|
-
assert_has_cookie('nauth')
|
31
|
-
assert_has_no_cookie('wow')
|
32
|
-
assert_cookie_equal('nauth', 'just an example, not used :)')
|
33
|
-
|
34
|
-
ctx = handle(
|
35
|
-
'/login',
|
36
|
-
request = { 'password' => 'dunno' }
|
37
|
-
)
|
38
|
-
assert_no_redirect
|
39
|
-
assert_output_contains('Invalid password')
|
40
|
-
assert_status_ok
|
41
|
-
end
|
42
|
-
|
43
|
-
end
|
data/examples/flash/log/README
DELETED