added widget and engine settings

This commit is contained in:
Harry Bomrah 2014-05-23 14:03:16 +08:00
parent cc527b069c
commit f97ccb0436
2 changed files with 16 additions and 1 deletions

View File

@ -33,4 +33,18 @@ class FaqsController < ApplicationController
"faqs_files" => faqs_files
}
end
def widget
faqs = Qa.filter_by_widget_categories.collect do |qa|
{
"link_to_show" => OrbitHelper.url_to_show(qa.to_param),
"title" => qa.title,
"postdate" => qa.created_at.strftime('%Y-%m-%d %H:%M')
}
end
{
"faqs" => faqs,
"extras" => {"widget-title"=>"Faqs"}
}
end
end

View File

@ -4,7 +4,8 @@ module Faq
OrbitApp.registration "Faq", :type => "ModuleApp" do
module_label "faq.faq"
base_url File.expand_path File.dirname(__FILE__)
widget_methods ['widget']
widget_settings [{"data_count"=>10}]
taggable "Qa"
categorizable
authorizable