##// END OF EJS Templates
Merged r1015, r1019, r1022 to r1025, r1045 and r1047 from trunk....
Jean-Philippe Lang -
r1035:bd7542cf9815
parent child
Show More
@@ -1,7 +1,7
1 <% user_projects_by_root = User.current.projects.find(:all, :include => :parent).group_by(&:root) %>
1 <% user_projects_by_root = User.current.projects.find(:all, :include => :parent).group_by(&:root) %>
2 <select onchange="if (this.value != '') { window.location = this.value; }">
2 <select onchange="if (this.value != '') { window.location = this.value; }">
3 <option selected><%= l(:label_jump_to_a_project) %></option>
3 <option selected="selected"><%= l(:label_jump_to_a_project) %></option>
4 <option disabled>---</option>
4 <option disabled="disabled">---</option>
5 <% user_projects_by_root.keys.sort.each do |root| %>
5 <% user_projects_by_root.keys.sort.each do |root| %>
6 <%= content_tag('option', h(root.name), :value => url_for(:controller => 'projects', :action => 'show', :id => root)) %>
6 <%= content_tag('option', h(root.name), :value => url_for(:controller => 'projects', :action => 'show', :id => root)) %>
7 <% user_projects_by_root[root].sort.each do |project| %>
7 <% user_projects_by_root[root].sort.each do |project| %>
@@ -1,4 +1,4
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.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 <title><%=h html_title %></title>
4 <title><%=h html_title %></title>
@@ -73,7 +73,7
73 <div id="ajax-indicator" style="display:none;"><span><%= l(:label_loading) %></span></div>
73 <div id="ajax-indicator" style="display:none;"><span><%= l(:label_loading) %></span></div>
74
74
75 <div id="footer">
75 <div id="footer">
76 Powered by <%= link_to Redmine::Info.app_name, Redmine::Info.url %> <%= Redmine::VERSION %> &copy 2006-2007 Jean-Philippe Lang
76 Powered by <%= link_to Redmine::Info.app_name, Redmine::Info.url %> <%= Redmine::VERSION %> &copy; 2006-2007 Jean-Philippe Lang
77 </div>
77 </div>
78 </body>
78 </body>
79 </html>
79 </html>
@@ -1,6 +1,6
1 <p><%= link_to(h(news.project.name), :controller => 'projects', :action => 'show', :id => news.project) + ': ' unless @project %>
1 <p><%= link_to(h(news.project.name), :controller => 'projects', :action => 'show', :id => news.project) + ': ' unless @project %>
2 <%= link_to h(news.title), :controller => 'news', :action => 'show', :id => news %>
2 <%= link_to h(news.title), :controller => 'news', :action => 'show', :id => news %>
3 <%= "(#{news.comments_count} #{lwr(:label_comment, news.comments_count).downcase})" if news.comments_count > 0 %></span>
3 <%= "(#{news.comments_count} #{lwr(:label_comment, news.comments_count).downcase})" if news.comments_count > 0 %>
4 <br />
4 <br />
5 <% unless news.summary.blank? %><span class="summary"><%=h news.summary %></span><br /><% end %>
5 <% unless news.summary.blank? %><span class="summary"><%=h news.summary %></span><br /><% end %>
6 <span class="author"><%= authoring news.created_on, news.author %></p>
6 <span class="author"><%= authoring news.created_on, news.author %></span></p>
@@ -11,9 +11,9
11 <%= select_tag 'type', options_for_select([[l(:label_diff_inline), "inline"], [l(:label_diff_side_by_side), "sbs"]], @diff_type), :onchange => "if (this.value != '') {this.form.submit()}" %></p>
11 <%= select_tag 'type', options_for_select([[l(:label_diff_inline), "inline"], [l(:label_diff_side_by_side), "sbs"]], @diff_type), :onchange => "if (this.value != '') {this.form.submit()}" %></p>
12 <% end %>
12 <% end %>
13
13
14 <div class="autoscroll">
15 <% cache(@cache_key) do %>
14 <% cache(@cache_key) do %>
16 <% @diff.each do |table_file| %>
15 <% @diff.each do |table_file| %>
16 <div class="autoscroll">
17 <% if @diff_type == 'sbs' %>
17 <% if @diff_type == 'sbs' %>
18 <table class="filecontent CodeRay">
18 <table class="filecontent CodeRay">
19 <thead>
19 <thead>
@@ -84,9 +84,9
84 </tbody>
84 </tbody>
85 </table>
85 </table>
86 <% end %>
86 <% end %>
87 </div>
87 <% end %>
88 <% end %>
88 <% end %>
89 <% end %>
89 </div>
90
90
91 <% content_for :header_tags do %>
91 <% content_for :header_tags do %>
92 <%= stylesheet_link_tag "scm" %>
92 <%= stylesheet_link_tag "scm" %>
@@ -24,12 +24,6
24
24
25 <%= link_to_attachments @page.attachments, :delete_url => (authorize_for('wiki', 'destroy_attachment') ? {:controller => 'wiki', :action => 'destroy_attachment', :page => @page.title} : nil) %>
25 <%= link_to_attachments @page.attachments, :delete_url => (authorize_for('wiki', 'destroy_attachment') ? {:controller => 'wiki', :action => 'destroy_attachment', :page => @page.title} : nil) %>
26
26
27 <div class="contextual">
28 <%= l(:label_export_to) %>
29 <%= link_to 'HTML', {:page => @page.title, :export => 'html', :version => @content.version}, :class => 'icon icon-html' %>,
30 <%= link_to 'TXT', {:page => @page.title, :export => 'txt', :version => @content.version}, :class => 'icon icon-txt' %>
31 </div>
32
33 <% if authorize_for('wiki', 'add_attachment') %>
27 <% if authorize_for('wiki', 'add_attachment') %>
34 <p><%= toggle_link l(:label_attachment_new), "add_attachment_form" %></p>
28 <p><%= toggle_link l(:label_attachment_new), "add_attachment_form" %></p>
35 <% form_tag({ :controller => 'wiki', :action => 'add_attachment', :page => @page.title }, :multipart => true, :class => "tabular", :id => "add_attachment_form", :style => "display:none;") do %>
29 <% form_tag({ :controller => 'wiki', :action => 'add_attachment', :page => @page.title }, :multipart => true, :class => "tabular", :id => "add_attachment_form", :style => "display:none;") do %>
@@ -38,6 +32,13
38 <% end %>
32 <% end %>
39 <% end %>
33 <% end %>
40
34
35 <div class="contextual">
36 <%= l(:label_export_to) %>
37 <%= link_to 'HTML', {:page => @page.title, :export => 'html', :version => @content.version}, :class => 'icon icon-html' %>,
38 <%= link_to 'TXT', {:page => @page.title, :export => 'txt', :version => @content.version}, :class => 'icon icon-txt' %>
39 </div>
40 &nbsp;
41
41 <% content_for :header_tags do %>
42 <% content_for :header_tags do %>
42 <%= stylesheet_link_tag 'scm' %>
43 <%= stylesheet_link_tag 'scm' %>
43 <% end %>
44 <% end %>
@@ -112,7 +112,7 module Redmine
112 :author => changeset[:user],
112 :author => changeset[:user],
113 :time => Time.parse(changeset[:date]),
113 :time => Time.parse(changeset[:date]),
114 :message => changeset[:description],
114 :message => changeset[:description],
115 :paths => changeset[:files].split.collect{|path| {:action => 'X', :path => "/#{path}"}}
115 :paths => changeset[:files].to_s.split.collect{|path| {:action => 'X', :path => "/#{path}"}}
116 })
116 })
117 end
117 end
118 return nil if $? && $?.exitstatus != 0
118 return nil if $? && $?.exitstatus != 0
@@ -69,4 +69,8 module ApplicationHelper
69 super((@current_theme && @current_theme.stylesheets.include?(source)) ?
69 super((@current_theme && @current_theme.stylesheets.include?(source)) ?
70 "/themes/#{@current_theme.dir}/stylesheets/#{source}" : source)
70 "/themes/#{@current_theme.dir}/stylesheets/#{source}" : source)
71 end
71 end
72
73 def path_to_stylesheet(source)
74 stylesheet_path source
75 end
72 end
76 end
@@ -39,6 +39,9 ContextMenu.prototype = {
39 this.selection = tr;
39 this.selection = tr;
40 var id = tr.id.substring(6, tr.id.length);
40 var id = tr.id.substring(6, tr.id.length);
41 /* TODO: do not hard code path */
41 /* TODO: do not hard code path */
42 new Ajax.Updater({success:'context-menu'}, '../../issues/context_menu/' + id, {asynchronous:true, evalScripts:true, onComplete:function(request){Effect.Appear('context-menu', {duration: 0.20})}})
42 new Ajax.Updater({success:'context-menu'}, '../../issues/context_menu/' + id, {asynchronous:true, evalScripts:true, onComplete:function(request){
43 Effect.Appear('context-menu', {duration: 0.20});
44 if (window.parseStylesheets) { window.parseStylesheets(); }
45 }})
43 }
46 }
44 }
47 }
@@ -123,7 +123,7 hr { width: 100%; height: 1px; background: #ccc; border: 0;}
123 textarea.wiki-edit { width: 99%; }
123 textarea.wiki-edit { width: 99%; }
124 li p {margin-top: 0;}
124 li p {margin-top: 0;}
125 div.issue {background:#ffffdd; padding:6px; margin-bottom:6px;border: 1px solid #d7d7d7;}
125 div.issue {background:#ffffdd; padding:6px; margin-bottom:6px;border: 1px solid #d7d7d7;}
126 .autoscroll {overflow-x: auto; padding:1px; width:100%;}
126 .autoscroll {overflow-x: auto; padding:1px; width:100%; margin-bottom: 1.2em;}
127 #user_firstname, #user_lastname, #user_mail, #my_account_form select { width: 90%; }
127 #user_firstname, #user_lastname, #user_mail, #my_account_form select { width: 90%; }
128
128
129 /***** Tabular forms ******/
129 /***** Tabular forms ******/
@@ -24,7 +24,7
24 }
24 }
25 #context-menu li.folder ul {
25 #context-menu li.folder ul {
26 position:absolute;
26 position:absolute;
27 left:128px; /* IE */
27 left:168px; /* IE6 */
28 top:-2px;
28 top:-2px;
29 }
29 }
30 #context-menu li.folder>ul { left:148px; }
30 #context-menu li.folder>ul { left:148px; }
@@ -117,4 +117,6 function getElementsBySelect(rule) {
117
117
118 return nodes;
118 return nodes;
119 }
119 }
120
121 window.parseStylesheets = parseStylesheets;
120 </script> No newline at end of file
122 </script>
@@ -35,83 +35,88 class RepositoriesMercurialControllerTest < Test::Unit::TestCase
35 Repository::Mercurial.create(:project => Project.find(3), :url => REPOSITORY_PATH)
35 Repository::Mercurial.create(:project => Project.find(3), :url => REPOSITORY_PATH)
36 end
36 end
37
37
38 def test_show
38 if File.directory?(REPOSITORY_PATH)
39 get :show, :id => 3
39 def test_show
40 assert_response :success
40 get :show, :id => 3
41 assert_template 'show'
41 assert_response :success
42 assert_not_nil assigns(:entries)
42 assert_template 'show'
43 assert_not_nil assigns(:changesets)
43 assert_not_nil assigns(:entries)
44 end
44 assert_not_nil assigns(:changesets)
45
45 end
46 def test_browse_root
46
47 get :browse, :id => 3
47 def test_browse_root
48 assert_response :success
48 get :browse, :id => 3
49 assert_template 'browse'
49 assert_response :success
50 assert_not_nil assigns(:entries)
50 assert_template 'browse'
51 assert_equal 3, assigns(:entries).size
51 assert_not_nil assigns(:entries)
52 assert assigns(:entries).detect {|e| e.name == 'images' && e.kind == 'dir'}
52 assert_equal 3, assigns(:entries).size
53 assert assigns(:entries).detect {|e| e.name == 'sources' && e.kind == 'dir'}
53 assert assigns(:entries).detect {|e| e.name == 'images' && e.kind == 'dir'}
54 assert assigns(:entries).detect {|e| e.name == 'README' && e.kind == 'file'}
54 assert assigns(:entries).detect {|e| e.name == 'sources' && e.kind == 'dir'}
55 end
55 assert assigns(:entries).detect {|e| e.name == 'README' && e.kind == 'file'}
56
56 end
57 def test_browse_directory
57
58 get :browse, :id => 3, :path => ['images']
58 def test_browse_directory
59 assert_response :success
59 get :browse, :id => 3, :path => ['images']
60 assert_template 'browse'
60 assert_response :success
61 assert_not_nil assigns(:entries)
61 assert_template 'browse'
62 assert_equal 2, assigns(:entries).size
62 assert_not_nil assigns(:entries)
63 entry = assigns(:entries).detect {|e| e.name == 'edit.png'}
63 assert_equal 2, assigns(:entries).size
64 assert_not_nil entry
64 entry = assigns(:entries).detect {|e| e.name == 'edit.png'}
65 assert_equal 'file', entry.kind
65 assert_not_nil entry
66 assert_equal 'images/edit.png', entry.path
66 assert_equal 'file', entry.kind
67 end
67 assert_equal 'images/edit.png', entry.path
68
68 end
69 def test_changes
69
70 get :changes, :id => 3, :path => ['images', 'edit.png']
70 def test_changes
71 assert_response :success
71 get :changes, :id => 3, :path => ['images', 'edit.png']
72 assert_template 'changes'
72 assert_response :success
73 assert_tag :tag => 'h2', :content => 'edit.png'
73 assert_template 'changes'
74 end
74 assert_tag :tag => 'h2', :content => 'edit.png'
75
75 end
76 def test_entry_show
76
77 get :entry, :id => 3, :path => ['sources', 'watchers_controller.rb']
77 def test_entry_show
78 assert_response :success
78 get :entry, :id => 3, :path => ['sources', 'watchers_controller.rb']
79 assert_template 'entry'
79 assert_response :success
80 # Line 19
80 assert_template 'entry'
81 assert_tag :tag => 'th',
81 # Line 19
82 :content => /10/,
82 assert_tag :tag => 'th',
83 :attributes => { :class => /line-num/ },
83 :content => /10/,
84 :sibling => { :tag => 'td', :content => /WITHOUT ANY WARRANTY/ }
84 :attributes => { :class => /line-num/ },
85 end
85 :sibling => { :tag => 'td', :content => /WITHOUT ANY WARRANTY/ }
86
86 end
87 def test_entry_download
87
88 get :entry, :id => 3, :path => ['sources', 'watchers_controller.rb'], :format => 'raw'
88 def test_entry_download
89 assert_response :success
89 get :entry, :id => 3, :path => ['sources', 'watchers_controller.rb'], :format => 'raw'
90 # File content
90 assert_response :success
91 assert @response.body.include?('WITHOUT ANY WARRANTY')
91 # File content
92 end
92 assert @response.body.include?('WITHOUT ANY WARRANTY')
93
93 end
94 def test_diff
95 # Full diff of changeset 4
96 get :diff, :id => 3, :rev => 4
97 assert_response :success
98 assert_template 'diff'
99 # Line 22 removed
100 assert_tag :tag => 'th',
101 :content => /22/,
102 :sibling => { :tag => 'td',
103 :attributes => { :class => /diff_out/ },
104 :content => /def remove/ }
105 end
106
94
107 def test_annotate
95 def test_diff
108 get :annotate, :id => 3, :path => ['sources', 'watchers_controller.rb']
96 # Full diff of changeset 4
109 assert_response :success
97 get :diff, :id => 3, :rev => 4
110 assert_template 'annotate'
98 assert_response :success
111 # Line 23, revision 4
99 assert_template 'diff'
112 assert_tag :tag => 'th', :content => /23/,
100 # Line 22 removed
113 :sibling => { :tag => 'td', :child => { :tag => 'a', :content => /4/ } },
101 assert_tag :tag => 'th',
114 :sibling => { :tag => 'td', :content => /jsmith/ },
102 :content => /22/,
115 :sibling => { :tag => 'td', :content => /watcher =/ }
103 :sibling => { :tag => 'td',
104 :attributes => { :class => /diff_out/ },
105 :content => /def remove/ }
106 end
107
108 def test_annotate
109 get :annotate, :id => 3, :path => ['sources', 'watchers_controller.rb']
110 assert_response :success
111 assert_template 'annotate'
112 # Line 23, revision 4
113 assert_tag :tag => 'th', :content => /23/,
114 :sibling => { :tag => 'td', :child => { :tag => 'a', :content => /4/ } },
115 :sibling => { :tag => 'td', :content => /jsmith/ },
116 :sibling => { :tag => 'td', :content => /watcher =/ }
117 end
118 else
119 puts "Mercurial test repository NOT FOUND. Skipping functional tests !!!"
120 def test_fake; assert true end
116 end
121 end
117 end
122 end
General Comments 0
You need to be logged in to leave comments. Login now