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
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
# Used as a before_filter
def find_project
@project = Project.find(params[:id])
- @html_title = @project.name
rescue ActiveRecord::RecordNotFound
render_404
end
private
def find_project
@project = Project.find(params[:id])
- @html_title = @project.name
rescue ActiveRecord::RecordNotFound
render_404
end
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?
<p><%= l(:notice_not_authorized) %></p>
<p><a href="javascript:history.back()">Back</a></p>
+
+<% set_html_title '403' %>
<p><%= l(:notice_file_not_found) %></p>
<p><a href="javascript:history.back()">Back</a></p>
+
+<% set_html_title '404' %>
<%= l(:label_export_to) %><%= link_to 'PDF', {:action => 'export_pdf', :id => @issue}, :class => 'icon icon-pdf' %>
</div>
+
+<% set_html_title "#{@issue.tracker.name} ##{@issue.id}" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
-<title><%= Setting.app_title + (@html_title ? ": #{@html_title}" : "") %></title>
+<title><%=h html_title %></title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="description" content="<%= Redmine::Info.app_name %>" />
<meta name="keywords" content="issue,bug,tracker" />
<% if authorize_for('projects', 'add_issue') %>| <%= l(:label_issue_new) %>: <%= new_issue_selector %><% end %>
</div>
<h2><%=l(:label_issue_plural)%></h2>
+ <% set_html_title l(:label_issue_plural) %>
<% form_tag({:action => 'list_issues'}, :id => 'query_form') do %>
<%= render :partial => 'queries/filters', :locals => {:query => @query} %>
<% if authorize_for('projects', 'add_issue') %>| <%= l(:label_issue_new) %>: <%= new_issue_selector %><% end %>
</div>
<h2><%= @query.name %></h2>
+ <% set_html_title @query.name %>
<% end %>
<%= error_messages_for 'query' %>
<% if @query.valid? %>
<% content_for :header_tags do %>
<%= stylesheet_link_tag 'scm' %>
<% end %>
+
+<% set_html_title @page.pretty_title %>
<% content_for :header_tags do %>
<%= stylesheet_link_tag 'scm' %>
<% end %>
+
+<% set_html_title @page.pretty_title %>