Merged r2270, r2344, r2359, r2360, r2362, r2363, r2415, r2423, r2424 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/0.8-stable@2425 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
fae04f3ae1
commit
bc4249e3d3
@ -40,7 +40,7 @@ class SettingsController < ApplicationController
|
|||||||
@options[:user_format] = User::USER_FORMATS.keys.collect {|f| [User.current.name(f), f.to_s] }
|
@options[:user_format] = User::USER_FORMATS.keys.collect {|f| [User.current.name(f), f.to_s] }
|
||||||
@deliveries = ActionMailer::Base.perform_deliveries
|
@deliveries = ActionMailer::Base.perform_deliveries
|
||||||
|
|
||||||
@guessed_host_and_path = request.host_with_port
|
@guessed_host_and_path = request.host_with_port.dup
|
||||||
@guessed_host_and_path << ('/'+ request.relative_url_root.gsub(%r{^\/}, '')) unless request.relative_url_root.blank?
|
@guessed_host_and_path << ('/'+ request.relative_url_root.gsub(%r{^\/}, '')) unless request.relative_url_root.blank?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -291,16 +291,15 @@ module ApplicationHelper
|
|||||||
attachments = attachments.sort_by(&:created_on).reverse
|
attachments = attachments.sort_by(&:created_on).reverse
|
||||||
text = text.gsub(/!((\<|\=|\>)?(\([^\)]+\))?(\[[^\]]+\])?(\{[^\}]+\})?)(\S+\.(bmp|gif|jpg|jpeg|png))!/i) do |m|
|
text = text.gsub(/!((\<|\=|\>)?(\([^\)]+\))?(\[[^\]]+\])?(\{[^\}]+\})?)(\S+\.(bmp|gif|jpg|jpeg|png))!/i) do |m|
|
||||||
style = $1
|
style = $1
|
||||||
filename = $6
|
filename = $6.downcase
|
||||||
rf = Regexp.new(Regexp.escape(filename), Regexp::IGNORECASE)
|
|
||||||
# search for the picture in attachments
|
# search for the picture in attachments
|
||||||
if found = attachments.detect { |att| att.filename =~ rf }
|
if found = attachments.detect { |att| att.filename.downcase == filename }
|
||||||
image_url = url_for :only_path => only_path, :controller => 'attachments', :action => 'download', :id => found
|
image_url = url_for :only_path => only_path, :controller => 'attachments', :action => 'download', :id => found
|
||||||
desc = found.description.to_s.gsub(/^([^\(\)]*).*$/, "\\1")
|
desc = found.description.to_s.gsub(/^([^\(\)]*).*$/, "\\1")
|
||||||
alt = desc.blank? ? nil : "(#{desc})"
|
alt = desc.blank? ? nil : "(#{desc})"
|
||||||
"!#{style}#{image_url}#{alt}!"
|
"!#{style}#{image_url}#{alt}!"
|
||||||
else
|
else
|
||||||
"!#{style}#{filename}!"
|
m
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -23,7 +23,7 @@ class Message < ActiveRecord::Base
|
|||||||
belongs_to :last_reply, :class_name => 'Message', :foreign_key => 'last_reply_id'
|
belongs_to :last_reply, :class_name => 'Message', :foreign_key => 'last_reply_id'
|
||||||
|
|
||||||
acts_as_searchable :columns => ['subject', 'content'],
|
acts_as_searchable :columns => ['subject', 'content'],
|
||||||
:include => {:board, :project},
|
:include => {:board => :project},
|
||||||
:project_key => 'project_id',
|
:project_key => 'project_id',
|
||||||
:date_column => "#{table_name}.created_on"
|
:date_column => "#{table_name}.created_on"
|
||||||
acts_as_event :title => Proc.new {|o| "#{o.board.name}: #{o.subject}"},
|
acts_as_event :title => Proc.new {|o| "#{o.board.name}: #{o.subject}"},
|
||||||
|
@ -31,9 +31,9 @@ class Role < ActiveRecord::Base
|
|||||||
raise "Can not copy workflow from a #{role.class}" unless role.is_a?(Role)
|
raise "Can not copy workflow from a #{role.class}" unless role.is_a?(Role)
|
||||||
raise "Can not copy workflow from/to an unsaved role" if proxy_owner.new_record? || role.new_record?
|
raise "Can not copy workflow from/to an unsaved role" if proxy_owner.new_record? || role.new_record?
|
||||||
clear
|
clear
|
||||||
connection.insert "INSERT INTO workflows (tracker_id, old_status_id, new_status_id, role_id)" +
|
connection.insert "INSERT INTO #{Workflow.table_name} (tracker_id, old_status_id, new_status_id, role_id)" +
|
||||||
" SELECT tracker_id, old_status_id, new_status_id, #{proxy_owner.id}" +
|
" SELECT tracker_id, old_status_id, new_status_id, #{proxy_owner.id}" +
|
||||||
" FROM workflows" +
|
" FROM #{Workflow.table_name}" +
|
||||||
" WHERE role_id = #{role.id}"
|
" WHERE role_id = #{role.id}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -23,9 +23,9 @@ class Tracker < ActiveRecord::Base
|
|||||||
raise "Can not copy workflow from a #{tracker.class}" unless tracker.is_a?(Tracker)
|
raise "Can not copy workflow from a #{tracker.class}" unless tracker.is_a?(Tracker)
|
||||||
raise "Can not copy workflow from/to an unsaved tracker" if proxy_owner.new_record? || tracker.new_record?
|
raise "Can not copy workflow from/to an unsaved tracker" if proxy_owner.new_record? || tracker.new_record?
|
||||||
clear
|
clear
|
||||||
connection.insert "INSERT INTO workflows (tracker_id, old_status_id, new_status_id, role_id)" +
|
connection.insert "INSERT INTO #{Workflow.table_name} (tracker_id, old_status_id, new_status_id, role_id)" +
|
||||||
" SELECT #{proxy_owner.id}, old_status_id, new_status_id, role_id" +
|
" SELECT #{proxy_owner.id}, old_status_id, new_status_id, role_id" +
|
||||||
" FROM workflows" +
|
" FROM #{Workflow.table_name}" +
|
||||||
" WHERE tracker_id = #{tracker.id}"
|
" WHERE tracker_id = #{tracker.id}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -24,11 +24,13 @@
|
|||||||
|
|
||||||
<p><%= f.select :priority_id, (@priorities.collect {|p| [p.name, p.id]}), :required => true %></p>
|
<p><%= f.select :priority_id, (@priorities.collect {|p| [p.name, p.id]}), :required => true %></p>
|
||||||
<p><%= f.select :assigned_to_id, (@issue.assignable_users.collect {|m| [m.name, m.id]}), :include_blank => true %></p>
|
<p><%= f.select :assigned_to_id, (@issue.assignable_users.collect {|m| [m.name, m.id]}), :include_blank => true %></p>
|
||||||
|
<% unless @project.issue_categories.empty? %>
|
||||||
<p><%= f.select :category_id, (@project.issue_categories.collect {|c| [c.name, c.id]}), :include_blank => true %>
|
<p><%= f.select :category_id, (@project.issue_categories.collect {|c| [c.name, c.id]}), :include_blank => true %>
|
||||||
<%= prompt_to_remote(l(:label_issue_category_new),
|
<%= prompt_to_remote(l(:label_issue_category_new),
|
||||||
l(:label_issue_category_new), 'category[name]',
|
l(:label_issue_category_new), 'category[name]',
|
||||||
{:controller => 'projects', :action => 'add_issue_category', :id => @project},
|
{:controller => 'projects', :action => 'add_issue_category', :id => @project},
|
||||||
:class => 'small', :tabindex => 199) if authorize_for('projects', 'add_issue_category') %></p>
|
:class => 'small', :tabindex => 199) if authorize_for('projects', 'add_issue_category') %></p>
|
||||||
|
<% end %>
|
||||||
<%= content_tag('p', f.select(:fixed_version_id,
|
<%= content_tag('p', f.select(:fixed_version_id,
|
||||||
(@project.versions.sort.collect {|v| [v.name, v.id]}),
|
(@project.versions.sort.collect {|v| [v.name, v.id]}),
|
||||||
{ :include_blank => true })) unless @project.versions.empty? %>
|
{ :include_blank => true })) unless @project.versions.empty? %>
|
||||||
|
@ -44,6 +44,7 @@
|
|||||||
<fieldset><legend><%= l(:field_notes) %></legend>
|
<fieldset><legend><%= l(:field_notes) %></legend>
|
||||||
<%= text_area_tag 'notes', @notes, :cols => 60, :rows => 10, :class => 'wiki-edit' %>
|
<%= text_area_tag 'notes', @notes, :cols => 60, :rows => 10, :class => 'wiki-edit' %>
|
||||||
<%= wikitoolbar_for 'notes' %>
|
<%= wikitoolbar_for 'notes' %>
|
||||||
|
</fieldset>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p><%= submit_tag l(:button_submit) %>
|
<p><%= submit_tag l(:button_submit) %>
|
||||||
|
@ -47,6 +47,6 @@ entries_by_day = entries.group_by(&:spent_on)
|
|||||||
</tr>
|
</tr>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
</tbdoy>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
<td><%= link_to(version.wiki_page_title, :controller => 'wiki', :page => Wiki.titleize(version.wiki_page_title)) unless version.wiki_page_title.blank? || @project.wiki.nil? %></td>
|
<td><%= link_to(version.wiki_page_title, :controller => 'wiki', :page => Wiki.titleize(version.wiki_page_title)) unless version.wiki_page_title.blank? || @project.wiki.nil? %></td>
|
||||||
<td align="center"><%= link_to_if_authorized l(:button_edit), { :controller => 'versions', :action => 'edit', :id => version }, :class => 'icon icon-edit' %></td>
|
<td align="center"><%= link_to_if_authorized l(:button_edit), { :controller => 'versions', :action => 'edit', :id => version }, :class => 'icon icon-edit' %></td>
|
||||||
<td align="center"><%= link_to_if_authorized l(:button_delete), {:controller => 'versions', :action => 'destroy', :id => version}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %></td>
|
<td align="center"><%= link_to_if_authorized l(:button_delete), {:controller => 'versions', :action => 'destroy', :id => version}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %></td>
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<% end; reset_cycle %>
|
<% end; reset_cycle %>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||||
<style>
|
<style>
|
||||||
body { font:80% Verdana,Tahoma,Arial,sans-serif; }
|
body { font:80% Verdana,Tahoma,Arial,sans-serif; }
|
||||||
h1, h2, h3, h4 { font-family: Trebuchet MS,Georgia,"Times New Roman",serif; }
|
h1, h2, h3, h4 { font-family: "Trebuchet MS",Georgia,"Times New Roman",serif; }
|
||||||
ul.toc { padding: 4px; margin-left: 0; }
|
ul.toc { padding: 4px; margin-left: 0; }
|
||||||
ul.toc li { list-style-type:none; }
|
ul.toc li { list-style-type:none; }
|
||||||
ul.toc li.heading2 { margin-left: 1em; }
|
ul.toc li.heading2 { margin-left: 1em; }
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
|
||||||
<style>
|
<style>
|
||||||
body { font:80% Verdana,Tahoma,Arial,sans-serif; }
|
body { font:80% Verdana,Tahoma,Arial,sans-serif; }
|
||||||
h1, h2, h3, h4 { font-family: Trebuchet MS,Georgia,"Times New Roman",serif; }
|
h1, h2, h3, h4 { font-family: "Trebuchet MS",Georgia,"Times New Roman",serif; }
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -2,9 +2,10 @@ class SetTopicAuthorsAsWatchers < ActiveRecord::Migration
|
|||||||
def self.up
|
def self.up
|
||||||
# Sets active users who created/replied a topic as watchers of the topic
|
# Sets active users who created/replied a topic as watchers of the topic
|
||||||
# so that the new watch functionality at topic level doesn't affect notifications behaviour
|
# so that the new watch functionality at topic level doesn't affect notifications behaviour
|
||||||
Message.connection.execute("INSERT INTO watchers (watchable_type, watchable_id, user_id)" +
|
Message.connection.execute("INSERT INTO #{Watcher.table_name} (watchable_type, watchable_id, user_id)" +
|
||||||
" SELECT DISTINCT 'Message', COALESCE(messages.parent_id, messages.id), messages.author_id FROM messages, users" +
|
" SELECT DISTINCT 'Message', COALESCE(m.parent_id, m.id), m.author_id" +
|
||||||
" WHERE messages.author_id = users.id AND users.status = 1")
|
" FROM #{Message.table_name} m, #{User.table_name} u" +
|
||||||
|
" WHERE m.author_id = u.id AND u.status = 1")
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.down
|
def self.down
|
||||||
|
@ -792,7 +792,7 @@ class RedCloth3 < String
|
|||||||
(?:\(([^)]+?)\)(?="))? # $title
|
(?:\(([^)]+?)\)(?="))? # $title
|
||||||
":
|
":
|
||||||
( # $url
|
( # $url
|
||||||
(\/|https?:\/\/|s?ftps?:\/\/|www\.)
|
(\/|[a-zA-Z]+:\/\/|www\.) # $proto
|
||||||
[\w\/]\S+?
|
[\w\/]\S+?
|
||||||
)
|
)
|
||||||
(\/)? # $slash
|
(\/)? # $slash
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><strong>[[sandbox:some page]]</strong> displays a link to the page named 'Some page' of the Sandbox wiki</li>
|
<li><strong>[[sandbox:some page]]</strong> displays a link to the page named 'Some page' of the Sandbox wiki</li>
|
||||||
<li><strong>[[sandbox]]</strong> displays a link to the Sandbox wiki main page</li>
|
<li><strong>[[sandbox:]]</strong> displays a link to the Sandbox wiki main page</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>Wiki links are displayed in red if the page doesn't exist yet, eg: <a href="Nonexistent_page.html" class="wiki-page new">Nonexistent page</a>.</p>
|
<p>Wiki links are displayed in red if the page doesn't exist yet, eg: <a href="Nonexistent_page.html" class="wiki-page new">Nonexistent page</a>.</p>
|
||||||
|
@ -89,7 +89,9 @@ class ApplicationHelperTest < HelperTestCase
|
|||||||
def test_attached_images
|
def test_attached_images
|
||||||
to_test = {
|
to_test = {
|
||||||
'Inline image: !logo.gif!' => 'Inline image: <img src="/attachments/download/3" title="This is a logo" alt="This is a logo" />',
|
'Inline image: !logo.gif!' => 'Inline image: <img src="/attachments/download/3" title="This is a logo" alt="This is a logo" />',
|
||||||
'Inline image: !logo.GIF!' => 'Inline image: <img src="/attachments/download/3" title="This is a logo" alt="This is a logo" />'
|
'Inline image: !logo.GIF!' => 'Inline image: <img src="/attachments/download/3" title="This is a logo" alt="This is a logo" />',
|
||||||
|
'No match: !ogo.gif!' => 'No match: <img src="ogo.gif" alt="" />',
|
||||||
|
'No match: !ogo.GIF!' => 'No match: <img src="ogo.GIF" alt="" />'
|
||||||
}
|
}
|
||||||
attachments = Attachment.find(:all)
|
attachments = Attachment.find(:all)
|
||||||
to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text, :attachments => attachments) }
|
to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text, :attachments => attachments) }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user