aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--web/lib/utils.rb5
-rw-r--r--web/views/test/wiki_import.erb2
2 files changed, 6 insertions, 1 deletions
diff --git a/web/lib/utils.rb b/web/lib/utils.rb
index 2549b57..c27241e 100644
--- a/web/lib/utils.rb
+++ b/web/lib/utils.rb
@@ -83,6 +83,11 @@ def external_link(id, title, link, new_window=false)
%Q{<a id="#{id}" #{target}rel="nofollow" class="extlink" href="#{link}">#{title}</a>}
end
+def wiki_link(title)
+ prefix = 'http://wiki.openstreetmap.org/wiki/'
+ external_link('wikilink_' + title.gsub(%r{[^A-Za-z0-9]}, '_'), title, prefix + title)
+end
+
def tagcloud_size(tag)
x = tag['scale1'].to_f / 20 + tag['pos'] / 4
(x * 40 + 12).to_i
diff --git a/web/views/test/wiki_import.erb b/web/views/test/wiki_import.erb
index 98c1d28..126d186 100644
--- a/web/views/test/wiki_import.erb
+++ b/web/views/test/wiki_import.erb
@@ -22,7 +22,7 @@
</tr>
<% @invalid_image_titles.each do |row| %>
<tr>
- <td><%= h(row['page_title']) %></td>
+ <td><%= wiki_link(h(row['page_title'])) %></td>
<td><%= h(row['image_title']) %></td>
</tr>
<% end %>