hobo_rapid 2.0.1 → 2.1.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b9631023feacbe60cbf5dcd5ad91511c8f224495
4
+ data.tar.gz: 055ee989d90d7a5f7189f6a57fe6c1756e391110
5
+ SHA512:
6
+ metadata.gz: 49003f955e40ec3cf27293adf4c272d1f98c1caead652580de9f91171b552902bfabd5049858cf84660deb2b2fe3e3629da0acc09eee5dcb3adbd7c8a5cc6042
7
+ data.tar.gz: 61adf94f34a9db00ca661c768e89abb9156a8067e07fda145343ec5d6daaebd5ed84341b4a1a0fe7bd4c84a6ce60341302d196315ece1973afa584fe5ef8fe5c
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.1
1
+ 2.1.0.pre1
@@ -23,7 +23,8 @@ module HoboCacheHelper
23
23
  key_attrs["#{qp}"] = params[qp] || ""
24
24
  end
25
25
 
26
- ActiveSupport::Cache.expand_cache_key(url_for(key_attrs).split('://').last, namespace)
26
+ key = ActiveSupport::Cache.expand_cache_key(url_for(key_attrs).split('://').last, namespace)
27
+ Digest::MD5.hexdigest(key)
27
28
  end
28
29
 
29
30
  def item_cache(*args, &block)
@@ -48,7 +48,11 @@ module HoboRapidHelper
48
48
 
49
49
  # returns the number of items in the collection. See LH #889
50
50
  def collection_count
51
- this.try.to_int || this.try.total_entries || (this.try.loaded? && this.try.length) || this.try.count || this.try.length
51
+ if this.respond_to?(:to_a)
52
+ this.try.count
53
+ else
54
+ this.try.to_int || this.try.total_entries || (this.try.loaded? && this.try.length) || this.try.count || this.try.length
55
+ end
52
56
  end
53
57
 
54
58
  def through_collection_names(object=this)
@@ -168,7 +172,7 @@ module HoboRapidHelper
168
172
  end
169
173
 
170
174
  unless method == "get"
171
- page_path = if (request.post? || request.put? || request.delete?) && params[:page_path]
175
+ page_path = if params[:page_path]
172
176
  params[:page_path]
173
177
  else
174
178
  request.fullpath
data/lib/hobo_rapid.rb CHANGED
@@ -9,6 +9,7 @@ module HoboRapid
9
9
 
10
10
  EDIT_LINK_BASE = "https://github.com/Hobo/hobodoc/edit/master/hobo_rapid"
11
11
 
12
+ require 'hobo_rapid/previous_uri_filter'
12
13
  require 'hobo_rapid/railtie' if defined?(Rails)
13
14
 
14
15
  class Engine < ::Rails::Engine
@@ -16,10 +16,11 @@ be parameterized. If you wish to parameterize it, see
16
16
  When placed inside of a part, provides a complete parameterizable `<live-editor>`.
17
17
 
18
18
  ### Usage
19
-
20
- <part name="my-part">
21
- <live-editor-innards hide="puff"/>
22
- </part>
19
+ <my-field-view:>
20
+ <div part="part-my-field">
21
+ <live-editor-innards hide="puff" style="margin-left: 10px"/>
22
+ </div>
23
+ </my-field-view:>
23
24
 
24
25
  ### Attributes
25
26
 
@@ -19,7 +19,7 @@ To use this tag, the model of the items the user is chosing *must* have unique n
19
19
  %>
20
20
  <def tag="select-many" attrs="options, remove-label, prompt, disabled, name"><%
21
21
  prompt ||= ht("#{this_field_reflection.klass.to_s.underscore}.form.select_many.prompt", :default=>"Add #{this_field.titleize.singularize}")
22
- options ||= this_field_reflection.klass.all(:conditions => this_field_reflection.options[:conditions]).select {|x| can_view?(x)}
22
+ options ||= this_field_reflection.klass.where(this_field_reflection.options[:conditions]).select {|x| can_view?(x)}
23
23
  name ||= param_name_for_this
24
24
 
25
25
  values = this
@@ -24,7 +24,7 @@ For situations where there are too many target records to practically include in
24
24
  options ||= begin
25
25
  conditions = ActiveRecord::Associations::BelongsToAssociation.new(this_parent, this_field_reflection).options[:conditions]
26
26
  order = this_field_reflection.klass.default_order
27
- this_field_reflection.klass.all(:conditions => conditions, :limit => limit, :order => order).select {|x| can_view?(x)}
27
+ this_field_reflection.klass.where(conditions).limit(limit).order(order).select {|x| can_view?(x)}
28
28
  end
29
29
 
30
30
  id_method = this_field_reflection.options[:primary_key] || this_field_reflection.klass.primary_key
@@ -3,7 +3,7 @@
3
3
  The message can be customized via the `empty-collection-message` parameter or by changing the `products.collection.empty_message` translation.
4
4
  -->
5
5
  <def tag="empty-collection-message">
6
- <unless test="&this._?.member_class.nil?">
6
+ <unless test="&!this.respond_to?('member_class') || this._?.member_class.nil?">
7
7
  <div class="empty-collection-message" style="#{'display:none' if !this.empty?}" param="default">
8
8
  <ht key="#{this.member_class.name.underscore}.collection.empty_message">
9
9
  No <collection-name/> to display
@@ -1,4 +1,4 @@
1
- <!-- This tag is very similar `<field-list-v1>`. However, instead of rendering a table, it renders what [Anatoli Papirovski calls "perfect form markup"](http://web.archive.org/web/20090922234755/http://fecklessmind.com/2009/01/23/how-to-reliable-css-forms/)
1
+ <!-- This tag is very similar `<field-list-v1>`. However, instead of rendering a table, it renders what [Anatoli Papirovski calls "perfect form markup"](http://web.archive.org/web/20090215003125/http://fecklessmind.com/2009/01/23/how-to-reliable-css-forms/)
2
2
 
3
3
  It takes the same attributes & parameters as `<field-list-v1>`, with the addition of a `legend` parameter and a `required` attribute.
4
4
 
@@ -6,10 +6,10 @@
6
6
  <submit label="&t('hobo.table_plus.submit_label', :default=>'Go')" class="search-button" param="search-submit"/>
7
7
  </form>
8
8
  <if test="&params[:search]">
9
- <form param="clear-form" method="get" action="" merge-attrs>
9
+ <form param="clear-form" method="get" action="" with="&nil" merge-attrs>
10
10
  <hidden-fields for-query-string skip="page, search"/>
11
11
  <input type="hidden" name="search" value=""/>
12
- <submit label="Clear" class="search-button" param="clear-submit"/>
12
+ <submit label="&t('hobo.table_plus.clear_label', :default=>'Clear')" class="search-button" param="clear-submit"/>
13
13
  </form>
14
14
  </if>
15
15
  </def>
metadata CHANGED
@@ -1,32 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hobo_rapid
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
5
- prerelease:
4
+ version: 2.1.0.pre1
6
5
  platform: ruby
7
6
  authors:
8
7
  - Tom Locke, Bryan Larsen
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-06-23 00:00:00.000000000 Z
11
+ date: 2013-12-18 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: hobo
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - '='
20
18
  - !ruby/object:Gem::Version
21
- version: 2.0.1
19
+ version: 2.1.0.pre1
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - '='
28
25
  - !ruby/object:Gem::Version
29
- version: 2.0.1
26
+ version: 2.1.0.pre1
30
27
  description: The RAPID tag library for Hobo
31
28
  email: tom@tomlocke.com
32
29
  executables: []
@@ -145,6 +142,7 @@ files:
145
142
  - vendor/assets/stylesheets/hobo_rapid.css
146
143
  homepage: http://hobocentral.net
147
144
  licenses: []
145
+ metadata: {}
148
146
  post_install_message:
149
147
  rdoc_options:
150
148
  - --charset=UTF-8
@@ -152,22 +150,19 @@ require_paths:
152
150
  - lib
153
151
  - vendor
154
152
  required_ruby_version: !ruby/object:Gem::Requirement
155
- none: false
156
153
  requirements:
157
154
  - - '>='
158
155
  - !ruby/object:Gem::Version
159
156
  version: '0'
160
157
  required_rubygems_version: !ruby/object:Gem::Requirement
161
- none: false
162
158
  requirements:
163
159
  - - '>='
164
160
  - !ruby/object:Gem::Version
165
161
  version: 1.3.6
166
162
  requirements: []
167
163
  rubyforge_project: hobo
168
- rubygems_version: 1.8.25
164
+ rubygems_version: 2.1.11
169
165
  signing_key:
170
- specification_version: 3
166
+ specification_version: 4
171
167
  summary: The RAPID tag library for Hobo
172
168
  test_files: []
173
- has_rdoc: