hobo 0.5.3 → 0.6

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.
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
@@ -1,6 +1,60 @@
1
- <taglib module="Hobo::Core"/>
1
+ <def tag="call_tag" attrs="tag">
2
+ <%= send(tag, attributes) %>
3
+ </def>
4
+
5
+
6
+ <def tag="CallTemplate" attrs="template">
7
+ <%= send(template, attributes, all_parameters) %>
8
+ </def>
2
9
 
3
- <def tag="theme_stylesheet">
4
- <link href="<%= urlb %>/hobothemes/<%= Hobo.current_theme %>/stylesheets/application.css"
5
- media="screen" rel="Stylesheet" type="text/css" />
10
+
11
+ <def tag="partial" attrs="as">
12
+ <%= render(:partial => find_partial(this, as), :locals => { :this => this }) %>
6
13
  </def>
14
+
15
+
16
+ <def tag="repeat" attrs="even_odd, join"><%=
17
+ if !this.blank?
18
+ if even_odd
19
+ map_this do
20
+ klass = [attributes[:class], cycle("even", "odd")].compact.join(' ')
21
+ content_tag(even_odd, tagbody.call, attributes.merge(:class => klass, :hobo_model_id => dom_id(this)))
22
+ end.join(join)
23
+ else
24
+ scope.new_scope do
25
+ scope[:even_odd] = "odd"
26
+ map_this do
27
+ res = tagbody.call
28
+ scope.even_odd = scope.even_odd == "even" ? "odd" : "even"
29
+ res
30
+ end.join(join)
31
+ end
32
+ end
33
+ else
34
+ ""
35
+ end
36
+ %></def>
37
+
38
+
39
+ <def tag="do"><tagbody/></def>
40
+ <def tag="with"><tagbody/></def>
41
+
42
+
43
+ <def tag="if" attrs="test"><%=
44
+ test = all_attributes.fetch(:test, this)
45
+ res = (cond = !test.blank?) ? tagbody.call : ""
46
+ Hobo::Dryml.last_if = cond
47
+ res
48
+ %></def>
49
+
50
+
51
+ <def tag="else"><tagbody unless="&Hobo::Dryml.last_if"/></def>
52
+
53
+
54
+ <def tag="unless" attrs="test"><%=
55
+ test = all_attributes.fetch(:test, this)
56
+ res = (cond = test.blank?) ? "" : tagbody.call
57
+ Hobo::Dryml.last_if = cond
58
+ res
59
+ %></def>
60
+
@@ -1,119 +1,307 @@
1
- <taglib module="Hobo::Rapid"/>
1
+ <include module="Hobo::RapidHelper"/>
2
2
 
3
- <taglib src="rapid_pages"/>
4
- <taglib src="rapid_editing"/>
5
- <taglib src="rapid_navigation"/>
3
+ <include src="rapid_support"/>
4
+ <include src="rapid_document_tags"/>
5
+ <include src="rapid_pages"/>
6
+ <include src="rapid_editing"/>
7
+ <include src="rapid_forms"/>
8
+ <include src="rapid_navigation"/>
6
9
 
7
- <def tag="clearer"><div class='clearer'>&nbsp;</div></def>
10
+ <def tag="FieldList" attrs="tag">
11
+ <% tag ||= (this.respond_to?(:new_record?) && this.new_record?) ? "input" : "editor" %>
12
+ <field_list merge_attrs="&attributes - attrs_for(:with_fields)">
13
+ <with_fields merge_attrs="&attributes & attrs_for(:with_fields)">
14
+ <field_list_item>
15
+ <item_label param="#{this_field.to_s.sub('?', '')}_label"><%= this_field.to_s.titleize %></item_label>
16
+ <item_value param="#{this_field.to_s.sub('?', '')}_view"><call_tag tag="&tag" /></item_value>
17
+ </field_list_item>
18
+ </with_fields>
19
+ </field_list>
20
+ </def>
8
21
 
9
- <def tag="object_table" attrs="fields, skip, associations">
10
- <% field_inner_tag_options, options = options.partition_hash {|k,v| k.to_s =~ /_label$|_editor$/ }
11
- inner_tag_options.merge!(field_inner_tag_options)
12
- fields = if fields.nil?
13
- this.class.content_columns.every(:name) - %w{created_at updated_at}
14
- else
15
- comma_split(fields)
16
- end
17
- fields -= comma_split(skip) if skip
18
- associations = if associations == '*'
19
- this.class.reflections.values.every(:name)
20
- elsif associations == 'belongs_to'
21
- this.class.reflections.values.oselect{macro == :belongs_to}.every(:name)
22
- else
23
- comma_split(associations)
24
- end
25
- associations -= comma_split(skip) if skip
26
- options = add_classes(options, "object_table", ("new_record" if this.new_record?))
27
- # force load
28
- Hobo.models
29
- %>
30
- <table xattrs="">
31
- <if q="#this.new_record? && 'type'.in?(this.class.column_names) && !this.class.send(:subclasses).empty?">
32
- <tr>
33
- <td class="field_label">Type:</td>
34
- <td><sti_type_field/></td>
35
- </tr>
36
- </if>
37
22
 
23
+ <def tag="item"><% scope.items << tagbody.call %></def>
38
24
 
39
- <% for field in fields.select{|f| can_view?(this, f)} %>
40
- <tr>
41
- <td class="field_label" content_option="#field + '_label'"><%= no_break(field.titleize) %>:</td>
42
- <td><edit attr="#field" replace_option="#field + '_editor'"/></td>
43
- </tr>
44
- <% end %>
45
25
 
46
- <% for field in associations.select{|f| can_view?(this, f)} %>
47
- <tr>
48
- <td class="field_label" content_option="#field.to_s + '_label'"><%= no_break(field.to_s.titleize) %>:</td>
49
- <td><edit attr="#field" replace_option="#field.to_s + '_editor'"/></td>
50
- </tr>
51
- <% end %>
26
+ <def tag="UL">
27
+ <ul merge_attrs unless="&this.empty?">
28
+ <repeat>
29
+ <li param if="&can_view?" class="#{scope.even_odd} #{this_type.name.underscore}"
30
+ hobo_model_id="#{dom_id this}">
31
+ <tagbody><a/></tagbody>
32
+ </li>
33
+ </repeat>
34
+ </ul>
35
+ </def>
52
36
 
53
- <tagbody/>
54
37
 
38
+ <def tag="Table">
39
+ <table merge_attrs unless="&this.empty?">
40
+ <thead if="&all_parameters[:thead]" param/>
41
+ <tbody>
42
+ <repeat>
43
+ <tr param if="&can_view?"
44
+ class="#{scope.even_odd} #{this_type.name.underscore}"
45
+ hobo_model_id="#{dom_id(this)}">
46
+ </tr>
47
+ </repeat>
48
+ </tbody>
49
+ <tfoot if="&all_parameters[:tfoot]" param/>
55
50
  </table>
56
51
  </def>
57
52
 
58
53
 
59
- <def tag="has_many_table" attrs="part_id, delete_buttons, headings, id">
60
- <table_for headings="#headings" xattrs="">
61
- <:empty>
62
- <p>There are no <%= this_type.klass.name.titleize.pluralize.downcase %></p>
63
- </:empty>
54
+ <def tag="image" attrs="src">
55
+ <img src="#{base_url}/images/#{src}" merge_attrs/>
56
+ </def>
64
57
 
65
- <tagbody/>
66
58
 
67
- <if q="#delete_buttons != false and can_delete?(this)">
68
- <td><delete_button/></td>
69
- </if>
70
- </table_for>
71
- <div>
72
- <create_button update="#id || part_id"/>
73
- </div>
59
+ <def tag="spinner">
60
+ <img src="#{base_url}/hobothemes/#{Hobo.current_theme}/images/spinner.gif" class="hidden" merge_attrs/>
74
61
  </def>
75
62
 
76
63
 
77
- <def tag="ul_for" attrs="else">
78
- <if q="#this.empty? and else_">
79
- <%= else_ %>
80
- </if>
81
- <else>
82
- <ul xattrs="">
83
- <% even_odd = "odd" %>
84
- <repeat>
85
- <if_can_view>
86
- <li class="<%= even_odd %> <%= this_type.name.underscore %>" hobo_model_id="<%= dom_id this %>">
87
- <%= tagbody.nil? ? object_link : tagbody.call %>
88
- </li>
89
- </if_can_view>
90
- <% even_odd = even_odd == "even" ? "odd" : "even" %>
91
- </repeat>
92
- </ul>
93
- </else>
64
+ <def tag="theme_image" attrs="src">
65
+ <img src="#{theme_asset('images/' + src)}" merge_attrs/>
66
+ </def>
67
+
68
+
69
+ <def tag="card">
70
+ <%= poly = call_polymorphic_tag('card', attributes) %>
71
+ <div class="card" unless="&poly"><human_type/>: <a/></div>
72
+ </def>
73
+
74
+
75
+ <def tag="hobo_rapid_javascripts" attrs="tiny_mce"><%=
76
+ res = javascript_include_tag("hobo_rapid")
77
+ res += '<script type="text/javascript">'
78
+ unless Hobo.all_controllers.empty?
79
+ res += "var controllerNames = {" +
80
+ Hobo.all_controllers.map {|c| "#{c.singularize}: '#{c}'"}.join(', ') +
81
+ "}; "
82
+ end
83
+ res += "urlBase = '#{base_url}'; hoboPartPage = '#{view_name}'</script>"
84
+
85
+ if tiny_mce
86
+ res += javascript_include_tag("tiny_mce/tiny_mce_src") + %{
87
+ <script type="text/javascript">
88
+ tinyMCE.init({ mode: "textareas", editor_selector: "tiny_mce",
89
+ plugins: 'save',
90
+ theme_advanced_buttons1 : "bold, italic, separator, " +
91
+ "bullist, outdent, indent, separator, " +
92
+ "undo, redo, separator, link, unlink",
93
+ theme_advanced_buttons2 : "",
94
+ theme_advanced_buttons3 : ""
95
+ });
96
+ </script>}
97
+ end
98
+ res
99
+ %></def>
100
+
101
+
102
+ <def tag="name"><%=
103
+ if this.nil?
104
+ "(not available)"
105
+ else
106
+ name_tag = find_polymorphic_tag("name")
107
+ if name_tag != "name"
108
+ send(name_tag)
109
+ elsif this.is_a?(Array) && this.respond_to?(:proxy_reflection)
110
+ count
111
+ elsif this.is_a? Class and this < ActiveRecord::Base
112
+ this.name.pluralize.titleize
113
+ elsif this.respond_to?(:name)
114
+ view(merge_attrs(attributes, {:field => 'name'}))
115
+ elsif this.respond_to?(:title)
116
+ view(merge_attrs(attributes, {:field => 'title'}))
117
+ else
118
+ this.to_s
119
+ end
120
+ end
121
+ %></def>
122
+
123
+
124
+ <def tag="a" attrs="action, to, params, resource_type, href"><%=
125
+ content = tagbody.call if tagbody
126
+
127
+ if href || attributes[:name]
128
+ # Regular link - skip all this stuff
129
+ else
130
+ target = to || this
131
+
132
+ return "(Not Available)" if target.nil?
133
+
134
+ if action == "new"
135
+ # Link to a new object form
136
+
137
+ new_class_name = if target.respond_to?(:proxy_reflection)
138
+ target.proxy_reflection.klass.name
139
+ else
140
+ target.name
141
+ end
142
+
143
+ href = object_url(target, "new")
144
+ add_classes!(attributes, "new_#{new_class_name.underscore}_link")
145
+ content ||= "New #{new_class_name.titleize}"
146
+ else
147
+ # Link to an existing object
148
+
149
+ href = if resource_type
150
+ send("formatted_#{model.to_s.downcase}_url", this, resource_type.downcase)
151
+ else
152
+ object_url(target, action, params)
153
+ end
154
+ add_classes!(attributes, "#{target.class.name.underscore}_link")
155
+
156
+ # Set default link text if none given
157
+ content ||= name
158
+ end
159
+ end
160
+ content_tag :a, content, attributes.update(:href => href)
161
+ %></def>
162
+
163
+
164
+ <def tag="view" attrs="inline, block, if_blank, no_wrapper"><%=
165
+ raise HoboError, "view of non-viewable field '#{this_field}' of #{this_parent.typed_id rescue this_parent}" unless
166
+ can_view?
167
+
168
+ if this == nil
169
+ this_type.is_a?(Class) && this_type <= String ? "" : "(Not Available)"
170
+ elsif this_type.respond_to?(:macro)
171
+ if this_type.macro == :belongs_to
172
+ belongs_to_view(attributes)
173
+ elsif this_type.macro == :has_many
174
+ has_many_view(attributes)
175
+ end
176
+ else
177
+ attrs = add_classes(attributes, "view", type_name, type_and_field)
178
+ attrs[:hobo_model_id] = this_field_dom_id if this_parent && this_parent.respond_to?(:typed_id)
179
+
180
+ view_tag = find_polymorphic_tag("view")
181
+
182
+ if view_tag == "view" # i.e. it didn't find a type specific tag
183
+ raise HoboError, "Cannot view: #{this.inspect} (field is #{this_field}, type is #{this.class})"
184
+ else
185
+ view_attrs = attrs_for(view_tag)
186
+ the_view = send(view_tag, attrs & view_attrs)
187
+
188
+ the_view = if_blank if if_blank && the_view.blank?
189
+
190
+ if no_wrapper
191
+ the_view
192
+ else
193
+ wrapper = if inline
194
+ :span
195
+ elsif block || (this.class.const_defined?(:COLUMN_TYPE) && this.class::COLUMN_TYPE == :text)
196
+ :div
197
+ else
198
+ :span
199
+ end
200
+ content_tag(wrapper, the_view, attrs - view_attrs)
201
+ end
202
+ end
203
+ end
204
+ %></def>
205
+
206
+
207
+ <def tag="belongs_to_view"><a/></def>
208
+
209
+ <def tag="has_many_view"><%= this.empty? ? "(none)" : map_this { a }.join(", ") %></def>
210
+
211
+ <def tag="view" for="Date"><%= this.to_s(:long) %></def>
212
+
213
+ <def tag="view" for="Time"><%= this.to_s(:long) %></def>
214
+
215
+ <def tag="view" for="Numeric" attrs="format"><%= format ? format % this : this.to_s %></def>
216
+
217
+ <def tag="view" for="Hobo::Text"><%= h(this).gsub("\n", "<br/>") %></def>
218
+
219
+ <def tag="view" for="html"><%= this %></def>
220
+
221
+ <def tag="view" for="Hobo::MarkdownString"><%= this.to_html %></def>
222
+
223
+ <def tag="view" for="Hobo::TextileString"><%= this.to_html %></def>
224
+
225
+ <def tag="view" for="Hobo::PasswordString">[password withheld]</def>
226
+
227
+ <def tag="view" for="String"><%= h(this).gsub("\n", "<br/>") %></def>
228
+
229
+ <def tag="view" for="TrueClass"><%= this ? 'Yes' : 'No' %></def>
230
+
231
+ <def tag="human_type" attrs="style"><%=
232
+ if can_view?
233
+ res = if this.respond_to? :proxy_reflection
234
+ this.proxy_reflection.klass.name.pluralize
235
+ elsif this.is_a? Class
236
+ this.name
237
+ else
238
+ this.class.name
239
+ end
240
+ res.underscore.humanize.send(style || :titleize)
241
+ end
242
+ %></def>
243
+
244
+
245
+ <def tag="count" attrs="label, prefix, unless_none"><%=
246
+ raise Exception.new("asked for count of a string") if this.is_a?(String)
247
+
248
+ if this.is_a?(Class) and this < ActiveRecord::Base
249
+ c = this.count
250
+ label ||= this.name.titleize
251
+ else
252
+ label ||= this.respond_to?(:proxy_reflection) && this.proxy_reflection.name.to_s.singularize.titleize
253
+ c = if this.is_a?(Fixnum)
254
+ this
255
+ elsif this.respond_to?(:count)
256
+ this.count
257
+ else
258
+ this.length
259
+ end
260
+ end
261
+
262
+ Dryml.last_if = c > 0 if unless_none
263
+ if unless_none && c == 0
264
+ ""
265
+ else
266
+ main = label.blank? ? c : pluralize(c, label)
267
+
268
+ if prefix.in? %w(are is)
269
+ p = c == 1 ? "is" : "are"
270
+ p + ' ' + main
271
+ else
272
+ main
273
+ end
274
+ end
275
+ %></def>
276
+
277
+
278
+ <def tag="theme_stylesheet">
279
+ <link href="<%= base_url %>/hobothemes/<%= Hobo.current_theme %>/stylesheets/application.css"
280
+ media="screen" rel="Stylesheet" type="text/css" />
94
281
  </def>
95
282
 
96
283
 
97
- <def tag="table_for" attrs="headings, row_class, footer, else">
98
- <if q="#this.empty? and else_">
99
- <%= else_ %>
100
- </if>
284
+ <def tag="clearer"><div class='clearer'>&nbsp;</div></def>
285
+
286
+
287
+ <!-- The Tags defined below here are a bit rough and will be improved
288
+ in the future - use at your own risk. -->
289
+
290
+ <def tag="has_many_table" attrs="part_id, delete_buttons, headings, id">
291
+ <table_for headings="&headings" merge_attrs="&true">
292
+
293
+ <tagbody/>
294
+
295
+ <if test="&delete_buttons != false and can_delete?(this)">
296
+ <td><DeleteButton/></td>
297
+ </if>
298
+ </table_for>
101
299
  <else>
102
- <table xattrs="">
103
- <if q="#headings"><tr><%= headings %></tr></if>
104
- <% even_odd = "odd" %>
105
- <repeat>
106
- <if_can_view>
107
- <tr class="<%= even_odd %> <%= row_class %> <%= this_type.name.underscore %>"
108
- hobo_model_id="<%= dom_id(this) %>">
109
- <%= tagbody && tagbody.call %>
110
- </tr>
111
- <% even_odd = even_odd == "even" ? "odd" : "even" %>
112
- </if_can_view>
113
- </repeat>
114
- <%= footer %>
115
- </table>
300
+ <p>There are no <%= this_type.klass.name.titleize.pluralize.downcase %></p>
116
301
  </else>
302
+ <div>
303
+ <CreateButton update="&id || part_id"/>
304
+ </div>
117
305
  </def>
118
306
 
119
307
 
@@ -127,51 +315,17 @@
127
315
  "enter its name"
128
316
  source = refl.source_reflection.name
129
317
  %>
130
- <tagbody obj="#joins"/>
131
- <with obj="#joins.new_without_appending">
132
- <if_can_create>
133
- <object_form update="#[update, part_id]" message="#action_name" hidden_fields="*">
318
+ <tagbody with="&joins"/>
319
+ <with with="&joins.new_without_appending">
320
+ <if test="can_create?">
321
+ <form update="&[update, part_id]" message="&action_name" hidden_fields="*">
134
322
  <p>
135
323
  <%= add_text %>:
136
- <belongs_to_autocompleting_field attr="#source" where_not_in="#dom_id(add_to)" class="autosubmit"/>
324
+ <belongs_to_autocompleting_field field="&source" where_not_in="&dom_id(add_to)" class="autosubmit"/>
137
325
  </p>
138
- </object_form>
139
- </if_can_create>
326
+ </form>
327
+ </if>
140
328
  </with>
141
329
  </def>
142
330
 
143
331
 
144
- <def tag="spinner">
145
- <img src="<%= urlb %>/hobothemes/<%= Hobo.current_theme %>/images/spinner.gif" class="hidden" xattrs=""/>
146
- </def>
147
-
148
-
149
- <def tag="image" attrs="src">
150
- <img src="<%= urlb %>/images/<%= src %>" xattrs=""/>
151
- </def>
152
-
153
-
154
- <def tag="theme_img" attrs="src">
155
- <img src="<%= theme_asset('images/' + src)%>" xattrs=""/>
156
- </def>
157
-
158
-
159
- <def tag="search_result">
160
- <div class='search_result'>
161
- <human_type/>: <object_link/>
162
- </div>
163
- </def>
164
-
165
-
166
- <def tag="object_card">
167
- <div class="object_card">
168
- <object_link/>
169
- </div>
170
- </def>
171
-
172
-
173
- <def tag="section_if">
174
- <% body = tagbody.call %>
175
- <%= body.blank? ? "" : section{body} %>
176
- </def>
177
-