beef-has_assets 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.7.0
1
+ 0.7.1
@@ -41,7 +41,13 @@ class Admin::AssetsController < Admin::BaseController
41
41
  end
42
42
 
43
43
  def category
44
- @assets = Asset.all(:conditions => ["category = ?",params[:category].rstrip])
44
+ category = params[:category].strip
45
+ if category == 'No Folder'
46
+ conditions = "category IS NULL or category = ''"
47
+ else
48
+ conditions = ["category = ?", category]
49
+ end
50
+ @assets = Asset.not_thumbnails.all( :conditions => conditions )
45
51
 
46
52
  respond_to do |format|
47
53
  format.html { render :layout => false}
@@ -1,12 +1,17 @@
1
+ <% attached = (controller.action_name == 'attach' or controller.controller_name != 'assets') %>
1
2
  <%= link_to_function truncate(asset.filename,{:length => 50}), "AssetBrowser.openInfo(#{asset.id}, this)" %> - <%= asset.description %>
2
3
  <div>
3
- <%= link_to_function "View Info<br/>", "AssetBrowser.openInfo(#{asset.id}, this)" %>
4
- <% if for_content -%>
5
- <%= link_to_function "Insert<br/>", "addAsset(#{asset.id})" %>
6
- <%= link_to_function "Attach", "AssetBrowser.addAssetToContentNode(#{asset.to_json}.#{asset.class.name.demodulize.underscore})" %>
7
- <% elsif controller.controller_name != 'assets' %>
8
- <%= link_to_function "Detach", "AssetBrowser.removeAssetFromContentNode(#{asset.id})" %>
9
- <% else %>
10
- <%= link_to_function "Delete", "AssetBrowser.assetAction(#{asset.to_json}.#{asset.class.name.demodulize.underscore})" %>
11
- <% end -%>
4
+ <%= link_to_function "View Info", "AssetBrowser.openInfo(#{asset.id}, this)" %><br/>
5
+
6
+ <% if for_content or attached %>
7
+ <%= link_to_function "Insert", "addAsset(#{asset.id})" %></br>
8
+ <% end -%>
9
+ <br/>
10
+ <% if for_content %>
11
+ <%= link_to_function "Attach", "AssetBrowser.addAssetToContentNode(#{asset.to_json}.#{asset.class.name.demodulize.underscore})" %>
12
+ <% elsif attached %>
13
+ <%= link_to_function "Detach", "AssetBrowser.removeAssetFromContentNode(#{asset.id})" %>
14
+ <% else %>
15
+ <%= link_to_function "Delete", "AssetBrowser.assetAction(#{asset.to_json}.#{asset.class.name.demodulize.underscore})" %>
16
+ <% end -%>
12
17
  </div>
@@ -1,19 +1,20 @@
1
+ <% attached = (controller.action_name == 'attach' or controller.controller_name != 'assets') %>
1
2
  <%= image_tag asset.public_filename(:square) %>
2
3
  <div>
3
4
  <h4><%= truncate(asset.filename,{:length => 50}) %></h4>
4
5
  <%= link_to_function "View Info", "AssetBrowser.openInfo(#{asset.id}, this)" %><br />
5
-
6
- <% if for_content -%>
7
- <%= link_to_function "Attach", "AssetBrowser.addAssetToContentNode(#{asset.to_json}.#{asset.class.name.demodulize.underscore})" %>
8
- <h4>Insert Image</h4>
9
- <%= link_to_function "Large", "addAsset(#{asset.id}, 'large' )" %> | <%= link_to_function "Medium ", "addAsset(#{asset.id}, 'medium' )" %> | <%= link_to_function "Small ", "addAsset(#{asset.id}, 'thumb' )" %>
10
6
 
11
- <% elsif controller.controller_name != 'assets' %>
12
-
13
- <%= link_to_function "Detach", "AssetBrowser.removeAssetFromContentNode(#{asset.id})" %>
7
+ <% if for_content or attached %>
14
8
  <h4>Insert Image</h4>
15
- <%= link_to_function "Large", "addAsset(#{asset.id}, 'large' )" %> | <%= link_to_function "Medium ", "addAsset(#{asset.id}, 'medium' )" %> | <%= link_to_function "Small ", "addAsset(#{asset.id}, 'thumb' )" %>
16
- <% else %>
9
+ <%= link_to_function "Large", "addAsset(#{asset.id}, 'large' )" %> | <%= link_to_function "Medium ", "addAsset(#{asset.id}, 'medium' )" %> | <%= link_to_function "Small ", "addAsset(#{asset.id}, 'thumb' )" %><br/>
10
+ <% end -%>
11
+ <br/>
12
+ <% if for_content %>
13
+ <%= link_to_function "Attach", "AssetBrowser.addAssetToContentNode(#{asset.to_json}.#{asset.class.name.demodulize.underscore})" %>
14
+ <% elsif attached %>
15
+ <%= link_to_function "Detach", "AssetBrowser.removeAssetFromContentNode(#{asset.id})" %>
16
+ <% else %>
17
17
  <%= link_to_function "Delete", "AssetBrowser.assetAction(#{asset.to_json}.#{asset.class.name.demodulize.underscore})" %>
18
- <% end -%>
18
+ <% end -%>
19
+
19
20
  </div>
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{beef-has_assets}
8
- s.version = "0.7.0"
8
+ s.version = "0.7.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Steve England"]
12
- s.date = %q{2010-01-26}
12
+ s.date = %q{2010-02-09}
13
13
  s.email = %q{steve@wearebeef.co.uk}
14
14
  s.extra_rdoc_files = [
15
15
  "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.7.0
4
+ version: 0.7.1
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: 2010-01-26 00:00:00 +00:00
12
+ date: 2010-02-09 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies: []
15
15