burp_cms 1.3.22 → 1.3.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/burp/lib/fileupload.js +1 -1
- data/app/assets/stylesheets/burp/application.less +6 -0
- data/app/assets/stylesheets/burp/views/pages/index.less +1 -1
- data/app/controllers/burp/application_controller.rb +5 -1
- data/app/lib/burp/group.rb +8 -0
- data/app/lib/burp/link.rb +10 -5
- data/app/views/burp/files/index.html.erb +56 -58
- data/app/views/burp/pages/index.html.erb +2 -4
- data/app/views/layouts/burp/application.html.erb +14 -9
- data/config/routes.rb +1 -1
- data/lib/burp/version.rb +1 -1
- data/lib/burp_cms.rb +23 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7eb5a2a04169b04a4ca36e4874d43359156d4ac7
|
4
|
+
data.tar.gz: c493348b8edb342492f771f94e19e319a669cbc2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 351d8d0f2bcc0657ffa87227776cacd733b0dc9489c051ee3c11e1ac989cd8c26b7b05f337b7d60b45f28b969ec72a9bd2cb5327203d52297963a36f5c27026f
|
7
|
+
data.tar.gz: 551b8d61164d2f5708b8ad1999fb2f13a2360146a33e9779601d4be9ac34b54db6b53f95868c2dcfbfc3ea573cba414ace675871c3956545205b1e5b878a8dde
|
@@ -1205,7 +1205,7 @@ qq.extend(qq.UploadHandlerXhr.prototype, {
|
|
1205
1205
|
if(window['jQuery']) {
|
1206
1206
|
var csrf_token = jQuery('meta[name=csrf-token]').attr('content');
|
1207
1207
|
if(csrf_token) {
|
1208
|
-
xhr.setRequestHeader("X-CSRF-Token",
|
1208
|
+
xhr.setRequestHeader("X-CSRF-Token", csrf_token);
|
1209
1209
|
}
|
1210
1210
|
}
|
1211
1211
|
|
@@ -28,6 +28,10 @@ body > .container {
|
|
28
28
|
padding: 60px 0px 100px;
|
29
29
|
}
|
30
30
|
|
31
|
+
.container > .row {
|
32
|
+
margin: 0px 20px;
|
33
|
+
}
|
34
|
+
|
31
35
|
.controls > .input > textarea {
|
32
36
|
width: 500px;
|
33
37
|
}
|
@@ -50,6 +54,8 @@ span.buttons {
|
|
50
54
|
display: block;
|
51
55
|
}
|
52
56
|
|
57
|
+
|
58
|
+
|
53
59
|
td {
|
54
60
|
padding: 1px 50px 1px 0px;
|
55
61
|
}
|
@@ -16,6 +16,11 @@ module Burp
|
|
16
16
|
@body_classes += " #{(request.user_agent || '').match(/(lion)/i) ? "noscrollbars" : "scrollbars"} "
|
17
17
|
end
|
18
18
|
|
19
|
+
helper_method :menu
|
20
|
+
def menu
|
21
|
+
Burp.menu(request)
|
22
|
+
end
|
23
|
+
|
19
24
|
private
|
20
25
|
|
21
26
|
def access
|
@@ -35,7 +40,6 @@ module Burp
|
|
35
40
|
username == Rails.application.config.burp_username && password == Rails.application.config.burp_password
|
36
41
|
end
|
37
42
|
end
|
38
|
-
|
39
43
|
end
|
40
44
|
end
|
41
45
|
|
data/app/lib/burp/group.rb
CHANGED
@@ -106,5 +106,13 @@ module Burp
|
|
106
106
|
to_hash.hash
|
107
107
|
end
|
108
108
|
|
109
|
+
def self.bootstrap_nav(group)
|
110
|
+
%{
|
111
|
+
<ul class="nav">
|
112
|
+
#{group.children.map { |child| child.is_a?(Link) ? "<li class=\"#{child.css_class}\">#{child.to_html}</li>" : "" }.join("\n\t\t\t")}
|
113
|
+
</ul>
|
114
|
+
}.html_safe
|
115
|
+
end
|
116
|
+
|
109
117
|
end
|
110
118
|
end
|
data/app/lib/burp/link.rb
CHANGED
@@ -3,11 +3,16 @@ module Burp
|
|
3
3
|
|
4
4
|
attr_reader :id
|
5
5
|
attr_accessor :url,:name
|
6
|
+
attr_accessor :css_class
|
6
7
|
|
7
|
-
def initialize(options)
|
8
|
-
self.name
|
9
|
-
self.url
|
10
|
-
|
8
|
+
def initialize(options)
|
9
|
+
self.name ||= options[:name]
|
10
|
+
self.url ||= options[:url]
|
11
|
+
self.css_class ||= options[:class]
|
12
|
+
|
13
|
+
self.name ||= options.keys.first
|
14
|
+
self.url ||= options.values.first
|
15
|
+
|
11
16
|
raise ArgumentError.new("Missing a url") unless url
|
12
17
|
raise ArgumentError.new("Missing a name") unless name
|
13
18
|
end
|
@@ -21,7 +26,7 @@ module Burp
|
|
21
26
|
end
|
22
27
|
|
23
28
|
def to_html(request = nil,name = nil)
|
24
|
-
%{<a class="#{current_class(request)}" #{id ? "id='#{id}'" : ""} href="#{url}">#{name || self.name}</a>}.html_safe
|
29
|
+
%{<a class="#{current_class(request)} #{css_class}" #{id ? "id='#{id}'" : ""} href="#{url}">#{name || self.name}</a>}.html_safe
|
25
30
|
end
|
26
31
|
|
27
32
|
def to_param
|
@@ -34,65 +34,63 @@
|
|
34
34
|
</table>
|
35
35
|
|
36
36
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
$.each(
|
54
|
-
|
55
|
-
errorMessage += value;
|
56
|
-
});
|
37
|
+
<% content_for :inline_javascript do %>
|
38
|
+
<script type="text/javascript" charset="utf-8">
|
39
|
+
|
40
|
+
|
41
|
+
var uploader = new qq.FileUploader({
|
42
|
+
element: document.getElementById('file-uploader'),
|
43
|
+
action: '/burp/files',
|
44
|
+
sizeLimit: 1024 * 1024 * 40,
|
45
|
+
onComplete: function(id, fileName, responseJSON){
|
46
|
+
if(responseJSON.success) {
|
47
|
+
$.get(document.location,function(data) {
|
48
|
+
$('table').replaceWith($(data).find('table'));
|
49
|
+
});
|
50
|
+
} else {
|
51
|
+
var errorMessage = "";
|
52
|
+
$.each(responseJSON.errors,function(index,error) {
|
53
|
+
$.each(error,function(key,value) {
|
54
|
+
errorMessage += value;
|
57
55
|
});
|
58
|
-
|
59
|
-
|
60
|
-
},
|
61
|
-
template: '<div class="qq-uploader">' +
|
62
|
-
'<div class="file-upload-drop-area" style="display: block;"><span>Drop files here to upload</span></div>' +
|
63
|
-
'<div class="file-upload-button btn btn-large">Click here to upload</div>' +
|
64
|
-
'<ul class="qq-upload-list"></ul>' +
|
65
|
-
'</div>',
|
66
|
-
|
67
|
-
// template for one item in file list
|
68
|
-
fileTemplate: '<li>' +
|
69
|
-
'<span class="qq-upload-file"></span>' +
|
70
|
-
'<span class="qq-upload-spinner"></span>' +
|
71
|
-
'<span class="qq-upload-size"></span>' +
|
72
|
-
'<a class="qq-upload-cancel" href="#">Cancel</a>' +
|
73
|
-
'<span class="qq-upload-failed-text">Failed</span>' +
|
74
|
-
'</li>',
|
75
|
-
|
76
|
-
classes: {
|
77
|
-
// used to get elements from templates
|
78
|
-
button: 'file-upload-button',
|
79
|
-
drop: 'file-upload-drop-area',
|
80
|
-
dropActive: 'file-upload-drop-area-active',
|
81
|
-
list: 'qq-upload-list',
|
82
|
-
|
83
|
-
file: 'qq-upload-file',
|
84
|
-
spinner: 'qq-upload-spinner',
|
85
|
-
size: 'qq-upload-size',
|
86
|
-
cancel: 'qq-upload-cancel',
|
87
|
-
|
88
|
-
// added to list item when upload completes
|
89
|
-
// used in css to hide progress spinner
|
90
|
-
success: 'qq-upload-success',
|
91
|
-
fail: 'qq-upload-fail'
|
56
|
+
});
|
57
|
+
alert(errorMessage);
|
92
58
|
}
|
93
|
-
|
94
|
-
|
95
|
-
|
59
|
+
},
|
60
|
+
template: '<div class="qq-uploader">' +
|
61
|
+
'<div class="file-upload-drop-area" style="display: block;"><span>Drop files here to upload</span></div>' +
|
62
|
+
'<div class="file-upload-button btn btn-large">Click here to upload</div>' +
|
63
|
+
'<ul class="qq-upload-list"></ul>' +
|
64
|
+
'</div>',
|
96
65
|
|
97
|
-
|
66
|
+
// template for one item in file list
|
67
|
+
fileTemplate: '<li>' +
|
68
|
+
'<span class="qq-upload-file"></span>' +
|
69
|
+
'<span class="qq-upload-spinner"></span>' +
|
70
|
+
'<span class="qq-upload-size"></span>' +
|
71
|
+
'<a class="qq-upload-cancel" href="#">Cancel</a>' +
|
72
|
+
'<span class="qq-upload-failed-text">Failed</span>' +
|
73
|
+
'</li>',
|
74
|
+
|
75
|
+
classes: {
|
76
|
+
// used to get elements from templates
|
77
|
+
button: 'file-upload-button',
|
78
|
+
drop: 'file-upload-drop-area',
|
79
|
+
dropActive: 'file-upload-drop-area-active',
|
80
|
+
list: 'qq-upload-list',
|
81
|
+
|
82
|
+
file: 'qq-upload-file',
|
83
|
+
spinner: 'qq-upload-spinner',
|
84
|
+
size: 'qq-upload-size',
|
85
|
+
cancel: 'qq-upload-cancel',
|
86
|
+
|
87
|
+
// added to list item when upload completes
|
88
|
+
// used in css to hide progress spinner
|
89
|
+
success: 'qq-upload-success',
|
90
|
+
fail: 'qq-upload-fail'
|
91
|
+
}
|
92
|
+
});
|
93
|
+
</script>
|
94
|
+
<% end %>
|
95
|
+
|
98
96
|
|
@@ -70,10 +70,9 @@
|
|
70
70
|
</div>
|
71
71
|
|
72
72
|
|
73
|
+
<% content_for :inline_javascript do %>
|
73
74
|
<script type="text/javascript" charset="utf-8">
|
74
75
|
|
75
|
-
<% content_for :inline_javascript do %>
|
76
|
-
|
77
76
|
$(function() {
|
78
77
|
|
79
78
|
// Popup for edit and new page
|
@@ -89,7 +88,6 @@
|
|
89
88
|
});
|
90
89
|
});
|
91
90
|
});
|
92
|
-
|
93
|
-
<% end %>
|
94
91
|
|
95
92
|
</script>
|
93
|
+
<% end %>
|
@@ -22,12 +22,7 @@
|
|
22
22
|
</a>
|
23
23
|
<a class="brand" href="/burp/">Burp</a>
|
24
24
|
<div class="nav-collapse collapse">
|
25
|
-
|
26
|
-
<li><%= link_to "Pages", "/burp/pages" %></li>
|
27
|
-
<li><%= Burp::Menu.count == 1 ? (link_to "Menu", edit_menu_path(Burp::Menu.all.first)) : (link_to "Menus", "/burp/menus") %></li>
|
28
|
-
<li><%= link_to "Files", "/burp/files" %></li>
|
29
|
-
<li class="markdown"><%= link_to "Help", "/burp/help" %></li>
|
30
|
-
</ul>
|
25
|
+
<%= Burp::Group.bootstrap_nav(menu) %>
|
31
26
|
</div>
|
32
27
|
</div>
|
33
28
|
</div>
|
@@ -35,6 +30,18 @@
|
|
35
30
|
|
36
31
|
<div class="container">
|
37
32
|
|
33
|
+
<% if flash[:notice] %>
|
34
|
+
<div class="alert alert-success">
|
35
|
+
<button type="button" class="close" data-dismiss="alert">×</button>
|
36
|
+
<%= flash[:notice] %>
|
37
|
+
</div>
|
38
|
+
<% elsif flash[:alert] %>
|
39
|
+
<div class="alert alert-error">
|
40
|
+
<button type="button" class="close" data-dismiss="alert">×</button>
|
41
|
+
<%= flash[:alert] %>
|
42
|
+
</div>
|
43
|
+
<% end %>
|
44
|
+
|
38
45
|
<div class="row">
|
39
46
|
<%= yield %>
|
40
47
|
</div>
|
@@ -49,9 +56,7 @@
|
|
49
56
|
</div>
|
50
57
|
|
51
58
|
<%= javascript_include_tag "burp/application" %>
|
52
|
-
|
53
|
-
<%= raw yield :inline_javascript %>
|
54
|
-
</script>
|
59
|
+
<%= raw yield :inline_javascript %>
|
55
60
|
</body>
|
56
61
|
</html>
|
57
62
|
|
data/config/routes.rb
CHANGED
data/lib/burp/version.rb
CHANGED
data/lib/burp_cms.rb
CHANGED
@@ -69,5 +69,28 @@ module Burp
|
|
69
69
|
Thread.current[:thread_local_content_directory] = path
|
70
70
|
end
|
71
71
|
|
72
|
+
def self.menu(request)
|
73
|
+
group = Group.new("")
|
74
|
+
group.children << Link.new(:name => "Pages", :url => "/burp/pages")
|
75
|
+
if Burp::Menu.count == 1
|
76
|
+
group.children << Link.new(:name => "Menu", :url => "/burp/menus/#{Burp::Menu.all.first.name}/edit")
|
77
|
+
else
|
78
|
+
group.children << Link.new(:name => "Menus", :url => "/burp/menus")
|
79
|
+
end
|
80
|
+
group.children << Link.new(:name => "Files", :url => "/burp/files")
|
81
|
+
group.children << Link.new(:name => "Help", :url => "/burp/herp", :class => "markdown")
|
82
|
+
|
83
|
+
@@menu_processors.values.each do |block|
|
84
|
+
block.call(group, request)
|
85
|
+
end
|
86
|
+
|
87
|
+
group
|
88
|
+
end
|
89
|
+
|
90
|
+
@@menu_processors = {}
|
91
|
+
|
92
|
+
def self.add_menu_processor(name, &block)
|
93
|
+
@@menu_processors[name] = block
|
94
|
+
end
|
72
95
|
|
73
96
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: burp_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Darwin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jquery-rails
|