diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 07190448..1a59f546 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -139,6 +139,8 @@ module ApplicationHelper format_wiki_link = Proc.new {|project, title| url_for :controller => 'wiki', :action => 'index', :id => project, :page => title } end + project = options[:project] || @project + # turn wiki links into html links # example: # [[mypage]] @@ -148,15 +150,15 @@ module ApplicationHelper # [[project:mypage]] # [[project:mypage|mytext]] text = text.gsub(/\[\[([^\]\|]+)(\|([^\]\|]+))?\]\]/) do |m| - project = @project + link_project = project page = $1 title = $3 if page =~ /^([^\:]+)\:(.*)$/ - project = Project.find_by_name($1) || Project.find_by_identifier($1) + link_project = Project.find_by_name($1) || Project.find_by_identifier($1) page = $2 title = $1 if page.blank? end - link_to((title || page), format_wiki_link.call(project, Wiki.titleize(page)), :class => 'wiki-page') + link_to((title || page), format_wiki_link.call(link_project, Wiki.titleize(page)), :class => 'wiki-page') end # turn issue ids into links @@ -167,7 +169,7 @@ module ApplicationHelper # turn revision ids into links (@project needed) # example: # r52 -> r52 (@project.id is 6) - text = text.gsub(/(?=\b)r(\d+)(?=\b)/) {|m| link_to "r#{$1}", {:controller => 'repositories', :action => 'revision', :id => @project.id, :rev => $1}, :class => 'changeset' } if @project + text = text.gsub(/(?=\b)r(\d+)(?=\b)/) {|m| link_to "r#{$1}", {:controller => 'repositories', :action => 'revision', :id => project.id, :rev => $1}, :class => 'changeset' } if project # when using an image link, try to use an attachment, if possible attachments = options[:attachments] diff --git a/app/views/admin/projects.rhtml b/app/views/admin/projects.rhtml index e181f85c..d231be10 100644 --- a/app/views/admin/projects.rhtml +++ b/app/views/admin/projects.rhtml @@ -27,7 +27,7 @@ <% for project in @projects %>
<%= f.select :parent_id, (@root_projects.collect {|p| [p.name, p.id]}), { :include_blank => true } %>
<% end %> -<%= f.text_area :description, :required => true, :cols => 60, :rows => 3 %>
<%= l(:text_caracters_maximum, 255) %>
<%= f.text_area :description, :required => true, :cols => 60, :rows => 5 %><%= l(:text_caracters_maximum, 255) %>
<%= f.text_field :identifier, :required => true, :size => 15, :disabled => @project.identifier_frozen? %>
<%= l(:text_length_between, 3, 12) %> <%= l(:text_project_identifier_info) unless @project.identifier_frozen? %>
<%= f.text_field :homepage, :size => 40 %>
<%= f.check_box :is_public %>
+<%= wikitoolbar_for 'project_description' %> <% for @custom_value in @custom_values %><%= custom_field_tag_with_label @custom_value %>
diff --git a/app/views/projects/list.rhtml b/app/views/projects/list.rhtml index 54cc7873..24448be4 100644 --- a/app/views/projects/list.rhtml +++ b/app/views/projects/list.rhtml @@ -11,7 +11,7 @@