summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2012-09-17 10:06:56 -0400
committerRobert Speicher <rspeicher@gmail.com>2012-09-26 16:32:21 -0400
commitb389247c029b21f5e85abb5896d2cf22230c9cb1 (patch)
treea5fa81007b4d40f1580ab916efe6729f50e16254 /app
parenta21abce94f25d24b48c038e4a36974735a5b7149 (diff)
downloadgitlab-ce-b389247c029b21f5e85abb5896d2cf22230c9cb1.tar.gz
Use Commit#show instead of Commits#show to view a single commit
Commits#show (plural) is going to be for showing commit history on a specific path.
Diffstat (limited to 'app')
-rw-r--r--app/controllers/commits_controller.rb38
-rw-r--r--app/roles/static_model.rb4
-rw-r--r--app/views/commit/show.html.haml (renamed from app/views/commits/show.html.haml)0
-rw-r--r--app/views/commits/_commit.html.haml7
-rw-r--r--app/views/events/_commit.html.haml2
-rw-r--r--app/views/refs/blame.html.haml4
-rw-r--r--app/views/repositories/_branch.html.haml2
7 files changed, 30 insertions, 27 deletions
diff --git a/app/controllers/commits_controller.rb b/app/controllers/commits_controller.rb
index 1e7aec005f1..83404bdc2db 100644
--- a/app/controllers/commits_controller.rb
+++ b/app/controllers/commits_controller.rb
@@ -26,25 +26,25 @@ class CommitsController < ApplicationController
end
end
- def show
- result = CommitLoad.new(project, current_user, params).execute
-
- @commit = result[:commit]
-
- if @commit
- @suppress_diff = result[:suppress_diff]
- @note = result[:note]
- @line_notes = result[:line_notes]
- @notes_count = result[:notes_count]
- @comments_allowed = true
- else
- return git_not_found!
- end
-
- if result[:status] == :huge_commit
- render "huge_commit" and return
- end
- end
+ # def show
+ # result = CommitLoad.new(project, current_user, params).execute
+
+ # @commit = result[:commit]
+
+ # if @commit
+ # @suppress_diff = result[:suppress_diff]
+ # @note = result[:note]
+ # @line_notes = result[:line_notes]
+ # @notes_count = result[:notes_count]
+ # @comments_allowed = true
+ # else
+ # return git_not_found!
+ # end
+
+ # if result[:status] == :huge_commit
+ # render "huge_commit" and return
+ # end
+ # end
def compare
result = Commit.compare(project, params[:from], params[:to])
diff --git a/app/roles/static_model.rb b/app/roles/static_model.rb
index d26c8f47501..d67af2439c7 100644
--- a/app/roles/static_model.rb
+++ b/app/roles/static_model.rb
@@ -25,6 +25,10 @@ module StaticModel
id
end
+ def new_record?
+ false
+ end
+
def persisted?
false
end
diff --git a/app/views/commits/show.html.haml b/app/views/commit/show.html.haml
index d12fff96835..d12fff96835 100644
--- a/app/views/commits/show.html.haml
+++ b/app/views/commit/show.html.haml
diff --git a/app/views/commits/_commit.html.haml b/app/views/commits/_commit.html.haml
index 61371d14c5f..6abea76cd14 100644
--- a/app/views/commits/_commit.html.haml
+++ b/app/views/commits/_commit.html.haml
@@ -1,16 +1,15 @@
%li.commit
.browse_code_link_holder
%p
- %strong= link_to "Browse Code »", tree_project_ref_path(@project, commit.id), class: "right"
+ %strong= link_to "Browse Code »", tree_project_ref_path(@project, commit), class: "right"
%p
- = link_to commit.short_id(8), project_commit_path(@project, id: commit.id), class: "commit_short_id"
+ = link_to commit.short_id(8), project_commit_path(@project, commit), class: "commit_short_id"
%strong.commit-author-name= commit.author_name
%span.dash &ndash;
= image_tag gravatar_icon(commit.author_email), class: "avatar", width: 16
- = link_to_gfm truncate(commit.title, length: 50), project_commit_path(@project, id: commit.id), class: "row_title"
+ = link_to_gfm truncate(commit.title, length: 50), project_commit_path(@project, commit.id), class: "row_title"
%span.committed_ago
= time_ago_in_words(commit.committed_date)
ago
&nbsp;
-
diff --git a/app/views/events/_commit.html.haml b/app/views/events/_commit.html.haml
index ed4f33c0187..ea417aa9f30 100644
--- a/app/views/events/_commit.html.haml
+++ b/app/views/events/_commit.html.haml
@@ -1,7 +1,7 @@
- commit = CommitDecorator.decorate(commit)
%li.commit
%p
- = link_to commit.short_id(8), project_commit_path(project, id: commit.id), class: "commit_short_id"
+ = link_to commit.short_id(8), project_commit_path(project, commit), class: "commit_short_id"
%span= commit.author_name
&ndash;
= image_tag gravatar_icon(commit.author_email), class: "avatar", width: 16
diff --git a/app/views/refs/blame.html.haml b/app/views/refs/blame.html.haml
index eb66f59760b..ba0fad5286d 100644
--- a/app/views/refs/blame.html.haml
+++ b/app/views/refs/blame.html.haml
@@ -32,8 +32,8 @@
= commit.author_name
%td.blame_commit
&nbsp;
- %code= link_to commit.short_id, project_commit_path(@project, id: commit.id)
- = link_to_gfm truncate(commit.title, length: 30), project_commit_path(@project, id: commit.id), class: "row_title" rescue "--broken encoding"
+ %code= link_to commit.short_id, project_commit_path(@project, commit)
+ = link_to_gfm truncate(commit.title, length: 30), project_commit_path(@project, commit), class: "row_title" rescue "--broken encoding"
%td.lines
= preserve do
%pre
diff --git a/app/views/repositories/_branch.html.haml b/app/views/repositories/_branch.html.haml
index 64a633be8ac..80028a82ced 100644
--- a/app/views/repositories/_branch.html.haml
+++ b/app/views/repositories/_branch.html.haml
@@ -7,7 +7,7 @@
- if branch.name == @project.root_ref
%span.label default
%td
- = link_to project_commit_path(@project, id: commit.id) do
+ = link_to project_commit_path(@project, commit) do
%code= commit.short_id
= image_tag gravatar_icon(commit.author_email), class: "", width: 16