-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Forgot to commit those files before...
- Loading branch information
Ippei Ukai
committed
May 31, 2012
1 parent
8e5cb8a
commit 81450d9
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |