beef-has_assets 0.2.5 → 0.2.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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.5
1
+ 0.2.6
@@ -20,7 +20,7 @@ module AssetsHelper
20
20
  else
21
21
  return
22
22
  end
23
- documents_items = documents.collect { |asset| content_tag( :li, link_to("Download #{asset.filename} (#{number_to_human_size(asset.size)})", asset.public_filename, :title => asset.description ) ) }
23
+ documents_items = documents.collect { |asset| content_tag( :li, link_to("<em>Download #{asset.filename}</em> (#{number_to_human_size(asset.size)})", asset.public_filename, :title => asset.description ) ) }
24
24
  content_tag :ul, documents_items.join, :class => 'documents' unless documents_items.empty?
25
25
  end
26
26
  end
@@ -135,18 +135,27 @@ Object.extend(AssetBrowser, {
135
135
  if (this.contentNodeForm) {
136
136
  this.contentNodeForm.model_name = this.contentNodeForm.className.split('_').slice(1,this.contentNodeForm.className.split('_').length).join('_');
137
137
  this.setUpAssetList();
138
- this.contentNodeForm.onsubmit = function() {
138
+ this.contentNodeForm.addAssetIDs = function() {
139
+ $$('input.asset_id').invoke('remove');
139
140
  assets = $$('#asset-list li');
140
141
  if (assets.size() == 0) {
141
142
  $(this).insert('<input type="hidden" name="' + this.model_name + '[asset_ids]" value="" />');
142
143
  } else {
143
144
  assets.each(function(li) {
144
145
  asset_id = li.id.split('-').last();
145
- this.insert('<input type="hidden" name="' + this.model_name + '[asset_ids][]" id="asset_id-' + asset_id + '" value="' + asset_id + '" />');
146
+ this.insert('<input type="hidden" name="' + this.model_name + '[asset_ids][]" class="asset_id" value="' + asset_id + '" />');
146
147
  }, this);
147
148
  }
149
+ };
150
+
151
+ this.contentNodeForm.onsubmit = function() {
152
+ this.addAssetIDs();
148
153
  return true;
149
154
  };
155
+ this.contentNodeForm.serialize = function() {
156
+ this.addAssetIDs();
157
+ return Form.serialize(this);
158
+ };
150
159
  }
151
160
  },
152
161
 
@@ -374,7 +383,7 @@ var Renameable = Class.create(Holdable, {
374
383
  this.replace(this.value);
375
384
  });
376
385
  this.text_input.observe('change', function() {
377
- asset_id = elem.id.split(':').last();
386
+ asset_id = elem.id.split('-').last();
378
387
  new Ajax.Request('/admin/assets/' + asset_id + '/rename_category' , {
379
388
  parameters: { name: this.value }
380
389
  });
data/has_assets.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{has_assets}
5
- s.version = "0.2.5"
5
+ s.version = "0.2.6"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Steve England"]
9
- s.date = %q{2009-08-05}
9
+ s.date = %q{2009-08-06}
10
10
  s.email = %q{steve@wearebeef.co.uk}
11
11
  s.extra_rdoc_files = [
12
12
  "LICENSE",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beef-has_assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve England
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-05 00:00:00 -07:00
12
+ date: 2009-08-06 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15