2014-05-20 02:31:44 +00:00
|
|
|
class Admin::DesignsController < OrbitAdminController
|
|
|
|
layout "structure"
|
|
|
|
|
|
|
|
def index
|
2014-05-29 10:32:27 +00:00
|
|
|
@designs = []
|
|
|
|
Dir.glob("#{Rails.root}/app/templates/*").each do |template|
|
|
|
|
if template.split('/').last != "mobile"
|
2014-08-11 08:02:58 +00:00
|
|
|
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
|
2014-05-29 10:32:27 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-05-20 02:31:44 +00:00
|
|
|
end
|
|
|
|
end
|