announcement-link-widget/app/controllers/announcement_link_widgets_c...

18 lines
476 B
Ruby
Raw Normal View History

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" => {
2014-11-05 09:37:04 +00:00
"heading-announcements" => t("announcement_link_widget.bulletins"),
"heading-links" => t("announcement_link_widget.related_links")
2014-10-31 05:36:38 +00:00
}
}
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