caboose-cms 0.2.66 → 0.2.67
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/javascripts/caboose/station.js +7 -3
- data/app/controllers/caboose/roles_controller.rb +1 -1
- data/app/controllers/caboose/users_controller.rb +1 -1
- data/app/models/caboose/core_plugin.rb +54 -0
- data/app/views/caboose/station/index.html.erb +2 -0
- data/lib/caboose.rb +1 -1
- data/lib/caboose/version.rb +1 -1
- metadata +2 -7
- data/app/models/caboose/page_plugin.rb +0 -45
- data/app/models/caboose/permission_plugin.rb +0 -27
- data/app/models/caboose/post_plugin.rb +0 -28
- data/app/models/caboose/role_plugin.rb +0 -28
- data/app/models/caboose/settings_plugin.rb +0 -27
- data/app/models/caboose/user_plugin.rb +0 -30
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YmE4OWQ0Yjg0YjBjMGU3MmJmYzA2YTBlMWE2MGQzZTc1YTE3ZjVmMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjljYTk5ODI0MjhiMjhkMGEyZjdiMGZkYzg1OThiMmY1NTZhNDc1MQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZWVhMTI4ZmU3OWYyYmZkYTQ5MzE1MWUxYjQ5NTQzN2JmNjczNjAxNDBlNmRh
|
10
|
+
NWIyNGUxYWRlNDU1OTZmOWYxNzUyYjYyMjkwNzMzOTUyNDNlNDZjMWE4ZWZh
|
11
|
+
NjMyYzA5MGYxMjc3NDJlOTQzY2ZhY2VmNGI0ZmRiNTMxYmU2YTY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTM5ZTFkNmE3NDViYTgyNDkyYjgzZjY2ZTg0Mzk0YzA2MWRiYjEzN2YxZGFm
|
14
|
+
ZDgxMzExOTM4ZTA4NmI5OGQ2OWQzOTJiZWFlODdkYWEwYjgzM2U1NmFiZTNj
|
15
|
+
OWI0YjVhZTYxZjY4NjhkZjhhZjk3ZmJmOWVlMDI3OTNiNGE4ZTY=
|
@@ -40,7 +40,7 @@ CabooseStation.prototype = {
|
|
40
40
|
|
41
41
|
subnav: function(id, href)
|
42
42
|
{
|
43
|
-
this.modal.set_width(400);
|
43
|
+
//this.modal.set_width(400);
|
44
44
|
|
45
45
|
$('#station > ul > li').each(function(i, li) {
|
46
46
|
id2 = $(li).attr('id').replace('nav_item_', '');
|
@@ -54,7 +54,11 @@ CabooseStation.prototype = {
|
|
54
54
|
$('#station ul li#nav_item_' + id + ' ul').show();
|
55
55
|
|
56
56
|
// Set the height of the selected subnav
|
57
|
-
var
|
58
|
-
$('#station
|
57
|
+
var h = $('#station ul li.selected ul').outerHeight(true);
|
58
|
+
var h2 = $('#station').outerHeight(true);
|
59
|
+
if (h2 > h) h = h2
|
60
|
+
$('#station ul li#nav_item_' + id + ' ul').height(h);
|
61
|
+
|
62
|
+
this.modal.resize(400, h);
|
59
63
|
}
|
60
64
|
};
|
@@ -0,0 +1,54 @@
|
|
1
|
+
class Caboose::CorePlugin < Caboose::CaboosePlugin
|
2
|
+
|
3
|
+
def self.admin_nav(nav, user, page)
|
4
|
+
return nav if user.nil?
|
5
|
+
|
6
|
+
item = {
|
7
|
+
'id' => 'profile',
|
8
|
+
'text' => 'Profile',
|
9
|
+
'children' => []
|
10
|
+
}
|
11
|
+
item['children'] << { 'id' => 'my-account' , 'text' => 'Edit Profile' , 'href' => '/my-account' , 'modal' => false }
|
12
|
+
item['children'] << { 'id' => 'logout' , 'text' => 'Logout' , 'href' => '/logout' , 'modal' => false }
|
13
|
+
nav << item
|
14
|
+
|
15
|
+
item = {
|
16
|
+
'id' => 'core',
|
17
|
+
'text' => 'Settings',
|
18
|
+
'children' => []
|
19
|
+
}
|
20
|
+
|
21
|
+
item['children'] << { 'id' => 'users' , 'text' => 'Users' , 'href' => '/admin/users' , 'modal' => false } if user.is_allowed('users' , 'view')
|
22
|
+
item['children'] << { 'id' => 'roles' , 'text' => 'Roles' , 'href' => '/admin/roles' , 'modal' => false } if user.is_allowed('roles' , 'view')
|
23
|
+
item['children'] << { 'id' => 'permissions' , 'text' => 'Permissions' , 'href' => '/admin/permissions' , 'modal' => false } if user.is_allowed('permissions' , 'view')
|
24
|
+
item['children'] << { 'id' => 'variables' , 'text' => 'Variables' , 'href' => '/admin/settings' , 'modal' => false } if user.is_allowed('settings' , 'view')
|
25
|
+
|
26
|
+
nav << item if item['children'].count > 0
|
27
|
+
|
28
|
+
item = {
|
29
|
+
'id' => 'content',
|
30
|
+
'text' => 'Content',
|
31
|
+
'children' => []
|
32
|
+
}
|
33
|
+
|
34
|
+
item['children'] << { 'id' => 'pages' , 'text' => 'Pages' , 'href' => '/admin/pages' , 'modal' => false } if user.is_allowed('pages' , 'view')
|
35
|
+
item['children'] << { 'id' => 'posts' , 'text' => 'Posts' , 'href' => '/admin/posts' , 'modal' => false } if user.is_allowed('posts' , 'view')
|
36
|
+
|
37
|
+
nav << item if item['children'].count > 0
|
38
|
+
return nav
|
39
|
+
end
|
40
|
+
|
41
|
+
#def self.admin_js
|
42
|
+
# return "
|
43
|
+
# $('#use_redirect_urls').click(function() {
|
44
|
+
# uru = $('#use_redirect_urls');
|
45
|
+
# val = (uru.html() == 'Enable' ? 1 : 0);
|
46
|
+
# $.ajax({
|
47
|
+
# url: '/admin/settings/toggle-redirect-urls',
|
48
|
+
# data: 'val='+val,
|
49
|
+
# succes: function(resp) { uri.html(val == 1 ? 'Disable' : 'Enable'); }
|
50
|
+
# });
|
51
|
+
# });"
|
52
|
+
#end
|
53
|
+
|
54
|
+
end
|
@@ -24,8 +24,10 @@ $(document).ready(function() {
|
|
24
24
|
|
25
25
|
<div id='station'>
|
26
26
|
<ul>
|
27
|
+
<!--
|
27
28
|
<li id='nav_item_logout'><a href='/logout'><span class='icon'></span><span class='text'>Logout</span></a>
|
28
29
|
<li id='nav_item_myaccount'><a href='/my-account'><span class='icon'></span><span class='text'>My Account</span></a>
|
30
|
+
-->
|
29
31
|
<% i = 0 %>
|
30
32
|
<% @nav.each do |item| %>
|
31
33
|
<% id = item['id'].nil? ? i.to_s : item['id'] %>
|
data/lib/caboose.rb
CHANGED
@@ -9,7 +9,7 @@ module Caboose
|
|
9
9
|
@@assets_path = "assets"
|
10
10
|
|
11
11
|
mattr_accessor :plugins
|
12
|
-
@@plugins = ['Caboose::
|
12
|
+
@@plugins = ['Caboose::CorePlugin']
|
13
13
|
|
14
14
|
# Any paths to modeljs javascript files
|
15
15
|
mattr_accessor :modeljs_js_files
|
data/lib/caboose/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caboose-cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.67
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
@@ -193,23 +193,18 @@ files:
|
|
193
193
|
- app/models/caboose/asset.rb
|
194
194
|
- app/models/caboose/authenticator.rb
|
195
195
|
- app/models/caboose/caboose_plugin.rb
|
196
|
+
- app/models/caboose/core_plugin.rb
|
196
197
|
- app/models/caboose/menu_block.rb
|
197
198
|
- app/models/caboose/page.rb
|
198
199
|
- app/models/caboose/page_bar_generator.rb
|
199
200
|
- app/models/caboose/page_permission.rb
|
200
|
-
- app/models/caboose/page_plugin.rb
|
201
201
|
- app/models/caboose/pager.rb
|
202
202
|
- app/models/caboose/permission.rb
|
203
|
-
- app/models/caboose/permission_plugin.rb
|
204
203
|
- app/models/caboose/post.rb
|
205
|
-
- app/models/caboose/post_plugin.rb
|
206
204
|
- app/models/caboose/role.rb
|
207
|
-
- app/models/caboose/role_plugin.rb
|
208
205
|
- app/models/caboose/setting.rb
|
209
|
-
- app/models/caboose/settings_plugin.rb
|
210
206
|
- app/models/caboose/std_class.rb
|
211
207
|
- app/models/caboose/user.rb
|
212
|
-
- app/models/caboose/user_plugin.rb
|
213
208
|
- app/views/caboose/admin/index.html.erb
|
214
209
|
- app/views/caboose/application/show.html.erb
|
215
210
|
- app/views/caboose/extras/error.html.erb
|
@@ -1,45 +0,0 @@
|
|
1
|
-
class Caboose::PagePlugin < Caboose::CaboosePlugin
|
2
|
-
|
3
|
-
def self.admin_nav(nav, user, page)
|
4
|
-
return nav if user.nil? || !user.is_allowed('pages', 'view')
|
5
|
-
|
6
|
-
item = {
|
7
|
-
'id' => 'pages',
|
8
|
-
'text' => 'Pages',
|
9
|
-
'children' => [],
|
10
|
-
'href' => '/admin/pages',
|
11
|
-
'modal' => false
|
12
|
-
#'show_children_default' => true
|
13
|
-
}
|
14
|
-
|
15
|
-
#is_admin = user.is_allowed('all', 'all')
|
16
|
-
#actions = Caboose::Page.permissible_actions(user.id, page.id)
|
17
|
-
#if (actions.include?('edit') || is_admin)
|
18
|
-
# item['children'] << { 'href' => "/pages/#{page.id}/sitemap" , 'text' => 'Site Map This Page' }
|
19
|
-
# item['children'] << { 'href' => "/pages/#{page.id}/edit" , 'text' => 'Edit Page Content' }
|
20
|
-
# item['children'] << { 'href' => "/pages/#{page.id}/edit-settings" , 'text' => 'Edit Page Settings', 'modal' => false }
|
21
|
-
#
|
22
|
-
# #uru = session['use_redirect_urls'].nil? ? true : session['use_redirect_urls']
|
23
|
-
# #item['children'] << { 'id' => 'use_redirect_urls', 'href' => '#', 'text' => '' + (uru ? 'Disable' : 'Enable') + ' Redirect Urls' }
|
24
|
-
#end
|
25
|
-
#if (user.is_allowed('pages', 'add') || is_admin)
|
26
|
-
# item['children'] << { 'href' => "/pages/new?parent_id=#{page.id}" , 'text' => 'New Page', 'modal' => true }
|
27
|
-
#end
|
28
|
-
nav << item
|
29
|
-
return nav
|
30
|
-
end
|
31
|
-
|
32
|
-
def self.admin_js
|
33
|
-
return "
|
34
|
-
$('#use_redirect_urls').click(function() {
|
35
|
-
uru = $('#use_redirect_urls');
|
36
|
-
val = (uru.html() == 'Enable' ? 1 : 0);
|
37
|
-
$.ajax({
|
38
|
-
url: '/admin/settings/toggle-redirect-urls',
|
39
|
-
data: 'val='+val,
|
40
|
-
succes: function(resp) { uri.html(val == 1 ? 'Disable' : 'Enable'); }
|
41
|
-
});
|
42
|
-
});"
|
43
|
-
end
|
44
|
-
|
45
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
class Caboose::PermissionPlugin < Caboose::CaboosePlugin
|
2
|
-
|
3
|
-
def self.admin_nav(nav, user, page)
|
4
|
-
return nav if user.nil? || !user.is_allowed('permissions', 'view')
|
5
|
-
|
6
|
-
item = {
|
7
|
-
'id' => 'permissions',
|
8
|
-
'text' => 'Permissions',
|
9
|
-
'children' => []
|
10
|
-
}
|
11
|
-
if (user.is_allowed('permissions', 'view'))
|
12
|
-
item['children'] << {
|
13
|
-
'href' => '/admin/permissions',
|
14
|
-
'text' => 'View All Permissions'
|
15
|
-
}
|
16
|
-
end
|
17
|
-
if (user.is_allowed('permissions', 'add'))
|
18
|
-
item['children'] << {
|
19
|
-
'href' => '/admin/permissions/new',
|
20
|
-
'text' => 'New Permission'
|
21
|
-
}
|
22
|
-
end
|
23
|
-
nav << item
|
24
|
-
return nav
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
class Caboose::PostPlugin < Caboose::CaboosePlugin
|
2
|
-
|
3
|
-
def self.admin_nav(nav, user, page)
|
4
|
-
return nav if user.nil? || !user.is_allowed('pages', 'view')
|
5
|
-
|
6
|
-
item = {
|
7
|
-
'id' => 'posts',
|
8
|
-
'text' => 'Posts',
|
9
|
-
'children' => []
|
10
|
-
#'show_children_default' => true
|
11
|
-
}
|
12
|
-
item['children'] << {
|
13
|
-
'href' => "/admin/posts",
|
14
|
-
'text' => 'New Post',
|
15
|
-
'modal' => true
|
16
|
-
}
|
17
|
-
if (user.is_allowed('posts', 'add'))
|
18
|
-
item['children'] << {
|
19
|
-
'href' => "/admin/posts/new",
|
20
|
-
'text' => 'New Post',
|
21
|
-
'modal' => true
|
22
|
-
}
|
23
|
-
end
|
24
|
-
nav << item
|
25
|
-
return nav
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
@@ -1,28 +0,0 @@
|
|
1
|
-
class Caboose::RolePlugin < Caboose::CaboosePlugin
|
2
|
-
|
3
|
-
def self.admin_nav(nav, user, page)
|
4
|
-
return nav if user.nil? || !user.is_allowed('roles', 'view')
|
5
|
-
|
6
|
-
item = {
|
7
|
-
'id' => 'roles',
|
8
|
-
'text' => 'Roles',
|
9
|
-
'children' => []
|
10
|
-
}
|
11
|
-
if (user.is_allowed('roles', 'view'))
|
12
|
-
item['children'] << {
|
13
|
-
'href' => '/admin/roles',
|
14
|
-
'text' => 'View All Roles',
|
15
|
-
'modal' => true
|
16
|
-
}
|
17
|
-
end
|
18
|
-
if (user.is_allowed('roles', 'add'))
|
19
|
-
item['children'] << {
|
20
|
-
'href' => '/admin/roles/new',
|
21
|
-
'text' => 'New Role'
|
22
|
-
}
|
23
|
-
end
|
24
|
-
nav << item
|
25
|
-
return nav
|
26
|
-
end
|
27
|
-
|
28
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
class Caboose::SettingsPlugin < Caboose::CaboosePlugin
|
2
|
-
|
3
|
-
def self.admin_nav(nav, user, page)
|
4
|
-
return nav if user.nil? || !user.is_allowed('settings', 'view')
|
5
|
-
|
6
|
-
item = {
|
7
|
-
'id' => 'settings',
|
8
|
-
'text' => 'Settings',
|
9
|
-
'children' => []
|
10
|
-
}
|
11
|
-
if (user.is_allowed('settings', 'view'))
|
12
|
-
item['children'] << {
|
13
|
-
'href' => '/admin/settings',
|
14
|
-
'text' => 'View All Settings'
|
15
|
-
}
|
16
|
-
end
|
17
|
-
if (user.is_allowed('settings', 'add'))
|
18
|
-
item['children'] << {
|
19
|
-
'href' => '/admin/settings/new',
|
20
|
-
'text' => 'New Setting'
|
21
|
-
}
|
22
|
-
end
|
23
|
-
nav << item
|
24
|
-
return nav
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
class Caboose::UserPlugin < Caboose::CaboosePlugin
|
2
|
-
|
3
|
-
def self.admin_nav(nav, user = nil, page = nil)
|
4
|
-
return nav if user.nil? || !user.is_allowed('users', 'view')
|
5
|
-
|
6
|
-
item = {
|
7
|
-
'id' => 'users',
|
8
|
-
'href' => '/admin/users',
|
9
|
-
'text' => 'Users',
|
10
|
-
'children' => []
|
11
|
-
}
|
12
|
-
if (user.is_allowed('users', 'view'))
|
13
|
-
item['children'] << {
|
14
|
-
'href' => '/admin/users',
|
15
|
-
'text' => 'View All Users',
|
16
|
-
'modal' => true,
|
17
|
-
}
|
18
|
-
end
|
19
|
-
if (user.is_allowed('users', 'add'))
|
20
|
-
item['children'] << {
|
21
|
-
'href' => '/admin/users/new',
|
22
|
-
'text' => 'New User',
|
23
|
-
'modal' => true,
|
24
|
-
}
|
25
|
-
end
|
26
|
-
nav << item
|
27
|
-
return nav
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|