[#4180] Move the CSS and JS includes to the layout hooks.

This commit is contained in:
Eric Davis
2010-07-01 16:31:40 -07:00
parent 92e7622d68
commit 54ddade978
8 changed files with 96 additions and 16 deletions
@@ -0,0 +1,20 @@
module RedmineContracts
module Hooks
class ViewLayoutsBaseHtmlHeadHook < Redmine::Hook::ViewListener
def view_layouts_base_html_head(context={})
if context[:controller] && (
context[:controller].is_a?(ContractsController) ||
context[:controller].is_a?(DeliverablesController)
)
return stylesheet_link_tag("redmine_contracts", :plugin => "redmine_contracts", :media => "screen") +
javascript_include_tag('jquery-1.4.2.min.js', :plugin => 'redmine_contracts') +
javascript_include_tag('contracts.js', :plugin => 'redmine_contracts')
else
return ''
end
end
end
end
end