hobo_rapid 2.0.0.pre7 → 2.0.0.pre8
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/VERSION +1 -1
- data/taglibs/buttons/transition_button.dryml +1 -1
- data/taglibs/cache/swept_cache.dryml +1 -1
- data/taglibs/forms/form.dryml +1 -1
- data/taglibs/html/a.dryml +9 -3
- data/taglibs/inputs/after_submit.dryml +1 -1
- data/taglibs/inputs/hot_input.dryml +4 -4
- data/taglibs/views/view.dryml +15 -2
- metadata +56 -34
- data/taglibs/inputs/sortable_input_many.dryml +0 -35
- data/taglibs/plus/sortable_collection.dryml +0 -36
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.0.
|
1
|
+
2.0.0.pre8
|
@@ -42,7 +42,7 @@ If the transition could not be found, the user does not have permissions for the
|
|
42
42
|
has_params = !transition.options[:params].blank?
|
43
43
|
ajax_attributes, html_attributes = attributes.partition_hash(HoboRapidHelper::AJAX_ATTRS)
|
44
44
|
|
45
|
-
html_attributes[:method] ||= has_params ?
|
45
|
+
html_attributes[:method] ||= has_params ? "get" : "put"
|
46
46
|
add_classes!(html_attributes, "transition-button #{transition_name}-button")
|
47
47
|
label = t("activerecord.attributes.#{this.class.to_s.underscore}.lifecycle.transitions.#{transition_name}", :default => (label || transition_name.to_s.titleize))
|
48
48
|
title = t("activerecord.attribute_help.#{this.class.to_s.underscore}.lifecycle.transitions.#{transition_name}")
|
@@ -86,7 +86,7 @@ All extra attributes are used as non-hierarchical cache keys, so for
|
|
86
86
|
inner caches these should either be constants or be manually
|
87
87
|
propagated to the outer caches
|
88
88
|
|
89
|
-
`dependencies`: see above. Default is
|
89
|
+
`dependencies`: see above. Default is `&[this]`
|
90
90
|
|
91
91
|
`query-params`: A comma separated list of query (or post) parameters
|
92
92
|
used as non-hierarchical cache keys.
|
data/taglibs/forms/form.dryml
CHANGED
@@ -65,7 +65,7 @@ or on a standard generated page using a default form:
|
|
65
65
|
|
66
66
|
- web-method
|
67
67
|
|
68
|
-
- lifecycle
|
68
|
+
- lifecycle: specifies the name of a transition or creator. This attribute is an alternative to the action and method attributes. There should also be auto-generated forms in your `app/views/taglibs/auto/rapid/forms.dryml` that you may be able to use unchanged or with light customization. See [the lifecycles manual](/manual/lifecycles#lifecycles_in_rapid_pages_forms_and_buttons) for more information
|
69
69
|
|
70
70
|
- owner
|
71
71
|
|
data/taglibs/html/a.dryml
CHANGED
@@ -71,7 +71,7 @@ This is desired behaviour; `<a>` usually means 'go somewhere else' after all.
|
|
71
71
|
|
72
72
|
The standard AJAX attributes are supported.
|
73
73
|
|
74
|
-
* action: If "new", triggers the special behaviour listed above. Otherwise, contains the action to be performed on the context. If
|
74
|
+
* action: If "new", triggers the special behaviour listed above. Otherwise, contains the action to be performed on the context. If `action` is not specified specified, the action will be "index" or "show", as appropriate.
|
75
75
|
|
76
76
|
* to: Use this item as the target instead of the current context.
|
77
77
|
|
@@ -87,12 +87,12 @@ The standard AJAX attributes are supported.
|
|
87
87
|
|
88
88
|
* force: overrides the permission check if `action` is "new"
|
89
89
|
|
90
|
-
* method: "get", "put", "post" or "delete". "get" is the default
|
90
|
+
* method: "get", "put", "post" or "delete". "get" is the default. This parameter assumes jquey-rails is being used, and simply sets data-method as well as rel="nofollow".
|
91
91
|
|
92
92
|
* only-path, protocol, host, subdomain, domain, tld-length, port, anchor, trailing-slash: In smart mode, passed through to Rails' polymorphic_url. For more information, see the Rails documentation for url_for.
|
93
93
|
|
94
94
|
-->
|
95
|
-
<def tag="a" attrs="action, to, params, query-params, href, format, subsite, force"><%=
|
95
|
+
<def tag="a" attrs="action, to, params, query-params, href, format, subsite, force, method"><%=
|
96
96
|
content = parameters.default
|
97
97
|
|
98
98
|
ajax_attrs, attributes = attributes.partition_hash(HoboRapidHelper::AJAX_ATTRS)
|
@@ -121,6 +121,12 @@ The standard AJAX attributes are supported.
|
|
121
121
|
|
122
122
|
target = to || this
|
123
123
|
|
124
|
+
if method!="get"
|
125
|
+
# assume jquery-rails
|
126
|
+
attributes['data-method']=method
|
127
|
+
attributes['rel']='nofollow'
|
128
|
+
end
|
129
|
+
|
124
130
|
if target.nil?
|
125
131
|
Dryml.last_if = false
|
126
132
|
nil_view
|
@@ -24,7 +24,7 @@ Use the `go-back` option to return to the page in `session[:previous_uri]`:
|
|
24
24
|
...
|
25
25
|
</form>
|
26
26
|
|
27
|
-
Note that session[:previous_uri] isn't automatically populated. To
|
27
|
+
Note that `session[:previous_uri]` isn't automatically populated. To
|
28
28
|
automatically populate it, add to application_controller.rb:
|
29
29
|
|
30
30
|
after_filter HoboRapid::PreviousUriFilter
|
@@ -6,11 +6,11 @@ An example of when this is useful is when a form is rendered differently dependi
|
|
6
6
|
<field-list: replace>
|
7
7
|
<do part="shipping">
|
8
8
|
<field-list fields="address,city,region,country,postal_code">
|
9
|
-
<country-view:><hot-input ajax
|
10
|
-
<region-label:><%= this_parent.country._?.region_label
|
11
|
-
|
9
|
+
<country-view:><hot-input ajax /></country-view:>
|
10
|
+
<region-label:><%= this_parent.country._?.region_label %></region-label:>
|
11
|
+
</field-list>
|
12
12
|
</do>
|
13
|
-
|
13
|
+
</field-list:>
|
14
14
|
|
15
15
|
The actual input is exposed as the default parameter, so it can be customized:
|
16
16
|
|
data/taglibs/views/view.dryml
CHANGED
@@ -18,6 +18,18 @@ Assuming the context is a blog post...
|
|
18
18
|
|
19
19
|
<view/> -> <span class="view model:blog-post-1"><a href="/blog_posts/1">My First Blog Post</a></span>
|
20
20
|
|
21
|
+
### if-blank
|
22
|
+
|
23
|
+
The `if-blank` attribute can be used to provide alternate content if `this.blank?`.
|
24
|
+
|
25
|
+
<view if-blank="(None)"/>
|
26
|
+
|
27
|
+
### force
|
28
|
+
|
29
|
+
The `force` attribute causes the permission check to be skipped.
|
30
|
+
|
31
|
+
<view force/>
|
32
|
+
|
21
33
|
### Additional Notes
|
22
34
|
|
23
35
|
* The wrapper tag is `<span>` unless the field type is `Text` (different to `String`) where it is `<div>`. Use the `inline` or `block` attributes to force a `<span>` or a `<div>`, e.g.
|
@@ -27,13 +39,14 @@ Assuming the context is a blog post...
|
|
27
39
|
<view:body inline/> -> <span class="view blog-post-body">This is my blog post body</span>
|
28
40
|
|
29
41
|
<view:created_at block/> -> <div class="view blog-post-created-at">June 09, 2008 15:36</div>
|
42
|
+
|
30
43
|
* Use the `no-wrapper` attribute to remove the wrapper tag completely. e.g.
|
31
44
|
|
32
45
|
<view:created_at no-wrapper/> -> June 09, 2008 15:36
|
33
46
|
-->
|
34
|
-
<def tag="view" attrs="inline, block, if-blank, no-wrapper, truncate"><%=
|
47
|
+
<def tag="view" attrs="inline, block, if-blank, no-wrapper, truncate, force"><%=
|
35
48
|
raise Hobo::PermissionDeniedError, "view of non-viewable field '#{this_field}' of #{this_parent.typed_id rescue this_parent}" unless
|
36
|
-
can_view?
|
49
|
+
force || can_view?
|
37
50
|
|
38
51
|
res = if this.nil? && if_blank.nil?
|
39
52
|
this_type.is_a?(Class) && this_type <= String ? "" : nil_view
|
metadata
CHANGED
@@ -1,38 +1,51 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: hobo_rapid
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 43576927
|
5
5
|
prerelease: 6
|
6
|
+
segments:
|
7
|
+
- 2
|
8
|
+
- 0
|
9
|
+
- 0
|
10
|
+
- pre
|
11
|
+
- 8
|
12
|
+
version: 2.0.0.pre8
|
6
13
|
platform: ruby
|
7
|
-
authors:
|
14
|
+
authors:
|
8
15
|
- Tom Locke, Bryan Larsen
|
9
16
|
autorequire:
|
10
17
|
bindir: bin
|
11
18
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
19
|
+
|
20
|
+
date: 2013-02-04 00:00:00 Z
|
21
|
+
dependencies:
|
22
|
+
- !ruby/object:Gem::Dependency
|
15
23
|
name: hobo
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - '='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: 2.0.0.pre7
|
22
|
-
type: :runtime
|
23
24
|
prerelease: false
|
24
|
-
|
25
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
26
|
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
|
27
|
+
requirements:
|
28
|
+
- - "="
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
hash: 43576927
|
31
|
+
segments:
|
32
|
+
- 2
|
33
|
+
- 0
|
34
|
+
- 0
|
35
|
+
- pre
|
36
|
+
- 8
|
37
|
+
version: 2.0.0.pre8
|
38
|
+
type: :runtime
|
39
|
+
version_requirements: *id001
|
30
40
|
description: The RAPID tag library for Hobo
|
31
41
|
email: tom@tomlocke.com
|
32
42
|
executables: []
|
43
|
+
|
33
44
|
extensions: []
|
45
|
+
|
34
46
|
extra_rdoc_files: []
|
35
|
-
|
47
|
+
|
48
|
+
files:
|
36
49
|
- README.markdown
|
37
50
|
- VERSION
|
38
51
|
- app/controllers/dev_controller.rb
|
@@ -101,7 +114,6 @@ files:
|
|
101
114
|
- taglibs/inputs/select_many.dryml
|
102
115
|
- taglibs/inputs/select_menu.dryml
|
103
116
|
- taglibs/inputs/select_one.dryml
|
104
|
-
- taglibs/inputs/sortable_input_many.dryml
|
105
117
|
- taglibs/inputs/sti_type_input.dryml
|
106
118
|
- taglibs/lists/collection.dryml
|
107
119
|
- taglibs/lists/empty_collection_message.dryml
|
@@ -126,7 +138,6 @@ files:
|
|
126
138
|
- taglibs/plus/live_search.dryml
|
127
139
|
- taglibs/plus/plus.dryml
|
128
140
|
- taglibs/plus/search_filter.dryml
|
129
|
-
- taglibs/plus/sortable_collection.dryml
|
130
141
|
- taglibs/plus/table_plus.dryml
|
131
142
|
- taglibs/views/a_or_an.dryml
|
132
143
|
- taglibs/views/collection_name.dryml
|
@@ -147,29 +158,40 @@ files:
|
|
147
158
|
- vendor/assets/stylesheets/hobo_rapid.css
|
148
159
|
homepage: http://hobocentral.net
|
149
160
|
licenses: []
|
161
|
+
|
150
162
|
post_install_message:
|
151
|
-
rdoc_options:
|
163
|
+
rdoc_options:
|
152
164
|
- --charset=UTF-8
|
153
|
-
require_paths:
|
165
|
+
require_paths:
|
154
166
|
- lib
|
155
167
|
- vendor
|
156
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
168
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
157
169
|
none: false
|
158
|
-
requirements:
|
159
|
-
- -
|
160
|
-
- !ruby/object:Gem::Version
|
161
|
-
|
162
|
-
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
hash: 3
|
174
|
+
segments:
|
175
|
+
- 0
|
176
|
+
version: "0"
|
177
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
163
178
|
none: false
|
164
|
-
requirements:
|
165
|
-
- -
|
166
|
-
- !ruby/object:Gem::Version
|
179
|
+
requirements:
|
180
|
+
- - ">="
|
181
|
+
- !ruby/object:Gem::Version
|
182
|
+
hash: 23
|
183
|
+
segments:
|
184
|
+
- 1
|
185
|
+
- 3
|
186
|
+
- 6
|
167
187
|
version: 1.3.6
|
168
188
|
requirements: []
|
189
|
+
|
169
190
|
rubyforge_project: hobo
|
170
|
-
rubygems_version: 1.8.
|
191
|
+
rubygems_version: 1.8.25
|
171
192
|
signing_key:
|
172
193
|
specification_version: 3
|
173
194
|
summary: The RAPID tag library for Hobo
|
174
195
|
test_files: []
|
196
|
+
|
175
197
|
has_rdoc:
|
@@ -1,35 +0,0 @@
|
|
1
|
-
<!-- An enhanced version of [`<input-many>`](/api_tag_defs/input-many) that supports drag-and-drop re-ordering.
|
2
|
-
|
3
|
-
Each item in the collection has a `<div class="ordering-handle" param="handle">` added, which can be used to drag the item up and down.
|
4
|
-
|
5
|
-
If the items in the collection contain an [`acts_as_list`](http://ar.rubyonrails.org/classes/ActiveRecord/Acts/List/ClassMethods.html) declaration, it is updated.
|
6
|
-
|
7
|
-
The specified sort order may be maintained even without `acts_as_list`. The items will be passed to the controller in the correct order, so the order may be persisted there.
|
8
|
-
|
9
|
-
### Attributes
|
10
|
-
|
11
|
-
- `position-column`: The position column may be specified via `acts_as_list`, via a `position_column` method on your model or via this attribute.
|
12
|
-
- others: all other attributes are passed through to [jQuery UI's Sortable](http://jqueryui.com/demos/sortable/) or to `<input-many>`, as appropriate.
|
13
|
-
|
14
|
-
The jQuery UI option `update` is used internally to update the order. If you modify this option, your function may call `$(this).hjq_sortable_input_many('update')` to retain this functionality.
|
15
|
-
-->
|
16
|
-
|
17
|
-
<def tag="sortable-input-many" attrs="position-column, template">
|
18
|
-
<%
|
19
|
-
options, attributes = attributes.partition_hash(['disabled', 'appendTo', 'axis', 'cancel', 'connectWith', 'containment', 'cursor', 'cursorAt', 'delay', 'distance', 'dropOnEmpty', 'forceHelperSize', 'forcePlaceholderSize', 'grid', 'handle', 'helper', 'items', 'opacity', 'placeholder', 'revert', 'scroll', 'scrollSensitivity', 'scrollSpeed', 'tolerance', 'zIndex'])
|
20
|
-
events, attributes = attributes.partition_hash(['create', 'start', 'sort', 'change', 'beforeStop', 'stop', 'update', 'receive', 'remove', 'over', 'out', 'activate', 'deactivate'])
|
21
|
-
|
22
|
-
data_rapid_options = { :options => options, :events => events }
|
23
|
-
%>
|
24
|
-
<% template ||= this.try.new_candidate || this.member_class.new %>
|
25
|
-
<% position_column ||= template.try.position_column -%>
|
26
|
-
<input-many merge class="sortable-input-many" template="&template" more-skip="&position_column" data-rapid="&data_rapid('sortable-input-many', data_rapid_options)">
|
27
|
-
<default: replace>
|
28
|
-
<div class="ordering-handle" param="handle" if="&can_edit?">↑<br/>↓</div>
|
29
|
-
<if test="&position_column">
|
30
|
-
<input class="sortable-position" type="hidden" value="&this.send(position_column)" name="#{param_name_for_this}[#{position_column}]" />
|
31
|
-
</if>
|
32
|
-
<default restore/>
|
33
|
-
</default:>
|
34
|
-
</input-many>
|
35
|
-
</def>
|
@@ -1,36 +0,0 @@
|
|
1
|
-
<!-- An enhanced version of Rapid's `<collection>` tag that supports drag-and-drop re-ordering.
|
2
|
-
|
3
|
-
Each item in the collection has a `<div class="ordering-handle" param="handle">` added, which can be used to drag the item up and down.
|
4
|
-
|
5
|
-
### Attributes
|
6
|
-
|
7
|
-
`sortable-collection` supports all of the options and events defined by [jQuery UI's Sortable](http://jqueryui.com/demos/sortable/).
|
8
|
-
|
9
|
-
Sortable also supports all of the standard [Hobo AJAX callbacks](http://cookbook.hobocentral.net/api_taglibs/rapid_forms).
|
10
|
-
|
11
|
-
The jQuery UI option `update` is used internally to save the new order via Ajax. If you modify this option, your function may call `$(this).hjq_sortable_collection('update')` to retain this functionality.
|
12
|
-
|
13
|
-
### Controller support
|
14
|
-
|
15
|
-
This tag assumes the controller has a `reorder` action and the model has a `position_column` method. This action is added automatically by Hobo's model-controller if the model declares `acts_as_list`. See also [Drag and Drop Reordering](/manual/controllers#drag_and_drop_reordering) in the [Controllers and Routing](/manual/controllers) chapter of the manual.
|
16
|
-
-->
|
17
|
-
<def tag="sortable-collection">
|
18
|
-
<%
|
19
|
-
options, attrs = attributes.partition_hash(['disabled', 'appendTo', 'axis', 'cancel', 'connectWith', 'containment', 'cursor', 'cursorAt', 'delay', 'distance', 'dropOnEmpty', 'forceHelperSize', 'forcePlaceholderSize', 'grid', 'handle', 'helper', 'items', 'opacity', 'placeholder', 'revert', 'scroll', 'scrollSensitivity', 'scrollSpeed', 'tolerance', 'zIndex'])
|
20
|
-
events, html_attrs = attrs.partition_hash(['create', 'start', 'sort', 'change', 'beforeStop', 'stop', 'update', 'receive', 'remove', 'over', 'out', 'activate', 'deactivate'])
|
21
|
-
ajax_attrs, html_attrs = attrs.partition_hash(HoboRapidHelper::AJAX_CALLBACKS)
|
22
|
-
|
23
|
-
singular_name = this.member_class.name.underscore
|
24
|
-
route_method = subsite ? "#{subsite}_reorder_#{singular_name.pluralize}_url" : "reorder_#{singular_name.pluralize}_url"
|
25
|
-
reorder_url = send(route_method)
|
26
|
-
|
27
|
-
add_classes!(html_attrs, "sortable-collection")
|
28
|
-
add_data_rapid!(html_attrs, "sortable-collection", :options => options, :events => events, :ajax_attrs => ajax_attrs, :reorder_url => reorder_url, :reorder_parameter => "#{singular_name}_ordering")
|
29
|
-
%>
|
30
|
-
<collection class="sortable" merge-attrs="&html_attrs" merge-params>
|
31
|
-
<item: param>
|
32
|
-
<div class="ordering-handle" param="handle" if="&can_edit?(this.position_column)">↑<br/>↓</div>
|
33
|
-
<do param="default"><card param/></do>
|
34
|
-
</item:>
|
35
|
-
</collection>
|
36
|
-
</def>
|