##// END OF EJS Templates
Load scripts and css for wiki formatter toolbar when needed....
Jean-Philippe Lang -
r5119:bf58ad61e57a
parent child
Show More
@@ -1,82 +1,81
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
3 <head>
3 <head>
4 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
4 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
5 <title><%=h html_title %></title>
5 <title><%=h html_title %></title>
6 <meta name="description" content="<%= Redmine::Info.app_name %>" />
6 <meta name="description" content="<%= Redmine::Info.app_name %>" />
7 <meta name="keywords" content="issue,bug,tracker" />
7 <meta name="keywords" content="issue,bug,tracker" />
8 <%= csrf_meta_tag %>
8 <%= csrf_meta_tag %>
9 <%= favicon %>
9 <%= favicon %>
10 <%= stylesheet_link_tag 'application', :media => 'all' %>
10 <%= stylesheet_link_tag 'application', :media => 'all' %>
11 <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
11 <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %>
12 <%= javascript_heads %>
12 <%= javascript_heads %>
13 <%= heads_for_theme %>
13 <%= heads_for_theme %>
14 <%= heads_for_wiki_formatter %>
15 <!--[if IE 6]>
14 <!--[if IE 6]>
16 <style type="text/css">
15 <style type="text/css">
17 * html body{ width: expression( document.documentElement.clientWidth < 900 ? '900px' : '100%' ); }
16 * html body{ width: expression( document.documentElement.clientWidth < 900 ? '900px' : '100%' ); }
18 body {behavior: url(<%= stylesheet_path "csshover.htc" %>);}
17 body {behavior: url(<%= stylesheet_path "csshover.htc" %>);}
19 </style>
18 </style>
20 <![endif]-->
19 <![endif]-->
21 <%= call_hook :view_layouts_base_html_head %>
20 <%= call_hook :view_layouts_base_html_head %>
22 <!-- page specific tags -->
21 <!-- page specific tags -->
23 <%= yield :header_tags -%>
22 <%= yield :header_tags -%>
24 </head>
23 </head>
25 <body class="<%=h body_css_classes %>">
24 <body class="<%=h body_css_classes %>">
26 <div id="wrapper">
25 <div id="wrapper">
27 <div id="wrapper2">
26 <div id="wrapper2">
28 <div id="top-menu">
27 <div id="top-menu">
29 <div id="account">
28 <div id="account">
30 <%= render_menu :account_menu -%>
29 <%= render_menu :account_menu -%>
31 </div>
30 </div>
32 <%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}", :id => 'loggedas') if User.current.logged? %>
31 <%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}", :id => 'loggedas') if User.current.logged? %>
33 <%= render_menu :top_menu if User.current.logged? || !Setting.login_required? -%>
32 <%= render_menu :top_menu if User.current.logged? || !Setting.login_required? -%>
34 </div>
33 </div>
35
34
36 <div id="header">
35 <div id="header">
37 <% if User.current.logged? || !Setting.login_required? %>
36 <% if User.current.logged? || !Setting.login_required? %>
38 <div id="quick-search">
37 <div id="quick-search">
39 <% form_tag({:controller => 'search', :action => 'index', :id => @project}, :method => :get ) do %>
38 <% form_tag({:controller => 'search', :action => 'index', :id => @project}, :method => :get ) do %>
40 <%= hidden_field_tag(controller.default_search_scope, 1, :id => nil) if controller.default_search_scope %>
39 <%= hidden_field_tag(controller.default_search_scope, 1, :id => nil) if controller.default_search_scope %>
41 <%= link_to l(:label_search), {:controller => 'search', :action => 'index', :id => @project}, :accesskey => accesskey(:search) %>:
40 <%= link_to l(:label_search), {:controller => 'search', :action => 'index', :id => @project}, :accesskey => accesskey(:search) %>:
42 <%= text_field_tag 'q', @question, :size => 20, :class => 'small', :accesskey => accesskey(:quick_search) %>
41 <%= text_field_tag 'q', @question, :size => 20, :class => 'small', :accesskey => accesskey(:quick_search) %>
43 <% end %>
42 <% end %>
44 <%= render_project_jump_box %>
43 <%= render_project_jump_box %>
45 </div>
44 </div>
46 <% end %>
45 <% end %>
47
46
48 <h1><%= page_header_title %></h1>
47 <h1><%= page_header_title %></h1>
49
48
50 <% if display_main_menu?(@project) %>
49 <% if display_main_menu?(@project) %>
51 <div id="main-menu">
50 <div id="main-menu">
52 <%= render_main_menu(@project) %>
51 <%= render_main_menu(@project) %>
53 </div>
52 </div>
54 <% end %>
53 <% end %>
55 </div>
54 </div>
56
55
57 <%= tag('div', {:id => 'main', :class => (has_content?(:sidebar) ? '' : 'nosidebar')}, true) %>
56 <%= tag('div', {:id => 'main', :class => (has_content?(:sidebar) ? '' : 'nosidebar')}, true) %>
58 <div id="sidebar">
57 <div id="sidebar">
59 <%= yield :sidebar %>
58 <%= yield :sidebar %>
60 <%= call_hook :view_layouts_base_sidebar %>
59 <%= call_hook :view_layouts_base_sidebar %>
61 </div>
60 </div>
62
61
63 <div id="content">
62 <div id="content">
64 <%= render_flash_messages %>
63 <%= render_flash_messages %>
65 <%= yield %>
64 <%= yield %>
66 <%= call_hook :view_layouts_base_content %>
65 <%= call_hook :view_layouts_base_content %>
67 <div style="clear:both;"></div>
66 <div style="clear:both;"></div>
68 </div>
67 </div>
69 </div>
68 </div>
70
69
71 <div id="ajax-indicator" style="display:none;"><span><%= l(:label_loading) %></span></div>
70 <div id="ajax-indicator" style="display:none;"><span><%= l(:label_loading) %></span></div>
72
71
73 <div id="footer">
72 <div id="footer">
74 <div class="bgl"><div class="bgr">
73 <div class="bgl"><div class="bgr">
75 Powered by <%= link_to Redmine::Info.app_name, Redmine::Info.url %> &copy; 2006-2011 Jean-Philippe Lang
74 Powered by <%= link_to Redmine::Info.app_name, Redmine::Info.url %> &copy; 2006-2011 Jean-Philippe Lang
76 </div></div>
75 </div></div>
77 </div>
76 </div>
78 </div>
77 </div>
79 </div>
78 </div>
80 <%= call_hook :view_layouts_base_body_bottom %>
79 <%= call_hook :view_layouts_base_body_bottom %>
81 </body>
80 </body>
82 </html>
81 </html>
@@ -1,47 +1,52
1 # Redmine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006-2008 Jean-Philippe Lang
2 # Copyright (C) 2006-2008 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 module Redmine
18 module Redmine
19 module WikiFormatting
19 module WikiFormatting
20 module Textile
20 module Textile
21 module Helper
21 module Helper
22 def wikitoolbar_for(field_id)
22 def wikitoolbar_for(field_id)
23 heads_for_wiki_formatter
23 # Is there a simple way to link to a public resource?
24 # Is there a simple way to link to a public resource?
24 url = "#{Redmine::Utils.relative_url_root}/help/wiki_syntax.html"
25 url = "#{Redmine::Utils.relative_url_root}/help/wiki_syntax.html"
25
26
26 help_link = l(:setting_text_formatting) + ': ' +
27 help_link = l(:setting_text_formatting) + ': ' +
27 link_to(l(:label_help), url,
28 link_to(l(:label_help), url,
28 :onclick => "window.open(\"#{ url }\", \"\", \"resizable=yes, location=no, width=300, height=640, menubar=no, status=no, scrollbars=yes\"); return false;")
29 :onclick => "window.open(\"#{ url }\", \"\", \"resizable=yes, location=no, width=300, height=640, menubar=no, status=no, scrollbars=yes\"); return false;")
29
30
30 javascript_tag("var wikiToolbar = new jsToolBar($('#{field_id}')); wikiToolbar.setHelpLink('#{help_link}'); wikiToolbar.draw();")
31 javascript_tag("var wikiToolbar = new jsToolBar($('#{field_id}')); wikiToolbar.setHelpLink('#{help_link}'); wikiToolbar.draw();")
31 end
32 end
32
33
33 def initial_page_content(page)
34 def initial_page_content(page)
34 "h1. #{@page.pretty_title}"
35 "h1. #{@page.pretty_title}"
35 end
36 end
36
37
37 def heads_for_wiki_formatter
38 def heads_for_wiki_formatter
38 @@heads_for_wiki_formatter ||=
39 unless @heads_for_wiki_formatter_included
39 javascript_include_tag('jstoolbar/jstoolbar') +
40 content_for :header_tags do
40 javascript_include_tag('jstoolbar/textile') +
41 javascript_include_tag('jstoolbar/jstoolbar') +
41 javascript_include_tag("jstoolbar/lang/jstoolbar-#{current_language.to_s.downcase}") +
42 javascript_include_tag('jstoolbar/textile') +
42 stylesheet_link_tag('jstoolbar')
43 javascript_include_tag("jstoolbar/lang/jstoolbar-#{current_language.to_s.downcase}") +
44 stylesheet_link_tag('jstoolbar')
45 end
46 @heads_for_wiki_formatter_included = true
47 end
43 end
48 end
44 end
49 end
45 end
50 end
46 end
51 end
47 end
52 end
General Comments 0
You need to be logged in to leave comments. Login now