caboose-cms 0.4.35 → 0.4.36
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.
- checksums.yaml +8 -8
- data/app/assets/stylesheets/caboose/admin.css +11 -0
- data/app/controllers/caboose/block_type_sources_controller.rb +1 -1
- data/app/models/caboose/block_type.rb +11 -7
- data/app/models/caboose/block_type_source.rb +2 -2
- data/app/models/caboose/block_type_summary.rb +1 -1
- data/app/views/caboose/block_type_sources/admin_edit.html.erb +7 -1
- data/app/views/caboose/block_type_sources/admin_index.html.erb +6 -0
- data/app/views/caboose/block_type_sources/admin_new.html.erb +6 -0
- data/app/views/caboose/block_type_store/admin_details.html.erb +35 -3
- data/app/views/caboose/block_type_store/admin_index.html.erb +5 -0
- data/app/views/caboose/block_types/admin_edit.html.erb +4 -0
- data/app/views/caboose/block_types/admin_index.html.erb +5 -0
- data/app/views/caboose/block_types/admin_new.html.erb +5 -0
- data/lib/caboose/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YTk2NTdlOTliOGZiMDJmOWY1M2JlODc4NzdlODgzY2NmMzU4ZmM4ZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZjRmNWEyZDdhMzg1YjNmODY0MDE3MGU3ZjI4NWYyYmMyNWY0MGVmNQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZmJmZmE5YmY0MjZhOGZkNDg2OTIwMDgyZDZjZjg2MjE1Y2U0YTU4ZjEzMTM2
|
10
|
+
ZDM2MDQzNjZkYzI1MTZmMzljM2YwOTNkYzFiYzhmOWQ5ZDM0MmM3YzFlYjUz
|
11
|
+
YWFiYWIzNzZmZjAzOWUxOTVmY2FkZjgxMzFkZjhhMzAyNWI3Nzg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
OGIyNTlmYTkzYWIzMmRhMmFkOTdjMzI3MGZlNTExNTBjYjhmZDg1Y2M2YmJi
|
14
|
+
OThmMDIwNDU0OWZmNjEwNjljODBmZDFlMTBhMGRhOTUwM2M3NzRmNTEwNjFi
|
15
|
+
NGZiZDE5N2E5ODYwMDhhMTNhMmU4Mjk4MTA0MzdjNGM3Y2JlOTc=
|
@@ -78,16 +78,20 @@ class Caboose::BlockType < ActiveRecord::Base
|
|
78
78
|
self.save
|
79
79
|
|
80
80
|
# Remove any named children that don't exist in the given hash
|
81
|
-
|
82
|
-
|
83
|
-
|
81
|
+
if h['children'].nil?
|
82
|
+
Caboose::BlockType.where("parent_id = ? and name is not null", self.id).destroy_all
|
83
|
+
else
|
84
|
+
new_child_names = h['children'].collect { |h2| h2['name'] }
|
85
|
+
Caboose::BlockType.where("parent_id = ? and name is not null and name not in (?)", self.id, new_child_names).destroy_all
|
84
86
|
end
|
85
87
|
|
86
88
|
# Now add/update all the children
|
87
|
-
h['children']
|
88
|
-
|
89
|
-
|
90
|
-
|
89
|
+
if h['children']
|
90
|
+
h['children'].each do |h2|
|
91
|
+
bt = self.child(h2['name'])
|
92
|
+
bt = Caboose::BlockType.create(:parent_id => self.id) if bt.nil?
|
93
|
+
bt.parse_api_hash(h2)
|
94
|
+
end
|
91
95
|
end
|
92
96
|
|
93
97
|
end
|
@@ -31,7 +31,7 @@ class Caboose::BlockTypeSource < ActiveRecord::Base
|
|
31
31
|
|
32
32
|
summaries.each do |h|
|
33
33
|
s = Caboose::BlockTypeSummary.where(:block_type_source_id => self.id, :name => h['name']).first
|
34
|
-
s = Caboose::BlockTypeSummary.create(:block_type_source_id => self.id)
|
34
|
+
s = Caboose::BlockTypeSummary.create(:block_type_source_id => self.id) if s.nil?
|
35
35
|
s.parse_api_hash(h)
|
36
36
|
s.save
|
37
37
|
end
|
@@ -65,7 +65,7 @@ class Caboose::BlockTypeSource < ActiveRecord::Base
|
|
65
65
|
Caboose.log("Response body isn't valid JSON.")
|
66
66
|
return false
|
67
67
|
end
|
68
|
-
|
68
|
+
#Caboose.log(h)
|
69
69
|
# Update the block type
|
70
70
|
bt.parse_api_hash(h)
|
71
71
|
|
@@ -1,6 +1,12 @@
|
|
1
1
|
<%
|
2
2
|
bts = @block_type_source
|
3
3
|
%>
|
4
|
+
<div id='crumbtrail'>
|
5
|
+
<a href='/admin'>Admin</a> >
|
6
|
+
<a href='/admin/block-types'>Block Types</a> >
|
7
|
+
<a href='/admin/block-types/store'>Store</a> >
|
8
|
+
<a href='/admin/block-types/store/sources'>Sources</a>
|
9
|
+
</div>
|
4
10
|
|
5
11
|
<h1>Edit Source</h1>
|
6
12
|
<p><div id='blocktypesource_<%= bts.id %>_name' ></div></p>
|
@@ -46,7 +52,7 @@ function refresh_block_types(bts_id)
|
|
46
52
|
{
|
47
53
|
$('#message').empty().append($('<p/>').addClass('loading').html('Refreshing block types from source...'));
|
48
54
|
$.ajax({
|
49
|
-
url: '/admin/block-
|
55
|
+
url: '/admin/block-types/store/sources/' + bts_id + '/refresh',
|
50
56
|
type: 'get',
|
51
57
|
success: function(resp) {
|
52
58
|
if (resp.error) $('#message').empty().append($('<p/>').addClass('note error').html(resp.error));
|
@@ -1,3 +1,9 @@
|
|
1
|
+
<div id='crumbtrail'>
|
2
|
+
<a href='/admin'>Admin</a> >
|
3
|
+
<a href='/admin/block-types'>Block Types</a> >
|
4
|
+
<a href='/admin/block-types/store'>Store</a> >
|
5
|
+
<a href='/admin/block-types/store/sources'>Sources</a>
|
6
|
+
</div>
|
1
7
|
|
2
8
|
<h1>New Source</h1>
|
3
9
|
<form action='/admin/block-types/store/sources' method='post' id='new_source_form'>
|
@@ -2,7 +2,8 @@
|
|
2
2
|
bts = @block_type_summary
|
3
3
|
%>
|
4
4
|
<div id='crumbtrail'>
|
5
|
-
<a href='/admin
|
5
|
+
<a href='/admin'>Admin</a> >
|
6
|
+
<a href='/admin/block-types'>Block Types</a> >
|
6
7
|
<a href='/admin/block-types/store'>Store</a>
|
7
8
|
</div>
|
8
9
|
|
@@ -10,5 +11,36 @@ bts = @block_type_summary
|
|
10
11
|
|
11
12
|
<p>Name: <%= bts.name %></p>
|
12
13
|
<p>Description: <%= bts.description %></p>
|
13
|
-
<
|
14
|
-
<p
|
14
|
+
<div id='message'></div>
|
15
|
+
<p>
|
16
|
+
<input type='button' value='< Back' onclick="window.location='/admin/block-types/store';" />
|
17
|
+
<input type='button' value='Download from Source' onclick="download_block_type(<%= bts.id %>);" />
|
18
|
+
</p>
|
19
|
+
|
20
|
+
<% content_for :caboose_js do %>
|
21
|
+
<script type='text/javascript'>
|
22
|
+
|
23
|
+
function download_block_type(summary_id, confirm)
|
24
|
+
{
|
25
|
+
if (!confirm)
|
26
|
+
{
|
27
|
+
var p = $('<p/>').addClass('note warning')
|
28
|
+
.append('Are you sure you want to download the block type?<br />')
|
29
|
+
.append($('<input/>').attr('type', 'button').val('Yes').click(function() { download_block_type(summary_id, true); })).append(' ')
|
30
|
+
.append($('<input/>').attr('type', 'button').val('No').click(function() { $('#message').empty(); }));
|
31
|
+
$('#message').empty().append(p);
|
32
|
+
return;
|
33
|
+
}
|
34
|
+
$('#message').html("<p class='loading'>Downloading block type...</p>");
|
35
|
+
$.ajax({
|
36
|
+
url: '/admin/block-types/store/' + summary_id + '/download',
|
37
|
+
type: 'get',
|
38
|
+
success: function(resp) {
|
39
|
+
if (resp.error) $('#message').html("<p class='note error'>" + resp.error + "</p>");
|
40
|
+
if (resp.success) $('#message').html("<p class='note success'>" + resp.success + "</p>");
|
41
|
+
}
|
42
|
+
});
|
43
|
+
}
|
44
|
+
|
45
|
+
</script>
|
46
|
+
<% 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.4.
|
4
|
+
version: 0.4.36
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|