caboose-cms 0.6.29 → 0.6.30

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZDkzZmIxYTIzNzgzMDkyMzJhMjM2MTNkZGVmYTcwYTcyMzg5MGVkNg==
4
+ ODMwZTNmNjZmMWZhNzdmZjBhOTNhZTQwMDk0OTEzOTI0MGVhOTMzYg==
5
5
  data.tar.gz: !binary |-
6
- ZjUxOWNkYjZjNDJlNTU3OGE5N2ZhYTM3Y2JjZTFkNmU1MzNiNTMzNg==
6
+ N2Y2MGU4ODljYzNhMmFjMjNiZDk2ODcwOTg4ODI0NmRiOGYxNGI3Yg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YTY4NDc0MDEzNzNiNmU1ZDgwMmNhYjViZmZkMzIwMjk4YmMxYmQyM2RmZGFl
10
- NzVmM2FhNGU3ZjU2NTQzY2ZhNTQ4YWZkODRmZDBhMWMxYTAwOTYzOWQxOTU3
11
- ZmZhNTY1N2I1NzZmZWQzZjgzOWRjNmJiZWVmZDNmZTIwYjdlZDI=
9
+ NmI5NDc3NDIxZTdhODkzMzNjMTIzMDMxZTYwMzY3M2Q2NTVmYWQ5Nzc3N2M2
10
+ YTk4M2QzZDNjOWEwZmNiYTFlYTcyNGM4MDk5ZmFjMjUxZjRhOTA1NjkwNDRl
11
+ YmE2NjI4ZTZhZWVkYTQwMjM2OWM3NDY2Y2ExOTBiNThjNWY5OTA=
12
12
  data.tar.gz: !binary |-
13
- ZTE5NjIzN2RiNTk3ZDBmMjliNzUxZTYxZmQ0ZDY2MjJiZDNlZmYyMjM5NDVj
14
- ZDU3NWYyZGY4MThiNjBhYWQxMGQyN2ViYTIxNzRmN2IxNGIxZjU3ZmY2Y2Ey
15
- NGQzOGUwOWUzYzlhOTJkOWRlMmE0M2IxMmNhN2ZlMTEzN2QzOTM=
13
+ MzAzZjIzMDgzZDBmM2I3OWU3MGY5YzIyMTQ0NTMzODFhMWJiNDZiYmNiM2Ex
14
+ YjY5YTBjMWZiYjU3OGQ5M2UxMzEwYmRiY2RiZDUyZjgxMGNmM2YzNmVmNDZm
15
+ MjA5OTM4MjZmOGJiODVjMmJlNjZhY2U0NGNkMTYxMzc5Y2I0NjU=
@@ -11,3 +11,11 @@ function curr(x)
11
11
  console.log(t);
12
12
  return 'STAHP'
13
13
  }
14
+
15
+ function add_to_crumbtrail(href, text)
16
+ {
17
+ var c = $('#crumbtrail');
18
+ if (!c.is(':empty'))
19
+ c.append(' > ');
20
+ c.append($('<a/>').attr('href', href).html(text));
21
+ }
@@ -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 = this.base_url + '/json';
110
- if (!this.bulk_update_url ) this.bulk_update_url = this.base_url + '/bulk';
111
- if (!this.bulk_delete_url ) this.bulk_delete_url = this.base_url + '/bulk';
112
- if (!this.add_url ) this.add_url = this.base_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
- form.append($('<p/>').append($('<input/>').attr('type', 'text').attr('name', f.name).attr('placeholder', f.nice_name).css('width', '' + f.width + 'px')));
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>')
@@ -22,7 +22,7 @@ Model.prototype = {
22
22
 
23
23
  save: function(attrib, after) {
24
24
  if (!attrib.update_url)
25
- attrib.update_url = this.update_url;
25
+ attrib.update_url = this.update_url;
26
26
  attrib.save(after);
27
27
  },
28
28
 
@@ -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 {
@@ -29,7 +29,7 @@ module Caboose
29
29
  })
30
30
 
31
31
  @orders = @pager.items
32
- @customers = Caboose::User.reorder('last_name, first_name').all
32
+ @customers = Caboose::User.where(:site_id => @site.id).reorder('last_name, first_name').all
33
33
 
34
34
  render :layout => 'caboose/admin'
35
35
  end
@@ -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'" : '' %>><%= "#{c.last_name}, #{c.first_name}" %></option>
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>
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.6.29'
2
+ VERSION = '0.6.30'
3
3
  end
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.29
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-10 00:00:00.000000000 Z
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