caboose-cms 0.6.30 → 0.6.31
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/assets/javascripts/caboose/model/index_table.js +15 -5
- data/app/models/caboose/comment_routes.rb +11 -22
- 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
|
+
YmE5Nzc5MGY3NWFjYTViZGZkMDc5NTkzMGU0MDQ3NjRmNjdmOGM0NQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzY2NTE4NmQ5MzE2ZWY4OGU2MzI0ZWVkNGUzZjNlYjA5YWVmNjA5Yg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YjY0MWY1MDQwMzE4MmRhMDAzMmViZDFhYmNjYjJhNThjODk1ZjYwOTc3NDZm
|
10
|
+
ODM3MWFlNjQzOGUzMTg5YmQ4YTgyN2I4ZDY0ZmUwNzgxMzg1ZjBiMWMzYWM1
|
11
|
+
MjlhYTdkY2ZiOWViYjE5NTJjYmRiY2UwM2ZkZDc3ZDMyMTRkOGQ=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YWQ0OWYxNjAwZmY3ZWI2NTIyNmUyYWI5OWExZjVlN2EzOTEzZDhkYWE3NTlh
|
14
|
+
ODFlZWFiZDI5MWZiZTlmZTY3MmRhMGZhN2Y3NGUwZTU5YzAzNjFkMjVmMDNi
|
15
|
+
MGEzYzU2ZDEwMjIwNWU4NGY3Njk3ZTFlMWJlNzcwYzQ5MzAzNjY=
|
@@ -804,24 +804,29 @@ IndexTable.prototype = {
|
|
804
804
|
},
|
805
805
|
|
806
806
|
current_message: false,
|
807
|
-
show_message: function(el, name) {
|
807
|
+
show_message: function(el, name, after) {
|
808
808
|
var that = this;
|
809
809
|
if (that.current_message == name)
|
810
810
|
{
|
811
811
|
$('#' + that.container + '_message').slideUp(function() { $('#' + that.container + '_message').empty().css('margin-bottom', 0); });
|
812
812
|
that.current_message = false;
|
813
|
+
if (after) after();
|
813
814
|
return;
|
814
815
|
}
|
815
816
|
if (!$('#' + that.container + '_message').is(':empty'))
|
816
817
|
{
|
817
|
-
$('#' + that.container + '_message').slideUp(function() {
|
818
|
-
|
818
|
+
$('#' + that.container + '_message').slideUp(function() {
|
819
|
+
$('#' + that.container + '_message').empty().append(el).css('margin-bottom', '10px').slideDown();
|
820
|
+
if (after) after();
|
821
|
+
});
|
822
|
+
that.current_message = name;
|
819
823
|
return;
|
820
824
|
}
|
821
825
|
else
|
822
826
|
{
|
823
827
|
$('#' + that.container + '_message').hide().empty().append(el).css('margin-bottom', '10px').slideDown();
|
824
828
|
that.current_message = name;
|
829
|
+
if (after) after();
|
825
830
|
}
|
826
831
|
},
|
827
832
|
|
@@ -830,11 +835,16 @@ IndexTable.prototype = {
|
|
830
835
|
var that = this;
|
831
836
|
var form = $('<form/>').attr('id', 'new_form')
|
832
837
|
.append($('<input/>').attr('type', 'hidden').attr('name', 'authenticity_token').val(that.form_authenticity_token));
|
838
|
+
var focus_field = false;
|
833
839
|
$.each(this.new_model_fields, function(i, f) {
|
834
840
|
if (f.type == 'hidden')
|
835
841
|
form.append($('<input/>').attr('type', 'hidden').attr('name', f.name).val(f.value));
|
836
842
|
else
|
843
|
+
{
|
837
844
|
form.append($('<p/>').append($('<input/>').attr('type', 'text').attr('name', f.name).attr('placeholder', f.nice_name).css('width', '' + f.width + 'px')));
|
845
|
+
if (!focus_field)
|
846
|
+
focus_field = f.name;
|
847
|
+
}
|
838
848
|
});
|
839
849
|
form.append($('<div/>').attr('id', that.container + '_new_message'));
|
840
850
|
form.append($('<p>')
|
@@ -843,8 +853,8 @@ IndexTable.prototype = {
|
|
843
853
|
);
|
844
854
|
var div = $('<div/>').addClass('note')
|
845
855
|
.append($('<h2/>').css('margin-top', 0).css('padding-top', 0).html(that.new_model_text))
|
846
|
-
.append(form);
|
847
|
-
that.show_message(div);
|
856
|
+
.append(form);
|
857
|
+
that.show_message(div, null, function() { $('#new_form input[name="' + focus_field + '"]').focus(); });
|
848
858
|
},
|
849
859
|
|
850
860
|
add_model: function()
|
@@ -19,30 +19,23 @@ module Caboose
|
|
19
19
|
if line =~ /^(.*?)class (.*?)Controller(.*?)$/
|
20
20
|
class_name = line.gsub(/^(.*?)class (.*?)Controller(.*?)$/, '\2').gsub(/([A-Z])/, '_\1').downcase
|
21
21
|
class_name[0] = '' if class_name[0] == '_'
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
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 ')
|
22
|
+
elsif line =~ /# @class_route_priority \d/
|
23
|
+
class_priority = line.gsub(/# @class_route_priority (\d*?)$/, '\1').to_i
|
24
|
+
elsif line =~ /# @route_priority \d/
|
25
|
+
route_priority = line.gsub(/# @route_priority (\d*?)$/, '\1').to_i
|
26
|
+
elsif line.starts_with?('def ')
|
33
27
|
actions << [line.gsub('def ', ''), uris, route_priority]
|
34
28
|
uris = []
|
35
29
|
route_priority = 20
|
36
|
-
|
37
|
-
|
38
|
-
elsif line =~ /#
|
39
|
-
elsif line =~ /#
|
40
|
-
elsif line =~ /# DELETE (.*?)/ then uris << "delete \"#{line.gsub(/# DELETE (.*?)/ , '\1')}\""
|
30
|
+
elsif line =~ /# @route GET (.*?)/ then uris << "get \"#{line.gsub(/# @route GET (.*?)/ , '\1')}\""
|
31
|
+
elsif line =~ /# @route POST (.*?)/ then uris << "post \"#{line.gsub(/# @route POST (.*?)/ , '\1')}\""
|
32
|
+
elsif line =~ /# @route PUT (.*?)/ then uris << "put \"#{line.gsub(/# @route PUT (.*?)/ , '\1')}\""
|
33
|
+
elsif line =~ /# @route DELETE (.*?)/ then uris << "delete \"#{line.gsub(/# @route DELETE (.*?)/ , '\1')}\""
|
41
34
|
end
|
42
35
|
end
|
43
36
|
classes << [class_name, actions, class_priority]
|
44
37
|
end
|
45
|
-
|
38
|
+
|
46
39
|
routes = []
|
47
40
|
classes.sort_by{ |arr| arr[2] }.each do |carr|
|
48
41
|
|
@@ -51,11 +44,7 @@ module Caboose
|
|
51
44
|
|
52
45
|
# Get the longest URI so we can make routes that line up vertically
|
53
46
|
longest = ''
|
54
|
-
actions.each
|
55
|
-
uris.each do |uri|
|
56
|
-
longest = uri if uri.length > longest.length
|
57
|
-
end
|
58
|
-
end
|
47
|
+
actions.each{ |action, uris| uris.each{ |uri| longest = uri if uri.length > longest.length }}
|
59
48
|
length = longest.length + 1
|
60
49
|
|
61
50
|
# Make the route line
|
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.31
|
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-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|