diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1f7d786c..227b7714 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -389,7 +389,9 @@ module ApplicationHelper end def page_header_title - if @project.nil? || @project.new_record? + if @page_header_title.present? + h(@page_header_title) + elsif @project.nil? || @project.new_record? h(Setting.app_title) else b = [] @@ -935,6 +937,32 @@ module ApplicationHelper end end + # Expands the current menu item using JavaScript based on the params + def expand_current_menu + current_menu_class = + case + when params[:controller] == "timelog" + "reports" + when params[:controller] == 'projects' && params[:action] == 'changelog' + "reports" + when params[:controller] == 'issues' && ['calendar','gantt'].include?(params[:action]) + "reports" + when params[:controller] == 'projects' && params[:action] == 'roadmap' + 'roadmap' + when params[:controller] == 'versions' && params[:action] == 'show' + 'roadmap' + when params[:controller] == 'projects' && params[:action] == 'settings' + 'settings' + when params[:controller] == 'contracts' || params[:controller] == 'deliverables' + 'contracts' + else + params[:controller] + end + + + javascript_tag("jQuery.menu_expand({ menuItem: '.#{current_menu_class}' });") + end + private def wiki_helper diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index dabac782..c270dc52 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -52,13 +52,14 @@ module IssuesHelper "#{@cached_label_priority}: #{h(issue.priority.name)}" end + # TODO: deprecate and/or remove def render_issue_subject_with_tree(issue) s = '' ancestors = issue.root? ? [] : issue.ancestors.all ancestors.each do |ancestor| - s << '
<%=l(:label_related_issues)%>
++ <%=l(:label_related_issues)%> + <% if authorize_for('issue_relations', 'new') %> + (<%= toggle_link l(:button_add), 'new-relation-form', {:focus => 'relation_issue_to_id'} %>) + <% end %> +
<% if @relations.present? %>