caboose-cms 0.6.31 → 0.6.32

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
- YmE5Nzc5MGY3NWFjYTViZGZkMDc5NTkzMGU0MDQ3NjRmNjdmOGM0NQ==
4
+ N2JlODk5YTY0MzRkMzVmNjJjOWU5ZTkxYjVhZGQyY2RiMDA2OTI5Mw==
5
5
  data.tar.gz: !binary |-
6
- NzY2NTE4NmQ5MzE2ZWY4OGU2MzI0ZWVkNGUzZjNlYjA5YWVmNjA5Yg==
6
+ ZGYxMTViOWU5NmVlN2NhNDllMTgwNDU0MjhiMzdmNzdhODc4YzIwOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YjY0MWY1MDQwMzE4MmRhMDAzMmViZDFhYmNjYjJhNThjODk1ZjYwOTc3NDZm
10
- ODM3MWFlNjQzOGUzMTg5YmQ4YTgyN2I4ZDY0ZmUwNzgxMzg1ZjBiMWMzYWM1
11
- MjlhYTdkY2ZiOWViYjE5NTJjYmRiY2UwM2ZkZDc3ZDMyMTRkOGQ=
9
+ NTIzMWU2ZDFkNTU0ZGI2YjlmZDU3NmUwMmRmMDUyZDMyYzVlODc2OWYwYTE0
10
+ ZDU0MDRiZDBjYzBiMDI0YzY1NjE4MDhiYWUyYWU3M2U5ZWQzOWZiYWNlZWZj
11
+ NjBhMjdhOGM1OGJhZGVlZmRhNmE5OWMxZjZiZWUxZmYxNjI5YjE=
12
12
  data.tar.gz: !binary |-
13
- YWQ0OWYxNjAwZmY3ZWI2NTIyNmUyYWI5OWExZjVlN2EzOTEzZDhkYWE3NTlh
14
- ODFlZWFiZDI5MWZiZTlmZTY3MmRhMGZhN2Y3NGUwZTU5YzAzNjFkMjVmMDNi
15
- MGEzYzU2ZDEwMjIwNWU4NGY3Njk3ZTFlMWJlNzcwYzQ5MzAzNjY=
13
+ OWViMGY4MTQzOGQzMGVhNzU4ZWY0ZGFkMWU1NjI4MjQ2NWIzNDhlNDYwZGE0
14
+ MDM3ZWI3MmU0NjRjZTZiM2IyOGU4Y2RkYTk0ZDc5YWM5OTczNjNkYTRiNjU5
15
+ MDZhYmFkNWVlNDI3YWMyZDY0Y2UxZTU0OWE3ZGU3NGE5NjUzNzY=
@@ -832,13 +832,37 @@ IndexTable.prototype = {
832
832
 
833
833
  new_form: function()
834
834
  {
835
- var that = this;
835
+ var that = this;
836
+
837
+ $.each(this.new_model_fields, function(i, f) {
838
+ if (f.options_url && !f.options)
839
+ {
840
+ $.ajax({
841
+ url: f.options_url,
842
+ type: 'get',
843
+ success: function(resp) { f.options = resp },
844
+ async: false
845
+ });
846
+ }
847
+ });
848
+
836
849
  var form = $('<form/>').attr('id', 'new_form')
837
850
  .append($('<input/>').attr('type', 'hidden').attr('name', 'authenticity_token').val(that.form_authenticity_token));
838
851
  var focus_field = false;
839
852
  $.each(this.new_model_fields, function(i, f) {
840
853
  if (f.type == 'hidden')
841
854
  form.append($('<input/>').attr('type', 'hidden').attr('name', f.name).val(f.value));
855
+ else if (f.type == 'select')
856
+ {
857
+ var select = $('<select/>').attr('name', f.name);
858
+ $.each(f.options, function(i, option) {
859
+ var opt = $('<option/>').val(option.value).html(option.text);
860
+ if (f.value && f.value == option.value)
861
+ opt.attr('selected', 'true');
862
+ select.append(opt);
863
+ });
864
+ form.append(select);
865
+ }
842
866
  else
843
867
  {
844
868
  form.append($('<p/>').append($('<input/>').attr('type', 'text').attr('name', f.name).attr('placeholder', f.nice_name).css('width', '' + f.width + 'px')));
@@ -38,9 +38,9 @@ module Caboose
38
38
  else
39
39
  remember = params[:remember] && (params[:remember] == 1 || params[:remember] == "1")
40
40
  login_user(login_resp.user, remember)
41
- resp.redirect = return_url
42
- resp.modal = false
43
- Caboose.plugin_hook('login_success', login_resp.user.id)
41
+ #resp.redirect = return_url
42
+ resp.redirect = Caboose.plugin_hook('login_success', return_url, login_resp.user)
43
+ resp.modal = false
44
44
  end
45
45
  end
46
46
  end
@@ -55,8 +55,12 @@ module Caboose
55
55
  # GET /admin/orders/:id
56
56
  def admin_edit
57
57
  return if !user_is_allowed('orders', 'edit')
58
- @order = Order.find(params[:id])
59
- #@order.calculate
58
+ @order = Order.where(:id => params[:id]).first
59
+
60
+ if params[:id].nil? || @order.nil?
61
+ render :file => 'caboose/orders/admin_invalid_order', :layout => 'caboose/admin'
62
+ return
63
+ end
60
64
  render :layout => 'caboose/admin'
61
65
  end
62
66
 
@@ -12,4 +12,8 @@ class Caboose::CaboosePlugin
12
12
  return nav
13
13
  end
14
14
 
15
+ def self.login_success(return_url, user_id)
16
+ return return_url
17
+ end
18
+
15
19
  end
@@ -0,0 +1,3 @@
1
+
2
+ <h1>Invalid Order Number</h1>
3
+ <p><input type='button' value='< Back' onclick="window.location='/admin/orders';" /></p>
@@ -1,3 +1,3 @@
1
1
  module Caboose
2
- VERSION = '0.6.31'
2
+ VERSION = '0.6.32'
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.31
4
+ version: 0.6.32
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-16 00:00:00.000000000 Z
11
+ date: 2015-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pg
@@ -914,6 +914,7 @@ files:
914
914
  - app/views/caboose/orders/admin_delete_form.html.erb
915
915
  - app/views/caboose/orders/admin_edit.html.erb
916
916
  - app/views/caboose/orders/admin_index.html.erb
917
+ - app/views/caboose/orders/admin_invalid_order.html.erb
917
918
  - app/views/caboose/orders/admin_new.html.erb
918
919
  - app/views/caboose/orders/admin_print.html.erb
919
920
  - app/views/caboose/orders/admin_summary_report.html.erb