##// END OF EJS Templates
Merged r2270, r2344, r2359, r2360, r2362, r2363, r2415, r2423, r2424 from trunk....
Jean-Philippe Lang -
r2364:bc4249e3d3ed
parent child
Show More
@@ -40,7 +40,7 class SettingsController < ApplicationController
40 @options[:user_format] = User::USER_FORMATS.keys.collect {|f| [User.current.name(f), f.to_s] }
40 @options[:user_format] = User::USER_FORMATS.keys.collect {|f| [User.current.name(f), f.to_s] }
41 @deliveries = ActionMailer::Base.perform_deliveries
41 @deliveries = ActionMailer::Base.perform_deliveries
42
42
43 @guessed_host_and_path = request.host_with_port
43 @guessed_host_and_path = request.host_with_port.dup
44 @guessed_host_and_path << ('/'+ request.relative_url_root.gsub(%r{^\/}, '')) unless request.relative_url_root.blank?
44 @guessed_host_and_path << ('/'+ request.relative_url_root.gsub(%r{^\/}, '')) unless request.relative_url_root.blank?
45 end
45 end
46
46
@@ -291,16 +291,15 module ApplicationHelper
291 attachments = attachments.sort_by(&:created_on).reverse
291 attachments = attachments.sort_by(&:created_on).reverse
292 text = text.gsub(/!((\<|\=|\>)?(\([^\)]+\))?(\[[^\]]+\])?(\{[^\}]+\})?)(\S+\.(bmp|gif|jpg|jpeg|png))!/i) do |m|
292 text = text.gsub(/!((\<|\=|\>)?(\([^\)]+\))?(\[[^\]]+\])?(\{[^\}]+\})?)(\S+\.(bmp|gif|jpg|jpeg|png))!/i) do |m|
293 style = $1
293 style = $1
294 filename = $6
294 filename = $6.downcase
295 rf = Regexp.new(Regexp.escape(filename), Regexp::IGNORECASE)
296 # search for the picture in attachments
295 # search for the picture in attachments
297 if found = attachments.detect { |att| att.filename =~ rf }
296 if found = attachments.detect { |att| att.filename.downcase == filename }
298 image_url = url_for :only_path => only_path, :controller => 'attachments', :action => 'download', :id => found
297 image_url = url_for :only_path => only_path, :controller => 'attachments', :action => 'download', :id => found
299 desc = found.description.to_s.gsub(/^([^\(\)]*).*$/, "\\1")
298 desc = found.description.to_s.gsub(/^([^\(\)]*).*$/, "\\1")
300 alt = desc.blank? ? nil : "(#{desc})"
299 alt = desc.blank? ? nil : "(#{desc})"
301 "!#{style}#{image_url}#{alt}!"
300 "!#{style}#{image_url}#{alt}!"
302 else
301 else
303 "!#{style}#{filename}!"
302 m
304 end
303 end
305 end
304 end
306 end
305 end
@@ -23,7 +23,7 class Message < ActiveRecord::Base
23 belongs_to :last_reply, :class_name => 'Message', :foreign_key => 'last_reply_id'
23 belongs_to :last_reply, :class_name => 'Message', :foreign_key => 'last_reply_id'
24
24
25 acts_as_searchable :columns => ['subject', 'content'],
25 acts_as_searchable :columns => ['subject', 'content'],
26 :include => {:board, :project},
26 :include => {:board => :project},
27 :project_key => 'project_id',
27 :project_key => 'project_id',
28 :date_column => "#{table_name}.created_on"
28 :date_column => "#{table_name}.created_on"
29 acts_as_event :title => Proc.new {|o| "#{o.board.name}: #{o.subject}"},
29 acts_as_event :title => Proc.new {|o| "#{o.board.name}: #{o.subject}"},
@@ -31,9 +31,9 class Role < ActiveRecord::Base
31 raise "Can not copy workflow from a #{role.class}" unless role.is_a?(Role)
31 raise "Can not copy workflow from a #{role.class}" unless role.is_a?(Role)
32 raise "Can not copy workflow from/to an unsaved role" if proxy_owner.new_record? || role.new_record?
32 raise "Can not copy workflow from/to an unsaved role" if proxy_owner.new_record? || role.new_record?
33 clear
33 clear
34 connection.insert "INSERT INTO workflows (tracker_id, old_status_id, new_status_id, role_id)" +
34 connection.insert "INSERT INTO #{Workflow.table_name} (tracker_id, old_status_id, new_status_id, role_id)" +
35 " SELECT tracker_id, old_status_id, new_status_id, #{proxy_owner.id}" +
35 " SELECT tracker_id, old_status_id, new_status_id, #{proxy_owner.id}" +
36 " FROM workflows" +
36 " FROM #{Workflow.table_name}" +
37 " WHERE role_id = #{role.id}"
37 " WHERE role_id = #{role.id}"
38 end
38 end
39 end
39 end
@@ -23,9 +23,9 class Tracker < ActiveRecord::Base
23 raise "Can not copy workflow from a #{tracker.class}" unless tracker.is_a?(Tracker)
23 raise "Can not copy workflow from a #{tracker.class}" unless tracker.is_a?(Tracker)
24 raise "Can not copy workflow from/to an unsaved tracker" if proxy_owner.new_record? || tracker.new_record?
24 raise "Can not copy workflow from/to an unsaved tracker" if proxy_owner.new_record? || tracker.new_record?
25 clear
25 clear
26 connection.insert "INSERT INTO workflows (tracker_id, old_status_id, new_status_id, role_id)" +
26 connection.insert "INSERT INTO #{Workflow.table_name} (tracker_id, old_status_id, new_status_id, role_id)" +
27 " SELECT #{proxy_owner.id}, old_status_id, new_status_id, role_id" +
27 " SELECT #{proxy_owner.id}, old_status_id, new_status_id, role_id" +
28 " FROM workflows" +
28 " FROM #{Workflow.table_name}" +
29 " WHERE tracker_id = #{tracker.id}"
29 " WHERE tracker_id = #{tracker.id}"
30 end
30 end
31 end
31 end
@@ -24,11 +24,13
24
24
25 <p><%= f.select :priority_id, (@priorities.collect {|p| [p.name, p.id]}), :required => true %></p>
25 <p><%= f.select :priority_id, (@priorities.collect {|p| [p.name, p.id]}), :required => true %></p>
26 <p><%= f.select :assigned_to_id, (@issue.assignable_users.collect {|m| [m.name, m.id]}), :include_blank => true %></p>
26 <p><%= f.select :assigned_to_id, (@issue.assignable_users.collect {|m| [m.name, m.id]}), :include_blank => true %></p>
27 <% unless @project.issue_categories.empty? %>
27 <p><%= f.select :category_id, (@project.issue_categories.collect {|c| [c.name, c.id]}), :include_blank => true %>
28 <p><%= f.select :category_id, (@project.issue_categories.collect {|c| [c.name, c.id]}), :include_blank => true %>
28 <%= prompt_to_remote(l(:label_issue_category_new),
29 <%= prompt_to_remote(l(:label_issue_category_new),
29 l(:label_issue_category_new), 'category[name]',
30 l(:label_issue_category_new), 'category[name]',
30 {:controller => 'projects', :action => 'add_issue_category', :id => @project},
31 {:controller => 'projects', :action => 'add_issue_category', :id => @project},
31 :class => 'small', :tabindex => 199) if authorize_for('projects', 'add_issue_category') %></p>
32 :class => 'small', :tabindex => 199) if authorize_for('projects', 'add_issue_category') %></p>
33 <% end %>
32 <%= content_tag('p', f.select(:fixed_version_id,
34 <%= content_tag('p', f.select(:fixed_version_id,
33 (@project.versions.sort.collect {|v| [v.name, v.id]}),
35 (@project.versions.sort.collect {|v| [v.name, v.id]}),
34 { :include_blank => true })) unless @project.versions.empty? %>
36 { :include_blank => true })) unless @project.versions.empty? %>
@@ -44,6 +44,7
44 <fieldset><legend><%= l(:field_notes) %></legend>
44 <fieldset><legend><%= l(:field_notes) %></legend>
45 <%= text_area_tag 'notes', @notes, :cols => 60, :rows => 10, :class => 'wiki-edit' %>
45 <%= text_area_tag 'notes', @notes, :cols => 60, :rows => 10, :class => 'wiki-edit' %>
46 <%= wikitoolbar_for 'notes' %>
46 <%= wikitoolbar_for 'notes' %>
47 </fieldset>
47 </div>
48 </div>
48
49
49 <p><%= submit_tag l(:button_submit) %>
50 <p><%= submit_tag l(:button_submit) %>
@@ -47,6 +47,6 entries_by_day = entries.group_by(&:spent_on)
47 </tr>
47 </tr>
48 <% end -%>
48 <% end -%>
49 <% end -%>
49 <% end -%>
50 </tbdoy>
50 </tbody>
51 </table>
51 </table>
52 <% end %>
52 <% end %>
@@ -17,7 +17,6
17 <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>
17 <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>
18 <td align="center"><%= link_to_if_authorized l(:button_edit), { :controller => 'versions', :action => 'edit', :id => version }, :class => 'icon icon-edit' %></td>
18 <td align="center"><%= link_to_if_authorized l(:button_edit), { :controller => 'versions', :action => 'edit', :id => version }, :class => 'icon icon-edit' %></td>
19 <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>
19 <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>
20 </td>
21 </tr>
20 </tr>
22 <% end; reset_cycle %>
21 <% end; reset_cycle %>
23 </tbody>
22 </tbody>
@@ -5,7 +5,7
5 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
5 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6 <style>
6 <style>
7 body { font:80% Verdana,Tahoma,Arial,sans-serif; }
7 body { font:80% Verdana,Tahoma,Arial,sans-serif; }
8 h1, h2, h3, h4 { font-family: Trebuchet MS,Georgia,"Times New Roman",serif; }
8 h1, h2, h3, h4 { font-family: "Trebuchet MS",Georgia,"Times New Roman",serif; }
9 ul.toc { padding: 4px; margin-left: 0; }
9 ul.toc { padding: 4px; margin-left: 0; }
10 ul.toc li { list-style-type:none; }
10 ul.toc li { list-style-type:none; }
11 ul.toc li.heading2 { margin-left: 1em; }
11 ul.toc li.heading2 { margin-left: 1em; }
@@ -5,7 +5,7
5 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
5 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
6 <style>
6 <style>
7 body { font:80% Verdana,Tahoma,Arial,sans-serif; }
7 body { font:80% Verdana,Tahoma,Arial,sans-serif; }
8 h1, h2, h3, h4 { font-family: Trebuchet MS,Georgia,"Times New Roman",serif; }
8 h1, h2, h3, h4 { font-family: "Trebuchet MS",Georgia,"Times New Roman",serif; }
9 </style>
9 </style>
10 </head>
10 </head>
11 <body>
11 <body>
@@ -2,9 +2,10 class SetTopicAuthorsAsWatchers < ActiveRecord::Migration
2 def self.up
2 def self.up
3 # Sets active users who created/replied a topic as watchers of the topic
3 # Sets active users who created/replied a topic as watchers of the topic
4 # so that the new watch functionality at topic level doesn't affect notifications behaviour
4 # so that the new watch functionality at topic level doesn't affect notifications behaviour
5 Message.connection.execute("INSERT INTO watchers (watchable_type, watchable_id, user_id)" +
5 Message.connection.execute("INSERT INTO #{Watcher.table_name} (watchable_type, watchable_id, user_id)" +
6 " SELECT DISTINCT 'Message', COALESCE(messages.parent_id, messages.id), messages.author_id FROM messages, users" +
6 " SELECT DISTINCT 'Message', COALESCE(m.parent_id, m.id), m.author_id" +
7 " WHERE messages.author_id = users.id AND users.status = 1")
7 " FROM #{Message.table_name} m, #{User.table_name} u" +
8 " WHERE m.author_id = u.id AND u.status = 1")
8 end
9 end
9
10
10 def self.down
11 def self.down
@@ -792,7 +792,7 class RedCloth3 < String
792 (?:\(([^)]+?)\)(?="))? # $title
792 (?:\(([^)]+?)\)(?="))? # $title
793 ":
793 ":
794 ( # $url
794 ( # $url
795 (\/|https?:\/\/|s?ftps?:\/\/|www\.)
795 (\/|[a-zA-Z]+:\/\/|www\.) # $proto
796 [\w\/]\S+?
796 [\w\/]\S+?
797 )
797 )
798 (\/)? # $slash
798 (\/)? # $slash
@@ -61,7 +61,7
61
61
62 <ul>
62 <ul>
63 <li><strong>[[sandbox:some page]]</strong> displays a link to the page named 'Some page' of the Sandbox wiki</li>
63 <li><strong>[[sandbox:some page]]</strong> displays a link to the page named 'Some page' of the Sandbox wiki</li>
64 <li><strong>[[sandbox]]</strong> displays a link to the Sandbox wiki main page</li>
64 <li><strong>[[sandbox:]]</strong> displays a link to the Sandbox wiki main page</li>
65 </ul>
65 </ul>
66
66
67 <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>
67 <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
89 def test_attached_images
89 def test_attached_images
90 to_test = {
90 to_test = {
91 'Inline image: !logo.gif!' => 'Inline image: <img src="/attachments/download/3" title="This is a logo" alt="This is a logo" />',
91 'Inline image: !logo.gif!' => 'Inline image: <img src="/attachments/download/3" title="This is a logo" alt="This is a logo" />',
92 'Inline image: !logo.GIF!' => 'Inline image: <img src="/attachments/download/3" title="This is a logo" alt="This is a logo" />'
92 'Inline image: !logo.GIF!' => 'Inline image: <img src="/attachments/download/3" title="This is a logo" alt="This is a logo" />',
93 'No match: !ogo.gif!' => 'No match: <img src="ogo.gif" alt="" />',
94 'No match: !ogo.GIF!' => 'No match: <img src="ogo.GIF" alt="" />'
93 }
95 }
94 attachments = Attachment.find(:all)
96 attachments = Attachment.find(:all)
95 to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text, :attachments => attachments) }
97 to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text, :attachments => attachments) }
General Comments 0
You need to be logged in to leave comments. Login now