forked from saurabh/orbit4-5
added template json for title key author
This commit is contained in:
parent
7dd2c25180
commit
a1fb6ebd68
|
@ -5,11 +5,15 @@ class Admin::DesignsController < OrbitAdminController
|
||||||
@designs = []
|
@designs = []
|
||||||
Dir.glob("#{Rails.root}/app/templates/*").each do |template|
|
Dir.glob("#{Rails.root}/app/templates/*").each do |template|
|
||||||
if template.split('/').last != "mobile"
|
if template.split('/').last != "mobile"
|
||||||
@designs << {
|
f = File.join("#{template}/template.json")
|
||||||
"key"=>template.split('/').last,
|
if File.exists?f
|
||||||
"title"=>template.split('/').last.titleize,
|
hash = JSON.parse(File.read(f)) rescue {}
|
||||||
"author"=>"Ray"
|
@designs << {
|
||||||
}
|
"key"=>hash["key"],
|
||||||
|
"title"=>hash["title"],
|
||||||
|
"author"=>hash["author"]
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
{
|
||||||
|
"title" : "Orbit Bootstrap",
|
||||||
|
"key" : "orbit_bootstrap",
|
||||||
|
"author" : "Ray"
|
||||||
|
}
|
Loading…
Reference in New Issue