Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 373
- Log:
Initial import of Radiant 0.9.1, which is now packaged as a gem. This is an
import of the tagged 0.9.1 source checked out from GitHub, which isn't quite
the same as the gem distribution - but it doesn't seem to be available in an
archived form and the installed gem already has modifications, so this is
the closest I can get.
- Author:
- rool
- Date:
- Mon Mar 21 13:40:05 +0000 2011
- Size:
- 1206 Bytes
1 | class LayoutsDataset < Dataset::Base |
2 | |
3 | def load |
4 | create_layout "Main", :content => <<-CONTENT |
5 | <html> |
6 | <head> |
7 | <title><r:title /></title> |
8 | </head> |
9 | <body> |
10 | <r:content /> |
11 | </body> |
12 | </html> |
13 | CONTENT |
14 | |
15 | create_layout "UTF8", :content_type => "text/html;charset=utf8", :content => <<-CONTENT |
16 | <html> |
17 | <head> |
18 | <title><r:title /></title> |
19 | </head> |
20 | <body> |
21 | <r:content /> |
22 | </body> |
23 | </html> |
24 | CONTENT |
25 | end |
26 | |
27 | helpers do |
28 | def create_layout(name, attributes={}) |
29 | create_record :layout, name.symbolize, layout_params(attributes.reverse_merge(:name => name)) |
30 | end |
31 | |
32 | def layout_params(attributes={}) |
33 | name = attributes[:name] || unique_layout_name |
34 | { |
35 | :name => name, |
36 | :content => "<r:content />" |
37 | }.merge(attributes) |
38 | end |
39 | |
40 | def destroy_test_layout(name = @layout_name) |
41 | while layout = get_test_layout(name) do |
42 | layout.destroy |
43 | end |
44 | end |
45 | |
46 | def get_test_layout(name = @layout_name) |
47 | Layout.find_by_name(name) |
48 | end |
49 | |
50 | private |
51 | |
52 | @@unique_layout_name_call_count = 0 |
53 | def unique_layout_name |
54 | @@unique_layout_name_call_count += 1 |
55 | "Layout #{@@unique_layout_name_call_count}" |
56 | end |
57 | end |
58 | end |