orbit4-5/app/controllers/admin/designs_controller.rb

21 lines
537 B
Ruby
Raw Normal View History

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"
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
end
end