2014-11-04 07:48:24 +00:00
|
|
|
require 'json'
|
2014-10-31 05:36:38 +00:00
|
|
|
class AnnouncementLinkWidgetsController < ApplicationController
|
|
|
|
def widget
|
2014-11-04 07:48:24 +00:00
|
|
|
data = {
|
2014-11-04 10:26:17 +00:00
|
|
|
"tags" => [],
|
2014-10-31 05:36:38 +00:00
|
|
|
"extras" => {
|
|
|
|
"heading-announcements" => "Announcements",
|
|
|
|
"heading-links" => "Links"
|
|
|
|
}
|
|
|
|
}
|
2014-11-04 09:28:43 +00:00
|
|
|
f = File.join(Rails.root, "public" , "announcement_link_widget_#{I18n.locale.to_s}.json")
|
2014-11-04 07:48:24 +00:00
|
|
|
if File.exists?(f)
|
2014-11-04 08:11:05 +00:00
|
|
|
contents = File.read(f)
|
2014-11-04 07:48:24 +00:00
|
|
|
data = JSON.parse(contents)
|
|
|
|
end
|
|
|
|
data
|
2014-10-31 05:36:38 +00:00
|
|
|
end
|
|
|
|
end
|