Defect #20397 » wiki_project_link-trunk_r14445.patch
public/help/en/wiki_syntax_detailed_textile.html (working copy) | ||
---|---|---|
144 | 144 |
<li>Projects: |
145 | 145 |
<ul> |
146 | 146 |
<li><strong>project#3</strong> (link to project with id 3)</li> |
147 |
<li><strong>project:some-project</strong> (link to project with name or slug of "some-project")</li>
|
|
147 |
<li><strong>project:some-project</strong> (link to project with identifier "some-project")</li>
|
|
148 | 148 |
<li><strong>project:"Some Project"</strong> (use double quotes for project name containing spaces)</li> |
149 | 149 |
</ul></li> |
150 | 150 |
</ul> |
app/helpers/application_helper.rb (working copy) | ||
---|---|---|
730 | 730 |
# Forum messages: |
731 | 731 |
# message#1218 -> Link to message with id 1218 |
732 | 732 |
# Projects: |
733 |
# project:someproject -> Link to project named "someproject"
|
|
733 |
# project:someproject -> Link to project with identifier "someproject"
|
|
734 | 734 |
# project#3 -> Link to project with id 3 |
735 | 735 |
# |
736 | 736 |
# Links can refer other objects from other projects, using project identifier: |
... | ... | |
864 | 864 |
link = link_to_attachment(attachment, :only_path => only_path, :download => true, :class => 'attachment') |
865 | 865 |
end |
866 | 866 |
when 'project' |
867 |
if p = Project.visible.where("identifier = :s OR LOWER(name) = :s", :s => name.downcase).first
|
|
867 |
if p = Project.visible.where("identifier = :s", :s => name).first
|
|
868 | 868 |
link = link_to_project(p, {:only_path => only_path}, :class => 'project') |
869 | 869 |
end |
870 | 870 |
end |