diff --git a/app/controllers/admin/designs_controller.rb b/app/controllers/admin/designs_controller.rb index 79d5c69..fca4efc 100644 --- a/app/controllers/admin/designs_controller.rb +++ b/app/controllers/admin/designs_controller.rb @@ -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 diff --git a/app/templates/orbit_bootstrap/template.json b/app/templates/orbit_bootstrap/template.json new file mode 100644 index 0000000..69295ae --- /dev/null +++ b/app/templates/orbit_bootstrap/template.json @@ -0,0 +1,5 @@ +{ + "title" : "Orbit Bootstrap", + "key" : "orbit_bootstrap", + "author" : "Ray" +} \ No newline at end of file