Fix issues with push 600+ commits. refactored, improved push events

This commit is contained in:
randx 2012-04-04 07:39:04 +03:00
parent eb2c1cd2e3
commit 897da534fa
9 changed files with 72 additions and 45 deletions

View file

@ -24,7 +24,7 @@
- unless @commits.empty?
%h4 Commits
%h4 Commits (#{@commits.count})
%ul.unstyled= render @commits
- unless @diffs.empty?

View file

@ -47,7 +47,7 @@
- if @last_push && @last_push.valid_push?
.padded.prepend-top-20
%h5
%small Latest push was to the #{@last_push.branch_name} branch of #{@last_push.project.name}:
%small Latest push was to the #{@last_push.ref_name} #{@last_push.ref_type} of #{@last_push.project.name}:
%ul.unstyled= render @last_push
- if @merge_requests.any?

View file

@ -11,17 +11,17 @@
ago.
- if event.push_with_commits?
- if event.commits.count > 1
- if event.commits_count > 1
= link_to compare_project_commits_path(event.project, :from => event.parent_commit.id, :to => event.last_commit.id) do
%strong #{event.commits.first.id[0..7]}...#{event.last_commit.id[0..7]}
%strong #{event.parent_commit.id[0..7]}...#{event.last_commit.id[0..7]}
- project = event.project
%ul.unstyled.event_commits
- if event.commits.size > 3
- if event.commits_count > 3
- event.commits[0...2].each do |commit|
= render "events/commit", :commit => commit, :project => project
%li
%br
\... and #{event.commits.size - 2} more commits
\... and #{event.commits_count - 2} more commits
- else
- event.commits.each do |commit|
= render "events/commit", :commit => commit, :project => project