gluttonberg-core 2.6.2 → 2.6.3

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.
@@ -493,6 +493,21 @@ var AssetBrowser = {
493
493
  if (target.attr("href") != '') {
494
494
  $.getJSON(target.attr("href"), null, AssetBrowser.handleJSON);
495
495
  }
496
+ } else if(target.is(".accordion-toggle")){
497
+ var accordionContent = $(target.attr('href'));
498
+ var accordionContentInner = accordionContent.find(".accordion-inner");
499
+ var collectionID = accordionContentInner.attr('data-id');
500
+
501
+ if(accordionContentInner.attr("content-loaded") == "false"){
502
+ accordionContentInner.prepend("<img src='/assets/gb_spinner.gif' class='gb_spinner'/>");
503
+ $.get("/admin/browser-collection/"+collectionID+".json", function(data){
504
+ $(".gb_spinner").remove();
505
+ accordionContentInner.prepend(data['markup']);
506
+ });
507
+ accordionContentInner.attr("content-loaded",true);
508
+ }
509
+
510
+ return true;
496
511
  } else if(target.is(".no-ajax")){
497
512
  return true;
498
513
  }
@@ -901,3 +916,22 @@ function stopAudio(){
901
916
  basicMP3Player.stopSound(basicMP3Player.lastSound);
902
917
  }
903
918
  }
919
+
920
+ function initCollectionAccordion(){
921
+ $(".collapse").collapse({parent: "#accordion_for_collections"})
922
+ $(".accordion-heading a").click(function(e){
923
+ var target = $(this);
924
+ var accordionContent = $(target.attr('href'));
925
+ var accordionContentInner = accordionContent.find(".accordion-inner");
926
+ var collectionID = accordionContentInner.attr('data-id');
927
+
928
+ if(accordionContentInner.attr("content-loaded") == "false"){
929
+ accordionContentInner.prepend("<img src='/assets/gb_spinner.gif' class='gb_spinner'/>");
930
+ $.get("/admin/browser-collection/"+collectionID+".json", function(data){
931
+ $(".gb_spinner").remove();
932
+ accordionContentInner.prepend(data['markup']);
933
+ });
934
+ accordionContentInner.attr("content-loaded",true);
935
+ }
936
+ });
937
+ }
@@ -3562,6 +3562,10 @@ a.thumbnail:hover {
3562
3562
  .thumbnail .caption {
3563
3563
  padding: 9px;
3564
3564
  }
3565
+ .thumbnail .caption h5 {
3566
+ height: 18px;
3567
+ overflow: hidden;
3568
+ }
3565
3569
  .label {
3566
3570
  padding: 1px 4px 2px;
3567
3571
  font-size: 10.998px;
@@ -42,7 +42,7 @@ module Gluttonberg
42
42
  # if filter param is provided then it will only show filtered type
43
43
  def browser
44
44
  # Get the latest assets
45
- @assets = Asset.order("created_at DESC").includes(:asset_type)
45
+ @assets = Asset.order("created_at DESC").includes(:asset_type).limit(20)
46
46
 
47
47
  @category_filter = ( params[:filter].blank? ? "all" : params[:filter] )
48
48
  if @category_filter == "all"
@@ -58,6 +58,12 @@ module Gluttonberg
58
58
  end
59
59
  end
60
60
 
61
+ def browser_collection
62
+ @collection = AssetCollection.find(params[:id])
63
+ @assets = @collection.assets
64
+ render :layout => false
65
+ end
66
+
61
67
  # list assets page by page if user drill down into a category from category tab of home page
62
68
  def category
63
69
  params[:category] = params[:category].downcase.singularize unless params[:category].blank?
@@ -364,4 +370,4 @@ class MyFile < File
364
370
  end
365
371
  end
366
372
 
367
- end
373
+ end
@@ -39,22 +39,19 @@
39
39
  #collections.tab-pane
40
40
  - unless @collections.empty?
41
41
  .accordion#accordion_for_collections
42
- - first_open = false
43
42
  - for collection in @collections
44
43
  - unless @category.blank? || @category.asset_type_ids.blank?
45
44
  - assets = collection.assets.where({:asset_type_id => @category.asset_type_ids })
46
45
  - else
47
46
  - assets = collection.assets
48
- - if assets.length > 0
47
+ - if assets.count > 0
49
48
  .accordion-group
50
49
  .accordion-heading
51
50
  %a{ :class=>"accordion-toggle no-ajax" , "data-toggle" => "collapse" , "data-parent" => "#accordion_for_collections" , "data-target" => "#collection-#{collection.id}", "href" => "#collection-#{collection.id}"}
52
- = "#{collection.name} ( #{pluralize(assets.length,'asset')} )"
53
- .accordion-body{:id => "collection-#{collection.id}" , :class => "collapse #{first_open ? '' : 'in' } " }
54
- .accordion-inner
55
- = render :partial => "gluttonberg/admin/shared/asset_panel.html" , :locals => {:assets => assets}
51
+ = "#{collection.name} ( #{pluralize(assets.count,'asset')} )"
52
+ .accordion-body{:id => "collection-#{collection.id}" , :class => "collapse " }
53
+ .accordion-inner{"content-loaded" => "false" , "data-id" => collection.id}
56
54
  .clear
57
- - first_open = true
58
55
 
59
56
  #upload.tab-pane
60
57
  - @asset = Gluttonberg::Asset.new
@@ -0,0 +1 @@
1
+ = { :name => "Assets for collection '#{@collection.name}'" , :backURL => admin_asset_browser_url+"?no_frame=false", :markup => asset_panel(@assets , params[:category] , "search" ) }.to_json.html_safe
@@ -22,17 +22,15 @@
22
22
  - assets = collection.assets.where({:asset_type_id => @category.asset_type_ids })
23
23
  - else
24
24
  - assets = collection.assets
25
- - if assets.length > 0
25
+ - if assets.count > 0
26
26
  .accordion-group
27
27
  .accordion-heading
28
28
  %a{ :class=>"accordion-toggle no-ajax" , "data-toggle" => "collapse" , "data-parent" => "#accordion_for_collections" , "data-target" => "#collection-#{collection.id}", "href" => "#collection-#{collection.id}"}
29
- = "#{collection.name} ( #{pluralize(assets.length,'asset')} )"
29
+ = "#{collection.name} ( #{pluralize(assets.count,'asset')} )"
30
30
  .accordion-body{:id => "collection-#{collection.id}" , :class => "collapse in"}
31
- .accordion-inner
32
- = render :partial => "gluttonberg/admin/shared/asset_panel.html" , :locals => {:assets => assets}
33
- /%li= link_to("Edit", edit_admin_collection_url(collection) )
34
- /%li= link_to("Delete", delete_admin_collection_url(collection) )
31
+ .accordion-inner{"content-loaded" => "false" , "data-id" => collection.id}
32
+
35
33
 
36
34
 
37
35
  :javascript
38
- $(".collapse").collapse({parent: "#accordion_for_collections"})
36
+ initCollectionAccordion();
@@ -1,6 +1,7 @@
1
1
  - @window_title = "Settings"
2
2
  - @page_title = "Configuration"
3
3
 
4
+ - has_deletable_settings = Gluttonberg::Setting.has_deletable_settings?
4
5
  .row-fluid
5
6
  = render :partial => "/gluttonberg/admin/settings/main/sidebar"
6
7
  .span9
@@ -18,7 +19,7 @@
18
19
  %tr
19
20
  %th Name
20
21
  %th Value (Click to edit)
21
- - if Gluttonberg::Setting.has_deletable_settings?
22
+ - if has_deletable_settings
22
23
  %th.controls Controls
23
24
  %tbody
24
25
  - i = 1
@@ -49,7 +50,7 @@
49
50
  = gb_editable_field setting, :value , :update_url => admin_generic_setting_path( setting)
50
51
 
51
52
  = image_tag("/assets/gb_spinner.gif" , :id => "progress_#{setting.id}" , :style => "display:none")
52
- - if Gluttonberg::Setting.has_deletable_settings?
53
+ - if has_deletable_settings
53
54
  %td.controls
54
55
  - if setting.delete_able
55
56
  = link_to 'Delete', delete_admin_generic_setting_path(setting)
data/config/routes.rb CHANGED
@@ -106,6 +106,7 @@ Rails.application.routes.draw do
106
106
  match "create_assets_in_bulk" => "assets#create_assets_in_bulk" , :as => :create_assets_in_bulk
107
107
  match "destroy_assets_in_bulk" => "assets#destroy_assets_in_bulk" , :as => :destroy_assets_in_bulk
108
108
  match "browser" => "assets#browser" , :as => :asset_browser
109
+ match "browser-collection/:id" => "assets#browser_collection" , :as => :asset_browser_collection
109
110
  match "browse/:category/page/:page" => "assets#category" , :as => :asset_category
110
111
  match "collections/:id/page/:page" => "collections#show" , :as => :asset_collection
111
112
  resources :collections do
@@ -1,4 +1,4 @@
1
- class BlogMigration < ActiveRecord::Migration
1
+ class BlogMigration < ActiveRecord::Migration
2
2
  def self.up
3
3
  create_table :gb_blogs do |t|
4
4
  t.string :name, :null => false
@@ -15,19 +15,19 @@ class BlogMigration < ActiveRecord::Migration
15
15
  t.datetime :published_at
16
16
  t.timestamps
17
17
  end
18
-
18
+
19
19
  create_table :gb_articles do |t|
20
20
  t.string :slug, :null => false
21
21
  t.integer :blog_id, :null => false
22
22
  t.integer :user_id, :null => false
23
- t.integer :author_id, :null => false
23
+ t.integer :author_id, :null => false
24
24
  t.column :state , :string #use for publishing
25
- t.column :disable_comments , :boolean , :default => false
26
- t.datetime :published_at
25
+ t.column :disable_comments , :boolean , :default => false
26
+ t.datetime :published_at
27
27
  t.string :previous_slug
28
28
  t.timestamps
29
29
  end
30
-
30
+
31
31
  create_table :gb_comments do |t|
32
32
  t.text :body
33
33
  t.string :author_name
@@ -38,9 +38,11 @@ class BlogMigration < ActiveRecord::Migration
38
38
  t.boolean :moderation_required, :default => true
39
39
  t.boolean :approved, :default => false
40
40
  t.datetime :notification_sent_at
41
+ t.boolean :spam , :default => false
42
+ t.float :spam_score
41
43
  t.timestamps
42
44
  end
43
-
45
+
44
46
  create_table :gb_comment_subscriptions do |t|
45
47
  t.integer :article_id
46
48
  t.string :author_name
@@ -48,7 +50,7 @@ class BlogMigration < ActiveRecord::Migration
48
50
  t.string :reference_hash
49
51
  t.timestamps
50
52
  end
51
-
53
+
52
54
  create_table :gb_article_localizations do |t|
53
55
  t.string :title, :null => false
54
56
  t.text :excerpt
@@ -63,19 +65,19 @@ class BlogMigration < ActiveRecord::Migration
63
65
  t.integer :fb_icon_id
64
66
  t.timestamps
65
67
  end
66
-
68
+
67
69
  begin
68
70
  Gluttonberg::Blog.create_versioned_table
69
71
  rescue => e
70
72
  puts e
71
73
  end
72
-
74
+
73
75
  begin
74
76
  Gluttonberg::ArticleLocalization.create_versioned_table
75
77
  rescue => e
76
78
  puts e
77
79
  end
78
-
80
+
79
81
  end
80
82
 
81
83
  def self.down
@@ -1,3 +1,3 @@
1
1
  module Gluttonberg
2
- VERSION = "2.6.2"
2
+ VERSION = "2.6.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gluttonberg-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.2
4
+ version: 2.6.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-04-11 00:00:00.000000000 Z
15
+ date: 2013-05-02 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: authlogic
@@ -579,6 +579,7 @@ files:
579
579
  - app/views/gluttonberg/admin/asset_library/assets/_search_form.html.haml
580
580
  - app/views/gluttonberg/admin/asset_library/assets/add_assets_in_bulk.html.haml
581
581
  - app/views/gluttonberg/admin/asset_library/assets/browser.html.haml
582
+ - app/views/gluttonberg/admin/asset_library/assets/browser_collection.json.haml
582
583
  - app/views/gluttonberg/admin/asset_library/assets/category.html.haml
583
584
  - app/views/gluttonberg/admin/asset_library/assets/category.json.haml
584
585
  - app/views/gluttonberg/admin/asset_library/assets/create_assets_in_bulk.html.haml
@@ -728,7 +729,6 @@ files:
728
729
  - config/locales/en_gb.yml
729
730
  - config/routes.rb
730
731
  - db/migrate/20121106025800_add_artist_and_link_to_assets.rb
731
- - db/migrate/20130201025800_spam_flag_for_comments.rb
732
732
  - lib/acts_as_versioned.rb
733
733
  - lib/audio_job.rb
734
734
  - lib/engine.rb
@@ -1,6 +0,0 @@
1
- class SpamFlagForComments < ActiveRecord::Migration
2
- def change
3
- add_column :gb_comments , :spam , :boolean , :default => false
4
- add_column :gb_comments , :spam_score , :float
5
- end
6
- end