<%= javascript_include_tag 'index', :plugin => "redmine_wktime" %>
<%= javascript_include_tag 'wkstatus', :plugin => "redmine_wktime" %>
<%= stylesheet_link_tag 'lockwarning', :plugin => "redmine_wktime" %>
<%= hidden_field_tag 'spent_time_user_id', User.current.id %>
<%= hidden_field_tag 'getspenttype_url', url_for(:controller => 'wklogmaterial', :action => 'loadSpentType') %>

<!-- For SideBar theme -->
<% if Setting.ui_theme.to_s.downcase == "sidebar" %>
    <%= stylesheet_link_tag 'sidebar', :plugin => "redmine_wktime" %>
    <%= javascript_tag do %>
        $(function() {
            $("#top-menu .wkdashboard").attr("title", "ERPmine");
            var topMenus = [];
            $("#top-menu ul li a").each(function() {
                var classNames = ($(this).attr('class')).split(" ");
                var menuItem = classNames[0];
                if(menuItem == "wkdashboard" && $("#main-menu ul").children("li").length > 0) {
                    var firstMenu =$("#main-menu ul").children("li").find("a").first().attr("href");
                    if(firstMenu.match("^/wk") || firstMenu.match("^/rm")) {
                        $("."+menuItem).parent('li').addClass("active");
                    }
                }
            });
        });
    <% end %>
<% end %>