hobo 0.5.3 → 0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. data/bin/hobo +18 -4
  2. data/hobo_files/plugin/CHANGES.txt +511 -0
  3. data/hobo_files/plugin/README +8 -3
  4. data/hobo_files/plugin/Rakefile +81 -0
  5. data/hobo_files/plugin/generators/hobo/hobo_generator.rb +4 -4
  6. data/hobo_files/plugin/generators/hobo/templates/guest.rb +1 -1
  7. data/hobo_files/plugin/generators/hobo_front_controller/hobo_front_controller_generator.rb +1 -1
  8. data/hobo_files/plugin/generators/hobo_front_controller/templates/index.dryml +16 -22
  9. data/hobo_files/plugin/generators/hobo_front_controller/templates/login.dryml +4 -6
  10. data/hobo_files/plugin/generators/hobo_front_controller/templates/search.dryml +6 -5
  11. data/hobo_files/plugin/generators/hobo_front_controller/templates/signup.dryml +4 -6
  12. data/hobo_files/plugin/generators/hobo_migration/hobo_migration_generator.rb +237 -0
  13. data/hobo_files/plugin/generators/hobo_migration/templates/migration.rb +9 -0
  14. data/hobo_files/plugin/generators/hobo_model/USAGE +2 -3
  15. data/hobo_files/plugin/generators/hobo_model/hobo_model_generator.rb +1 -14
  16. data/hobo_files/plugin/generators/hobo_model/templates/fixtures.yml +1 -6
  17. data/hobo_files/plugin/generators/hobo_model/templates/model.rb +10 -4
  18. data/hobo_files/plugin/generators/hobo_rapid/hobo_rapid_generator.rb +7 -6
  19. data/hobo_files/plugin/generators/hobo_rapid/templates/hobo_base.css +68 -0
  20. data/hobo_files/plugin/generators/hobo_rapid/templates/hobo_rapid.css +93 -0
  21. data/hobo_files/plugin/generators/hobo_rapid/templates/hobo_rapid.js +11 -6
  22. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/images/plus.png +0 -0
  23. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/public/stylesheets/application.css +24 -14
  24. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/views/application.dryml +28 -44
  25. data/hobo_files/plugin/generators/hobo_user_model/USAGE +2 -12
  26. data/hobo_files/plugin/generators/hobo_user_model/hobo_user_model_generator.rb +1 -14
  27. data/hobo_files/plugin/generators/hobo_user_model/templates/fixtures.yml +0 -6
  28. data/hobo_files/plugin/generators/hobo_user_model/templates/model.rb +8 -1
  29. data/hobo_files/plugin/init.rb +6 -2
  30. data/hobo_files/plugin/lib/active_record/has_many_association.rb +23 -12
  31. data/hobo_files/plugin/lib/extensions.rb +134 -40
  32. data/hobo_files/plugin/lib/extensions/test_case.rb +0 -1
  33. data/hobo_files/plugin/lib/hobo.rb +77 -46
  34. data/hobo_files/plugin/lib/hobo/authenticated_user.rb +24 -2
  35. data/hobo_files/plugin/lib/hobo/authentication_support.rb +2 -1
  36. data/hobo_files/plugin/lib/hobo/controller.rb +35 -12
  37. data/hobo_files/plugin/lib/hobo/define_tags.rb +4 -4
  38. data/hobo_files/plugin/lib/hobo/dryml.rb +33 -51
  39. data/hobo_files/plugin/lib/hobo/dryml/dryml_builder.rb +47 -34
  40. data/hobo_files/plugin/lib/hobo/dryml/scoped_variables.rb +37 -0
  41. data/hobo_files/plugin/lib/hobo/dryml/taglib.rb +27 -5
  42. data/hobo_files/plugin/lib/hobo/dryml/template.rb +545 -302
  43. data/hobo_files/plugin/lib/hobo/dryml/template_environment.rb +305 -135
  44. data/hobo_files/plugin/lib/hobo/email_address.rb +5 -0
  45. data/hobo_files/plugin/lib/hobo/field_spec.rb +66 -0
  46. data/hobo_files/plugin/lib/hobo/hobo_helper.rb +325 -0
  47. data/hobo_files/plugin/lib/hobo/html_string.rb +2 -0
  48. data/hobo_files/plugin/lib/hobo/lazy_hash.rb +13 -1
  49. data/hobo_files/plugin/lib/hobo/markdown_string.rb +3 -1
  50. data/hobo_files/plugin/lib/hobo/model.rb +185 -66
  51. data/hobo_files/plugin/lib/hobo/model_controller.rb +56 -49
  52. data/hobo_files/plugin/lib/hobo/password_string.rb +2 -0
  53. data/hobo_files/plugin/lib/hobo/plugins.rb +75 -0
  54. data/hobo_files/plugin/lib/hobo/rapid_helper.rb +98 -0
  55. data/hobo_files/plugin/lib/hobo/static_tags +0 -3
  56. data/hobo_files/plugin/lib/hobo/textile_string.rb +11 -1
  57. data/hobo_files/plugin/lib/hobo/undefined.rb +1 -1
  58. data/hobo_files/plugin/lib/rexml.rb +166 -75
  59. data/hobo_files/plugin/spec/fixtures/users.yml +9 -0
  60. data/hobo_files/plugin/spec/spec.opts +6 -0
  61. data/hobo_files/plugin/spec/spec_helper.rb +28 -0
  62. data/hobo_files/plugin/spec/unit/hobo/dryml/template_spec.rb +650 -0
  63. data/hobo_files/plugin/tags/core.dryml +58 -4
  64. data/hobo_files/plugin/tags/rapid.dryml +289 -135
  65. data/hobo_files/plugin/tags/rapid_document_tags.dryml +49 -0
  66. data/hobo_files/plugin/tags/rapid_editing.dryml +92 -69
  67. data/hobo_files/plugin/tags/rapid_forms.dryml +242 -0
  68. data/hobo_files/plugin/tags/rapid_navigation.dryml +65 -65
  69. data/hobo_files/plugin/tags/rapid_pages.dryml +197 -124
  70. data/hobo_files/plugin/tags/rapid_support.dryml +23 -0
  71. metadata +29 -22
  72. data/hobo_files/plugin/generators/hobo_model/templates/migration.rb +0 -13
  73. data/hobo_files/plugin/generators/hobo_rapid/templates/themes/default/default_mapping.rb +0 -11
  74. data/hobo_files/plugin/generators/hobo_user_model/templates/migration.rb +0 -15
  75. data/hobo_files/plugin/lib/hobo/HtmlString +0 -3
  76. data/hobo_files/plugin/lib/hobo/controller_helpers.rb +0 -135
  77. data/hobo_files/plugin/lib/hobo/core.rb +0 -475
  78. data/hobo_files/plugin/lib/hobo/rapid.rb +0 -447
  79. data/hobo_files/plugin/test/hobo_dryml_template_test.rb +0 -7
  80. data/hobo_files/plugin/test/hobo_test.rb +0 -7
@@ -2,94 +2,94 @@
2
2
  Main nav bar, account nav bar (login, signup...), page nav
3
3
  -->
4
4
 
5
-
6
- <def tag="navigation" attrs="current, item, link_current">
7
- <nav_container xattrs="">
8
- <repeat obj="#item">
9
- <% c = this[:content]; klass = c == current ? "current" : "" %>
10
- <if q="#!link_current && c == current">
11
- <nav_item class="#klass" content_option="li"><%= c %></nav_item>
12
- </if>
13
- <else>
14
- <nav_item content_option="item_el" class="#klass">
15
- <a href="#this[:href]" content_option="link"><%= c %></a>
16
- </nav_item>
17
- </else>
18
- </repeat>
19
- <tagbody/>
20
- </nav_container>
5
+ <!--- General Navigation -->
6
+
7
+ <def tag="navigation" attrs="current">
8
+ <ul merge_attrs>
9
+ <set_scoped current_navigation="&current">
10
+ <tagbody/>
11
+ </set_scoped>
12
+ </ul>
21
13
  </def>
22
14
 
15
+ <def tag="nav_item">
16
+ <set body="&tagbody.call"/>
17
+ <li class="#{'current' if (c = scope.current_navigation) && c.downcase == body.downcase.strip}"
18
+ merge_attrs="&attributes - attrs_for(:a)">
19
+ <a merge_attrs="&attributes & attrs_for(:a)"><%= body %></a>
20
+ </li>
21
+ </def>
23
22
 
24
- <def tag="nav_container"><ul xattrs=""><tagbody/></ul></def>
25
-
26
-
27
- <def tag="nav_item"><li xattrs=""><tagbody/></li></def>
28
23
 
24
+ <!--- Account Navigation (log in / out / signup) -->
29
25
 
30
- <def tag="application_account_nav">
31
- <if q="#logged_in?">
32
- <div class='nav_item'>Logged in as <%= h current_user.login %></div>
33
- <div class='nav_item'><a href="<%= logout_url%>">Log out</a></div>
34
- </if>
35
- <else>
36
- <div class='nav_item'><a href="<%= login_url%>">Log in</a></div>
37
- <if q="#signup_url"> <div class='nav_item'><a href="<%= signup_url%>">Sign up</a></div> </if>
38
- </else>
26
+ <def tag="account_nav">
27
+ <ul class="account_nav">
28
+ <if test="&logged_in?">
29
+ <li class='nav_item'>Logged in as <view:login with="&current_user"/></li>
30
+ <li class='nav_item'><a href="&logout_url">Log out</a></li>
31
+ </if>
32
+ <else>
33
+ <li class='nav_item'><a href="&login_url">Log in</a></li>
34
+ <li if="&defined_route? :signup" class='nav_item'><a href="&signup_url">Sign up</a></li>
35
+ </else>
36
+ </ul>
39
37
  </def>
40
38
 
41
39
 
42
- <def tag="previous_page_link" attrs="query_params">
43
- <% opts = { :page => @pages.current.previous }.merge(query_params || {}) %>
44
- <%= link_to(tagbody ? tagbody.call : '&laquo; Previous page', opts) if @pages and @pages.current.previous %>
45
- </def>
46
-
40
+ <!--- Pagination Navigation -->
47
41
 
48
- <def tag="next_page_link" attrs="query_params">
49
- <% opts = { :page => @pages.current.next }.merge(query_params || {}) %>
50
- <%= link_to(tagbody ? tagbody.call : 'Next page &raquo;', opts) if @pages and @pages.current.next %>
42
+ <def tag="page_nav" attrs="params">
43
+ <page_n_of_count/> -
44
+ <first_page_link params="&params">|&lt;</first_page_link>
45
+ <previous_page_link params="&params">Previous</previous_page_link>
46
+ <next_page_link params="&params">Next</next_page_link>
47
+ <last_page_link params="&params">&gt|</last_page_link>
51
48
  </def>
52
49
 
53
50
 
54
- <def tag="first_page_link" attrs="query_params">
55
- <% opts = { :page => @pages.first }.merge(query_params || {}) %>
56
- <%= link_to(tagbody ? tagbody.call : '&laquo; First page', opts) if @pages and @pages.current != @pages.first %>
51
+ <def tag="page_n_of_count">
52
+ Page <%= @pages.current_page.number %> of <%= @pages.length %>
57
53
  </def>
58
54
 
59
55
 
60
- <def tag="last_page_link" attrs="query_params">
61
- <% opts = { :page => @pages.last }.merge(query_params || {}) %>
62
- <%= link_to(tagbody ? tagbody.call : '&laquo; Last page', opts) if @pages and @pages.current != @pages.last %>
56
+ <def tag="previous_page_link" attrs="params">
57
+ <a if="&@pages && @pages.current.previous"
58
+ href="&url_for({ :page => @pages.current.previous }.merge(params || {}))">
59
+ <tagbody>&laquo; Previous page</tagbody>
60
+ </a>
63
61
  </def>
64
62
 
65
63
 
66
- <def tag="page_n_of_count">
67
- Page <%= @pages.current_page.number %> of <%= @pages.length %>
64
+ <def tag="next_page_link" attrs="params">
65
+ <a if="&@pages && @pages.current.next"
66
+ href="&url_for({ :page => @pages.current.previous }.merge(params || {}))">
67
+ <tagbody>Next page &raqou;</tagbody>
68
+ </a>
68
69
  </def>
69
70
 
70
71
 
71
- <def tag="page_nav" attrs="query_params">
72
- <if q="#@pages.length > 1">
73
- <p>
74
- <page_n_of_count/> -
75
- <first_page_link query_params="#query_params">|&lt;</first_page_link>
76
- <previous_page_link query_params="#query_params">Previous</previous_page_link>
77
- <next_page_link query_params="#query_params">Next</next_page_link>
78
- <last_page_link query_params="#query_params">&gt|</last_page_link>
79
- </p>
80
- </if>
72
+ <def tag="first_page_link" attrs="params">
73
+ <a if="&@pages && @pages.first_page"
74
+ href="&url_for({ :page => @pages.current.previous }.merge(params || {}))">
75
+ <tagbody>&laquo; First page</tagbody>
76
+ </a>
81
77
  </def>
82
78
 
83
- <def tag="link_to_resource" attrs="type">
84
- <%= link_to type, self.send("formatted_#{model.to_s.downcase}_url", this, type.downcase) %>
79
+
80
+ <def tag="last_page_link" attrs="params">
81
+ <a if="&@pages && @pages.last_page"
82
+ href="&url_for({ :page => @pages.current.previous }.merge(params || {}))">
83
+ <tagbody>Last page &raquo;</tagbody>
84
+ </a>
85
85
  </def>
86
86
 
87
- <def tag="link_to_resources" attrs="types">
88
- <ul class="resource_list">
89
- <% comma_split(types).each do |t| %>
90
- <li class="<%= t.downcase %>_resource">
91
- <link_to_resource type="#t" />
92
- </li>
93
- <% end %>
94
- </ul>
87
+ <!-- magic nav, just to get you started -->
88
+ <!-- write your own navigation using the <navigation> tag -->
89
+ <def tag="magic_nav">
90
+ <navigation merge_attrs>
91
+ <nav_item href="#{base_url}/">Home</nav_item>
92
+ <nav_item repeat="&Hobo.models[0..2]"><name/></nav_item>
93
+ <nav_item href="&search_url" if="&defined_route? :search">Search</nav_item>
94
+ </navigation>
95
95
  </def>
@@ -1,175 +1,248 @@
1
- <def tag="page" attrs="title_prefix, title">
2
- <%= '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">' %>
1
+ <def tag="BasePage" attrs="title, doctype">
2
+ <doctype version="&doctype || 'HTML 4.01 STRICT'"/>
3
3
  <html>
4
- <head>
5
- <title><%= title_prefix %><%= title || human_type + ": " + display_name %></title>
6
- <%= stylesheet_link_tag 'application' %>
7
- <%= javascript_include_tag :defaults %>
8
- <hobo_rapid_javascripts replace_option="rapid_javascripts" tiny_mce="#true"/>
4
+ <head param>
5
+ <title param><%= title %></title>
6
+ <do param="stylesheets">
7
+ <stylesheet name="hobo_base"/>
8
+ <stylesheet name="application"/>
9
+ </do>
10
+ <do param="scripts">
11
+ <%= javascript_include_tag :defaults %>
12
+ </do>
9
13
  </head>
10
- <body onload="Hobo.applyEvents();" content_option="body">
11
- <div content_option="header"/>
12
- <div content_option="intro"/>
13
- <div content_option="main"/>
14
- <div content_option="footer"/>
14
+ <body onload="Hobo.applyEvents();" param>
15
15
  </body>
16
16
  </html>
17
17
  </def>
18
18
 
19
+ <def tag="Page">
20
+ <BasePage merge>
21
+ <stylesheets>
22
+ <stylesheet name="hobo_base"/>
23
+ <stylesheet name="hobo_rapid"/>
24
+ <stylesheet name="application"/>
25
+ </stylesheets>
26
+ <scripts>
27
+ <default_tagbody/>
28
+ <hobo_rapid_javascripts param/>
29
+ </scripts>
30
+
31
+ <body param>
32
+ <div class="page_wrapper" param="wrapper">
33
+ <ajax_progress/>
34
+ <header id="page_header" param>
35
+ <div class="logo" param="logo"><image src="logo.png"/></div>
36
+ <nav param>
37
+ <magic_nav class="main_nav" param="main_mav"/>
38
+ <account_nav if="&respond_to? :login_url" param/>
39
+ </nav>
40
+ </header>
41
+ <flash_message param/>
42
+ <div id="page_main" param="main"></div>
43
+ <footer id="page_footer" param/>
44
+ </div>
45
+ </body>
46
+ </BasePage>
47
+ </def>
19
48
 
20
- <def tag="index_page">
21
- <% model_name = @model.name.titleize %>
22
- <page title="All #{model_name.pluralize}" xattrs="">
23
-
24
- <:intro>
25
- <h1><%= model_name.pluralize %></h1>
26
- </:intro>
49
+ <def tag="PageForIndex"><Page merge/></def>
50
+ <def tag="PageForNew"><Page merge/></def>
51
+ <def tag="PageForShow"><Page merge/></def>
52
+ <def tag="PageForNewInCollection"><Page merge/></def>
53
+ <def tag="PageForShowCollection"><Page merge/></def>
27
54
 
28
- <:main>
29
- <panel replace_option="main_panel">
30
- <h2 replace_option="panel_heading"><count label="#model_name"/></h2>
31
- <section>
32
- <table_for replace_option="table">
33
- <td><object_link/></td><td><delete_button class='text'/></td>
34
- </table_for>
55
+ <def tag="IndexPage">
56
+ <% model_name = @model.name.titleize %>
57
+ <PageForIndex title="All #{model_name.pluralize}" merge>
58
+ <body class="rapid_generic_page"/>
59
+ <main>
60
+ <header>
61
+ <heading><%= model_name.pluralize %></heading>
62
+ </header>
63
+
64
+ <nav param="top_page_nav"><page_nav/></nav>
65
+
66
+ <panel param="main" class="main">
67
+ <header param="main_header">
68
+ <h2><count label="&model_name"/></h2>
69
+ </header>
70
+ <section param="main_section">
71
+ <Table param>
72
+ <tr><td><a/></td><td><delete_button update="item_count"/></td></tr>
73
+ </Table>
35
74
  </section>
36
75
 
37
- <if q="#@pages.length > 1">
38
- <section replace_option="page_nav">
39
- <div class="page_links">
40
- <page_nav/>
41
- </div>
42
- </section>
43
- </if>
76
+ <nav param="bottom_page_nav"><page_nav/></nav>
44
77
 
45
- <section_if replace_option="new_link">
46
- <p><new_object_link for="#@model"/></p>
47
- </section_if>
78
+ <section param="new_link"><a to="&@model" action="new"/></section>
48
79
  </panel>
49
- </:main>
50
- </page>
80
+ </main>
81
+ </PageForIndex>
51
82
  </def>
52
83
 
53
84
 
54
- <def tag="new_page">
55
- <page title="New #{human_type}" xattrs="">
56
- <:intro>
57
- <h1>New <human_type/></h1>
58
- </:intro>
85
+ <def tag="NewPage">
86
+ <PageForNew title="New #{human_type}" merge>
87
+ <body class="rapid_generic_page"/>
88
+ <main>
89
+ <header>
90
+ <heading>New <human_type/></heading>
91
+ </header>
59
92
 
60
- <:main>
61
- <panel replace_option="main_panel">
62
- <h2 replace_option="pannel_heading">Details</h2>
93
+ <panel param="main" class="main">
94
+ <header param="main_header"><h2>Details</h2></header>
63
95
  <section>
64
- <div class="error_messages" replace_option="error_messages">
65
- <%= error_messages_for 'this' %>
66
- </div>
67
-
68
- <object_form hidden_fields="*">
69
- <object_table associations="belongs_to" replace_option="fields"/>
70
- <submit label="Create" class="create_button" replace_option="submit_button"/>
71
- </object_form>
96
+ <error_messages param="error_messages"/>
97
+
98
+ <form>
99
+ <FieldList skip_associations="has_many"/>
100
+ <submit label="Create" param/>
101
+ </form>
72
102
  </section>
73
103
  </panel>
74
- </:main>
75
-
76
- </page>
104
+ </main>
105
+ </PageForNew>
77
106
  </def>
78
107
 
79
108
 
80
- <def tag="show_page">
109
+ <def tag="ShowPage">
81
110
  <% has_many_assocs = this.class.reflections.values.map do |refl|
82
111
  this.send(refl.name) if Hobo.simple_has_many_association?(refl)
83
112
  end.compact
84
113
  %>
85
- <page xattrs="">
86
-
87
- <:intro>
88
- <h1><human_type/><if q="#this.respond_to? :name">: <edit attr="name"/></if></h1>
89
- <p><delete_button ajax="#false"/></p>
90
- </:intro>
91
-
92
- <:main>
93
- <panel replace_option="main_panel">
94
- <h2 replace_option="panel_heading">Details</h2>
114
+ <PageForShow merge>
115
+ <body class="rapid_generic_page"/>
116
+ <main>
117
+ <header>
118
+ <heading><human_type/><if test="&this.respond_to? :name">: <editor:name/></if></heading>
119
+ <p><delete_button in_place="&false"/></p>
120
+ </header>
121
+
122
+ <panel param="main_panel">
123
+ <header param="main_header"><h2>Details</h2></header>
95
124
  <section>
96
- <object_table associations="*" skip_fields="name" replace_option="fields"/>
125
+ <FieldList skip="name" tag="editor" param/>
97
126
  </section>
98
127
 
99
- <section_if replace_option="new_links">
100
- <repeat obj="#has_many_assocs">
101
- <p><new_object_link/></p>
128
+ <section param="new_links">
129
+ <repeat with="&has_many_assocs">
130
+ <p><a action="new"/></p>
102
131
  </repeat>
103
- </section_if>
132
+ </section>
104
133
  </panel>
105
- </:main>
106
-
107
- </page>
134
+ </main>
135
+ </PageForShow>
108
136
  </def>
109
137
 
110
138
 
111
- <def tag="new_in_collection_page">
112
- <page title="New #{human_type}" xattrs="">
113
-
114
- <:intro>
115
- <h1>New <human_type/></h1>
116
- <h2>For: <object_link obj="#@owner" /></h2>
117
- </:intro>
139
+ <def tag="NewInCollectionPage">
140
+ <PageForNewInCollection title="New #{human_type}" merge>
141
+ <body class="rapid_generic_page"/>
142
+ <main>
143
+ <header>
144
+ <h1>New <human_type/></h1>
145
+ <h2>For: <a with="&@owner" /></h2>
146
+ </header>
118
147
 
119
- <:main>
120
- <panel replace_option="main_panel">
121
- <h2 replace_option="panel_heading">Details</h2>
148
+ <panel param="main">
149
+ <header param="main_header">
150
+ <h2>Details</h2>
151
+ </header>
122
152
  <section>
123
- <div class="error_messages" replace_option="error_messages">
124
- <%= error_messages_for 'this' %>
125
- </div>
126
-
127
- <object_form hidden_fields="*">
128
- <object_table associations="belongs_to" replace_option="fields"/>
129
- <submit label='#"Add to #{display_name(:obj => @owner, :no_span => true)}"'
130
- replace_option="submit_button"/>
131
- </object_form>
132
- </section>
153
+ <error_messages param="error_messages"/>
133
154
 
155
+ <form>
156
+ <FieldList associations="belongs_to"/>
157
+ <submit label='Add to #{name(:with => @owner, :no_wrapper => true)}'
158
+ param="submit_button"/>
159
+ </form>
160
+ </section>
134
161
  </panel>
135
- </:main>
136
-
137
- </page>
162
+ </main>
163
+ </PageForNewInCollection>
138
164
  </def>
139
165
 
140
166
 
141
- <def tag="show_collection_page">
142
- <% title = "#{@reflection.name.to_s.titleize} for #{display_name(:obj => @owner, :no_span => true)}" %>
143
- <page title="#title" xattrs="">
167
+ <def tag="ShowCollectionPage">
168
+ <% title = "#{@reflection.name.to_s.titleize} for #{name(:with => @owner)}" %>
169
+ <PageForShowCollection title="&title" merge>
170
+ <body class="rapid_generic_page"/>
171
+ <main>
172
+ <header>
173
+ <h1><%= title %></h1>
174
+ <h2>Back to <a with="&@owner"/></h2>
175
+ </header>
144
176
 
145
- <:intro>
146
- <h1><%= title %></h1>
147
- <h2>Back to <object_link obj="#@owner"/></h2>
148
- </:intro>
177
+ <panel param="main">
178
+ <header param="main_header">
179
+ <count with="&@pages.item_count" label="&@reflection.klass.name.titleize"/>
180
+ </header>
181
+
182
+ <nav param="top_page_nav"><page_nav/></nav>
149
183
 
150
- <:main>
151
- <panel replace_option="main_panel">
152
- <h2 replace_option="panel_heading"><count label="#@reflection.klass.name.titleize"/></h2>
153
184
  <section>
154
- <table_for replace_option="table">
155
- <if_can_view><td><object_link/></td><td><delete_button class='text'/></td></if_can_view>
156
- </table_for>
185
+ <Table param="Table">
186
+ <tr>
187
+ <if test="can_view?">
188
+ <td><a/></td><td><delete_button/></td>
189
+ </if>
190
+ </tr>
191
+ </Table>
157
192
  </section>
158
193
 
159
- <if q="#@pages.length > 1">
160
- <section replace_option="page_nav">
161
- <div class="page_links">
162
- <page_nav/>
163
- </div>
164
- </section>
165
- </if>
194
+ <nav param="bottom_page_nav"><page_nav param/></nav>
166
195
 
167
- <if q="#Hobo.simple_has_many_association?(@association)">
168
- <section replace_option="new_link">
169
- <new_object_link for="#@association"/>
196
+ <if test="&Hobo.simple_has_many_association?(@association)">
197
+ <section param="new_link">
198
+ <a to="&@associaton.new"/>
170
199
  </section>
171
200
  </if>
172
201
  </panel>
173
- </:main>
174
- </page>
202
+ </main>
203
+ </PageForShowCollection>
204
+ </def>
205
+
206
+ <def tag="doctype" attrs="version"><%=
207
+ case version.upcase
208
+ when "HTML 4.01 STRICT"
209
+ '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" ' +
210
+ '"http://www.w3.org/TR/html4/strict.dtd">'
211
+ when "HTML 4.01 TRANSITIONAL"
212
+ '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" ' +
213
+ '"http://www.w3.org/TR/html4/loose.dtd">'
214
+ when "XHTML 1.0 STRICT"
215
+ '!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" ' +
216
+ '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'
217
+ when "XHTML 1.0 TRANSITIONAL"
218
+ '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ' +
219
+ '"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'
220
+ when "XHTML 1.1"
221
+ '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" ' +
222
+ '"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'
223
+ end
224
+ %></def>
225
+
226
+ <def tag="stylesheet" attrs="name,media">
227
+ <link href="#{base_url}/stylesheets/#{name}.css" media="#{ media || 'all' }" rel="stylesheet" type="text/css" />
175
228
  </def>
229
+
230
+ <def tag="flash_message" attr="type">
231
+ <% type = type ? type.to_sym : :notice %>
232
+ <div class="flash" if="&flash[type]"><%= flash[type] %></div>
233
+ </def>
234
+
235
+ <def tag="ajax_progress">
236
+ <div id='ajax_progress'>
237
+ <div>
238
+ <span id="ajax_progress_text"></span><theme_image src="spinner.gif"/>
239
+ </div>
240
+ </div>
241
+ </def>
242
+
243
+ <def tag="error_messages">
244
+ <div class="error_messages">
245
+ <%= error_messages_for 'this' %>
246
+ </div>
247
+ </def>
248
+