hobo 2.0.0.pre5 → 2.0.0.pre6

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES-1.4.txt CHANGED
@@ -595,7 +595,7 @@ Examples:
595
595
 
596
596
  <form ajax hide="drop" show="&['slide', nil, 1000, 'alert(done);']"/>
597
597
 
598
- These two options have global defaults which are TBD. They may be overridden by passing options to the page-script parameter of `<page>`:
598
+ These default effect is "no effect". They may be overridden by passing options to the page-script parameter of `<page>`:
599
599
 
600
600
  <extend tag="page">
601
601
  <old-page merge>
@@ -603,7 +603,11 @@ These two options have global defaults which are TBD. They may be overridden by
603
603
  </old-page>
604
604
  </extend>
605
605
 
606
- To disable effects entirely: FIXME.
606
+ If, after changing the default you wish to disable effects on one specific ajax element, pass false:
607
+
608
+ <form ajax hide="&false" show="&false" ...
609
+
610
+ Note that these effects require jQuery-UI. You will get Javascript errors if you attempt to use effects and do not have jQuery-UI installed.
607
611
 
608
612
  ### spinner options
609
613
  {.todo}
@@ -721,6 +725,11 @@ to press 'return' to initiate the search. This should be easy to fix
721
725
  in hjq-live-search.js -- the hard part will probably be in doing it in
722
726
  a way that works in all possible browsers.
723
727
 
728
+ `live-search` requires an implementation of
729
+ `<search-results-container>`. Both hobo-jquery-ui and
730
+ hobo-bootstrap-ui provide implementations of
731
+ `<search-results-container>`.
732
+
724
733
  ### hot-input
725
734
  {.done}
726
735
 
data/CHANGES-2.0.markdown CHANGED
@@ -595,7 +595,7 @@ Examples:
595
595
 
596
596
  <form ajax hide="drop" show="&['slide', nil, 1000, 'alert(done);']"/>
597
597
 
598
- These two options have global defaults which are TBD. They may be overridden by passing options to the page-script parameter of `<page>`:
598
+ These default effect is "no effect". They may be overridden by passing options to the page-script parameter of `<page>`:
599
599
 
600
600
  <extend tag="page">
601
601
  <old-page merge>
@@ -603,7 +603,11 @@ These two options have global defaults which are TBD. They may be overridden by
603
603
  </old-page>
604
604
  </extend>
605
605
 
606
- To disable effects entirely: FIXME.
606
+ If, after changing the default you wish to disable effects on one specific ajax element, pass false:
607
+
608
+ <form ajax hide="&false" show="&false" ...
609
+
610
+ Note that these effects require jQuery-UI. You will get Javascript errors if you attempt to use effects and do not have jQuery-UI installed.
607
611
 
608
612
  ### spinner options
609
613
  {.todo}
@@ -721,6 +725,11 @@ to press 'return' to initiate the search. This should be easy to fix
721
725
  in hjq-live-search.js -- the hard part will probably be in doing it in
722
726
  a way that works in all possible browsers.
723
727
 
728
+ `live-search` requires an implementation of
729
+ `<search-results-container>`. Both hobo-jquery-ui and
730
+ hobo-bootstrap-ui provide implementations of
731
+ `<search-results-container>`.
732
+
724
733
  ### hot-input
725
734
  {.done}
726
735
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.0.pre5
1
+ 2.0.0.pre6
@@ -95,6 +95,15 @@ module HoboRouteHelper
95
95
  options, params = options.partition_hash([:subsite, :method, :format])
96
96
  options[:subsite] ||= self.subsite
97
97
 
98
+ action ||= case options[:method].to_s
99
+ when 'put'; :update
100
+ when 'post'; :create
101
+ when 'delete'; :destroy
102
+ else; obj.is_a?(Class) || obj.respond_to?(:length) ? :index : :show
103
+ end
104
+
105
+ params[:action] = action unless action.in?(IMPLICIT_ACTIONS)
106
+
98
107
  if obj.respond_to?(:member_class)
99
108
  if obj.respond_to?(:origin) && obj.origin
100
109
  # Asking for URL of a collection, e.g. category/1/adverts or category/1/adverts/new
@@ -103,6 +112,7 @@ module HoboRouteHelper
103
112
  owner_name = owner_name.singularize if refl.macro == :has_many
104
113
  poly = [owner_name, obj.member_class]
105
114
  params[:"#{owner_name}_id"] = obj.origin
115
+ action = "#{action}_for_#{owner_name}"
106
116
  else
107
117
  poly = [obj.member_class]
108
118
  end
@@ -112,21 +122,20 @@ module HoboRouteHelper
112
122
 
113
123
  poly = [options[:subsite]] + poly if options[:subsite]
114
124
 
115
- action ||= case options[:method].to_s
116
- when 'put'; :update
117
- when 'post'; :create
118
- when 'delete'; :destroy
119
- else; obj.is_a?(Class) ? :index : :show
120
- end
121
-
122
- params[:action] = action unless action.in?(IMPLICIT_ACTIONS)
123
-
124
125
  begin
125
126
  url = polymorphic_path(poly, params)
126
127
  # validate URL, since polymorphic URL may return a URL for a
127
128
  # different method
128
- Rails.application.routes.recognize_path(url, {:method => options[:method]})
129
- url
129
+ # use starts_with because recognize path may return new_for_owner, for example
130
+ recognized_params = Rails.application.routes.recognize_path(url, {:method => options[:method]})
131
+ if recognized_params[:action] == action.to_s
132
+ url
133
+ else
134
+ # we get here if the action name is modified: do_signup, etc.
135
+ recognized_params[:action] = action
136
+ url2 = url_for(recognized_params)
137
+ url==url2 ? url : nil
138
+ end
130
139
  rescue NoMethodError => e # raised if polymorphic_url fails
131
140
  nil
132
141
  rescue ArgumentError => e # raised from polymorphic_url
@@ -13,7 +13,7 @@ es:
13
13
  # if you uncomment the following you will loose the automatic selection of dinamically pluralized nav-tabs
14
14
  # if you need a different title you should implement a different way to select the tab on your own
15
15
  #title: "Indice %{model}"
16
- heading: "Indice %{model}"
16
+ heading: "Índice %{model}"
17
17
 
18
18
  new:
19
19
  title: "Nuevo Registro de %{model}"
@@ -52,7 +52,7 @@ es:
52
52
  name: "Nombre"
53
53
  password: "Contraseña"
54
54
  remember_me: "Recuerda mis datos"
55
- login: "Identifición"
55
+ login: "Identificación"
56
56
  signup: "Inscripción"
57
57
  forgot_password: &forgot_password "¿Contraseña olvidada?"
58
58
 
@@ -71,7 +71,7 @@ es:
71
71
  forgot_password_sent:
72
72
  title: "Contraseña olvidada - Correo Eléctronico enviado"
73
73
  heading: "Contraseña olvidada - Correo Eléctronico enviado"
74
- text: "El mensaje con las instruciones para generar una nueva contraseña ha sido enviado a %{email_address}
74
+ text: "El mensaje con las instrucciones para generar una nueva contraseña ha sido enviado a %{email_address}
75
75
  Si no lo recibe, por favor verifique el filtro anti-spam."
76
76
 
77
77
  account_disabled_page:
@@ -117,13 +117,13 @@ es:
117
117
  creator:
118
118
  error: "El creator %{name} no se pudo executar.\n%{errors}"
119
119
  transition:
120
- error: "La transición %{name} no se pudo executar.\n%{errors}"
120
+ error: "La transición %{name} no se pudo ejecutar.\n%{errors}"
121
121
  update:
122
122
  no_attribute_error: "Ninguna actualización esta especificada en los parámetros"
123
123
  success: "Los cambios a %{model} han sido guardados"
124
124
  error: "Ha habido un problema con ese cambio.\n%{errors}"
125
125
  destroy:
126
- success: "La borradura de %{model} ha sido exitosa."
126
+ success: "La borradura de %{model} ha sido tenido éxito."
127
127
  signup:
128
128
  success: "¡Gracias por inscribirse!"
129
129
  must_activate: "Tiene que activar la cuenta antes de iniciar la sesión. Por favor verifique su correo eléctronico."
@@ -135,7 +135,7 @@ es:
135
135
  permission_denied: "¡Permiso denegado!"
136
136
  not_found: "La página solicitada no se encuentra."
137
137
  unauthenticated: "No se pudo autenticar."
138
- validate_password: "debe contener tansiquiera 6 caracteres, letras mayúsculas y minúsculas"
138
+ validate_password: "debe contener al menos 6 caracteres, letras mayúsculas y minúsculas"
139
139
  current_password_is_not_correct: "no está correcta"
140
140
  you_are_site_admin: "Ahora usted es el administrador del sitio."
141
141
  you_signed_up: "Usted se inscribió."
@@ -154,7 +154,7 @@ es:
154
154
  # you better define the heading.* in the specific collection namespace
155
155
  #heading:
156
156
  add_form_heading: "Añadir %{model}"
157
- empty_message: "Ningun registros"
157
+ empty_message: "Ningún registro"
158
158
 
159
159
  # default hobo form translation
160
160
  form:
@@ -178,7 +178,7 @@ es:
178
178
  live_search:
179
179
  label: "Buscar"
180
180
  results_label: "Buscar Resultados"
181
- close_button: "cierrar"
181
+ close_button: "cerrar"
182
182
  no_results: "No se encuentran resultados."
183
183
 
184
184
  dev_user_changer:
@@ -18,7 +18,7 @@ module Hobo
18
18
  say "Installing hobo_jquery plugin..."
19
19
  install_plugin_helper('hobo_jquery', nil, opts.merge(:skip_gem => true))
20
20
  say "Installing hobo_jquery_ui plugin..."
21
- install_plugin_helper('hobo_jquery_ui', nil, opts.merge(:skip_gem => true))
21
+ install_plugin_helper('hobo_jquery_ui', nil, opts)
22
22
 
23
23
  say "Installing #{opts[:theme]} theme..."
24
24
  inject_css_require("jquery-ui/#{opts[:ui_theme]}", opts[:subsite], nil)
@@ -591,7 +591,7 @@ module Hobo
591
591
  end
592
592
 
593
593
 
594
- def create_response(new_action, options={})
594
+ def create_response(new_action=:new, options={})
595
595
  valid = valid? # valid? can be expensive
596
596
  if params[:render]
597
597
  if (params[:render_options] && params[:render_options][:errors_ok]) || valid
@@ -32,54 +32,52 @@ model_key = model.to_s.underscore
32
32
  <page merge title="#{ht '<%= model_key %>.index.title', :default=>[model.model_name.human(:count=>100)] }">
33
33
  <body: class="index-page <%= model_class %>" param/>
34
34
 
35
- <content: param>
36
- <header param="content-header">
37
- <h2 param="heading">
38
- <ht key="<%= model_key %>.index.heading">
39
- <model-name-human model="&model"/>
40
- </ht>
41
- </h2>
42
-
43
- <p param="count" if>
44
- <ht key="<%= model_key %>.collection.count" count="&collection_count">
45
- <count summary/>
46
- </ht>
47
- </p>
48
- </header>
49
-
50
- <section param="content-body">
35
+ <content-header: param>
36
+ <h2 param="heading">
37
+ <ht key="<%= model_key %>.index.heading">
38
+ <model-name-human model="&model"/>
39
+ </ht>
40
+ </h2>
41
+
42
+ <p param="count" if>
43
+ <ht key="<%= model_key %>.collection.count" count="&collection_count">
44
+ <count summary/>
45
+ </ht>
46
+ </p>
47
+ </content-header:>
48
+
49
+ <content-body: param>
51
50
  <% if new_link -%>
52
- <a action="new" to="&model" param="new-link">
53
- <ht key="<%= model_key %>.actions.new">New <%=model_name %></ht>
54
- </a>
51
+ <a action="new" to="&model" param="new-link">
52
+ <ht key="<%= model_key %>.actions.new">New <%=model_name %></ht>
53
+ </a>
55
54
  <% end -%>
56
55
 
57
56
  <% if view_hints.paginate? -%>
58
- <page-nav param="top-page-nav"/>
57
+ <page-nav param="top-page-nav"/>
59
58
 
60
59
  <% end -%>
61
60
  <% if view_hints.sortable? -%>
62
- <sortable-collection param="collection"/>
61
+ <sortable-collection param="collection"/>
63
62
  <% else -%>
64
- <collection param/>
63
+ <collection param/>
65
64
  <% end -%>
66
65
 
67
66
  <% if view_hints.paginate? -%>
68
- <page-nav param="bottom-page-nav"/>
67
+ <page-nav param="bottom-page-nav"/>
69
68
 
70
69
  <% end -%>
71
70
 
72
71
  <% if new_form -%>
73
- <div param="new-form">
74
- <h3 param="new-form-heading">
75
- <ht key="<%= model_key %>.form.new.heading">New <%= model_name %></ht>
76
- </h3>
77
- <form with="&@invalid_record || new_for_current_user(<%= model %>)" param/>
78
- </div>
72
+ <div param="new-form">
73
+ <h3 param="new-form-heading">
74
+ <ht key="<%= model_key %>.form.new.heading">New <%= model_name %></ht>
75
+ </h3>
76
+ <form with="&@invalid_record || new_for_current_user(<%= model %>)" param/>
77
+ </div>
79
78
 
80
79
  <% end -%>
81
- </section>
82
- </content:>
80
+ </content-body:>
83
81
  </page>
84
82
  </def>
85
83
 
@@ -88,21 +86,19 @@ model_key = model.to_s.underscore
88
86
  <page merge title="#{ht '<%= model_key %>.new.title', :default=>[' New <%= sq_escape(model_name) %>'] }">
89
87
  <body: class="new-page <%= model_class %>" param/>
90
88
 
91
- <content: param>
92
- <section param="content-header">
93
- <h2 param="heading">
94
- <ht key="<%= model_key %>.new.heading">
95
- New <%= model_name %>
96
- </ht>
97
- </h2>
98
- </section>
99
-
100
- <section param="content-body">
101
- <form param>
102
- <submit: label="#{ht '<%= model_key %>.actions.create', :default=>['Create <%= sq_escape(model_name) %>']}"/>
103
- </form>
104
- </section>
105
- </content:>
89
+ <content-header: param>
90
+ <h2 param="heading">
91
+ <ht key="<%= model_key %>.new.heading">
92
+ New <%= model_name %>
93
+ </ht>
94
+ </h2>
95
+ </content-header:>
96
+
97
+ <content-body: param>
98
+ <form param>
99
+ <submit: label="#{ht '<%= model_key %>.actions.create', :default=>['Create <%= sq_escape(model_name) %>']}"/>
100
+ </form>
101
+ </content-body:>
106
102
  </page>
107
103
  </def>
108
104
 
@@ -135,113 +131,105 @@ unless model.view_hints.secondary_children.empty?
135
131
  end
136
132
  -%>
137
133
  <def tag="show-page" for="<%= model.name %>">
138
- <page merge title="#{ht '<%=model_key %>.show.title', :default=>['<%=sq_escape model_name %>'], :name => name(:no_wrapper => true) }">
134
+ <page merge title="#{ht '<%=model_key %>.show.title', :default=>['<%=sq_escape model_name %>'], :name => name(:no_wrapper => true) }"<%= ' without-aside' unless aside_collections %> >
139
135
 
140
136
  <body: class="show-page <%= model_class %>" param/>
141
137
 
142
- <content: param>
143
- <% if aside_collections -%>
144
- <section-group>
145
- <section param="main-content">
146
- <% end -%>
147
- <header param="content-header">
138
+ <content-header: param>
148
139
  <% if back_link -%>
149
- <a:<%= back_link %> param="parent-link">&laquo; <ht key="<%= model_key %>.actions.back_to_parent" parent="<%= back_link_human_name %>" name="&this">Back to <name/></ht></a:<%= back_link %>>
140
+ <a:<%= back_link %> param="parent-link">&laquo; <ht key="<%= model_key %>.actions.back_to_parent" parent="<%= back_link_human_name %>" name="&this">Back to <name/></ht></a:<%= back_link %>>
150
141
  <% end -%>
151
- <h2 param="heading">
152
- <ht key="<%= model_key %>.show.heading" name="#{name(:no_wrapper => true)}">
153
- <%= model_name %> <name/>
154
- </ht>
155
- </h2>
142
+ <h2 param="heading">
143
+ <ht key="<%= model_key %>.show.heading" name="#{name(:no_wrapper => true)}">
144
+ <%= model_name %> <name/>
145
+ </ht>
146
+ </h2>
156
147
  <% if boolean_fields -%>
157
148
 
158
- <record-flags fields="<%= boolean_fields * ', ' %>" param/>
149
+ <record-flags fields="<%= boolean_fields * ', ' %>" param/>
159
150
  <% end -%>
160
151
  <% if creator_link -%>
161
152
 
162
- <a:<%= model.creator_attribute %> param="creator-link"/>
153
+ <a:<%= model.creator_attribute %> param="creator-link"/>
163
154
  <% elsif creator -%>
164
155
 
165
- <view:get-creator param="creator-name"/>
156
+ <view:get-creator param="creator-name"/>
166
157
  <% end -%>
167
158
  <% if edit_link -%>
168
159
 
169
- <a action="edit" if="&can_edit?" param="edit-link">
170
- <ht key="<%= model_key %>.actions.edit" name="#{name(:no_wrapper => true)}">
171
- Edit <%= model_name %>
172
- </ht>
173
- </a>
160
+ <a action="edit" if="&can_edit?" param="edit-link">
161
+ <ht key="<%= model_key %>.actions.edit" name="#{name(:no_wrapper => true)}">
162
+ Edit <%= model_name %>
163
+ </ht>
164
+ </a>
174
165
  <% end -%>
175
- </header>
166
+ </content-header:>
176
167
 
177
- <section param="content-body">
168
+ <content-body: param>
178
169
  <% if main_content -%>
179
- <view:<%= main_content %> param="description" />
170
+ <view:<%= main_content %> param="description" />
180
171
  <% end -%>
181
172
  <% if show_fields.any? -%>
182
- <field-list fields="<%= show_fields * ', ' %>" param/>
173
+ <field-list fields="<%= show_fields * ', ' %>" param/>
183
174
  <% end -%>
184
175
  <% if collection -%>
185
- <section param="collection-section">
186
- <h3 param="collection-heading">
187
- <ht key="<%= collection_class.to_s.underscore %>.collection.heading" count="&this.<%= collection.to_s %>.count" >
188
- <human-collection-name collection="<%= collection %>" your/>
189
- </ht>
190
- </h3>
176
+ <section param="collection-section">
177
+ <h3 param="collection-heading">
178
+ <ht key="<%= collection_class.to_s.underscore %>.collection.heading" count="&this.<%= collection.to_s %>.count" >
179
+ <human-collection-name collection="<%= collection %>" your/>
180
+ </ht>
181
+ </h3>
191
182
 
192
183
  <% if sortable_collection?(collection) -%>
193
- <sortable-collection:<%= collection %> param="collection"/>
184
+ <sortable-collection:<%= collection %> param="collection"/>
194
185
  <% else -%>
195
- <collection:<%= collection %> param/>
186
+ <collection:<%= collection %> param/>
196
187
  <% end -%>
197
188
  <% if add_link -%>
198
189
 
199
- <a:<%= collection %> action="new" if="&can_create?(@<%= model.name.underscore %>.<%= collection %>)" param="new-link">
200
- <ht key="<%= collection_class.to_s.underscore %>.actions.new" count="1">
201
- New <%= collection_class.to_s.titleize %>
202
- </ht>
203
- </a:<%= collection %>>
190
+ <a:<%= collection %> action="new" if="&can_create?(@<%= model.name.underscore %>.<%= collection %>)" param="new-link">
191
+ <ht key="<%= collection_class.to_s.underscore %>.actions.new" count="1">
192
+ New <%= collection_class.to_s.titleize %>
193
+ </ht>
194
+ </a:<%= collection %>>
204
195
  <% elsif add_form -%>
205
196
 
206
- <section param="add-to-collection" if="&can_create?(@<%= model.name.underscore %>.<%= collection %>)">
207
- <h3 param="add-form-heading">
208
- <ht key="<%= collection_class.to_s.underscore %>.collection.add_form_heading" count="1">
209
- Add <%= a_or_an collection_class.to_s.titleize %>
210
- </ht>
211
- </h3>
212
- <form with="&@<%= collection_class.name.underscore %> || new_for_current_user(@<%= model.name.underscore %>.<%= collection %>)" owner="<%= owner %>" without-cancel param>
213
- <field-list: skip="<%= owner %>"/>
214
- <submit: label="#{ht '<%= sq_escape collection_class.to_s.underscore %>.actions.add', :default=>['Add'] }"/>
215
- </form>
216
- </section>
197
+ <section param="add-to-collection" if="&can_create?(@<%= model.name.underscore %>.<%= collection %>)">
198
+ <h3 param="add-form-heading">
199
+ <ht key="<%= collection_class.to_s.underscore %>.collection.add_form_heading" count="1">
200
+ Add <%= a_or_an collection_class.to_s.titleize %>
201
+ </ht>
202
+ </h3>
203
+ <form with="&@<%= collection_class.name.underscore %> || new_for_current_user(@<%= model.name.underscore %>.<%= collection %>)" owner="<%= owner %>" without-cancel param>
204
+ <field-list: skip="<%= owner %>"/>
205
+ <submit: label="#{ht '<%= sq_escape collection_class.to_s.underscore %>.actions.add', :default=>['Add'] }"/>
206
+ </form>
207
+ </section>
217
208
  <% end -%>
218
- </section>
209
+ </section>
219
210
  <% end -%>
220
- </section>
211
+ </content-body:>
221
212
  <% if aside_collections -%>
222
- </section>
223
213
 
224
- <aside param>
214
+ <aside: param>
225
215
  <% for refl, reverse_refl in aside_collections -%>
226
216
  <% if reverse_refl && linkable?(refl.klass, :"index_for_#{reverse_refl.name}") -%>
227
- <collection-preview:<%= refl.name %>.recent param="<%= refl.name %>-preview">
228
- <heading-content:><human-collection-name with="&this.origin" collection="<%= refl.name %>" your/></heading-content:>
229
- </collection-preview:<%= refl.name %>.recent>
217
+ <collection-preview:<%= refl.name %>.recent param="<%= refl.name %>-preview">
218
+ <heading-content:><human-collection-name with="&this.origin" collection="<%= refl.name %>" your/></heading-content:>
219
+ </collection-preview:<%= refl.name %>.recent>
230
220
  <% else -%>
231
- <section param="<%= refl.name %>-collection-section">
232
- <h3 param="<%= refl.name %>-collection-heading">
233
- <ht key="<%= refl.klass.to_s.underscore %>.collection.heading" count="&this.<%= refl.name.to_s %>.count" >
234
- <human-collection-name collection="<%= refl.name %>" your/>
235
- </ht>
236
- </h3>
237
- <collection:<%= refl.name %> param="<%= refl.name %>-collection"/>
238
- </section>
221
+ <section param="<%= refl.name %>-collection-section">
222
+ <h3 param="<%= refl.name %>-collection-heading">
223
+ <ht key="<%= refl.klass.to_s.underscore %>.collection.heading" count="&this.<%= refl.name.to_s %>.count" >
224
+ <human-collection-name collection="<%= refl.name %>" your/>
225
+ </ht>
226
+ </h3>
227
+ <collection:<%= refl.name %> param="<%= refl.name %>-collection"/>
228
+ </section>
239
229
  <% end -%>
240
230
  <% end -%>
241
- </aside>
242
- </section-group>
231
+ </aside:>
243
232
  <% end -%>
244
- </content:>
245
233
 
246
234
  </page>
247
235
  </def>
@@ -255,20 +243,18 @@ name_attribute = model.name_attribute
255
243
 
256
244
  <body: class="edit-page <%= model_class %>" param/>
257
245
 
258
- <content:>
259
- <section param="content-header">
260
- <h2 param="heading">
261
- <ht key="<%= model_key %>.edit.heading" name="#{name(:no_wrapper => true)}">
262
- Edit <%= model_name %>
263
- </ht>
264
- </h2>
265
- <delete-button label="#{ht '<%= model_key %>.actions.delete', :default=>['Remove This <%= sq_escape model_name %>']}" param/>
266
- </section>
246
+ <content-header: param>
247
+ <h2 param="heading">
248
+ <ht key="<%= model_key %>.edit.heading" name="#{name(:no_wrapper => true)}">
249
+ Edit <%= model_name %>
250
+ </ht>
251
+ </h2>
252
+ <delete-button label="#{ht '<%= model_key %>.actions.delete', :default=>['Remove This <%= sq_escape model_name %>']}" param/>
253
+ </content-header:>
267
254
 
268
- <section param="content-body">
269
- <form param/>
270
- </section>
271
- </content:>
255
+ <content-body: param>
256
+ <form param/>
257
+ </content-body:>
272
258
 
273
259
  </page>
274
260
  </def>
@@ -292,48 +278,46 @@ new_link = :new.in?(actions)
292
278
  <def tag="index-for-<%= owner.dasherize %>-page" for="<%= model.name %>">
293
279
  <page merge title="#{ht '<%= model_key %>.index_for_owner.title', :count=>100, :default=>['<%= sq_escape(model_name(:plural)) %> for']} #{name :with => @<%= owner %>, :no_wrapper => true}">
294
280
  <body: class="index-for-owner-page <%= owner.dasherize %> <%= model_class %>" param/>
295
- <content: param>
296
- <header param="content-header">
281
+ <content-header: param>
297
282
  <% if linkable_owner -%>
298
- <div param="back-to">
299
- <t key="hobo.actions.back">Back to</t> <a with="&@<%= owner %>"/>
300
- </div>
283
+ <div param="back-to">
284
+ <t key="hobo.actions.back">Back to</t> <a with="&@<%= owner %>"/>
285
+ </div>
301
286
  <% end -%>
302
- <h2 param="heading" if="&@owner">
303
- <ht key="<%= model_key %>.index_for_owner.heading" count="&@<%= owner %>.<%= collection_name %>.count">
304
- <human-collection-name with="&@<%= owner %>" collection="<%= collection_name %>" your/>
305
- </ht>
306
- </h2>
287
+ <h2 param="heading" if="&@owner">
288
+ <ht key="<%= model_key %>.index_for_owner.heading" count="&@<%= owner %>.<%= collection_name %>.count">
289
+ <human-collection-name with="&@<%= owner %>" collection="<%= collection_name %>" your/>
290
+ </ht>
291
+ </h2>
307
292
  <% unless owner_is_user %>
308
- <h3 param="subheading">
309
- <ht key="<%= model_key %>.index_for_owner.subheading">
310
- For:
311
- </ht>
312
- <<%= owner_tag %> with="&@<%= owner %>"/>
313
- </h3>
293
+ <h3 param="subheading">
294
+ <ht key="<%= model_key %>.index_for_owner.subheading">
295
+ For:
296
+ </ht>
297
+ <<%= owner_tag %> with="&@<%= owner %>"/>
298
+ </h3>
314
299
  <% end -%>
315
- <p param="count" if>
316
- <ht key="<%= model_key %>.collection.count" count="&collection_count">
317
- <count summary/>
318
- </ht>
319
- </p>
320
- </header>
321
-
322
- <section param="content-body">
300
+ <p param="count" if>
301
+ <ht key="<%= model_key %>.collection.count" count="&collection_count">
302
+ <count summary/>
303
+ </ht>
304
+ </p>
305
+ </content-header:>
306
+
307
+ <content-body: param>
323
308
  <% if new_link -%>
324
- <a action="new" to="&@<%= owner %>.<%= collection_name %>" param="new-link">
325
- <ht key="<%= model_key %>.actions.new" >New <%=model_name %></ht>
326
- </a>
309
+ <a action="new" to="&@<%= owner %>.<%= collection_name %>" param="new-link">
310
+ <ht key="<%= model_key %>.actions.new" >New <%=model_name %></ht>
311
+ </a>
327
312
 
328
313
  <% end -%>
329
314
 
330
- <page-nav param="top-page-nav"/>
315
+ <page-nav param="top-page-nav"/>
331
316
 
332
- <collection param/>
317
+ <collection param/>
333
318
 
334
- <page-nav param="bottom-page-nav"/>
335
- </section>
336
- </content:>
319
+ <page-nav param="bottom-page-nav"/>
320
+ </content-body:>
337
321
  </page>
338
322
  </def>
339
323
  <% end -%>
@@ -345,28 +329,26 @@ new_link = :new.in?(actions)
345
329
  <page merge title="#{ht '<%=model_key %>.new_for_owner.title', :default=>['New <%= sq_escape model_name %> for']} #{name :with => @<%= owner %>}">
346
330
  <body: class="new-for-owner-page <% owner.dasherize %> <%= model_class %>" param/>
347
331
 
348
- <content: param>
349
- <header param="content-header">
350
- <h2 param="heading">
351
- <ht key="<%= model_key %>.new_for_owner.heading">
352
- New <%= collection_name.singularize.titleize %>
353
- </ht>
354
- </h2>
355
- <h3 param="subheading">
356
- <ht key="<%= model_key %>.new_for_owner.subheading">
357
- For:
358
- </ht>
359
- <<%= owner_tag %> with="&@<%= owner %>"/>
360
- </h3>
361
- </header>
362
-
363
- <section param="content-body">
364
- <form owner="<%= owner %>" method="post" param>
365
- <field-list: skip="<%= owner %>"/>
366
- <submit: label="#{ht '<%=model_key %>.actions.create', :default=>['Create <%= sq_escape model_name %>']}"/>
367
- </form>
368
- </section>
369
- </content:>
332
+ <content-header: param>
333
+ <h2 param="heading">
334
+ <ht key="<%= model_key %>.new_for_owner.heading">
335
+ New <%= collection_name.singularize.titleize %>
336
+ </ht>
337
+ </h2>
338
+ <h3 param="subheading">
339
+ <ht key="<%= model_key %>.new_for_owner.subheading">
340
+ For:
341
+ </ht>
342
+ <<%= owner_tag %> with="&@<%= owner %>"/>
343
+ </h3>
344
+ </content-header:>
345
+
346
+ <content-body: param>
347
+ <form owner="<%= owner %>" method="post" param>
348
+ <field-list: skip="<%= owner %>"/>
349
+ <submit: label="#{ht '<%=model_key %>.actions.create', :default=>['Create <%= sq_escape model_name %>']}"/>
350
+ </form>
351
+ </content-body:>
370
352
  </page>
371
353
  </def>
372
354
  <% end -%>
@@ -381,19 +363,17 @@ new_link = :new.in?(actions)
381
363
 
382
364
  <body: class="lifecycle-start-page <%= creator.dasherize %>-page" param/>
383
365
 
384
- <content: param>
385
- <header param="content-header">
386
- <h2 param="heading">
387
- <ht key="<%= model_key %>.<%= creator.underscore %>.heading">
388
- <%= creator.titleize %>
389
- </ht>
390
- </h2>
391
- </header>
366
+ <content-header: param>
367
+ <h2 param="heading">
368
+ <ht key="<%= model_key %>.<%= creator.underscore %>.heading">
369
+ <%= creator.titleize %>
370
+ </ht>
371
+ </h2>
372
+ </content-header:>
392
373
 
393
- <section param="content-body">
394
- <<%= creator.dasherize %>-form param="form"/>
395
- </section>
396
- </content:>
374
+ <content-body: param>
375
+ <<%= creator.dasherize %>-form param="form"/>
376
+ </content-body:>
397
377
 
398
378
  </page>
399
379
  </def>
@@ -406,19 +386,17 @@ new_link = :new.in?(actions)
406
386
 
407
387
  <body: class="lifecycle-transition-page <%= transition.dasherize -%>-page" param/>
408
388
 
409
- <content:>
410
- <header param="content-header">
411
- <h2 param="heading">
412
- <ht key="<%= model_key %>.<%= transition.underscore %>.heading">
413
- <%= transition.titleize %>
414
- </ht>
415
- </h2>
416
- </header>
417
-
418
- <section param="content-body">
419
- <<%= transition.dasherize %>-form param="form"/>
420
- </section>
421
- </content:>
389
+ <content-header: param>
390
+ <h2 param="heading">
391
+ <ht key="<%= model_key %>.<%= transition.underscore %>.heading">
392
+ <%= transition.titleize %>
393
+ </ht>
394
+ </h2>
395
+ </content-header:>
396
+
397
+ <content-body: param>
398
+ <<%= transition.dasherize %>-form param="form"/>
399
+ </content-body:>
422
400
 
423
401
  </page>
424
402
  </def>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hobo
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre5
4
+ version: 2.0.0.pre6
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-02 00:00:00.000000000 Z
12
+ date: 2012-11-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: hobo_support
@@ -18,7 +18,7 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 2.0.0.pre5
21
+ version: 2.0.0.pre6
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: 2.0.0.pre5
29
+ version: 2.0.0.pre6
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: hobo_fields
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -34,7 +34,7 @@ dependencies:
34
34
  requirements:
35
35
  - - '='
36
36
  - !ruby/object:Gem::Version
37
- version: 2.0.0.pre5
37
+ version: 2.0.0.pre6
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -42,7 +42,7 @@ dependencies:
42
42
  requirements:
43
43
  - - '='
44
44
  - !ruby/object:Gem::Version
45
- version: 2.0.0.pre5
45
+ version: 2.0.0.pre6
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: dryml
48
48
  requirement: !ruby/object:Gem::Requirement
@@ -50,7 +50,7 @@ dependencies:
50
50
  requirements:
51
51
  - - '='
52
52
  - !ruby/object:Gem::Version
53
- version: 2.0.0.pre5
53
+ version: 2.0.0.pre6
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
@@ -58,7 +58,7 @@ dependencies:
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 2.0.0.pre5
61
+ version: 2.0.0.pre6
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: will_paginate
64
64
  requirement: !ruby/object:Gem::Requirement