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 = []
|
||||
Dir.glob("#{Rails.root}/app/templates/*").each do |template|
|
||||
if template.split('/').last != "mobile"
|
||||
@designs << {
|
||||
"key"=>template.split('/').last,
|
||||
"title"=>template.split('/').last.titleize,
|
||||
"author"=>"Ray"
|
||||
}
|
||||
f = File.join("#{template}/template.json")
|
||||
if File.exists?f
|
||||
hash = JSON.parse(File.read(f)) rescue {}
|
||||
@designs << {
|
||||
"key"=>hash["key"],
|
||||
"title"=>hash["title"],
|
||||
"author"=>hash["author"]
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"title" : "Orbit Bootstrap",
|
||||
"key" : "orbit_bootstrap",
|
||||
"author" : "Ray"
|
||||
}
|
Loading…
Reference in New Issue