Project

General

Profile

Defect #20397 » wiki_project_link-trunk_r14445.patch

Paweł Hikiert, 2015-07-23 12:28

View differences:

public/help/en/wiki_syntax_detailed_textile.html (working copy)
<li>Projects:
<ul>
<li><strong>project#3</strong> (link to project with id 3)</li>
<li><strong>project:some-project</strong> (link to project with name or slug of "some-project")</li>
<li><strong>project:some-project</strong> (link to project with identifier "some-project")</li>
<li><strong>project:"Some Project"</strong> (use double quotes for project name containing spaces)</li>
</ul></li>
</ul>
app/helpers/application_helper.rb (working copy)
# Forum messages:
# message#1218 -> Link to message with id 1218
# Projects:
# project:someproject -> Link to project named "someproject"
# project:someproject -> Link to project with identifier "someproject"
# project#3 -> Link to project with id 3
#
# Links can refer other objects from other projects, using project identifier:
......
link = link_to_attachment(attachment, :only_path => only_path, :download => true, :class => 'attachment')
end
when 'project'
if p = Project.visible.where("identifier = :s OR LOWER(name) = :s", :s => name.downcase).first
if p = Project.visible.where("identifier = :s", :s => name).first
link = link_to_project(p, {:only_path => only_path}, :class => 'project')
end
end
    (1-1/1)