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
Boxiang Sun
gitlab-ce
Commits
b5c681c0
Commit
b5c681c0
authored
Sep 14, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add current_ref helper method
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
d3be65a8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
7 deletions
+9
-7
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+4
-2
app/views/layouts/nav/_project.html.haml
app/views/layouts/nav/_project.html.haml
+2
-2
app/views/projects/commits/_head.html.haml
app/views/projects/commits/_head.html.haml
+2
-2
app/views/projects/show.html.haml
app/views/projects/show.html.haml
+1
-1
No files found.
app/helpers/projects_helper.rb
View file @
b5c681c0
...
...
@@ -313,9 +313,11 @@ module ProjectsHelper
end
end
def
detect_project_title
(
project
)
current_ref
=
@ref
||
project
.
repository
.
root_ref
def
current_ref
@ref
||
@repository
.
try
(
:root_ref
)
end
def
detect_project_title
(
project
)
name
,
url
=
if
current_controller?
'wikis'
[
'Wiki'
,
get_project_wiki_path
(
project
)]
...
...
app/views/layouts/nav/_project.html.haml
View file @
b5c681c0
...
...
@@ -40,14 +40,14 @@
-
if
project_nav_tab?
:network
=
nav_link
(
controller:
%w(network)
)
do
=
link_to
namespace_project_network_path
(
@project
.
namespace
,
@project
,
@ref
||
@repository
.
roo
t_ref
),
title:
'Network'
,
class:
'shortcuts-network'
,
data:
{
placement:
'right'
}
do
=
link_to
namespace_project_network_path
(
@project
.
namespace
,
@project
,
curren
t_ref
),
title:
'Network'
,
class:
'shortcuts-network'
,
data:
{
placement:
'right'
}
do
=
icon
(
'code-fork fw'
)
%span
Network
-
if
project_nav_tab?
:graphs
=
nav_link
(
controller:
%w(graphs)
)
do
=
link_to
namespace_project_graph_path
(
@project
.
namespace
,
@project
,
@ref
||
@repository
.
roo
t_ref
),
title:
'Graphs'
,
class:
'shortcuts-graphs'
,
data:
{
placement:
'right'
}
do
=
link_to
namespace_project_graph_path
(
@project
.
namespace
,
@project
,
curren
t_ref
),
title:
'Graphs'
,
class:
'shortcuts-graphs'
,
data:
{
placement:
'right'
}
do
=
icon
(
'area-chart fw'
)
%span
Graphs
...
...
app/views/projects/commits/_head.html.haml
View file @
b5c681c0
%ul
.center-top-menu
=
nav_link
(
controller:
[
:commit
,
:commits
])
do
=
link_to
namespace_project_commits_path
(
@project
.
namespace
,
@project
,
@ref
||
@repository
.
roo
t_ref
)
do
=
link_to
namespace_project_commits_path
(
@project
.
namespace
,
@project
,
curren
t_ref
)
do
Commits
%span
.badge
=
number_with_delimiter
(
@repository
.
commit_count
)
=
nav_link
(
controller: :compare
)
do
=
link_to
namespace_project_compare_index_path
(
@project
.
namespace
,
@project
,
from:
@repository
.
root_ref
,
to:
@ref
||
@repository
.
roo
t_ref
)
do
=
link_to
namespace_project_compare_index_path
(
@project
.
namespace
,
@project
,
from:
@repository
.
root_ref
,
to:
curren
t_ref
)
do
Compare
=
nav_link
(
html_options:
{
class:
branches_tab_class
})
do
...
...
app/views/projects/show.html.haml
View file @
b5c681c0
...
...
@@ -14,7 +14,7 @@
.project-stats.gray-content-block
%ul
.nav.nav-pills
%li
=
link_to
namespace_project_commits_path
(
@project
.
namespace
,
@project
,
@ref
||
@repository
.
roo
t_ref
)
do
=
link_to
namespace_project_commits_path
(
@project
.
namespace
,
@project
,
curren
t_ref
)
do
=
pluralize
(
number_with_delimiter
(
@project
.
commit_count
),
'commit'
)
%li
=
link_to
namespace_project_branches_path
(
@project
.
namespace
,
@project
)
do
...
...
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