populate-me 0.13.1 → 0.13.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 77ffe6684618f49dc39e02b871af4e4099fe306f95e78fbe4ebcd6610910cdde
4
- data.tar.gz: 884fd2dd42222de62bc684ab6671c88671836d764d0b985a808fb4990eee062c
3
+ metadata.gz: 3c4a183e9fa73daeea4219947bf0b2e0eef9594a992b2777aee96c262658ed53
4
+ data.tar.gz: 7ef5380f8917b3c9f14a13b08eec2cb31e16dcb0db4210a71d56d44e0667e11f
5
5
  SHA512:
6
- metadata.gz: 454c3c3bbfd309e6449ec58f9c46246dcc359fee2ae04aa04e684285c68619d8f9a8b529ec9d843e5ab722a52dfff0e70aac697d8713f023e45f5bace935a42a
7
- data.tar.gz: 22786caacc68f4b8d9ca60837a416c86ab037b87a3826519506b0eadf78b97693232b07312206e72cafba69b9e8bf447a02d38fe57c3585981b88f68f14580e7
6
+ metadata.gz: ef4b40dec8280769115a5f5af5d69f124e6238214b06db0211e9640b988644199323f578a656aad017062af6493e5fd9627e28b40dff25cd5b37e8aa1d5c0f3b
7
+ data.tar.gz: e0eebe06dd540d7173284b65e4175eeb7829e059f6b5b2841ddf4f3968e0e8a45c4dba9d1dd3eb1e2cdceb8c0ff0080948c247de42d1cef1222d3b688c1a1599
@@ -67,6 +67,7 @@ class PopulateMe::Admin < Sinatra::Base
67
67
  if request.path_info=='/menu'
68
68
  items.push({title: '?', href: "#{request.script_name}/help", new_page: false})
69
69
  end
70
+ content_type :json
70
71
  {
71
72
  template: 'template_menu',
72
73
  page_title: page_title,
@@ -76,6 +77,7 @@ class PopulateMe::Admin < Sinatra::Base
76
77
 
77
78
  get '/list/:class_name' do
78
79
  @model_class = resolve_model_class params[:class_name]
80
+ content_type :json
79
81
  @model_class.to_admin_list(request: request, params: params).to_json
80
82
  end
81
83
 
@@ -87,6 +89,7 @@ class PopulateMe::Admin < Sinatra::Base
87
89
  else
88
90
  @model_instance = resolve_model_instance @model_class, params[:id]
89
91
  end
92
+ content_type :json
90
93
  @model_instance.to_admin_form(
91
94
  request: request,
92
95
  params: params,
@@ -102,6 +105,7 @@ class PopulateMe::Admin < Sinatra::Base
102
105
 
103
106
  not_found do
104
107
  response.headers['X-Cascade'] = 'pass'
108
+ content_type :json
105
109
  {'success'=>false,'message'=>'Not Found'}.to_json
106
110
  end
107
111
 
@@ -109,6 +113,7 @@ class PopulateMe::Admin < Sinatra::Base
109
113
  puts
110
114
  puts env['sinatra.error'].inspect
111
115
  puts
116
+ content_type :json
112
117
  {'success'=>false,'message'=>env['sinatra.error'].message}.to_json
113
118
  end
114
119
 
@@ -413,6 +413,8 @@ $(function() {
413
413
  process_data: function(data) {
414
414
  if (typeof data == 'object') {
415
415
  return PopulateMe.mustache_render(data);
416
+ } else if (typeof data == 'string' && data[0] == '{') {
417
+ return PopulateMe.mustache_render(JSON.parse(data));
416
418
  } else {
417
419
  return data;
418
420
  }
@@ -1,4 +1,4 @@
1
1
  module PopulateMe
2
- VERSION = '0.13.1'
2
+ VERSION = '0.13.2'
3
3
  end
4
4
 
@@ -1,5 +1,6 @@
1
1
  require 'helper'
2
2
  require 'populate_me/document'
3
+ require 'populate_me/attachment'
3
4
 
4
5
  describe PopulateMe::Document, 'Schema' do
5
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: populate-me
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.1
4
+ version: 0.13.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mickael Riga
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-28 00:00:00.000000000 Z
11
+ date: 2020-10-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: web-utils