2012-07-18 19:02:27 +01:00
|
|
|
%ul.nav.nav-tabs#pull_tabs
|
2012-07-16 17:27:41 +01:00
|
|
|
%li
|
|
|
|
%a{"data-toggle" => "tab", :href => "#discussion"}=t 'pull_requests.tabs.discussion'
|
|
|
|
-if @stats
|
|
|
|
%li
|
|
|
|
%a{"data-toggle" => "tab", :href => "#diff"}="#{t'pull_requests.tabs.diff'} (#{@stats.count})"
|
|
|
|
-if @commits
|
|
|
|
%li
|
2012-09-26 18:00:58 +01:00
|
|
|
- commits_message = @commits.count.to_s
|
|
|
|
- commits_message << '+' if @total_commits > @commits.count
|
|
|
|
%a{"data-toggle" => "tab", :href => "#commits"}="#{t'pull_requests.tabs.commits'} (#{commits_message})"
|
2012-07-18 19:02:27 +01:00
|
|
|
|
|
|
|
:javascript
|
|
|
|
$(document).ready(function() {
|
2012-08-08 16:47:58 +01:00
|
|
|
var tab = 'discussion';
|
|
|
|
if(document.location.href.match(/(.*)#diff(.*)/)) {
|
|
|
|
tab = 'diff';
|
|
|
|
} else if(document.location.href.match(/(.*)#commits(.*)/)) {
|
|
|
|
tab = 'commits';
|
|
|
|
};
|
|
|
|
$('#pull_tabs a[href="#'+tab+'"]').tab('show');
|
2012-09-26 18:00:58 +01:00
|
|
|
});
|