diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 9a70967..7d4a895 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -123,14 +123,12 @@ class ApplicationController < ActionController::Base end def render_403 - @html_title = "403" @project = nil render :template => "common/403", :layout => true, :status => 403 return false end def render_404 - @html_title = "404" render :template => "common/404", :layout => true, :status => 404 return false end diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index b83d950..4bd359c 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -169,7 +169,6 @@ private def find_project @issue = Issue.find(params[:id], :include => [:project, :tracker, :status, :author, :priority, :category]) @project = @issue.project - @html_title = "#{@project.name} - #{@issue.tracker.name} ##{@issue.id}" rescue ActiveRecord::RecordNotFound render_404 end diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 63cf8a0..0acd640 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -631,7 +631,6 @@ private # Used as a before_filter def find_project @project = Project.find(params[:id]) - @html_title = @project.name rescue ActiveRecord::RecordNotFound render_404 end diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index 2a3fe4f..01e78dc 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -78,7 +78,6 @@ class SearchController < ApplicationController private def find_project @project = Project.find(params[:id]) - @html_title = @project.name rescue ActiveRecord::RecordNotFound render_404 end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9159452..794c6a6 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -101,6 +101,18 @@ module ApplicationHelper html end + def set_html_title(text) + @html_header_title = text + end + + def html_title + title = [] + title << @project.name if @project + title << @html_header_title + title << Setting.app_title + title.compact.join(' - ') + end + # format text according to system settings def textilizable(text, options = {}) return "" if text.blank? diff --git a/app/views/common/403.rhtml b/app/views/common/403.rhtml index 138c1a2..d2d03f8 100644 --- a/app/views/common/403.rhtml +++ b/app/views/common/403.rhtml @@ -2,3 +2,5 @@
<%= l(:notice_not_authorized) %>
+ +<% set_html_title '403' %> diff --git a/app/views/common/404.rhtml b/app/views/common/404.rhtml index a1a11c3..080b048 100644 --- a/app/views/common/404.rhtml +++ b/app/views/common/404.rhtml @@ -2,3 +2,5 @@<%= l(:notice_file_not_found) %>
+ +<% set_html_title '404' %> diff --git a/app/views/issues/show.rhtml b/app/views/issues/show.rhtml index 3df53e2..59bf9ea 100644 --- a/app/views/issues/show.rhtml +++ b/app/views/issues/show.rhtml @@ -109,3 +109,5 @@ end %> <%= l(:label_export_to) %><%= link_to 'PDF', {:action => 'export_pdf', :id => @issue}, :class => 'icon icon-pdf' %> + +<% set_html_title "#{@issue.tracker.name} ##{@issue.id}" %> diff --git a/app/views/layouts/base.rhtml b/app/views/layouts/base.rhtml index acce89d..eae5cf5 100644 --- a/app/views/layouts/base.rhtml +++ b/app/views/layouts/base.rhtml @@ -1,7 +1,7 @@ -