Skip to content

Commit

Permalink
Fixed hidakatsuya#8 invalid issue path in the history page of Wiki
Browse files Browse the repository at this point in the history
  • Loading branch information
hidakatsuya committed Oct 29, 2014
1 parent 5557bc7 commit d7f1cb5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
16 changes: 14 additions & 2 deletions app/views/layouts/_body_bottom.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
<%# Render JavaScript only if current request is 'wiki/history'. -%>
<% if controller_name == 'wiki' && action_name == 'history' -%>
<%= javascript_include_tag :link_to_issue_in_comments, plugin: 'redmine_issue_wiki_journal' %>
<script>
(function() {
var issuePath = '<%=j issue_path(999) %>'.replace(/999$/, '');
var re = /#(\d+)/;
var comment;

$('.wiki-page-version .comments').each(function() {
comment = $(this).text();
if (re.test(comment)) {
$(this).html(comment.replace(re, '<a href="' + issuePath + '$1" title="Open Issue #$1">#$1</a>'));
}
});
})();
</script>
<% end -%>

10 changes: 0 additions & 10 deletions assets/javascripts/link_to_issue_in_comments.js

This file was deleted.

0 comments on commit d7f1cb5

Please sign in to comment.