caboose-cms 0.2.89 → 0.2.90
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/modal_integration.js +15 -0
- data/app/controllers/caboose/application_controller.rb +10 -1
- data/app/models/caboose/core_plugin.rb +12 -9
- data/app/views/caboose/pages/admin_edit_general.html.erb +38 -11
- data/lib/caboose/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
YzQ4ZjEzOGFlZmM3OWUzYjI0MDZkY2Q2ODIxYTdlOTNjMjQ2NDE4OQ==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
YWMwODQ0OTZmMjgxMDkwMTc0M2VmYzJiMzg0MDBiNThkNDJmODBkYQ==
|
|
7
7
|
!binary "U0hBNTEy":
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
ZDQ5ZDBkZGZmNTA1Njk4Y2Y2N2RkZDNjYjcyYmU1MjE5ODA4MDRmYTJlNGMy
|
|
10
|
+
ZDkzNGZhMTM5Yjc5ODk5YzE0ODY5YmUzOWUxOTcyZjVlMTkyODg5ODFjZWY0
|
|
11
|
+
NzJhMjlmZjdlYzhjN2YzNzRjNTM4NzM4OTI3NTRhYTBhYTBlOGQ=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
ZDAzODYzZjBlNzQ2OWQwNWZiMTA2OTk4NWFlMThjOGJkZjUxMDVlMWE2Y2Q5
|
|
14
|
+
NjIyNjI3Mjg2MmJiMTBhODY1MGM0ZmFmNzUyMjI5OTZlNmY5OWQ3ZjE5OTRh
|
|
15
|
+
OGNlMzc5YzEwODczZjBiZDdkZDllZmY2Mzk2NDdhNDAwODJmZTI=
|
|
@@ -66,6 +66,21 @@ function caboose_modal(el)
|
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
function caboose_modal_url(url)
|
|
70
|
+
{
|
|
71
|
+
$.colorbox({
|
|
72
|
+
href: url,
|
|
73
|
+
iframe: true,
|
|
74
|
+
innerWidth: 200,
|
|
75
|
+
innerHeight: 50,
|
|
76
|
+
scrolling: false,
|
|
77
|
+
transition: 'fade',
|
|
78
|
+
closeButton: false,
|
|
79
|
+
onComplete: caboose_fix_colorbox,
|
|
80
|
+
opacity: 0.50
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
|
|
69
84
|
function caboose_fix_colorbox() {
|
|
70
85
|
var padding = 21; // 21 is default
|
|
71
86
|
$("#cboxTopLeft" ).css('background', '#111');
|
|
@@ -69,7 +69,7 @@ module Caboose
|
|
|
69
69
|
def user_is_allowed(resource, action)
|
|
70
70
|
if (!logged_in?)
|
|
71
71
|
redirect_to "/login?return_url=" + URI.encode(request.fullpath)
|
|
72
|
-
return
|
|
72
|
+
return false
|
|
73
73
|
end
|
|
74
74
|
|
|
75
75
|
@user = logged_in_user
|
|
@@ -82,6 +82,15 @@ module Caboose
|
|
|
82
82
|
return true
|
|
83
83
|
end
|
|
84
84
|
|
|
85
|
+
# Redirects to login if not logged in.
|
|
86
|
+
def verify_logged_in
|
|
87
|
+
if (!logged_in?)
|
|
88
|
+
redirect_to "/login?return_url=" + URI.encode(request.fullpath)
|
|
89
|
+
return false
|
|
90
|
+
end
|
|
91
|
+
return true
|
|
92
|
+
end
|
|
93
|
+
|
|
85
94
|
# Removes a given parameter from a URL querystring
|
|
86
95
|
def reject_param(url, param)
|
|
87
96
|
arr = url.split('?')
|
|
@@ -2,15 +2,18 @@ class Caboose::CorePlugin < Caboose::CaboosePlugin
|
|
|
2
2
|
|
|
3
3
|
def self.admin_nav(nav, user, page)
|
|
4
4
|
return nav if user.nil?
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
|
|
6
|
+
nav << { 'id' => 'logout' , 'text' => 'Logout' , 'href' => '/logout' , 'modal' => false }
|
|
7
|
+
nav << { 'id' => 'my-account' , 'text' => 'My Account' , 'href' => '/my-account' , 'modal' => true }
|
|
8
|
+
|
|
9
|
+
#item = {
|
|
10
|
+
# 'id' => 'profile',
|
|
11
|
+
# 'text' => 'Profile',
|
|
12
|
+
# 'children' => []
|
|
13
|
+
#}
|
|
14
|
+
#item['children'] << { 'id' => 'my-account' , 'text' => 'Edit Profile' , 'href' => '/my-account' , 'modal' => false }
|
|
15
|
+
#item['children'] << { 'id' => 'logout' , 'text' => 'Logout' , 'href' => '/logout' , 'modal' => false }
|
|
16
|
+
#nav << item
|
|
14
17
|
|
|
15
18
|
item = {
|
|
16
19
|
'id' => 'core',
|
|
@@ -1,19 +1,46 @@
|
|
|
1
1
|
|
|
2
2
|
<%= render :partial => 'caboose/pages/admin_header' %>
|
|
3
3
|
|
|
4
|
-
<p>URI: /<span id='uri'><%= @page.uri %></span></p>
|
|
5
|
-
<
|
|
6
|
-
<
|
|
7
|
-
<
|
|
8
|
-
<
|
|
9
|
-
<
|
|
10
|
-
<
|
|
11
|
-
<
|
|
12
|
-
<
|
|
13
|
-
<
|
|
14
|
-
<
|
|
4
|
+
<p class='uri'>URI: /<span id='uri'><%= @page.uri %></span></p>
|
|
5
|
+
<div class='field_with_explanation'><div id='page_<%= @page.id %>_title' ></div><span class='explanation'>The title of the page.</span></div>
|
|
6
|
+
<div class='field_with_explanation'><div id='page_<%= @page.id %>_menu_title' ></div><span class='explanation'>The menu title is an abbreviated form of the title that is used in navigation menus and crumb trails.</span></div>
|
|
7
|
+
<div class='field_with_explanation'><div id='page_<%= @page.id %>_parent_id' ></div><span class='explanation'>This page's parent page.</span></div>
|
|
8
|
+
<div class='field_with_explanation'><div id='page_<%= @page.id %>_slug' ></div><span class='explanation'>The portion of the URL that this page represents.</span></div>
|
|
9
|
+
<div class='field_with_explanation'><div id='page_<%= @page.id %>_alias' ></div><span class='explanation'>Starts the URL over at the domain root.</span></div>
|
|
10
|
+
<div class='field_with_explanation'><div id='page_<%= @page.id %>_redirect_url' ></div><span class='explanation'>If the redirect URL field is set, then this page will simply redirect to that URL instead of showing the page itself.</span></div>
|
|
11
|
+
<div class='field_with_explanation'><div id='page_<%= @page.id %>_hide' ></div><span class='explanation'>Whether or not this page is displayed in the menu.</span></div>
|
|
12
|
+
<div class='field_with_explanation'><div id='page_<%= @page.id %>_layout' ></div><span class='explanation'>Specify a specific layout file for this page.</span></div>
|
|
13
|
+
<div class='field_with_explanation'><div id='page_<%= @page.id %>_custom_sort_children' ></div><span class='explanation'>Sort child pages alphabetically or custom.</span></div>
|
|
14
|
+
<div class='field_with_explanation'><div id='page_<%= @page.id %>_content_format' ></div><span class='explanation'>Specify whether or not you want to embed ruby code in your page.</span></div>
|
|
15
15
|
|
|
16
16
|
<%= render :partial => 'caboose/pages/admin_footer' %>
|
|
17
|
+
|
|
18
|
+
<% content_for :caboose_css do %>
|
|
19
|
+
<style type='text/css'>
|
|
20
|
+
|
|
21
|
+
p.uri {
|
|
22
|
+
background: #efefef;
|
|
23
|
+
border: #999 1px solid;
|
|
24
|
+
padding: 10px;
|
|
25
|
+
position: absolute;
|
|
26
|
+
top: 67px;
|
|
27
|
+
left: 0;
|
|
28
|
+
height: 16px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
div.field_with_explanation {
|
|
32
|
+
width: 420px;
|
|
33
|
+
background: #efefef;
|
|
34
|
+
margin-bottom: 12px;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
span.explanation {
|
|
38
|
+
display: block;
|
|
39
|
+
padding: 8px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
</style>
|
|
43
|
+
<% end %>
|
|
17
44
|
<% content_for :caboose_js do %>
|
|
18
45
|
<script type='text/javascript'>
|
|
19
46
|
|
data/lib/caboose/version.rb
CHANGED