Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
0c8f0777
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
0c8f0777
编写于
9月 14, 2015
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add page titles to header for group and project
Signed-off-by:
N
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
上级
b35d5a6a
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
67 addition
and
20 deletion
+67
-20
app/helpers/gitlab_routing_helper.rb
app/helpers/gitlab_routing_helper.rb
+8
-0
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+52
-17
app/views/groups/edit.html.haml
app/views/groups/edit.html.haml
+2
-0
app/views/groups/projects.html.haml
app/views/groups/projects.html.haml
+2
-0
app/views/layouts/nav/_project.html.haml
app/views/layouts/nav/_project.html.haml
+2
-2
app/views/layouts/project.html.haml
app/views/layouts/project.html.haml
+1
-1
未找到文件。
app/helpers/gitlab_routing_helper.rb
浏览文件 @
0c8f0777
...
...
@@ -17,6 +17,14 @@ module GitlabRoutingHelper
namespace_project_path
(
project
.
namespace
,
project
,
*
args
)
end
def
project_files_path
(
project
,
*
args
)
namespace_project_tree_path
(
project
.
namespace
,
project
,
@ref
||
project
.
repository
.
root_ref
)
end
def
project_commits_path
(
project
,
*
args
)
namespace_project_commits_path
(
project
.
namespace
,
project
,
@ref
||
project
.
repository
.
root_ref
)
end
def
activity_project_path
(
project
,
*
args
)
activity_namespace_project_path
(
project
.
namespace
,
project
,
*
args
)
end
...
...
app/helpers/projects_helper.rb
浏览文件 @
0c8f0777
...
...
@@ -43,24 +43,22 @@ module ProjectsHelper
end
end
def
project_title
(
project
)
if
project
.
group
content_tag
:span
do
link_to
(
simple_sanitize
(
project
.
group
.
name
),
group_path
(
project
.
group
)
)
+
' / '
+
link_to
(
simple_sanitize
(
project
.
name
),
project_path
(
project
))
end
else
owner
=
project
.
namespace
.
owner
content_tag
:span
do
link_to
(
simple_sanitize
(
owner
.
name
),
user_path
(
owner
)
)
+
' / '
+
link_to
(
simple_sanitize
(
project
.
name
),
project_path
(
project
))
def
project_title
(
project
,
name
=
nil
,
url
=
nil
)
namespace_link
=
if
project
.
group
link_to
(
simple_sanitize
(
project
.
group
.
name
),
group_path
(
project
.
group
))
else
owner
=
project
.
namespace
.
owner
link_to
(
simple_sanitize
(
owner
.
name
),
user_path
(
owner
))
end
project_link
=
link_to
(
simple_sanitize
(
project
.
name
),
project_path
(
project
))
full_title
=
namespace_link
+
' / '
+
project_link
full_title
+=
' · '
.
html_safe
+
link_to
(
simple_sanitize
(
name
),
url
)
if
name
content_tag
:span
do
full_title
end
end
...
...
@@ -315,6 +313,43 @@ module ProjectsHelper
end
end
def
detect_project_title
(
project
)
current_ref
=
@ref
||
project
.
repository
.
root_ref
name
,
url
=
if
current_controller?
'wikis'
[
'Wiki'
,
get_project_wiki_path
(
project
)]
elsif
current_controller?
'project_members'
[
'Members'
,
namespace_project_project_members_path
(
project
.
namespace
,
project
)]
elsif
current_controller?
'labels'
[
'Labels'
,
namespace_project_labels_path
(
project
.
namespace
,
project
)]
elsif
current_controller?
'members'
[
'Members'
,
project_files_path
(
project
)]
elsif
current_controller?
'commits'
[
'Commits'
,
project_commits_path
(
project
)]
elsif
current_controller?
'graphs'
[
'Graphs'
,
namespace_project_graph_path
(
project
.
namespace
,
project
,
current_ref
)]
elsif
current_controller?
'network'
[
'Network'
,
namespace_project_network_path
(
project
.
namespace
,
project
,
current_ref
)]
elsif
current_controller?
'milestones'
[
'Milestones'
,
namespace_project_milestones_path
(
project
.
namespace
,
project
)]
elsif
current_controller?
'snippets'
[
'Snippets'
,
namespace_project_snippets_path
(
project
.
namespace
,
project
)]
elsif
current_controller?
'issues'
[
'Issues'
,
namespace_project_issues_path
(
project
.
namespace
,
project
)]
elsif
current_controller?
'merge_requests'
[
'Merge Requests'
,
namespace_project_merge_requests_path
(
project
.
namespace
,
project
)]
elsif
current_controller?
'tree'
,
'blob'
[
'Files'
,
project_files_path
(
project
)]
elsif
current_path?
'projects#activity'
[
'Activity'
,
activity_project_path
(
project
)]
else
[
nil
,
nil
]
end
project_title
(
project
,
name
,
url
)
end
private
def
filename_path
(
project
,
filename
)
...
...
app/views/groups/edit.html.haml
浏览文件 @
0c8f0777
-
header_title
group_title
(
@group
,
"Settings"
,
edit_group_path
(
@group
))
-
@blank_container
=
true
.panel.panel-default
.panel-heading
%strong
=
@group
.
name
...
...
app/views/groups/projects.html.haml
浏览文件 @
0c8f0777
-
page_title
"Projects"
-
header_title
group_title
(
@group
,
"Projects"
,
projects_group_path
(
@group
))
.panel.panel-default
.panel-heading
%strong
=
@group
.
name
...
...
app/views/layouts/nav/_project.html.haml
浏览文件 @
0c8f0777
...
...
@@ -26,14 +26,14 @@
Activity
-
if
project_nav_tab?
:files
=
nav_link
(
controller:
%w(tree blob blame edit_tree new_tree)
)
do
=
link_to
namespace_project_tree_path
(
@project
.
namespace
,
@project
,
@ref
||
@repository
.
root_ref
),
title:
'Files'
,
class:
'shortcuts-tree'
,
data:
{
placement:
'right'
}
do
=
link_to
project_files_path
(
@project
),
title:
'Files'
,
class:
'shortcuts-tree'
,
data:
{
placement:
'right'
}
do
=
icon
(
'files-o fw'
)
%span
Files
-
if
project_nav_tab?
:commits
=
nav_link
(
controller:
%w(commit commits compare repositories tags branches)
)
do
=
link_to
namespace_project_commits_path
(
@project
.
namespace
,
@project
,
@ref
||
@repository
.
root_ref
),
title:
'Commits'
,
class:
'shortcuts-commits'
,
data:
{
placement:
'right'
}
do
=
link_to
project_commits_path
(
@project
),
title:
'Commits'
,
class:
'shortcuts-commits'
,
data:
{
placement:
'right'
}
do
=
icon
(
'history fw'
)
%span
Commits
...
...
app/views/layouts/project.html.haml
浏览文件 @
0c8f0777
-
page_title
@project
.
name_with_namespace
-
header_title
project_title
(
@project
)
-
header_title
detect_
project_title
(
@project
)
-
sidebar
"project"
unless
sidebar
-
content_for
:scripts_body_top
do
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录