1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-19 15:01:14 +00:00

Merged r1505, r1506, r1511, r1512, r1517, r1518, r1524 to 1526 from trunk.

git-svn-id: http://redmine.rubyforge.org/svn/branches/0.7-stable@1532 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2008-06-14 12:21:52 +00:00
parent 9c5ec2974d
commit 2af910e8e6
9 changed files with 18 additions and 8 deletions

View File

@ -30,7 +30,7 @@ class Journal < ActiveRecord::Base
:project_key => "#{Issue.table_name}.project_id",
:date_column => "#{Issue.table_name}.created_on"
acts_as_event :title => Proc.new {|o| "#{o.issue.tracker.name} ##{o.issue.id}: #{o.issue.subject}" + ((s = o.new_status) ? " (#{s})" : '') },
acts_as_event :title => Proc.new {|o| status = ((s = o.new_status) ? " (#{s})" : nil); "#{o.issue.tracker} ##{o.issue.id}#{status}: #{o.issue.subject}" },
:description => :notes,
:author => :user,
:type => Proc.new {|o| (s = o.new_status) && s.is_closed? ? 'issue-closed' : 'issue-edit' },

View File

@ -76,7 +76,8 @@ class Repository::Cvs < Repository
unless revision_to
revision_to=scm.get_previous_revision(revision_from)
end
diff=diff+scm.diff(change_from.path, revision_from, revision_to, type)
file_diff = scm.diff(change_from.path, revision_from, revision_to)
diff = diff + file_diff unless file_diff.nil?
end
end
return diff

View File

@ -36,7 +36,7 @@
<%= render :partial => 'layouts/project_selector' if User.current.memberships.any? %>
</div>
<h1><%= h(@project ? @project.name : Setting.app_title) %></h1>
<h1><%= h(@project && !@project.new_record? ? @project.name : Setting.app_title) %></h1>
<div id="main-menu">
<%= render_main_menu(@project) %>

View File

@ -26,7 +26,7 @@ end %>
<td class="revision"><%= link_to(format_revision(entry.lastrev.name), :action => 'revision', :id => @project, :rev => entry.lastrev.identifier) if entry.lastrev && entry.lastrev.identifier %></td>
<td class="age"><%= distance_of_time_in_words(entry.lastrev.time, Time.now) if entry.lastrev && entry.lastrev.time %></td>
<td class="author"><%=h(entry.lastrev.author.to_s.split('<').first) if entry.lastrev %></td>
<% changeset = @project.repository.changesets.find_by_revision(entry.lastrev.identifier) if entry.lastrev %>
<% changeset = @project.repository.changesets.find_by_revision(entry.lastrev.identifier) if entry.lastrev && entry.lastrev.identifier %>
<td class="comments"><%=h truncate(changeset.comments, 50) unless changeset.nil? %></td>
</tr>
<% end %>

View File

@ -13,6 +13,7 @@
<%= "(#{number_to_human_size(@entry.size)})" if @entry.size %>
</p>
<%= render :partial => 'revisions', :locals => {:project => @project, :path => @path, :revisions => @changesets, :entry => @entry }%>
<%= render(:partial => 'revisions',
:locals => {:project => @project, :path => @path, :revisions => @changesets, :entry => @entry }) unless @changesets.empty? %>
<% html_title(l(:label_change_plural)) -%>

View File

@ -829,7 +829,7 @@ module SVG
@doc << DocType.new( %q{svg PUBLIC "-//W3C//DTD SVG 1.0//EN" } +
%q{"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd"} )
if style_sheet && style_sheet != ''
@doc << ProcessingInstruction.new( "xml-stylesheet",
@doc << Instruction.new( "xml-stylesheet",
%Q{href="#{style_sheet}" type="text/css"} )
end
@root = @doc.add_element( "svg", {

View File

@ -1131,7 +1131,7 @@ class RedCloth < String
end
end
ALLOWED_TAGS = %w(redpre pre code)
ALLOWED_TAGS = %w(redpre pre code notextile)
def escape_html_tags(text)
text.gsub!(%r{<(\/?([!\w]+)[^<>\n]*)(>?)}) {|m| ALLOWED_TAGS.include?($2) ? "<#{$1}#{$3}" : "&lt;#{$1}#{'&gt;' unless $3.blank?}" }

View File

@ -223,7 +223,7 @@ height: 1%;
clear:left;
}
html>body .tabular p {overflow:auto;}
html>body .tabular p {overflow:hidden;}
.tabular label{
font-weight: bold;

View File

@ -151,6 +151,14 @@ class ApplicationHelperTest < HelperTestCase
to_test.each { |text, result| assert_equal result, textilizable(text) }
end
def test_allowed_html_tags
to_test = {
"<pre>preformatted text</pre>" => "<pre>preformatted text</pre>",
"<notextile>no *textile* formatting</notextile>" => "no *textile* formatting",
}
to_test.each { |text, result| assert_equal result, textilizable(text) }
end
def test_wiki_links_in_tables
to_test = {"|Cell 11|Cell 12|Cell 13|\n|Cell 21|Cell 22||\n|Cell 31||Cell 33|" =>
'<tr><td>Cell 11</td><td>Cell 12</td><td>Cell 13</td></tr>' +