diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-02-09 18:46:00 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-02-09 18:46:00 +0000 |
commit | bc4249e3d3edebef687acadd9b2eaadd6eefab48 (patch) | |
tree | 14be495681dce08ea526b4db4a50e2ba7f8128b1 | |
parent | fae04f3ae1f66c797d6f7cd08ce4e8eba1cb3df7 (diff) | |
download | redmine-bc4249e3d3edebef687acadd9b2eaadd6eefab48.tar.gz redmine-bc4249e3d3edebef687acadd9b2eaadd6eefab48.zip |
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
-rw-r--r-- | app/controllers/settings_controller.rb | 2 | ||||
-rw-r--r-- | app/helpers/application_helper.rb | 7 | ||||
-rw-r--r-- | app/models/message.rb | 2 | ||||
-rw-r--r-- | app/models/role.rb | 4 | ||||
-rw-r--r-- | app/models/tracker.rb | 4 | ||||
-rw-r--r-- | app/views/issues/_form.rhtml | 2 | ||||
-rw-r--r-- | app/views/issues/bulk_edit.rhtml | 1 | ||||
-rw-r--r-- | app/views/my/blocks/_timelog.rhtml | 2 | ||||
-rw-r--r-- | app/views/projects/settings/_versions.rhtml | 1 | ||||
-rw-r--r-- | app/views/wiki/export.rhtml | 2 | ||||
-rw-r--r-- | app/views/wiki/export_multiple.rhtml | 2 | ||||
-rw-r--r-- | db/migrate/098_set_topic_authors_as_watchers.rb | 7 | ||||
-rw-r--r-- | lib/redcloth3.rb | 2 | ||||
-rw-r--r-- | public/help/wiki_syntax_detailed.html | 2 | ||||
-rw-r--r-- | test/unit/helpers/application_helper_test.rb | 4 |
15 files changed, 24 insertions, 20 deletions
diff --git a/app/controllers/settings_controller.rb b/app/controllers/settings_controller.rb index 99f7bcf08..2abda90a8 100644 --- a/app/controllers/settings_controller.rb +++ b/app/controllers/settings_controller.rb @@ -40,7 +40,7 @@ class SettingsController < ApplicationController @options[:user_format] = User::USER_FORMATS.keys.collect {|f| [User.current.name(f), f.to_s] } @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? end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 35d1670ae..c1acc5eb0 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -291,16 +291,15 @@ module ApplicationHelper attachments = attachments.sort_by(&:created_on).reverse text = text.gsub(/!((\<|\=|\>)?(\([^\)]+\))?(\[[^\]]+\])?(\{[^\}]+\})?)(\S+\.(bmp|gif|jpg|jpeg|png))!/i) do |m| style = $1 - filename = $6 - rf = Regexp.new(Regexp.escape(filename), Regexp::IGNORECASE) + filename = $6.downcase # 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 desc = found.description.to_s.gsub(/^([^\(\)]*).*$/, "\\1") alt = desc.blank? ? nil : "(#{desc})" "!#{style}#{image_url}#{alt}!" else - "!#{style}#{filename}!" + m end end end diff --git a/app/models/message.rb b/app/models/message.rb index 080e757b3..716c53b0b 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -23,7 +23,7 @@ class Message < ActiveRecord::Base belongs_to :last_reply, :class_name => 'Message', :foreign_key => 'last_reply_id' acts_as_searchable :columns => ['subject', 'content'], - :include => {:board, :project}, + :include => {:board => :project}, :project_key => 'project_id', :date_column => "#{table_name}.created_on" acts_as_event :title => Proc.new {|o| "#{o.board.name}: #{o.subject}"}, diff --git a/app/models/role.rb b/app/models/role.rb index beb13c03b..b07e7a039 100644 --- a/app/models/role.rb +++ b/app/models/role.rb @@ -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/to an unsaved role" if proxy_owner.new_record? || role.new_record? 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}" + - " FROM workflows" + + " FROM #{Workflow.table_name}" + " WHERE role_id = #{role.id}" end end diff --git a/app/models/tracker.rb b/app/models/tracker.rb index ecee908eb..7c5bae250 100644 --- a/app/models/tracker.rb +++ b/app/models/tracker.rb @@ -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/to an unsaved tracker" if proxy_owner.new_record? || tracker.new_record? 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" + - " FROM workflows" + + " FROM #{Workflow.table_name}" + " WHERE tracker_id = #{tracker.id}" end end diff --git a/app/views/issues/_form.rhtml b/app/views/issues/_form.rhtml index 0ca12554d..b44719002 100644 --- a/app/views/issues/_form.rhtml +++ b/app/views/issues/_form.rhtml @@ -24,11 +24,13 @@ <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> +<% unless @project.issue_categories.empty? %> <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), l(:label_issue_category_new), 'category[name]', {:controller => 'projects', :action => 'add_issue_category', :id => @project}, :class => 'small', :tabindex => 199) if authorize_for('projects', 'add_issue_category') %></p> +<% end %> <%= content_tag('p', f.select(:fixed_version_id, (@project.versions.sort.collect {|v| [v.name, v.id]}), { :include_blank => true })) unless @project.versions.empty? %> diff --git a/app/views/issues/bulk_edit.rhtml b/app/views/issues/bulk_edit.rhtml index b916cf092..01e4e2e16 100644 --- a/app/views/issues/bulk_edit.rhtml +++ b/app/views/issues/bulk_edit.rhtml @@ -44,6 +44,7 @@ <fieldset><legend><%= l(:field_notes) %></legend> <%= text_area_tag 'notes', @notes, :cols => 60, :rows => 10, :class => 'wiki-edit' %> <%= wikitoolbar_for 'notes' %> +</fieldset> </div> <p><%= submit_tag l(:button_submit) %> diff --git a/app/views/my/blocks/_timelog.rhtml b/app/views/my/blocks/_timelog.rhtml index a3f74e54d..ca66f7ee4 100644 --- a/app/views/my/blocks/_timelog.rhtml +++ b/app/views/my/blocks/_timelog.rhtml @@ -47,6 +47,6 @@ entries_by_day = entries.group_by(&:spent_on) </tr> <% end -%> <% end -%> -</tbdoy> +</tbody> </table> <% end %> diff --git a/app/views/projects/settings/_versions.rhtml b/app/views/projects/settings/_versions.rhtml index 7329c7f3b..79d92d81e 100644 --- a/app/views/projects/settings/_versions.rhtml +++ b/app/views/projects/settings/_versions.rhtml @@ -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 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> </tr> <% end; reset_cycle %> </tbody> diff --git a/app/views/wiki/export.rhtml b/app/views/wiki/export.rhtml index 94b4e6f0d..7f861facf 100644 --- a/app/views/wiki/export.rhtml +++ b/app/views/wiki/export.rhtml @@ -5,7 +5,7 @@ <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <style> 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 li { list-style-type:none; } ul.toc li.heading2 { margin-left: 1em; } diff --git a/app/views/wiki/export_multiple.rhtml b/app/views/wiki/export_multiple.rhtml index 6f6c603ad..a4e4c5e21 100644 --- a/app/views/wiki/export_multiple.rhtml +++ b/app/views/wiki/export_multiple.rhtml @@ -5,7 +5,7 @@ <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <style> 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> </head> <body> diff --git a/db/migrate/098_set_topic_authors_as_watchers.rb b/db/migrate/098_set_topic_authors_as_watchers.rb index 5bc41fb38..92a53f4a1 100644 --- a/db/migrate/098_set_topic_authors_as_watchers.rb +++ b/db/migrate/098_set_topic_authors_as_watchers.rb @@ -2,9 +2,10 @@ class SetTopicAuthorsAsWatchers < ActiveRecord::Migration def self.up # 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 - Message.connection.execute("INSERT INTO watchers (watchable_type, watchable_id, user_id)" + - " SELECT DISTINCT 'Message', COALESCE(messages.parent_id, messages.id), messages.author_id FROM messages, users" + - " WHERE messages.author_id = users.id AND users.status = 1") + Message.connection.execute("INSERT INTO #{Watcher.table_name} (watchable_type, watchable_id, user_id)" + + " SELECT DISTINCT 'Message', COALESCE(m.parent_id, m.id), m.author_id" + + " FROM #{Message.table_name} m, #{User.table_name} u" + + " WHERE m.author_id = u.id AND u.status = 1") end def self.down diff --git a/lib/redcloth3.rb b/lib/redcloth3.rb index c138450a2..9e63bf5ac 100644 --- a/lib/redcloth3.rb +++ b/lib/redcloth3.rb @@ -792,7 +792,7 @@ class RedCloth3 < String (?:\(([^)]+?)\)(?="))? # $title ": ( # $url - (\/|https?:\/\/|s?ftps?:\/\/|www\.) + (\/|[a-zA-Z]+:\/\/|www\.) # $proto [\w\/]\S+? ) (\/)? # $slash diff --git a/public/help/wiki_syntax_detailed.html b/public/help/wiki_syntax_detailed.html index 581da8582..b3db673b9 100644 --- a/public/help/wiki_syntax_detailed.html +++ b/public/help/wiki_syntax_detailed.html @@ -61,7 +61,7 @@ <ul>
<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>
<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>
diff --git a/test/unit/helpers/application_helper_test.rb b/test/unit/helpers/application_helper_test.rb index 5f1a58935..03a4db34d 100644 --- a/test/unit/helpers/application_helper_test.rb +++ b/test/unit/helpers/application_helper_test.rb @@ -89,7 +89,9 @@ class ApplicationHelperTest < HelperTestCase def test_attached_images 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" />', + '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) to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text, :attachments => attachments) } |