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 +4 -4
- data/lib/populate_me/admin.rb +5 -0
- data/lib/populate_me/admin/__assets__/js/main.js +2 -0
- data/lib/populate_me/version.rb +1 -1
- data/test/test_document_schema.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c4a183e9fa73daeea4219947bf0b2e0eef9594a992b2777aee96c262658ed53
|
4
|
+
data.tar.gz: 7ef5380f8917b3c9f14a13b08eec2cb31e16dcb0db4210a71d56d44e0667e11f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef4b40dec8280769115a5f5af5d69f124e6238214b06db0211e9640b988644199323f578a656aad017062af6493e5fd9627e28b40dff25cd5b37e8aa1d5c0f3b
|
7
|
+
data.tar.gz: e0eebe06dd540d7173284b65e4175eeb7829e059f6b5b2841ddf4f3968e0e8a45c4dba9d1dd3eb1e2cdceb8c0ff0080948c247de42d1cef1222d3b688c1a1599
|
data/lib/populate_me/admin.rb
CHANGED
@@ -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
|
}
|
data/lib/populate_me/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2020-10-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: web-utils
|