Orbit/app/helpers/admin/dashboard_helper.rb

29 lines
705 B
Ruby
Raw Normal View History

2012-05-08 21:53:07 +00:00
module Admin::DashboardHelper
def get_link(title)
case title
when 'bulletin'
2012-05-15 13:26:09 +00:00
panel_announcement_front_end_bulletins_path
2012-05-08 21:53:07 +00:00
when 'news_bulletin'
2012-05-15 13:26:09 +00:00
panel_news_front_end_news_bulletins_path
2012-05-08 21:53:07 +00:00
when'page_context'
2012-05-15 13:26:09 +00:00
panel_page_content_front_end_page_contexts_path
2012-05-08 21:53:07 +00:00
when'web_link'
2012-05-15 13:26:09 +00:00
panel_web_resource_front_end_web_links_path
2012-05-08 21:53:07 +00:00
end
end
def get_link_to_object(object)
case object._type.underscore
when 'bulletin'
2012-05-15 13:26:09 +00:00
panel_announcement_front_end_bulletin_path(object)
2012-05-08 21:53:07 +00:00
when 'news_bulletin'
2012-05-15 13:26:09 +00:00
panel_news_front_end_news_bulletin_path(object)
2012-05-08 21:53:07 +00:00
when'page_context'
2012-05-16 10:19:41 +00:00
"/#{object.page.path}"
2012-05-08 21:53:07 +00:00
when'web_link'
2012-05-15 13:26:09 +00:00
panel_web_resource_front_end_web_link_path(object)
2012-05-08 21:53:07 +00:00
end
end
end