Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Display contributors in plugin info page ;)
- Loading branch information
root
committed
Sep 17, 2015
1 parent
96285a8
commit 0cc7ef1
Showing
9 changed files
with
103 additions
and
7 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,4 @@ | ||
%div{ style: 'height: 50%;' } | ||
%ul{ class: 'authors-list' } | ||
- @authors.each do |author| | ||
%li= mail_to author.email, author.name |
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,41 @@ | ||
// Bind links on Dialog box | ||
function initModalBox() { | ||
$('#ajax-modal').dialog({ | ||
resizable: false, | ||
autoOpen: false, | ||
height: 'auto', | ||
width: 'auto', | ||
modal: true, | ||
hide: { | ||
effect: "fade", | ||
duration: 500 | ||
}, | ||
buttons: { | ||
Ok: function(){$(this).dialog('close');} | ||
} | ||
}); | ||
|
||
$('.modal-box').each(function() { | ||
$(this).on('click', function() { | ||
var title = $(this).html(); | ||
$.get($(this).attr('href'), function(data){ | ||
$('#ajax-modal').html(data); | ||
$('#ajax-modal').dialog('option', 'title', title); | ||
$('#ajax-modal').dialog('open'); | ||
}); | ||
return false; | ||
}); | ||
}); | ||
} | ||
|
||
function enhanceAuthorsUrlForPlugin(plugin_name) { | ||
var link = $('#plugin-' + plugin_name + ' > td.author > a'); | ||
if (link.length) { | ||
link.addClass('modal-box'); | ||
initModalBox(); | ||
} | ||
} | ||
|
||
$(document).ready(function() { | ||
enhanceAuthorsUrlForPlugin('redmine_git_hosting'); | ||
}); |
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
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
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
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
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
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 @@ | ||
module RedmineGitHosting | ||
class PluginAuthor | ||
|
||
attr_reader :author | ||
|
||
|
||
def initialize(author) | ||
@author = author | ||
end | ||
|
||
|
||
def name | ||
RedmineGitHosting::Utils::Git.author_name(author) | ||
end | ||
|
||
|
||
def email | ||
RedmineGitHosting::Utils::Git.author_email(author).downcase | ||
end | ||
|
||
end | ||
end |
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