caboose-cms 0.5.221 → 0.5.222
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/assets/javascripts/caboose/admin_media_index.js +401 -0
- data/app/assets/javascripts/caboose/jquery-ui.drag-multiple.min.js +4 -0
- data/app/assets/javascripts/plupload/Moxie.swf +0 -0
- data/app/assets/javascripts/plupload/Moxie.xap +0 -0
- data/app/assets/javascripts/plupload/i18n/ar.js +2 -0
- data/app/assets/javascripts/plupload/i18n/az.js +2 -0
- data/app/assets/javascripts/plupload/i18n/bg.js +2 -0
- data/app/assets/javascripts/plupload/i18n/bs.js +2 -0
- data/app/assets/javascripts/plupload/i18n/ca.js +2 -0
- data/app/assets/javascripts/plupload/i18n/cs.js +2 -0
- data/app/assets/javascripts/plupload/i18n/cy.js +2 -0
- data/app/assets/javascripts/plupload/i18n/da.js +2 -0
- data/app/assets/javascripts/plupload/i18n/de.js +2 -0
- data/app/assets/javascripts/plupload/i18n/el.js +2 -0
- data/app/assets/javascripts/plupload/i18n/en.js +2 -0
- data/app/assets/javascripts/plupload/i18n/es.js +2 -0
- data/app/assets/javascripts/plupload/i18n/et.js +2 -0
- data/app/assets/javascripts/plupload/i18n/fa.js +2 -0
- data/app/assets/javascripts/plupload/i18n/fi.js +2 -0
- data/app/assets/javascripts/plupload/i18n/fr.js +2 -0
- data/app/assets/javascripts/plupload/i18n/he.js +2 -0
- data/app/assets/javascripts/plupload/i18n/hr.js +2 -0
- data/app/assets/javascripts/plupload/i18n/hu.js +2 -0
- data/app/assets/javascripts/plupload/i18n/hy.js +2 -0
- data/app/assets/javascripts/plupload/i18n/id.js +2 -0
- data/app/assets/javascripts/plupload/i18n/it.js +2 -0
- data/app/assets/javascripts/plupload/i18n/ja.js +2 -0
- data/app/assets/javascripts/plupload/i18n/ka.js +2 -0
- data/app/assets/javascripts/plupload/i18n/kk.js +2 -0
- data/app/assets/javascripts/plupload/i18n/km.js +2 -0
- data/app/assets/javascripts/plupload/i18n/ko.js +2 -0
- data/app/assets/javascripts/plupload/i18n/ku_IQ.js +2 -0
- data/app/assets/javascripts/plupload/i18n/lt.js +2 -0
- data/app/assets/javascripts/plupload/i18n/lv.js +2 -0
- data/app/assets/javascripts/plupload/i18n/mn.js +2 -0
- data/app/assets/javascripts/plupload/i18n/ms.js +2 -0
- data/app/assets/javascripts/plupload/i18n/nl.js +2 -0
- data/app/assets/javascripts/plupload/i18n/pl.js +2 -0
- data/app/assets/javascripts/plupload/i18n/pt_BR.js +2 -0
- data/app/assets/javascripts/plupload/i18n/ro.js +2 -0
- data/app/assets/javascripts/plupload/i18n/ru.js +2 -0
- data/app/assets/javascripts/plupload/i18n/sk.js +2 -0
- data/app/assets/javascripts/plupload/i18n/sq.js +2 -0
- data/app/assets/javascripts/plupload/i18n/sr.js +2 -0
- data/app/assets/javascripts/plupload/i18n/sr_RS.js +2 -0
- data/app/assets/javascripts/plupload/i18n/sv.js +2 -0
- data/app/assets/javascripts/plupload/i18n/th_TH.js +2 -0
- data/app/assets/javascripts/plupload/i18n/tr.js +2 -0
- data/app/assets/javascripts/plupload/i18n/uk_UA.js +2 -0
- data/app/assets/javascripts/plupload/i18n/vi.js +2 -0
- data/app/assets/javascripts/plupload/i18n/zh_CN.js +2 -0
- data/app/assets/javascripts/plupload/i18n/zh_TW.js +2 -0
- data/app/assets/javascripts/plupload/jquery.plupload.queue/css/jquery.plupload.queue.css +185 -0
- data/app/assets/javascripts/plupload/jquery.plupload.queue/img/backgrounds.gif +0 -0
- data/app/assets/javascripts/plupload/jquery.plupload.queue/img/buttons-disabled.png +0 -0
- data/app/assets/javascripts/plupload/jquery.plupload.queue/img/buttons.png +0 -0
- data/app/assets/javascripts/plupload/jquery.plupload.queue/img/delete.gif +0 -0
- data/app/assets/javascripts/plupload/jquery.plupload.queue/img/done.gif +0 -0
- data/app/assets/javascripts/plupload/jquery.plupload.queue/img/error.gif +0 -0
- data/app/assets/javascripts/plupload/jquery.plupload.queue/img/throbber.gif +0 -0
- data/app/assets/javascripts/plupload/jquery.plupload.queue/img/transp50.png +0 -0
- data/app/assets/javascripts/plupload/jquery.plupload.queue/jquery.plupload.queue.js +428 -0
- data/app/assets/javascripts/plupload/jquery.plupload.queue/jquery.plupload.queue.min.js +1 -0
- data/app/assets/javascripts/plupload/jquery.ui.plupload/css/jquery.ui.plupload.css +370 -0
- data/app/assets/javascripts/plupload/jquery.ui.plupload/img/loading.gif +0 -0
- data/app/assets/javascripts/plupload/jquery.ui.plupload/img/plupload.png +0 -0
- data/app/assets/javascripts/plupload/jquery.ui.plupload/jquery.ui.plupload.js +1323 -0
- data/app/assets/javascripts/plupload/jquery.ui.plupload/jquery.ui.plupload.min.js +1 -0
- data/app/assets/javascripts/plupload/moxie.js +10726 -0
- data/app/assets/javascripts/plupload/moxie.min.js +15 -0
- data/app/assets/javascripts/plupload/plupload.dev.js +2315 -0
- data/app/assets/javascripts/plupload/plupload.full.min.js +28 -0
- data/app/assets/javascripts/plupload/plupload.min.js +13 -0
- data/app/assets/stylesheets/caboose/admin_media_index.css.scss +115 -0
- data/app/controllers/caboose/application_controller.rb +1 -1
- data/app/controllers/caboose/cart_controller.rb +1 -1
- data/app/controllers/caboose/media_categories_controller.rb +44 -8
- data/app/controllers/caboose/media_controller.rb +116 -0
- data/app/controllers/caboose/posts_controller.rb +1 -1
- data/app/controllers/caboose/sns_controller.rb +60 -0
- data/app/models/caboose/block.rb +4 -2
- data/app/models/caboose/media.rb +94 -0
- data/app/models/caboose/media_category.rb +55 -15
- data/app/models/caboose/schema.rb +6 -9
- data/app/models/caboose/tax_calculator.rb +1 -1
- data/app/views/caboose/{images → media}/admin_edit.html.erb +0 -0
- data/app/views/caboose/media/admin_index.html.erb +49 -0
- data/app/views/caboose/posts/admin_edit_general.html.erb +3 -1
- data/config/routes.rb +30 -17
- data/lib/caboose.rb +6 -0
- data/lib/caboose/version.rb +1 -1
- metadata +81 -11
- data/app/assets/javascripts/caboose/admin_images_index.js +0 -171
- data/app/assets/stylesheets/caboose/admin_images_index.css.scss +0 -53
- data/app/controllers/caboose/images_controller.rb +0 -149
- data/app/models/caboose/media_file.rb +0 -18
- data/app/models/caboose/media_image.rb +0 -43
- data/app/views/caboose/images/admin_index.html.erb +0 -59
- data/app/views/caboose/images/admin_new.html.erb +0 -80
- data/app/views/caboose/images/admin_s3_result.html.erb +0 -3
@@ -0,0 +1,94 @@
|
|
1
|
+
require 'uri'
|
2
|
+
require 'httparty'
|
3
|
+
|
4
|
+
class Caboose::Media < ActiveRecord::Base
|
5
|
+
|
6
|
+
self.table_name = "media"
|
7
|
+
belongs_to :media_category
|
8
|
+
has_attached_file :file, :path => ':path_prefixmedia/:id_:media_name.:extension'
|
9
|
+
do_not_validate_attachment_file_type :file
|
10
|
+
has_attached_file :image,
|
11
|
+
:path => ':path_prefixmedia/:id_:media_name_:style.:extension',
|
12
|
+
:default_url => 'http://placehold.it/300x300',
|
13
|
+
:styles => {
|
14
|
+
:tiny => '150x200>',
|
15
|
+
:thumb => '300x400>',
|
16
|
+
:large => '600x800>'
|
17
|
+
}
|
18
|
+
#:s3_headers => lambda { |attachment| { "Content-Disposition" => "attachment; filename=\"#{attachment.name}\"" }}
|
19
|
+
do_not_validate_attachment_file_type :image
|
20
|
+
attr_accessible :id,
|
21
|
+
:media_category_id,
|
22
|
+
:name,
|
23
|
+
:original_name,
|
24
|
+
:description,
|
25
|
+
:processed
|
26
|
+
|
27
|
+
has_attached_file :sample
|
28
|
+
|
29
|
+
#before_post_process :set_content_dispositon
|
30
|
+
#def set_content_dispositon
|
31
|
+
# self.sample.options.merge({ :s3_headers => { "Content-Disposition" => "attachment; filename=#{self.name}" }})
|
32
|
+
#end
|
33
|
+
|
34
|
+
def process
|
35
|
+
#return if self.processed
|
36
|
+
|
37
|
+
config = YAML.load(File.read(Rails.root.join('config', 'aws.yml')))[Rails.env]
|
38
|
+
bucket = config['bucket']
|
39
|
+
|
40
|
+
key = "#{self.media_category_id}_#{self.original_name}"
|
41
|
+
uri = "http://#{bucket}-uploads.s3.amazonaws.com/#{key}"
|
42
|
+
|
43
|
+
image_extensions = ['.jpg', '.jpeg', '.gif', '.png', '.tif']
|
44
|
+
ext = File.extname(key).downcase
|
45
|
+
if image_extensions.include?(ext)
|
46
|
+
self.image = URI.parse(uri)
|
47
|
+
else
|
48
|
+
self.file = URI.parse(uri)
|
49
|
+
end
|
50
|
+
self.processed = true
|
51
|
+
self.save
|
52
|
+
|
53
|
+
# Set the downloadable file names
|
54
|
+
#bucket = AWS::S3::Bucket.new(bucket)
|
55
|
+
#['tiny', 'thumb', 'large'].each do |style|
|
56
|
+
# obj = bucket.objects["media/#{self.id}_#{style}#{ext}"]
|
57
|
+
# obj.content_disposition = 'attachment; filename="' + self.name + '"'
|
58
|
+
# obj.store
|
59
|
+
#end
|
60
|
+
|
61
|
+
# Remove the temp file
|
62
|
+
bucket = AWS::S3::Bucket.new("#{bucket}-uploads")
|
63
|
+
obj = bucket.objects[key]
|
64
|
+
obj.delete
|
65
|
+
|
66
|
+
end
|
67
|
+
|
68
|
+
def api_hash
|
69
|
+
{
|
70
|
+
:id => self.id,
|
71
|
+
:name => self.name,
|
72
|
+
:description => self.description,
|
73
|
+
:processed => self.processed,
|
74
|
+
:image_urls => self.image_urls,
|
75
|
+
:file_url => self.file ? self.file.url : nil
|
76
|
+
}
|
77
|
+
end
|
78
|
+
|
79
|
+
def image_urls
|
80
|
+
return nil if self.image.nil? || self.image.url(:tiny).starts_with?('http://placehold.it')
|
81
|
+
return {
|
82
|
+
:tiny_url => self.image.url(:tiny),
|
83
|
+
:thumb_url => self.image.url(:thumb),
|
84
|
+
:large_url => self.image.url(:large),
|
85
|
+
:original_url => self.image.url(:original)
|
86
|
+
}
|
87
|
+
end
|
88
|
+
|
89
|
+
def self.upload_name(str)
|
90
|
+
return '' if str.nil?
|
91
|
+
return File.basename(str, File.extname(str)).downcase.gsub(' ', '-').gsub(/[^\w-]/, '')
|
92
|
+
end
|
93
|
+
|
94
|
+
end
|
@@ -3,28 +3,68 @@ class Caboose::MediaCategory < ActiveRecord::Base
|
|
3
3
|
self.table_name = "media_categories"
|
4
4
|
belongs_to :parent, :class_name => 'Caboose::MediaCategory'
|
5
5
|
has_many :children, :class_name => 'Caboose::MediaCategory', :foreign_key => 'parent_id', :order => 'name'
|
6
|
-
has_many :
|
7
|
-
has_many :media_files, :class_name => 'Caboose::MediaFile', :order => 'name'
|
6
|
+
has_many :media, :class_name => 'Caboose::Media', :order => 'name'
|
8
7
|
attr_accessible :id, :site_id, :parent_id, :name
|
9
8
|
|
10
|
-
def self.
|
11
|
-
|
9
|
+
def self.top_category(site_id)
|
10
|
+
cat = self.where(:site_id => site_id, :parent_id => nil).first
|
11
|
+
cat = self.create(:site_id => site_id, :parent_id => nil, :name => 'Media') if cat.nil?
|
12
|
+
return cat
|
12
13
|
end
|
13
|
-
|
14
|
-
def self.top_file_category(site_id)
|
15
|
-
return self.where("parent_id is null and site_id = ? and name = ?", site_id, 'Files').first
|
16
|
-
end
|
17
|
-
|
14
|
+
|
18
15
|
def api_hash
|
19
16
|
{
|
20
|
-
:id
|
17
|
+
:id => self.id,
|
21
18
|
:parent_id => self.parent_id,
|
22
|
-
:site_id
|
23
|
-
:name
|
24
|
-
:children
|
25
|
-
:
|
26
|
-
:files => self.media_files.collect { |file| file.api_hash }
|
19
|
+
:site_id => self.site_id,
|
20
|
+
:name => self.name,
|
21
|
+
:children => self.children.collect { |child| child.api_hash },
|
22
|
+
:media => self.media.collect { |m| m.api_hash }
|
27
23
|
}
|
28
24
|
end
|
25
|
+
|
26
|
+
def self.tree(site_id)
|
27
|
+
return self.where(:parent_id => nil, :site_id => site_id).reorder("name").all
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.flat_tree(site_id, prefix = '-')
|
31
|
+
arr = []
|
32
|
+
self.tree(site_id).each do |cat|
|
33
|
+
arr += self.flat_tree_helper(cat, prefix, '')
|
34
|
+
end
|
35
|
+
return arr
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.flat_tree_helper(cat, prefix, str)
|
39
|
+
cat.name = "#{str}#{cat.name}"
|
40
|
+
arr = [{
|
41
|
+
:id => cat.id,
|
42
|
+
:parent_id => cat.parent_id,
|
43
|
+
:site_id => cat.site_id,
|
44
|
+
:name => cat.name,
|
45
|
+
:media_count => cat.media.count
|
46
|
+
}]
|
47
|
+
cat.children.each do |cat2|
|
48
|
+
arr += self.flat_tree_helper(cat2, prefix, "#{str}#{prefix}")
|
49
|
+
end
|
50
|
+
return arr
|
51
|
+
end
|
52
|
+
|
53
|
+
def is_ancestor_of?(cat)
|
54
|
+
if cat.is_a?(Integer) || cat.is_a?(String)
|
55
|
+
cat_id = cat.to_i
|
56
|
+
return false if cat_id == -1
|
57
|
+
cat = Caboose::MediaCategory.find(cat_id)
|
58
|
+
end
|
59
|
+
return false if cat.parent_id.nil?
|
60
|
+
return false if cat.parent.nil?
|
61
|
+
return true if cat.parent.id == self.id
|
62
|
+
return is_ancestor_of?(cat.parent)
|
63
|
+
end
|
64
|
+
|
65
|
+
def is_child_of?(cat)
|
66
|
+
cat = Caboose::MediaCategory.find(cat) if cat.is_a?(Integer)
|
67
|
+
return cat.is_ancestor_of?(self)
|
68
|
+
end
|
29
69
|
|
30
70
|
end
|
@@ -329,18 +329,15 @@ class Caboose::Schema < Caboose::Utilities::Schema
|
|
329
329
|
[ :site_id , :integer ],
|
330
330
|
[ :name , :string ]
|
331
331
|
],
|
332
|
-
Caboose::
|
332
|
+
Caboose::Media => [
|
333
333
|
[ :media_category_id , :integer ],
|
334
334
|
[ :name , :string ],
|
335
335
|
[ :description , :text ],
|
336
|
-
[ :
|
337
|
-
|
338
|
-
|
339
|
-
[ :
|
340
|
-
|
341
|
-
[ :description , :text ],
|
342
|
-
[ :file , :attachment ]
|
343
|
-
],
|
336
|
+
[ :original_name , :string ],
|
337
|
+
[ :image , :attachment ],
|
338
|
+
[ :file , :attachment ],
|
339
|
+
[ :processed , :boolean , { :default => false }]
|
340
|
+
],
|
344
341
|
Caboose::Modification => [
|
345
342
|
[ :product_id , :integer ],
|
346
343
|
[ :sort_order , :integer , { :default => 0 }],
|
@@ -25,7 +25,7 @@ module Caboose
|
|
25
25
|
sa = order.shipping_address
|
26
26
|
if sa.nil? || sa.address1.nil? || sa.city.nil? || sa.state.nil? || sa.zip.nil?
|
27
27
|
sa = order.billing_address
|
28
|
-
end
|
28
|
+
end
|
29
29
|
return 0.00 if sa.nil? || sa.address1.nil? || sa.city.nil? || sa.state.nil? || sa.zip.nil?
|
30
30
|
|
31
31
|
TaxCloud.configure do |config|
|
File without changes
|
@@ -0,0 +1,49 @@
|
|
1
|
+
|
2
|
+
<h1>Media</h1>
|
3
|
+
|
4
|
+
<p><a href='http://d9hjv462jiw15.cloudfront.net/media-images/22_tiny.jpg?1435603149'>Download</a></p>
|
5
|
+
|
6
|
+
<div id='left_content'>
|
7
|
+
<div id='categories'></div>
|
8
|
+
<div id='controls'></div>
|
9
|
+
</div>
|
10
|
+
<div id='right_content'>
|
11
|
+
<div id='uploader'></div>
|
12
|
+
<div id='media'></div>
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<% content_for :caboose_css do %>
|
16
|
+
<%= stylesheet_link_tag 'caboose/admin_media_index' %>
|
17
|
+
<link rel="stylesheet" href="/assets/plupload/jquery.ui.plupload/css/jquery.ui.plupload.css" type="text/css" />
|
18
|
+
<% end %>
|
19
|
+
|
20
|
+
<% content_for :caboose_js do %>
|
21
|
+
<%= javascript_include_tag 'caboose/admin_media_index.js' %>
|
22
|
+
<%= javascript_include_tag 'caboose/jquery-ui.drag-multiple.min.js' %>
|
23
|
+
|
24
|
+
<!-- production -->
|
25
|
+
<script type="text/javascript" src="/assets/plupload/plupload.full.min.js"></script>
|
26
|
+
<script type="text/javascript" src="/assets/plupload/jquery.ui.plupload/jquery.ui.plupload.js"></script>
|
27
|
+
|
28
|
+
<!-- debug
|
29
|
+
<script type="text/javascript" src="/assets/plupload/moxie.js"></script>
|
30
|
+
<script type="text/javascript" src="/assets/plupload/plupload.dev.js"></script>
|
31
|
+
<script type="text/javascript" src="/assets/plupload/jquery.ui.plupload/jquery.ui.plupload.js"></script>
|
32
|
+
-->
|
33
|
+
|
34
|
+
<script type="text/javascript">
|
35
|
+
|
36
|
+
var controller = false;
|
37
|
+
$(document).ready(function() {
|
38
|
+
controller = new MediaController({
|
39
|
+
top_cat_id: <%= raw Caboose.json(@media_category ? @top_media_category.id : false) %>,
|
40
|
+
cat_id: <%= raw Caboose.json(@media_category ? @media_category.id : false) %>,
|
41
|
+
s3_upload_url: '<%= raw @s3_upload_url %>',
|
42
|
+
aws_access_key_id: '<%= raw @aws_access_key_id %>',
|
43
|
+
policy: '<%= raw @policy %>',
|
44
|
+
signature: '<%= raw @signature %>'
|
45
|
+
});
|
46
|
+
});
|
47
|
+
|
48
|
+
</script>
|
49
|
+
<% end %>
|
@@ -6,6 +6,7 @@
|
|
6
6
|
<p><div id='post_<%= @post.id %>_title' ></div></p>
|
7
7
|
<p><div id='post_<%= @post.id %>_subtitle' ></div></p>
|
8
8
|
<p><div id='post_<%= @post.id %>_author' ></div></p>
|
9
|
+
<p><div id='post_<%= @post.id %>_created_at'></div></p>
|
9
10
|
<p><div id='post_<%= @post.id %>_published' ></div></p>
|
10
11
|
<p><div id='post_<%= @post.id %>_image' ></div></p>
|
11
12
|
|
@@ -25,7 +26,8 @@ $(document).ready(function() {
|
|
25
26
|
{ name: 'slug' , nice_name: 'Slug' , type: 'text' , value: <%= raw Caboose.json(@post.slug ) %>, width: 600, after_update: function() { refresh_uri(); } },
|
26
27
|
{ name: 'title' , nice_name: 'Title' , type: 'text' , value: <%= raw Caboose.json(@post.title ) %>, width: 600, after_update: function() { refresh_uri(); } },
|
27
28
|
{ name: 'subtitle' , nice_name: 'Subtitle' , type: 'text' , value: <%= raw Caboose.json(@post.subtitle ) %>, width: 600 },
|
28
|
-
{ name: 'author' , nice_name: 'Author' , type: 'text' , value: <%= raw Caboose.json(@post.author ) %>, width: 600 },
|
29
|
+
{ name: 'author' , nice_name: 'Author' , type: 'text' , value: <%= raw Caboose.json(@post.author ) %>, width: 600 },
|
30
|
+
{ name: 'created_at' , nice_name: 'Date Published' , type: 'date' , value: <%= raw Caboose.json( @post.created_at.strftime('%m/%d/%Y') ) %>, width: 600 },
|
29
31
|
{ name: 'published' , nice_name: 'Published' , type: 'checkbox' , value: <%= raw @post.published ? true : false %>, width: 600 },
|
30
32
|
{ name: 'image' , nice_name: 'Image' , type: 'image' , value: <%= raw Caboose.json(@post.image.url(:thumb)) %>, width: 600, update_url: '/admin/posts/<%= @post.id %>/image' }
|
31
33
|
]
|
data/config/routes.rb
CHANGED
@@ -111,7 +111,17 @@ Caboose::Engine.routes.draw do
|
|
111
111
|
put "/admin/social" => "social#admin_update"
|
112
112
|
get "/admin/analytics" => "social#analytics"
|
113
113
|
|
114
|
+
#=============================================================================
|
115
|
+
# Amazon SNS
|
116
|
+
#=============================================================================
|
114
117
|
|
118
|
+
get "/admin/sns/confirm" => "sns#admin_confirm"
|
119
|
+
post "/admin/sns/confirm" => "sns#admin_confirm"
|
120
|
+
get "/admin/sns" => "sns#admin_index"
|
121
|
+
post "/admin/sns" => "sns#admin_add"
|
122
|
+
put "/admin/sns/:id" => "sns#admin_update"
|
123
|
+
delete "/admin/sns/:id" => "sns#admin_delete"
|
124
|
+
|
115
125
|
#=============================================================================
|
116
126
|
# Fonts
|
117
127
|
#=============================================================================
|
@@ -119,7 +129,6 @@ Caboose::Engine.routes.draw do
|
|
119
129
|
get "/admin/fonts" => "fonts#admin_index"
|
120
130
|
put "/admin/fonts" => "fonts#admin_update"
|
121
131
|
|
122
|
-
|
123
132
|
#=============================================================================
|
124
133
|
# Shipping Packages
|
125
134
|
#=============================================================================
|
@@ -200,22 +209,26 @@ Caboose::Engine.routes.draw do
|
|
200
209
|
# Images
|
201
210
|
#=============================================================================
|
202
211
|
|
203
|
-
|
204
|
-
get "/admin/
|
205
|
-
get "/admin/
|
206
|
-
get "/admin/
|
207
|
-
get "/admin/
|
208
|
-
get "/admin/
|
209
|
-
get "/admin/
|
210
|
-
|
211
|
-
|
212
|
-
post "/admin/
|
213
|
-
|
214
|
-
delete "/admin/
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
212
|
+
post "/admin/media/pre-upload" => "media#admin_pre_upload"
|
213
|
+
get "/admin/media" => "media#admin_index"
|
214
|
+
get "/admin/media/new" => "media#admin_new"
|
215
|
+
get "/admin/media/json" => "media#admin_json"
|
216
|
+
get "/admin/media/:id/process" => "media#admin_process"
|
217
|
+
get "/admin/media/:id/finished" => "media#admin_process_finished"
|
218
|
+
get "/admin/media/:id" => "media#admin_edit"
|
219
|
+
put "/admin/media/:id" => "media#admin_update"
|
220
|
+
post "/admin/media/:id/image" => "media#admin_update_image"
|
221
|
+
post "/admin/media" => "media#admin_add"
|
222
|
+
delete "/admin/media/bulk" => "media#admin_bulk_delete"
|
223
|
+
delete "/admin/media/:id" => "media#admin_delete"
|
224
|
+
|
225
|
+
|
226
|
+
get "/admin/media-categories/json" => "media_categories#admin_json"
|
227
|
+
get "/admin/media-categories/flat-tree" => "media_categories#admin_flat_tree"
|
228
|
+
post "/admin/media-categories" => "media_categories#admin_add"
|
229
|
+
post "/admin/media-categories/:id/attach" => "media_categories#admin_attach"
|
230
|
+
put "/admin/media-categories/:id" => "media_categories#admin_update"
|
231
|
+
delete "/admin/media-categories/:id" => "media_categories#admin_delete"
|
219
232
|
|
220
233
|
#=============================================================================
|
221
234
|
# Settings
|
data/lib/caboose.rb
CHANGED
@@ -153,3 +153,9 @@ Paperclip.interpolates :block_image_upload_name do |attachment, style|
|
|
153
153
|
return b.id if b.image_upload_name.nil? || b.image_upload_name.strip.length == 0
|
154
154
|
return b.image_upload_name
|
155
155
|
end
|
156
|
+
|
157
|
+
Paperclip.interpolates :media_name do |attachment, style|
|
158
|
+
m = attachment.instance
|
159
|
+
return '' if m.name.nil? || m.name.strip.length == 0
|
160
|
+
return m.name
|
161
|
+
end
|
data/lib/caboose/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caboose-cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.222
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|
@@ -398,8 +398,8 @@ files:
|
|
398
398
|
- app/assets/javascripts/caboose/admin_block_edit.js
|
399
399
|
- app/assets/javascripts/caboose/admin_edit_modifications.js
|
400
400
|
- app/assets/javascripts/caboose/admin_edit_order.js
|
401
|
-
- app/assets/javascripts/caboose/admin_images_index.js
|
402
401
|
- app/assets/javascripts/caboose/admin_main.js
|
402
|
+
- app/assets/javascripts/caboose/admin_media_index.js
|
403
403
|
- app/assets/javascripts/caboose/admin_page_edit_content.js
|
404
404
|
- app/assets/javascripts/caboose/admin_page_new_blocks.js
|
405
405
|
- app/assets/javascripts/caboose/admin_post_edit_content.js
|
@@ -419,6 +419,7 @@ files:
|
|
419
419
|
- app/assets/javascripts/caboose/date_format.js
|
420
420
|
- app/assets/javascripts/caboose/google_spreadsheets.js
|
421
421
|
- app/assets/javascripts/caboose/imageZoom.js
|
422
|
+
- app/assets/javascripts/caboose/jquery-ui.drag-multiple.min.js
|
422
423
|
- app/assets/javascripts/caboose/jquery.datetimepicker.js
|
423
424
|
- app/assets/javascripts/caboose/jquery.detect.js
|
424
425
|
- app/assets/javascripts/caboose/jquery.fileupload.js
|
@@ -464,11 +465,82 @@ files:
|
|
464
465
|
- app/assets/javascripts/caboose/spectrum.js
|
465
466
|
- app/assets/javascripts/caboose/station.js
|
466
467
|
- app/assets/javascripts/caboose/testing.js
|
468
|
+
- app/assets/javascripts/plupload/Moxie.swf
|
469
|
+
- app/assets/javascripts/plupload/Moxie.xap
|
470
|
+
- app/assets/javascripts/plupload/i18n/ar.js
|
471
|
+
- app/assets/javascripts/plupload/i18n/az.js
|
472
|
+
- app/assets/javascripts/plupload/i18n/bg.js
|
473
|
+
- app/assets/javascripts/plupload/i18n/bs.js
|
474
|
+
- app/assets/javascripts/plupload/i18n/ca.js
|
475
|
+
- app/assets/javascripts/plupload/i18n/cs.js
|
476
|
+
- app/assets/javascripts/plupload/i18n/cy.js
|
477
|
+
- app/assets/javascripts/plupload/i18n/da.js
|
478
|
+
- app/assets/javascripts/plupload/i18n/de.js
|
479
|
+
- app/assets/javascripts/plupload/i18n/el.js
|
480
|
+
- app/assets/javascripts/plupload/i18n/en.js
|
481
|
+
- app/assets/javascripts/plupload/i18n/es.js
|
482
|
+
- app/assets/javascripts/plupload/i18n/et.js
|
483
|
+
- app/assets/javascripts/plupload/i18n/fa.js
|
484
|
+
- app/assets/javascripts/plupload/i18n/fi.js
|
485
|
+
- app/assets/javascripts/plupload/i18n/fr.js
|
486
|
+
- app/assets/javascripts/plupload/i18n/he.js
|
487
|
+
- app/assets/javascripts/plupload/i18n/hr.js
|
488
|
+
- app/assets/javascripts/plupload/i18n/hu.js
|
489
|
+
- app/assets/javascripts/plupload/i18n/hy.js
|
490
|
+
- app/assets/javascripts/plupload/i18n/id.js
|
491
|
+
- app/assets/javascripts/plupload/i18n/it.js
|
492
|
+
- app/assets/javascripts/plupload/i18n/ja.js
|
493
|
+
- app/assets/javascripts/plupload/i18n/ka.js
|
494
|
+
- app/assets/javascripts/plupload/i18n/kk.js
|
495
|
+
- app/assets/javascripts/plupload/i18n/km.js
|
496
|
+
- app/assets/javascripts/plupload/i18n/ko.js
|
497
|
+
- app/assets/javascripts/plupload/i18n/ku_IQ.js
|
498
|
+
- app/assets/javascripts/plupload/i18n/lt.js
|
499
|
+
- app/assets/javascripts/plupload/i18n/lv.js
|
500
|
+
- app/assets/javascripts/plupload/i18n/mn.js
|
501
|
+
- app/assets/javascripts/plupload/i18n/ms.js
|
502
|
+
- app/assets/javascripts/plupload/i18n/nl.js
|
503
|
+
- app/assets/javascripts/plupload/i18n/pl.js
|
504
|
+
- app/assets/javascripts/plupload/i18n/pt_BR.js
|
505
|
+
- app/assets/javascripts/plupload/i18n/ro.js
|
506
|
+
- app/assets/javascripts/plupload/i18n/ru.js
|
507
|
+
- app/assets/javascripts/plupload/i18n/sk.js
|
508
|
+
- app/assets/javascripts/plupload/i18n/sq.js
|
509
|
+
- app/assets/javascripts/plupload/i18n/sr.js
|
510
|
+
- app/assets/javascripts/plupload/i18n/sr_RS.js
|
511
|
+
- app/assets/javascripts/plupload/i18n/sv.js
|
512
|
+
- app/assets/javascripts/plupload/i18n/th_TH.js
|
513
|
+
- app/assets/javascripts/plupload/i18n/tr.js
|
514
|
+
- app/assets/javascripts/plupload/i18n/uk_UA.js
|
515
|
+
- app/assets/javascripts/plupload/i18n/vi.js
|
516
|
+
- app/assets/javascripts/plupload/i18n/zh_CN.js
|
517
|
+
- app/assets/javascripts/plupload/i18n/zh_TW.js
|
518
|
+
- app/assets/javascripts/plupload/jquery.plupload.queue/css/jquery.plupload.queue.css
|
519
|
+
- app/assets/javascripts/plupload/jquery.plupload.queue/img/backgrounds.gif
|
520
|
+
- app/assets/javascripts/plupload/jquery.plupload.queue/img/buttons-disabled.png
|
521
|
+
- app/assets/javascripts/plupload/jquery.plupload.queue/img/buttons.png
|
522
|
+
- app/assets/javascripts/plupload/jquery.plupload.queue/img/delete.gif
|
523
|
+
- app/assets/javascripts/plupload/jquery.plupload.queue/img/done.gif
|
524
|
+
- app/assets/javascripts/plupload/jquery.plupload.queue/img/error.gif
|
525
|
+
- app/assets/javascripts/plupload/jquery.plupload.queue/img/throbber.gif
|
526
|
+
- app/assets/javascripts/plupload/jquery.plupload.queue/img/transp50.png
|
527
|
+
- app/assets/javascripts/plupload/jquery.plupload.queue/jquery.plupload.queue.js
|
528
|
+
- app/assets/javascripts/plupload/jquery.plupload.queue/jquery.plupload.queue.min.js
|
529
|
+
- app/assets/javascripts/plupload/jquery.ui.plupload/css/jquery.ui.plupload.css
|
530
|
+
- app/assets/javascripts/plupload/jquery.ui.plupload/img/loading.gif
|
531
|
+
- app/assets/javascripts/plupload/jquery.ui.plupload/img/plupload.png
|
532
|
+
- app/assets/javascripts/plupload/jquery.ui.plupload/jquery.ui.plupload.js
|
533
|
+
- app/assets/javascripts/plupload/jquery.ui.plupload/jquery.ui.plupload.min.js
|
534
|
+
- app/assets/javascripts/plupload/moxie.js
|
535
|
+
- app/assets/javascripts/plupload/moxie.min.js
|
536
|
+
- app/assets/javascripts/plupload/plupload.dev.js
|
537
|
+
- app/assets/javascripts/plupload/plupload.full.min.js
|
538
|
+
- app/assets/javascripts/plupload/plupload.min.js
|
467
539
|
- app/assets/javascripts/tinymce/plugins/caboose/plugin.js
|
468
540
|
- app/assets/stylesheets/caboose/admin.css
|
469
541
|
- app/assets/stylesheets/caboose/admin_crumbtrail.css.scss
|
470
|
-
- app/assets/stylesheets/caboose/admin_images_index.css.scss
|
471
542
|
- app/assets/stylesheets/caboose/admin_main.css
|
543
|
+
- app/assets/stylesheets/caboose/admin_media_index.css.scss
|
472
544
|
- app/assets/stylesheets/caboose/admin_page_edit_content.css
|
473
545
|
- app/assets/stylesheets/caboose/admin_post_edit_content.css
|
474
546
|
- app/assets/stylesheets/caboose/admin_products.css
|
@@ -537,11 +609,11 @@ files:
|
|
537
609
|
- app/controllers/caboose/fonts_controller.rb
|
538
610
|
- app/controllers/caboose/gift_cards_controller.rb
|
539
611
|
- app/controllers/caboose/google_spreadsheets_controller.rb
|
540
|
-
- app/controllers/caboose/images_controller.rb
|
541
612
|
- app/controllers/caboose/line_items_controller.rb
|
542
613
|
- app/controllers/caboose/login_controller.rb
|
543
614
|
- app/controllers/caboose/logout_controller.rb
|
544
615
|
- app/controllers/caboose/media_categories_controller.rb
|
616
|
+
- app/controllers/caboose/media_controller.rb
|
545
617
|
- app/controllers/caboose/modal_controller.rb
|
546
618
|
- app/controllers/caboose/modification_value_input_fields_controller.rb
|
547
619
|
- app/controllers/caboose/modification_values_controller.rb
|
@@ -568,6 +640,7 @@ files:
|
|
568
640
|
- app/controllers/caboose/shipping_packages_controller.rb
|
569
641
|
- app/controllers/caboose/sites_controller.rb
|
570
642
|
- app/controllers/caboose/smtp_controller.rb
|
643
|
+
- app/controllers/caboose/sns_controller.rb
|
571
644
|
- app/controllers/caboose/social_controller.rb
|
572
645
|
- app/controllers/caboose/stackable_groups_controller.rb
|
573
646
|
- app/controllers/caboose/station_controller.rb
|
@@ -619,9 +692,8 @@ files:
|
|
619
692
|
- app/models/caboose/gift_card.rb
|
620
693
|
- app/models/caboose/line_item.rb
|
621
694
|
- app/models/caboose/line_item_modification.rb
|
695
|
+
- app/models/caboose/media.rb
|
622
696
|
- app/models/caboose/media_category.rb
|
623
|
-
- app/models/caboose/media_file.rb
|
624
|
-
- app/models/caboose/media_image.rb
|
625
697
|
- app/models/caboose/menu_block.rb
|
626
698
|
- app/models/caboose/message.rb
|
627
699
|
- app/models/caboose/model_binder.rb
|
@@ -797,15 +869,13 @@ files:
|
|
797
869
|
- app/views/caboose/fonts/admin_index.html.erb
|
798
870
|
- app/views/caboose/gift_cards/admin_edit.html.erb
|
799
871
|
- app/views/caboose/gift_cards/admin_index.html.erb
|
800
|
-
- app/views/caboose/images/admin_edit.html.erb
|
801
|
-
- app/views/caboose/images/admin_index.html.erb
|
802
|
-
- app/views/caboose/images/admin_new.html.erb
|
803
|
-
- app/views/caboose/images/admin_s3_result.html.erb
|
804
872
|
- app/views/caboose/line_items/admin_new.html.erb
|
805
873
|
- app/views/caboose/login/forgot_password_form.html.erb
|
806
874
|
- app/views/caboose/login/index.html.erb
|
807
875
|
- app/views/caboose/login/reset_password_form.html.erb
|
808
876
|
- app/views/caboose/login_mailer/forgot_password_email.html.erb
|
877
|
+
- app/views/caboose/media/admin_edit.html.erb
|
878
|
+
- app/views/caboose/media/admin_index.html.erb
|
809
879
|
- app/views/caboose/modal/index.html.erb
|
810
880
|
- app/views/caboose/modification_value_input_fields/admin_edit.html.erb
|
811
881
|
- app/views/caboose/my_account/index.html.erb
|