Skip to content

Commit

Permalink
Forgot to commit those files before...
Browse files Browse the repository at this point in the history
  • Loading branch information
Ippei Ukai committed May 31, 2012
1 parent 8e5cb8a commit 81450d9
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/views/issues/_changeset_github.rhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<div class="changeset <%= cycle('odd', 'even') %>">
<p><% link_to(url_for_revision) do %><%="#{l(:label_revision)} #{changeset.format_identifier}" %><% end %><br />
<span class="author"><%= authoring(changeset.committed_on, changeset.author) %></span></p>
<div class="changeset-changes">
<%= textilizable(changeset, :comments) %>
</div>
</div>
22 changes: 22 additions & 0 deletions lib/issue_changeset_listener.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
class IssueChangesetListener < Redmine::Hook::ViewListener

def view_issue_show_changeset(context)
changeset = context[:changeset]

projects_github = Setting.plugin_redmine_issue_changesets_view_link_github
github_repo = nil
github_repo = projects_github[changeset.project.identifier] unless projects_github.blank?

unless github_repo.blank?
url = "https://github.com/%s/commit/%s" % [github_repo, changeset.identifier]
else
rev = changeset.respond_to?(:identifier) ? revision.identifier : revision
url = url_for({:controller => 'repositories', :action => 'revision', :id => project.identifier, :rev => rev})
end
context[:controller].send(:render_to_string, {
:partial => "changeset_github",
:locals => context.merge({:url_for_revision=>url})
})
end

end

0 comments on commit 81450d9

Please sign in to comment.