@@ -40,7 +40,7 class SettingsController < ApplicationController | |||
|
40 | 40 | @options[:user_format] = User::USER_FORMATS.keys.collect {|f| [User.current.name(f), f.to_s] } |
|
41 | 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 | 44 | @guessed_host_and_path << ('/'+ request.relative_url_root.gsub(%r{^\/}, '')) unless request.relative_url_root.blank? |
|
45 | 45 | end |
|
46 | 46 |
@@ -291,16 +291,15 module ApplicationHelper | |||
|
291 | 291 | attachments = attachments.sort_by(&:created_on).reverse |
|
292 | 292 | text = text.gsub(/!((\<|\=|\>)?(\([^\)]+\))?(\[[^\]]+\])?(\{[^\}]+\})?)(\S+\.(bmp|gif|jpg|jpeg|png))!/i) do |m| |
|
293 | 293 | style = $1 |
|
294 | filename = $6 | |
|
295 | rf = Regexp.new(Regexp.escape(filename), Regexp::IGNORECASE) | |
|
294 | filename = $6.downcase | |
|
296 | 295 | # search for the picture in attachments |
|
297 |
if found = attachments.detect { |att| att.filename = |
|
|
296 | if found = attachments.detect { |att| att.filename.downcase == filename } | |
|
298 | 297 | image_url = url_for :only_path => only_path, :controller => 'attachments', :action => 'download', :id => found |
|
299 | 298 | desc = found.description.to_s.gsub(/^([^\(\)]*).*$/, "\\1") |
|
300 | 299 | alt = desc.blank? ? nil : "(#{desc})" |
|
301 | 300 | "!#{style}#{image_url}#{alt}!" |
|
302 | 301 | else |
|
303 | "!#{style}#{filename}!" | |
|
302 | m | |
|
304 | 303 | end |
|
305 | 304 | end |
|
306 | 305 | end |
@@ -23,7 +23,7 class Message < ActiveRecord::Base | |||
|
23 | 23 | belongs_to :last_reply, :class_name => 'Message', :foreign_key => 'last_reply_id' |
|
24 | 24 | |
|
25 | 25 | acts_as_searchable :columns => ['subject', 'content'], |
|
26 |
:include => {:board |
|
|
26 | :include => {:board => :project}, | |
|
27 | 27 | :project_key => 'project_id', |
|
28 | 28 | :date_column => "#{table_name}.created_on" |
|
29 | 29 | acts_as_event :title => Proc.new {|o| "#{o.board.name}: #{o.subject}"}, |
@@ -31,9 +31,9 class Role < ActiveRecord::Base | |||
|
31 | 31 | raise "Can not copy workflow from a #{role.class}" unless role.is_a?(Role) |
|
32 | 32 | raise "Can not copy workflow from/to an unsaved role" if proxy_owner.new_record? || role.new_record? |
|
33 | 33 | clear |
|
34 |
connection.insert "INSERT INTO |
|
|
34 | connection.insert "INSERT INTO #{Workflow.table_name} (tracker_id, old_status_id, new_status_id, role_id)" + | |
|
35 | 35 | " SELECT tracker_id, old_status_id, new_status_id, #{proxy_owner.id}" + |
|
36 |
" FROM |
|
|
36 | " FROM #{Workflow.table_name}" + | |
|
37 | 37 | " WHERE role_id = #{role.id}" |
|
38 | 38 | end |
|
39 | 39 | end |
@@ -23,9 +23,9 class Tracker < ActiveRecord::Base | |||
|
23 | 23 | raise "Can not copy workflow from a #{tracker.class}" unless tracker.is_a?(Tracker) |
|
24 | 24 | raise "Can not copy workflow from/to an unsaved tracker" if proxy_owner.new_record? || tracker.new_record? |
|
25 | 25 | clear |
|
26 |
connection.insert "INSERT INTO |
|
|
26 | connection.insert "INSERT INTO #{Workflow.table_name} (tracker_id, old_status_id, new_status_id, role_id)" + | |
|
27 | 27 | " SELECT #{proxy_owner.id}, old_status_id, new_status_id, role_id" + |
|
28 |
" FROM |
|
|
28 | " FROM #{Workflow.table_name}" + | |
|
29 | 29 | " WHERE tracker_id = #{tracker.id}" |
|
30 | 30 | end |
|
31 | 31 | end |
@@ -24,11 +24,13 | |||
|
24 | 24 | |
|
25 | 25 | <p><%= f.select :priority_id, (@priorities.collect {|p| [p.name, p.id]}), :required => true %></p> |
|
26 | 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 | 28 | <p><%= f.select :category_id, (@project.issue_categories.collect {|c| [c.name, c.id]}), :include_blank => true %> |
|
28 | 29 | <%= prompt_to_remote(l(:label_issue_category_new), |
|
29 | 30 | l(:label_issue_category_new), 'category[name]', |
|
30 | 31 | {:controller => 'projects', :action => 'add_issue_category', :id => @project}, |
|
31 | 32 | :class => 'small', :tabindex => 199) if authorize_for('projects', 'add_issue_category') %></p> |
|
33 | <% end %> | |
|
32 | 34 | <%= content_tag('p', f.select(:fixed_version_id, |
|
33 | 35 | (@project.versions.sort.collect {|v| [v.name, v.id]}), |
|
34 | 36 | { :include_blank => true })) unless @project.versions.empty? %> |
@@ -44,6 +44,7 | |||
|
44 | 44 | <fieldset><legend><%= l(:field_notes) %></legend> |
|
45 | 45 | <%= text_area_tag 'notes', @notes, :cols => 60, :rows => 10, :class => 'wiki-edit' %> |
|
46 | 46 | <%= wikitoolbar_for 'notes' %> |
|
47 | </fieldset> | |
|
47 | 48 | </div> |
|
48 | 49 | |
|
49 | 50 | <p><%= submit_tag l(:button_submit) %> |
@@ -47,6 +47,6 entries_by_day = entries.group_by(&:spent_on) | |||
|
47 | 47 | </tr> |
|
48 | 48 | <% end -%> |
|
49 | 49 | <% end -%> |
|
50 |
</tb |
|
|
50 | </tbody> | |
|
51 | 51 | </table> |
|
52 | 52 | <% end %> |
@@ -17,7 +17,6 | |||
|
17 | 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 | 18 | <td align="center"><%= link_to_if_authorized l(:button_edit), { :controller => 'versions', :action => 'edit', :id => version }, :class => 'icon icon-edit' %></td> |
|
19 | 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 | 20 | </tr> |
|
22 | 21 | <% end; reset_cycle %> |
|
23 | 22 | </tbody> |
@@ -5,7 +5,7 | |||
|
5 | 5 | <meta http-equiv="content-type" content="text/html; charset=utf-8" /> |
|
6 | 6 | <style> |
|
7 | 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 | 9 | ul.toc { padding: 4px; margin-left: 0; } |
|
10 | 10 | ul.toc li { list-style-type:none; } |
|
11 | 11 | ul.toc li.heading2 { margin-left: 1em; } |
@@ -5,7 +5,7 | |||
|
5 | 5 | <meta http-equiv="content-type" content="text/html; charset=utf-8" /> |
|
6 | 6 | <style> |
|
7 | 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 | 9 | </style> |
|
10 | 10 | </head> |
|
11 | 11 | <body> |
@@ -2,9 +2,10 class SetTopicAuthorsAsWatchers < ActiveRecord::Migration | |||
|
2 | 2 | def self.up |
|
3 | 3 | # Sets active users who created/replied a topic as watchers of the topic |
|
4 | 4 | # so that the new watch functionality at topic level doesn't affect notifications behaviour |
|
5 |
Message.connection.execute("INSERT INTO |
|
|
6 |
" SELECT DISTINCT 'Message', COALESCE(m |
|
|
7 |
" |
|
|
5 | Message.connection.execute("INSERT INTO #{Watcher.table_name} (watchable_type, watchable_id, user_id)" + | |
|
6 | " SELECT DISTINCT 'Message', COALESCE(m.parent_id, m.id), m.author_id" + | |
|
7 | " FROM #{Message.table_name} m, #{User.table_name} u" + | |
|
8 | " WHERE m.author_id = u.id AND u.status = 1") | |
|
8 | 9 | end |
|
9 | 10 | |
|
10 | 11 | def self.down |
@@ -792,7 +792,7 class RedCloth3 < String | |||
|
792 | 792 | (?:\(([^)]+?)\)(?="))? # $title |
|
793 | 793 | ": |
|
794 | 794 | ( # $url |
|
795 | (\/|https?:\/\/|s?ftps?:\/\/|www\.) | |
|
795 | (\/|[a-zA-Z]+:\/\/|www\.) # $proto | |
|
796 | 796 | [\w\/]\S+? |
|
797 | 797 | ) |
|
798 | 798 | (\/)? # $slash |
@@ -61,7 +61,7 | |||
|
61 | 61 | |
|
62 | 62 | <ul> |
|
63 | 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 | 65 | </ul> |
|
66 | 66 | |
|
67 | 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 | 89 | def test_attached_images |
|
90 | 90 | to_test = { |
|
91 | 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 | 96 | attachments = Attachment.find(:all) |
|
95 | 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