From 11ab8c0f3913f869da6ea1fb83a169efb85f57f7 Mon Sep 17 00:00:00 2001 From: "Timothy N. Tsvetkov" Date: Thu, 10 Mar 2011 16:39:49 +0300 Subject: [PATCH] views for commit --- app/views/git/commits/_commit.html.haml | 4 ++++ app/views/git/commits/_commit_pane.html.haml | 7 +++++++ app/views/git/commits/_committer_pane.html.haml | 5 +++++ app/views/git/commits/index.html.haml | 4 ++++ app/views/git/commits/show.html.haml | 14 ++++++++++++++ 5 files changed, 34 insertions(+) create mode 100644 app/views/git/commits/_commit.html.haml create mode 100644 app/views/git/commits/_commit_pane.html.haml create mode 100644 app/views/git/commits/_committer_pane.html.haml create mode 100644 app/views/git/commits/index.html.haml create mode 100644 app/views/git/commits/show.html.haml diff --git a/app/views/git/commits/_commit.html.haml b/app/views/git/commits/_commit.html.haml new file mode 100644 index 000000000..37fa64237 --- /dev/null +++ b/app/views/git/commits/_commit.html.haml @@ -0,0 +1,4 @@ +.commit_row + = render :partial => "commit_pane", :locals => { :commit => commit } + + .row= link_to commit.message, commit_path(@platform.name, @project.name, commit.id) \ No newline at end of file diff --git a/app/views/git/commits/_commit_pane.html.haml b/app/views/git/commits/_commit_pane.html.haml new file mode 100644 index 000000000..63b4815a8 --- /dev/null +++ b/app/views/git/commits/_commit_pane.html.haml @@ -0,0 +1,7 @@ += render :partial => "committer_pane", :locals => { :commit => commit } + +.row.tree Tree: #{link_to @commit.tree.id, tree_path(@platform.name, @project.name, commit.tree.id)} + +.row.parents + - commit.parents.each do |parent| + Parent: #{link_to parent, commit_path(@platform.name, @project.name, parent)} \ No newline at end of file diff --git a/app/views/git/commits/_committer_pane.html.haml b/app/views/git/commits/_committer_pane.html.haml new file mode 100644 index 000000000..e0f3fe46a --- /dev/null +++ b/app/views/git/commits/_committer_pane.html.haml @@ -0,0 +1,5 @@ +- if @commit.committer != @commit.author + .row.author Author: #{@commit.author}, #{commit_date(@commit.authored_date)} + .row.committer Committer: #{@commit.committer}, #{commit_date(@commit.committed_date)} +- else + .row.author #{@commit.author}, #{commit_date(@commit.committed_date)} \ No newline at end of file diff --git a/app/views/git/commits/index.html.haml b/app/views/git/commits/index.html.haml new file mode 100644 index 000000000..9f6d75b19 --- /dev/null +++ b/app/views/git/commits/index.html.haml @@ -0,0 +1,4 @@ +- if @path.present? + %h3 Commits for: #{@path} + += render :partial => "commit", :collection => @commits \ No newline at end of file diff --git a/app/views/git/commits/show.html.haml b/app/views/git/commits/show.html.haml new file mode 100644 index 000000000..665cb8de3 --- /dev/null +++ b/app/views/git/commits/show.html.haml @@ -0,0 +1,14 @@ +%h3 Commit: #{@commit.id} + += render :partial => "commit_pane", :locals => { :commit => @commit} + +#{link_to "raw diff", commit_path(@project.title, @repository.name, @commit.id, :diff)} | #{link_to "patch", commit_path(@project.title, @repository.name, @commit.id, :patch)} + +.row.commit_message + %code!= format_commit_message(@commit.message) + +.row.commit_stats + != render_commit_stats(@commit.stats) + +- @commit.diffs.each do |diff| + != render_inline_diff(@commit, diff)