<% # API my $api = gitprep_api; # Git my $git = $self->app->git; # Parameters my $user = param('user'); my $project = param('project'); my $rev_file = param('rev_file'); my ($rev, $file) = $git->parse_rev_path($user, $project, $rev_file); my $page = param('page') || 0; # Commit my $commit = $git->get_commit($user, $project, $rev); # Commits my $page_count = 30; my $commits = $git->get_commits( $user, $project, $commit->{id}, $page_count, $page_count * $page, $file ); my $commits_count = @$commits; my $commits_date = {}; for my $commit (@$commits) { my $date = $commit->{age_string_date_local}; $commits_date->{$date} ||= []; push @{$commits_date->{$date}}, $commit; } # Global variable stash(user => $user, project => $project, rev => $rev); %> % layout 'common', title => "Commit History \x{30fb} $user/$project"; %= include '/include/header';
%= include '/include/project_header'; %= include '/include/code_menu', display => 'commits';
% if (defined $file && length $file) { %= include '/include/page_path', type => 'blob', Path => $file, operation => 'commits', prefix => 'History for'; % } else {
"> <%= $project %> / Commit History
% }
% for my $date (reverse sort keys %$commits_date) {
% my $commits = $commits_date->{$date};
<%= $date %>
% my $num = 0; % for my $commit (sort {$b->{author_epoch} <=> $a->{author_epoch}} @$commits) {
<%= $commit->{author_name} %> <%= $commit->{age_string} %>
% $num++; % }
% }
%= include '/include/footer';