caboose-cms 0.6.29 → 0.6.30
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/admin_main.js +8 -0
- data/app/assets/javascripts/caboose/model/index_table.js +19 -6
- data/app/assets/javascripts/caboose/model/model.js +1 -1
- data/app/assets/stylesheets/caboose/admin_main.css +42 -0
- data/app/controllers/caboose/orders_controller.rb +1 -1
- data/app/models/caboose/comment_routes.rb +76 -0
- data/app/views/caboose/orders/admin_index.html.erb +3 -1
- data/lib/caboose/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ODMwZTNmNjZmMWZhNzdmZjBhOTNhZTQwMDk0OTEzOTI0MGVhOTMzYg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
N2Y2MGU4ODljYzNhMmFjMjNiZDk2ODcwOTg4ODI0NmRiOGYxNGI3Yg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NmI5NDc3NDIxZTdhODkzMzNjMTIzMDMxZTYwMzY3M2Q2NTVmYWQ5Nzc3N2M2
|
10
|
+
YTk4M2QzZDNjOWEwZmNiYTFlYTcyNGM4MDk5ZmFjMjUxZjRhOTA1NjkwNDRl
|
11
|
+
YmE2NjI4ZTZhZWVkYTQwMjM2OWM3NDY2Y2ExOTBiNThjNWY5OTA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MzAzZjIzMDgzZDBmM2I3OWU3MGY5YzIyMTQ0NTMzODFhMWJiNDZiYmNiM2Ex
|
14
|
+
YjY5YTBjMWZiYjU3OGQ5M2UxMzEwYmRiY2RiZDUyZjgxMGNmM2YzNmVmNDZm
|
15
|
+
MjA5OTM4MjZmOGJiODVjMmJlNjZhY2U0NGNkMTYxMzc5Y2I0NjU=
|
@@ -99,17 +99,27 @@ IndexTable.prototype = {
|
|
99
99
|
options: { page: 1 },
|
100
100
|
params: {}
|
101
101
|
},
|
102
|
+
|
103
|
+
add_to_url: function(url, str)
|
104
|
+
{
|
105
|
+
if (url.indexOf('?') > -1)
|
106
|
+
{
|
107
|
+
bu = url.split('?');
|
108
|
+
return bu.shift() + str + '?' + bu.join('?');
|
109
|
+
}
|
110
|
+
return url + str;
|
111
|
+
},
|
102
112
|
|
103
113
|
// Constructor
|
104
114
|
init: function(params) {
|
105
115
|
for (var thing in params)
|
106
116
|
this[thing] = params[thing];
|
107
117
|
|
108
|
-
var that = this;
|
109
|
-
if (!this.refresh_url ) this.refresh_url
|
110
|
-
if (!this.bulk_update_url ) this.bulk_update_url
|
111
|
-
if (!this.bulk_delete_url ) this.bulk_delete_url
|
112
|
-
if (!this.add_url ) this.add_url
|
118
|
+
var that = this;
|
119
|
+
if (!this.refresh_url ) this.refresh_url = this.add_to_url(this.base_url, '/json');
|
120
|
+
if (!this.bulk_update_url ) this.bulk_update_url = this.add_to_url(this.base_url, '/bulk');
|
121
|
+
if (!this.bulk_delete_url ) this.bulk_delete_url = this.add_to_url(this.base_url, '/bulk');
|
122
|
+
if (!this.add_url ) this.add_url = this.base_url;
|
113
123
|
|
114
124
|
$.each(this.fields, function(i, f) {
|
115
125
|
if (f.editable == null) f.editable = true;
|
@@ -821,7 +831,10 @@ IndexTable.prototype = {
|
|
821
831
|
var form = $('<form/>').attr('id', 'new_form')
|
822
832
|
.append($('<input/>').attr('type', 'hidden').attr('name', 'authenticity_token').val(that.form_authenticity_token));
|
823
833
|
$.each(this.new_model_fields, function(i, f) {
|
824
|
-
|
834
|
+
if (f.type == 'hidden')
|
835
|
+
form.append($('<input/>').attr('type', 'hidden').attr('name', f.name).val(f.value));
|
836
|
+
else
|
837
|
+
form.append($('<p/>').append($('<input/>').attr('type', 'text').attr('name', f.name).attr('placeholder', f.nice_name).css('width', '' + f.width + 'px')));
|
825
838
|
});
|
826
839
|
form.append($('<div/>').attr('id', that.container + '_new_message'));
|
827
840
|
form.append($('<p>')
|
@@ -379,6 +379,48 @@ Page Bar Generator
|
|
379
379
|
#search_form input[type='submit'] { height: 35px; padding: 0 12px; }
|
380
380
|
|
381
381
|
|
382
|
+
/******************************************************************************/
|
383
|
+
|
384
|
+
#htabs_container {
|
385
|
+
width: 100%;
|
386
|
+
}
|
387
|
+
#htabs {
|
388
|
+
width: 100%;
|
389
|
+
list-style: none;
|
390
|
+
margin: 0 0 0 -30px;
|
391
|
+
padding: 0;
|
392
|
+
border-top: #ccc 0px solid;
|
393
|
+
}
|
394
|
+
#htabs li {
|
395
|
+
display: inline-block;
|
396
|
+
list-style: none;
|
397
|
+
margin: 0;
|
398
|
+
padding: 0;
|
399
|
+
text-align: center;
|
400
|
+
}
|
401
|
+
#htabs a {
|
402
|
+
display: block;
|
403
|
+
margin: 0;
|
404
|
+
padding: 16px 12px 12px 12px;
|
405
|
+
text-decoration: none;
|
406
|
+
background: #efefef;
|
407
|
+
border-bottom: #ccc 1px solid;
|
408
|
+
color: #000;
|
409
|
+
}
|
410
|
+
#htabs a:hover {
|
411
|
+
background: #666;
|
412
|
+
color: #fff;
|
413
|
+
}
|
414
|
+
#htabs li.selected a {
|
415
|
+
background: transparent;
|
416
|
+
color: #000;
|
417
|
+
font-weight: bold;
|
418
|
+
border-bottom: #fff 1px solid;
|
419
|
+
}
|
420
|
+
#htabs_content {
|
421
|
+
clear: left;
|
422
|
+
}
|
423
|
+
|
382
424
|
/******************************************************************************/
|
383
425
|
|
384
426
|
#tabs {
|
@@ -0,0 +1,76 @@
|
|
1
|
+
module Caboose
|
2
|
+
class CommentRoutes
|
3
|
+
|
4
|
+
def CommentRoutes.parse_controllers
|
5
|
+
|
6
|
+
classes = []
|
7
|
+
files = Dir.glob(Rails.root.join('app', 'controllers','*.rb'))
|
8
|
+
for file in files
|
9
|
+
f = Rails.root.join('app', 'controllers', file)
|
10
|
+
f2 = File.open(f, "r")
|
11
|
+
|
12
|
+
class_name = nil
|
13
|
+
class_priority = 20
|
14
|
+
route_priority = 20
|
15
|
+
uris = []
|
16
|
+
actions = []
|
17
|
+
f2.each_line do |line|
|
18
|
+
line = line.strip
|
19
|
+
if line =~ /^(.*?)class (.*?)Controller(.*?)$/
|
20
|
+
class_name = line.gsub(/^(.*?)class (.*?)Controller(.*?)$/, '\2').gsub(/([A-Z])/, '_\1').downcase
|
21
|
+
class_name[0] = '' if class_name[0] == '_'
|
22
|
+
next
|
23
|
+
end
|
24
|
+
if line =~ /# CLASS PRIORITY: \d/
|
25
|
+
class_priority = line.gsub(/# ROUTES PRIORITY: (\d*?)$/, '\1').to_i
|
26
|
+
next
|
27
|
+
end
|
28
|
+
if line =~ /# ROUTE PRIORITY: \d/
|
29
|
+
route_priority = line.gsub(/# ROUTE PRIORITY: (\d*?)$/, '\1').to_i
|
30
|
+
next
|
31
|
+
end
|
32
|
+
if line.starts_with?('def ')
|
33
|
+
actions << [line.gsub('def ', ''), uris, route_priority]
|
34
|
+
uris = []
|
35
|
+
route_priority = 20
|
36
|
+
end
|
37
|
+
if line =~ /# GET (.*?)/ then uris << "get \"#{line.gsub(/# GET (.*?)/ , '\1')}\""
|
38
|
+
elsif line =~ /# POST (.*?)/ then uris << "post \"#{line.gsub(/# POST (.*?)/ , '\1')}\""
|
39
|
+
elsif line =~ /# PUT (.*?)/ then uris << "put \"#{line.gsub(/# PUT (.*?)/ , '\1')}\""
|
40
|
+
elsif line =~ /# DELETE (.*?)/ then uris << "delete \"#{line.gsub(/# DELETE (.*?)/ , '\1')}\""
|
41
|
+
end
|
42
|
+
end
|
43
|
+
classes << [class_name, actions, class_priority]
|
44
|
+
end
|
45
|
+
puts "--------------------------------------------------------------------"
|
46
|
+
routes = []
|
47
|
+
classes.sort_by{ |arr| arr[2] }.each do |carr|
|
48
|
+
|
49
|
+
class_name = carr[0]
|
50
|
+
actions = carr[1]
|
51
|
+
|
52
|
+
# Get the longest URI so we can make routes that line up vertically
|
53
|
+
longest = ''
|
54
|
+
actions.each do |action, uris|
|
55
|
+
uris.each do |uri|
|
56
|
+
longest = uri if uri.length > longest.length
|
57
|
+
end
|
58
|
+
end
|
59
|
+
length = longest.length + 1
|
60
|
+
|
61
|
+
# Make the route line
|
62
|
+
actions.sort_by{ |arr| arr[2] }.each do |arr|
|
63
|
+
action = arr[0]
|
64
|
+
uris = arr[1]
|
65
|
+
uris.each do |uri|
|
66
|
+
puts "#{uri.ljust(length, ' ')} => \"#{class_name}\##{action}\""
|
67
|
+
routes << "#{uri.ljust(length, ' ')} => \"#{class_name}\##{action}\""
|
68
|
+
end
|
69
|
+
end
|
70
|
+
puts ""
|
71
|
+
end
|
72
|
+
return routes
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
76
|
+
end
|
@@ -15,7 +15,9 @@
|
|
15
15
|
<optgroup label='Status' style='width: 100px'>
|
16
16
|
<option value=''>-- All customers --</option>
|
17
17
|
<% @customers.each do |c| %>
|
18
|
-
<option value='<%= c.id %>'<%= @pager.params['customer_id'] == c.id ? " selected='true'" : ''
|
18
|
+
<option value='<%= c.id %>'<%= @pager.params['customer_id'] == c.id ? " selected='true'" : '' %>>
|
19
|
+
<%= c.first_name.blank? && c.last_name.blank? ? c.username : "#{c.last_name}, #{c.first_name}" %>
|
20
|
+
</option>
|
19
21
|
<% end %>
|
20
22
|
</optgroup>
|
21
23
|
</select></p>
|
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.6.
|
4
|
+
version: 0.6.30
|
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-09-
|
11
|
+
date: 2015-09-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|
@@ -696,6 +696,7 @@ files:
|
|
696
696
|
- app/models/caboose/calendar_event_group.rb
|
697
697
|
- app/models/caboose/category.rb
|
698
698
|
- app/models/caboose/category_membership.rb
|
699
|
+
- app/models/caboose/comment_routes.rb
|
699
700
|
- app/models/caboose/core_plugin.rb
|
700
701
|
- app/models/caboose/crumbtrail.rb
|
701
702
|
- app/models/caboose/customization_membership.rb
|