nitro 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/{ChangeLog → CHANGELOG} +137 -0
- data/INSTALL +1 -2
- data/README +1 -1
- data/Rakefile +10 -61
- data/benchmark/{nitro/bench.rb → bench.rb} +1 -1
- data/benchmark/{nitro/simple-webrick-n-200.txt → simple-webrick-n-200.txt} +0 -0
- data/benchmark/{nitro/static-webrick-n-200.txt → static-webrick-n-200.txt} +0 -0
- data/benchmark/{nitro/tiny-lhttpd-n-200-c-5.txt → tiny-lhttpd-n-200-c-5.txt} +0 -0
- data/benchmark/{nitro/tiny-webrick-n-200-c-5.txt → tiny-webrick-n-200-c-5.txt} +0 -0
- data/benchmark/{nitro/tiny-webrick-n-200.txt → tiny-webrick-n-200.txt} +0 -0
- data/benchmark/{nitro/tiny2-webrick-n-200.txt → tiny2-webrick-n-200.txt} +0 -0
- data/doc/{ChangeLog.1 → CHANGELOG.1} +0 -0
- data/{RELEASES → doc/RELEASES} +46 -0
- data/doc/faq.txt +7 -0
- data/examples/README.windows +1 -1
- data/examples/ajax/controller.rb +21 -0
- data/examples/ajax/public/index.xhtml +70 -0
- data/examples/ajax/public/js/ajax.js +64 -0
- data/examples/ajax/run.rb +16 -0
- data/examples/blog/README +6 -3
- data/examples/blog/conf/apache.conf +2 -2
- data/examples/blog/conf/lhttpd.conf +2 -2
- data/examples/blog/log/apache.error_log +777 -0
- data/examples/blog/{root → public}/base.xsl +0 -0
- data/examples/blog/{root → public}/fcgi.rb +0 -0
- data/examples/blog/{root → public}/m/bubbles.gif +0 -0
- data/examples/blog/{root → public}/m/comments_curve.gif +0 -0
- data/examples/blog/{root → public}/m/down.gif +0 -0
- data/examples/blog/{root → public}/m/footer_bg.gif +0 -0
- data/examples/blog/{root → public}/m/garrow.gif +0 -0
- data/examples/blog/{root → public}/m/gbull.gif +0 -0
- data/examples/blog/{root → public}/m/grbull.gif +0 -0
- data/examples/blog/{root → public}/m/h1_bg.gif +0 -0
- data/examples/blog/{root → public}/m/header_bg.gif +0 -0
- data/examples/blog/{root → public}/m/nitro.gif +0 -0
- data/examples/blog/{root → public}/m/obull.gif +0 -0
- data/examples/blog/{root → public}/m/page_bg.gif +0 -0
- data/examples/blog/{root → public}/m/rss.gif +0 -0
- data/examples/blog/{root → public}/m/side_title_bg.gif +0 -0
- data/examples/blog/{root → public}/m/sidebar_bg.gif +0 -0
- data/examples/{no_xsl_blog/root → blog/public}/style.css +6 -0
- data/examples/blog/run.rb +10 -12
- data/examples/blog/{lib → src}/blog.rb +3 -3
- data/examples/blog/{lib/blog → src}/controller.rb +13 -2
- data/examples/blog/src/mailer.rb +23 -0
- data/examples/blog/{lib/blog/model.rb → src/models/blog.rb} +4 -7
- data/examples/blog/src/models/content.rb +52 -0
- data/examples/blog/src/views/blog_entry_email.xhtml +16 -0
- data/examples/blog/{root → src/views}/comments.xhtml +0 -0
- data/examples/blog/{root → src/views}/entry_form.xhtml +0 -0
- data/examples/blog/{root → src/views}/error.xhtml +0 -0
- data/examples/blog/{root → src/views}/index.xhtml +0 -0
- data/examples/blog/{root → src/views}/login.xhtml +0 -0
- data/examples/blog/{root → src/views}/recent_posts.xhtml +0 -0
- data/examples/blog/{root → src/views}/view_entry.xhtml +8 -0
- data/examples/blog/{root → src/views}/view_entry.xml +0 -0
- data/examples/blog/src/xsl/base.xsl +153 -0
- data/examples/blog/{root → src/xsl}/style.xsl +2 -2
- data/examples/no_xsl_blog/README +5 -1
- data/examples/no_xsl_blog/conf/apache.conf +2 -2
- data/examples/no_xsl_blog/conf/lhttpd.conf +2 -2
- data/examples/no_xsl_blog/lib/blog/model.rb +1 -1
- data/{lib/parts → examples/no_xsl_blog/lib}/content.rb +1 -11
- data/examples/no_xsl_blog/log/apache.error_log +405 -0
- data/examples/no_xsl_blog/{root → public}/comments.xhtml +0 -0
- data/examples/no_xsl_blog/{root → public}/entry_form.xhtml +0 -0
- data/examples/no_xsl_blog/{root → public}/fcgi.rb +0 -0
- data/examples/no_xsl_blog/{root → public}/index.xhtml +0 -0
- data/examples/no_xsl_blog/{root → public}/login.xhtml +0 -0
- data/examples/no_xsl_blog/{root → public}/m/bubbles.gif +0 -0
- data/examples/no_xsl_blog/{root → public}/m/comments_curve.gif +0 -0
- data/examples/no_xsl_blog/{root → public}/m/down.gif +0 -0
- data/examples/no_xsl_blog/{root → public}/m/footer_bg.gif +0 -0
- data/examples/no_xsl_blog/{root → public}/m/garrow.gif +0 -0
- data/examples/no_xsl_blog/{root → public}/m/gbull.gif +0 -0
- data/examples/no_xsl_blog/{root → public}/m/grbull.gif +0 -0
- data/examples/no_xsl_blog/{root → public}/m/h1_bg.gif +0 -0
- data/examples/no_xsl_blog/{root → public}/m/header_bg.gif +0 -0
- data/examples/no_xsl_blog/{root → public}/m/nitro.gif +0 -0
- data/examples/no_xsl_blog/{root → public}/m/obull.gif +0 -0
- data/examples/no_xsl_blog/{root → public}/m/page_bg.gif +0 -0
- data/examples/no_xsl_blog/{root → public}/m/rss.gif +0 -0
- data/examples/no_xsl_blog/{root → public}/m/side_title_bg.gif +0 -0
- data/examples/no_xsl_blog/{root → public}/m/sidebar_bg.gif +0 -0
- data/examples/no_xsl_blog/{root → public}/recent_posts.xhtml +0 -0
- data/examples/{blog/root → no_xsl_blog/public}/style.css +0 -0
- data/examples/no_xsl_blog/{root → public}/view_entry.xhtml +0 -0
- data/examples/no_xsl_blog/{root → public}/view_entry.xml +0 -0
- data/examples/tiny/conf/apache.conf +2 -2
- data/examples/tiny/log/apache.error_log +100 -0
- data/examples/tiny/{root → public}/fcgi.rb +0 -0
- data/examples/tiny/{root → public}/include.xhtml +0 -0
- data/examples/tiny/{root → public}/index.xhtml +0 -0
- data/{bin/proto/root/m → examples/tiny/public}/nitro.png +0 -0
- data/examples/tiny/{root → public}/upload.xhtml +0 -0
- data/examples/tiny/run.rb +1 -2
- data/examples/why_wiki/wiki.yml +1 -0
- data/install.rb +5 -2
- data/lib/nitro.rb +2 -6
- data/lib/nitro/adapters/fastcgi.rb +2 -2
- data/lib/nitro/adapters/webrick.rb +4 -4
- data/lib/nitro/conf.rb +5 -2
- data/lib/nitro/controller.rb +2 -2
- data/lib/nitro/dispatcher.rb +19 -8
- data/lib/nitro/mail.rb +252 -8
- data/lib/nitro/render.rb +24 -21
- data/lib/nitro/runner.rb +1 -1
- data/lib/nitro/scaffold.rb +2 -5
- data/lib/nitro/simple.rb +2 -1
- data/lib/nitro/template.rb +42 -2
- data/test/nitro/tc_controller.rb +9 -4
- data/test/nitro/tc_dispatcher.rb +4 -6
- data/test/nitro/tc_mail.rb +95 -0
- data/test/{root → public}/blog/list.xhtml +0 -0
- data/test/public/dummy_mailer/registration.xhtml +5 -0
- data/vendor/README +0 -1
- metadata +136 -181
- data/benchmark/og/bench.rb +0 -75
- data/benchmark/og/sqlite-no-prepare.1.txt +0 -13
- data/benchmark/og/sqlite-no-prepare.2.txt +0 -13
- data/benchmark/og/sqlite-prepare.1.txt +0 -13
- data/benchmark/og/sqlite-prepare.2.txt +0 -13
- data/bin/proto/README +0 -34
- data/bin/proto/conf/apache.conf +0 -1
- data/bin/proto/conf/app.conf.rb +0 -14
- data/bin/proto/conf/lhttpd.conf +0 -236
- data/bin/proto/ctl +0 -4
- data/bin/proto/lib/README +0 -5
- data/bin/proto/log/README +0 -3
- data/bin/proto/root/fcgi.rb +0 -6
- data/bin/proto/root/index.xhtml +0 -69
- data/bin/proto/root/style.css +0 -152
- data/bin/proto/root/style.xsl +0 -99
- data/doc/og_config.txt +0 -35
- data/doc/og_tutorial.txt +0 -595
- data/examples/og/README +0 -11
- data/examples/og/mock_example.rb +0 -50
- data/examples/og/mysql_to_psql.rb +0 -96
- data/examples/og/run.rb +0 -286
- data/examples/tiny/root/nitro.png +0 -0
- data/lib/glue.rb +0 -55
- data/lib/glue/array.rb +0 -61
- data/lib/glue/attribute.rb +0 -83
- data/lib/glue/cache.rb +0 -138
- data/lib/glue/flexob.rb +0 -12
- data/lib/glue/hash.rb +0 -122
- data/lib/glue/inflector.rb +0 -91
- data/lib/glue/logger.rb +0 -147
- data/lib/glue/misc.rb +0 -14
- data/lib/glue/mixins.rb +0 -36
- data/lib/glue/number.rb +0 -24
- data/lib/glue/object.rb +0 -32
- data/lib/glue/pool.rb +0 -60
- data/lib/glue/property.rb +0 -408
- data/lib/glue/string.rb +0 -162
- data/lib/glue/time.rb +0 -85
- data/lib/glue/validation.rb +0 -394
- data/lib/og.rb +0 -185
- data/lib/og/adapter.rb +0 -513
- data/lib/og/adapters/filesys.rb +0 -121
- data/lib/og/adapters/mysql.rb +0 -347
- data/lib/og/adapters/oracle.rb +0 -375
- data/lib/og/adapters/psql.rb +0 -273
- data/lib/og/adapters/sqlite.rb +0 -262
- data/lib/og/backend.rb +0 -297
- data/lib/og/connection.rb +0 -304
- data/lib/og/database.rb +0 -282
- data/lib/og/enchant.rb +0 -125
- data/lib/og/meta.rb +0 -373
- data/lib/og/mock.rb +0 -165
- data/lib/og/observer.rb +0 -53
- data/lib/og/typemacros.rb +0 -23
- data/lib/parts/README +0 -9
- data/test/glue/tc_attribute.rb +0 -22
- data/test/glue/tc_cache.rb +0 -45
- data/test/glue/tc_hash.rb +0 -38
- data/test/glue/tc_logger.rb +0 -39
- data/test/glue/tc_numbers.rb +0 -20
- data/test/glue/tc_property.rb +0 -89
- data/test/glue/tc_property_mixins.rb +0 -93
- data/test/glue/tc_property_type_checking.rb +0 -35
- data/test/glue/tc_strings.rb +0 -103
- data/test/glue/tc_validation.rb +0 -188
- data/test/og/tc_filesys.rb +0 -83
- data/test/og/tc_lifecycle.rb +0 -104
- data/test/og/tc_many_to_many.rb +0 -62
- data/test/og/tc_meta.rb +0 -55
- data/test/og/tc_observer.rb +0 -85
- data/test/og/tc_sqlite.rb +0 -87
- data/test/tc_og.rb +0 -355
- data/vendor/composite_sexp_processor.rb +0 -43
- data/vendor/parse_tree.rb +0 -745
- data/vendor/sexp_processor.rb +0 -453
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/examples/blog/run.rb
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
# * George Moschovitis <gm@navel.gr>
|
|
2
2
|
# (c) 2004-2005 Navel, all rights reserved.
|
|
3
|
-
# $Id: run.rb
|
|
3
|
+
# $Id: run.rb 313 2005-03-16 19:18:09Z gmosx $
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Dir.chdir File.dirname(__FILE__); $:.unshift 'src'
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
require 'nitro'; include N
|
|
7
|
+
require 'nitro'
|
|
10
8
|
require 'og'
|
|
11
9
|
|
|
12
|
-
require '
|
|
10
|
+
require 'blog'
|
|
11
|
+
require 'mailer'
|
|
12
|
+
|
|
13
|
+
include N
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
Og.create_schema = false
|
|
15
16
|
# Session.store_type = :drb
|
|
16
17
|
|
|
17
18
|
runner = Runner.new.setup
|
|
@@ -27,9 +28,7 @@ db = Og::Database.new(
|
|
|
27
28
|
:connection_count => 3
|
|
28
29
|
)
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
Rendering.shader = XSLTShader.new("#{dispatcher.root}/style.xsl",
|
|
31
|
+
Rendering.shader = XSLTShader.new("src/xsl/style.xsl",
|
|
33
32
|
RubyShader.new(
|
|
34
33
|
CompressShader.new
|
|
35
34
|
)
|
|
@@ -39,8 +38,7 @@ conf = Conf.new(
|
|
|
39
38
|
:name => 'Nitro Blog',
|
|
40
39
|
:host => '127.0.0.1',
|
|
41
40
|
:port => 9999,
|
|
42
|
-
:dispatcher =>
|
|
43
|
-
:db => db
|
|
41
|
+
:dispatcher => Dispatcher.new(BlogController, :xml => 'text/xml')
|
|
44
42
|
)
|
|
45
43
|
|
|
46
44
|
runner.run(conf)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# * George Moschovitis <gm@navel.gr>
|
|
2
2
|
# (c) 2004-2005 Navel, all rights reserved.
|
|
3
|
-
# $Id: blog.rb
|
|
3
|
+
# $Id: blog.rb 313 2005-03-16 19:18:09Z gmosx $
|
|
4
4
|
|
|
5
5
|
# A simple blog to demonstrate the power of Nitro.
|
|
6
6
|
|
|
@@ -16,5 +16,5 @@ class Blog
|
|
|
16
16
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
require '
|
|
20
|
-
require '
|
|
19
|
+
require 'controller'
|
|
20
|
+
require 'models/blog'
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
# * George Moschovitis <gm@navel.gr>
|
|
2
2
|
# (c) 2004-2005 Navel, all rights reserved.
|
|
3
|
-
# $Id$
|
|
3
|
+
# $Id: controller.rb 313 2005-03-16 19:18:09Z gmosx $
|
|
4
4
|
|
|
5
5
|
require 'nitro/controller'
|
|
6
6
|
require 'nitro/ui/pager'
|
|
7
7
|
|
|
8
|
-
require '
|
|
8
|
+
require 'mailer'
|
|
9
|
+
require 'models/blog'
|
|
9
10
|
|
|
10
11
|
# The controller of the Blog part.
|
|
11
12
|
|
|
@@ -17,6 +18,11 @@ class BlogController < N::Controller
|
|
|
17
18
|
scaffold BlogEntry, :name => 'entry', :index => true # , :nosuffix => true
|
|
18
19
|
scaffold Comment
|
|
19
20
|
|
|
21
|
+
def initialize(context)
|
|
22
|
+
super
|
|
23
|
+
@template_root = 'src/views'
|
|
24
|
+
end
|
|
25
|
+
|
|
20
26
|
def list_entry
|
|
21
27
|
@pager = UI::Pager.new('entries', request, 3)
|
|
22
28
|
@entries = BlogEntry.all("ORDER BY oid DESC #{@pager.sql_limit}")
|
|
@@ -51,6 +57,11 @@ class BlogController < N::Controller
|
|
|
51
57
|
def list_entry__xml
|
|
52
58
|
o.build_rss(@entries, :description => 'Blog entries', :link => context.host_url)
|
|
53
59
|
end
|
|
60
|
+
|
|
61
|
+
def mail_entry
|
|
62
|
+
entry = BlogEntry[request['oid']]
|
|
63
|
+
BlogMailer.deliver_blog_entry_email(request['to'], entry)
|
|
64
|
+
end
|
|
54
65
|
|
|
55
66
|
def new_comment
|
|
56
67
|
comment = request.fill(Comment.new)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# * George Moschovitis <gm@navel.gr>
|
|
2
|
+
# (c) 2004-2005 Navel, all rights reserved.
|
|
3
|
+
# $Id$
|
|
4
|
+
|
|
5
|
+
require 'nitro/mail'
|
|
6
|
+
|
|
7
|
+
# A simple mailer.
|
|
8
|
+
|
|
9
|
+
class BlogMailer < N::Mailer
|
|
10
|
+
|
|
11
|
+
def initialize(*p)
|
|
12
|
+
super(*p)
|
|
13
|
+
@template_root = 'src/views'
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def blog_entry_email(to, entry)
|
|
17
|
+
@from = 'system@blog.com'
|
|
18
|
+
@to = to
|
|
19
|
+
@subject = "Blog Entry: #{entry.title}"
|
|
20
|
+
@body.entry = entry
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
end
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
# * George Moschovitis <gm@navel.gr>
|
|
2
2
|
# (c) 2004-2005 Navel, all rights reserved.
|
|
3
|
-
# $Id$
|
|
3
|
+
# $Id: blog.rb 313 2005-03-16 19:18:09Z gmosx $
|
|
4
4
|
|
|
5
|
-
require '
|
|
6
|
-
|
|
7
|
-
# The models used in the Blog part.
|
|
5
|
+
require 'models/content'
|
|
8
6
|
|
|
9
7
|
# Forward reference to the Comment definition.
|
|
10
8
|
|
|
@@ -15,9 +13,8 @@ class Comment; end
|
|
|
15
13
|
# the markup expanding/compacting for the body.
|
|
16
14
|
|
|
17
15
|
module Common
|
|
18
|
-
include
|
|
19
|
-
include
|
|
20
|
-
|
|
16
|
+
include BaseContent
|
|
17
|
+
include CreateTime
|
|
21
18
|
prop_accessor :author, String
|
|
22
19
|
validate_value :body
|
|
23
20
|
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# * George Moschovitis <gm@navel.gr>
|
|
2
|
+
# (c) 2004-2005 Navel, all rights reserved.
|
|
3
|
+
# $Id: content.rb 313 2005-03-16 19:18:09Z gmosx $
|
|
4
|
+
|
|
5
|
+
require 'nitro/markup'
|
|
6
|
+
|
|
7
|
+
include N
|
|
8
|
+
|
|
9
|
+
# The foundamental Content Unit.
|
|
10
|
+
|
|
11
|
+
module BaseContent
|
|
12
|
+
include Markup
|
|
13
|
+
prop_accessor :title, String
|
|
14
|
+
prop_accessor :body, String, :markup => true, :ui => :textarea
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
# CreateTime mixin.
|
|
18
|
+
|
|
19
|
+
module CreateTime
|
|
20
|
+
prop_accessor :create_time, Time
|
|
21
|
+
prop_accessor :update_time, Time
|
|
22
|
+
|
|
23
|
+
def og_pre_insert(conn)
|
|
24
|
+
@create_time = @update_time = Time.now
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def og_pre_update(conn)
|
|
28
|
+
@update_time = Time.now
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# The foundamental Content Unit.
|
|
33
|
+
#--
|
|
34
|
+
# THINK: rename this to Entity?
|
|
35
|
+
#++
|
|
36
|
+
|
|
37
|
+
module Content
|
|
38
|
+
include BaseContent
|
|
39
|
+
prop_accessor :name, String
|
|
40
|
+
prop_accessor :ctime, Time
|
|
41
|
+
prop_accessor :mtime, Time
|
|
42
|
+
|
|
43
|
+
def initialize(*args)
|
|
44
|
+
@ctime = @mtime = Time.now
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# A Category.
|
|
49
|
+
|
|
50
|
+
class Category
|
|
51
|
+
include BaseContent
|
|
52
|
+
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -11,6 +11,14 @@
|
|
|
11
11
|
#{@entry.body}
|
|
12
12
|
<div class="footer">
|
|
13
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>
|
|
14
22
|
<?r if session[:owner] ?>
|
|
15
23
|
[<a href="del_entry?oid=#{@entry.oid}">del</a>]
|
|
16
24
|
<?r end ?>
|
|
File without changes
|
|
@@ -0,0 +1,153 @@
|
|
|
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
|
+
</xsl:stylesheet>
|