Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
6b121aa5
Commit
6b121aa5
authored
Jul 08, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move the links decision to helper.
parent
5d25f3d9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
app/helpers/commits_helper.rb
app/helpers/commits_helper.rb
+12
-0
app/views/projects/commits/_commit.html.haml
app/views/projects/commits/_commit.html.haml
+1
-6
No files found.
app/helpers/commits_helper.rb
View file @
6b121aa5
...
@@ -180,6 +180,18 @@ module CommitsHelper
...
@@ -180,6 +180,18 @@ module CommitsHelper
return
old_lines
,
new_lines
return
old_lines
,
new_lines
end
end
def
link_to_browse_code
(
project
,
commit
)
if
current_controller?
(
:projects
,
:commits
)
if
@repo
.
blob_at
(
commit
.
id
,
@path
)
link_to
"Browse File »"
,
project_blob_path
(
project
,
tree_join
(
commit
.
id
,
@path
)),
class:
"pull-right"
else
link_to
"Browse Dir »"
,
project_tree_path
(
project
,
tree_join
(
commit
.
id
,
@path
)),
class:
"pull-right"
end
else
link_to
"Browse Code »"
,
project_tree_path
(
project
,
commit
),
class:
"pull-right"
end
end
protected
protected
# Private: Returns a link to a person. If the person has a matching user and
# Private: Returns a link to a person. If the person has a matching user and
...
...
app/views/projects/commits/_commit.html.haml
View file @
6b121aa5
...
@@ -7,12 +7,7 @@
...
@@ -7,12 +7,7 @@
-
if
commit
.
description?
-
if
commit
.
description?
%a
.text-expander.js-toggle-button
...
%a
.text-expander.js-toggle-button
...
-
if
@repo
&&
@repo
.
blob_at
(
commit
.
id
,
@path
)
=
link_to_browse_code
(
project
,
commit
)
=
link_to
"Browse File »"
,
project_blob_path
(
project
,
tree_join
(
commit
.
id
,
@path
)),
class:
"pull-right"
-
elsif
@path
.
blank?
=
link_to
"Browse Code »"
,
project_tree_path
(
project
,
commit
),
class:
"pull-right"
-
else
=
link_to
"Browse Dir »"
,
project_tree_path
(
project
,
tree_join
(
commit
.
id
,
@path
)),
class:
"pull-right"
.notes_count
.notes_count
-
if
@note_counts
-
if
@note_counts
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment