diff --git a/app/controllers/auto_completes_controller.rb b/app/controllers/auto_completes_controller.rb index 021d5367..17d86f34 100644 --- a/app/controllers/auto_completes_controller.rb +++ b/app/controllers/auto_completes_controller.rb @@ -4,17 +4,18 @@ class AutoCompletesController < ApplicationController def issues @issues = [] q = params[:q].to_s - query = (params[:scope] == "all" && Setting.cross_project_issue_relations?) ? Issue : @project.issues - if q.match(/^\d+$/) - @issues << query.visible.find_by_id(q.to_i) - end - unless q.blank? - @issues += query.visible.find(:all, + + if q.present? + query = (params[:scope] == "all" && Setting.cross_project_issue_relations?) ? Issue : @project.issues + + @issues |= query.visible.find_all_by_id(q.to_i) if q =~ /^\d+$/ + + @issues |= query.visible.find(:all, :limit => 10, :order => "#{Issue.table_name}.id ASC", :conditions => ["LOWER(#{Issue.table_name}.subject) LIKE :q OR CAST(#{Issue.table_name}.id AS CHAR(13)) LIKE :q", {:q => "%#{q.downcase}%" }]) end - @issues.compact! + render :layout => false end diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb new file mode 100644 index 00000000..c0e92159 --- /dev/null +++ b/app/controllers/help_controller.rb @@ -0,0 +1,7 @@ +class HelpController < ApplicationController + def wiki_syntax + end + + def wiki_syntax_detailed + end +end diff --git a/app/controllers/watchers_controller.rb b/app/controllers/watchers_controller.rb index ad8d8be2..11699c35 100644 --- a/app/controllers/watchers_controller.rb +++ b/app/controllers/watchers_controller.rb @@ -90,7 +90,12 @@ private format.js do render(:update) do |page| replace_ids.each do |replace_id| - page.replace_html replace_id, watcher_link(@watched, user, :replace => replace_ids) + case replace_id + when 'watchers' + page.replace_html 'watchers', :partial => 'watchers/watchers', :locals => {:watched => @watched} + else + page.replace_html replace_id, watcher_link(@watched, user, :replace => replace_ids) + end end end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 67509b22..fc4ef6ef 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -60,6 +60,11 @@ module ApplicationHelper h(user.to_s) end end + + # Show a sorted linkified (if active) comma-joined list of users + def list_users(users, options={}) + users.sort.collect{|u| link_to_user(u, options)}.join(", ") + end # Displays a link to +issue+ with its subject. # Examples: diff --git a/public/help/wiki_syntax.html b/app/views/help/wiki_syntax.html.erb similarity index 74% rename from public/help/wiki_syntax.html rename to app/views/help/wiki_syntax.html.erb index 6886f340..9d41a717 100644 --- a/public/help/wiki_syntax.html +++ b/app/views/help/wiki_syntax.html.erb @@ -1,23 +1,15 @@ - - - - - -Wiki formatting - - - +<% content_for :styles do %> + h1 { font-family: Verdana, sans-serif; font-size: 14px; text-align: center; color: #444; } + body { font-family: Verdana, sans-serif; font-size: 12px; color: #444; } + table th { padding-top: 1em; } + table td { vertical-align: top; background-color: #f5f5f5; height: 2em; vertical-align: middle;} + table td code { font-size: 1.2em; } + table td h1 { font-size: 1.8em; text-align: left; } + table td h2 { font-size: 1.4em; text-align: left; } + table td h3 { font-size: 1.2em; text-align: left; } +<% end %> +<% html_title "Wiki Syntax Quick Reference" %>

Wiki Syntax Quick Reference

@@ -48,8 +40,9 @@ table td h3 { font-size: 1.2em; text-align: left; } - + + @@ -60,7 +53,4 @@ table td h3 { font-size: 1.2em; text-align: left; }
http://foo.barhttp://foo.bar
"Foo":http://foo.barFoo
Redmine links
ChiliProject links
Link to a Wiki page[[Wiki page]]Wiki page
Link to a Wiki page[[Sandbox:Wiki page]]Wiki page (On the Sandbox project)
Issue #12Issue #12
Revision r43Revision r43
commit:f30e13e43f30e13e4
!attached_image!
-

More Information

- - - +

More Information

diff --git a/public/help/wiki_syntax_detailed.html b/app/views/help/wiki_syntax_detailed.html.erb similarity index 83% rename from public/help/wiki_syntax_detailed.html rename to app/views/help/wiki_syntax_detailed.html.erb index 0c9cea34..0127efd7 100644 --- a/public/help/wiki_syntax_detailed.html +++ b/app/views/help/wiki_syntax_detailed.html.erb @@ -1,9 +1,4 @@ - - - -RedmineWikiFormatting - - - +<% end %> - -

Wiki formatting

+<% html_title "Wiki Formatting" %> +

Wiki Formatting

Links

-

Redmine links

+

ChiliProject links

-

Redmine allows hyperlinking between issues, changesets and wiki pages from anywhere wiki formatting is used.

+

ChiliProject allows hyperlinking between issues, changesets and wiki pages from anywhere wiki formatting is used.

@@ -130,8 +124,8 @@

Escaping:

-