use hook to fulfill issue #3303
git-svn-id: https://dev.finn.de/svn/cockpit/branches/reporting_merge@1618 7926756e-e54e-46e6-9721-ed318f58905epull/6827/head
parent
5a98e85ccf
commit
88868c9a1f
@ -0,0 +1,18 @@ |
||||
<script type="text/javascript"> |
||||
//<![CDATA[ |
||||
remove_old_sidebar = function() { |
||||
if ($($("sidebar").down()).innerHTML === "<%= l(:label_spent_time) %>") { |
||||
var reporting_link, old_html; |
||||
// The sidebar is showing spent time, hide the links, which are in the second para |
||||
$("sidebar").down().siblings()[1].hide(); |
||||
// Make the hours a link, which are in the first para |
||||
reporting_link = "<%= link_to('PLACEHOLDER', { |
||||
:controller => 'cost_reports', :project_id => project }).gsub('"', "'") %>"; |
||||
old_html = $("sidebar").down().siblings().first().innerHTML; |
||||
$("sidebar").down().siblings().first().innerHTML = reporting_link.replace("PLACEHOLDER", old_html) |
||||
} |
||||
} |
||||
|
||||
remove_old_sidebar(); |
||||
//]]> |
||||
</script> |
@ -0,0 +1,3 @@ |
||||
class ViewProjectsShowSidebarBottomHook < Redmine::Hook::ViewListener |
||||
render_on :view_projects_show_sidebar_bottom, :partial => 'hooks/view_projects_show_sidebar_bottom_hook' |
||||
end |
Loading…
Reference in new issue