Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
2338a300
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,发现更多精彩内容 >>
提交
2338a300
编写于
11月 26, 2018
作者:
S
Stan Hu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove downcase of slug and present home as "Home"
上级
00209ed8
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
24 addition
and
16 deletion
+24
-16
app/assets/javascripts/pages/projects/wikis/wikis.js
app/assets/javascripts/pages/projects/wikis/wikis.js
+2
-2
app/models/wiki_page.rb
app/models/wiki_page.rb
+6
-0
app/views/projects/wikis/_sidebar_wiki_page.html.haml
app/views/projects/wikis/_sidebar_wiki_page.html.haml
+1
-1
app/views/projects/wikis/edit.html.haml
app/views/projects/wikis/edit.html.haml
+6
-4
app/views/projects/wikis/history.html.haml
app/views/projects/wikis/history.html.haml
+2
-2
app/views/projects/wikis/show.html.haml
app/views/projects/wikis/show.html.haml
+3
-3
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
+2
-2
spec/features/projects/wiki/user_updates_wiki_page_spec.rb
spec/features/projects/wiki/user_updates_wiki_page_spec.rb
+2
-2
未找到文件。
app/assets/javascripts/pages/projects/wikis/wikis.js
浏览文件 @
2338a300
import
bp
from
'
../../../breakpoints
'
;
import
{
slugify
}
from
'
../../../lib/utils/text_utility
'
;
import
{
parseQueryStringIntoObject
}
from
'
../../../lib/utils/common_utils
'
;
import
{
mergeUrlParams
,
redirectTo
}
from
'
../../../lib/utils/url_utility
'
;
...
...
@@ -26,7 +25,8 @@ export default class Wikis {
if
(
!
this
.
newWikiForm
)
return
;
const
slugInput
=
this
.
newWikiForm
.
querySelector
(
'
#new_wiki_path
'
);
const
slug
=
slugify
(
slugInput
.
value
);
const
slug
=
slugInput
.
value
;
if
(
slug
.
length
>
0
)
{
const
wikisPath
=
slugInput
.
getAttribute
(
'
data-wikis-path
'
);
...
...
app/models/wiki_page.rb
浏览文件 @
2338a300
...
...
@@ -85,6 +85,12 @@ class WikiPage
alias_method
:to_param
,
:slug
def
human_title
return
'Home'
if
title
==
'home'
title
end
# The formatted title of this page.
def
title
if
@attributes
[
:title
]
...
...
app/views/projects/wikis/_sidebar_wiki_page.html.haml
浏览文件 @
2338a300
%li
{
class:
active_when
(
params
[
:id
]
==
wiki_page
.
slug
)
}
=
link_to
project_wiki_path
(
@project
,
wiki_page
)
do
=
wiki_page
.
title
=
wiki_page
.
human_
title
app/views/projects/wikis/edit.html.haml
浏览文件 @
2338a300
-
@content_class
=
"limit-container-width"
unless
fluid_layout
-
page_title
_
(
"Edit"
),
@page
.
title
,
_
(
"Wiki"
)
-
add_to_breadcrumbs
_
(
"Wiki"
),
project_wiki_path
(
@project
,
@page
)
-
breadcrumb_title
@page
.
persisted?
?
_
(
"Edit"
)
:
_
(
"New"
)
-
page_title
@page
.
persisted?
?
_
(
"Edit"
)
:
_
(
"New"
),
@page
.
human_title
,
_
(
"Wiki"
)
=
wiki_page_errors
(
@error
)
...
...
@@ -10,9 +12,9 @@
.nav-text
%h2
.wiki-page-title
-
if
@page
.
persisted?
=
link_to
@page
.
title
,
project_wiki_path
(
@project
,
@page
)
=
link_to
@page
.
human_
title
,
project_wiki_path
(
@project
,
@page
)
-
else
=
@page
.
title
=
@page
.
human_
title
%span
.light
·
-
if
@page
.
persisted?
...
...
@@ -28,7 +30,7 @@
=
link_to
project_wiki_history_path
(
@project
,
@page
),
class:
"btn"
do
=
s_
(
"Wiki|Page history"
)
-
if
can?
(
current_user
,
:admin_wiki
,
@project
)
#delete-wiki-modal-wrapper
{
data:
{
delete_wiki_url:
project_wiki_path
(
@project
,
@page
),
page_title:
@page
.
title
}
}
#delete-wiki-modal-wrapper
{
data:
{
delete_wiki_url:
project_wiki_path
(
@project
,
@page
),
page_title:
@page
.
human_
title
}
}
=
render
'form'
,
uploads_path:
wiki_attachment_upload_url
...
...
app/views/projects/wikis/history.html.haml
浏览文件 @
2338a300
-
page_title
_
(
"History"
),
@page
.
title
,
_
(
"Wiki"
)
-
page_title
_
(
"History"
),
@page
.
human_
title
,
_
(
"Wiki"
)
.wiki-page-header.has-sidebar-toggle
%button
.btn.btn-default.sidebar-toggle.js-sidebar-wiki-toggle
{
role:
"button"
,
type:
"button"
}
...
...
@@ -6,7 +6,7 @@
.nav-text
%h2
.wiki-page-title
=
link_to
@page
.
title
,
project_wiki_path
(
@project
,
@page
)
=
link_to
@page
.
human_
title
,
project_wiki_path
(
@project
,
@page
)
%span
.light
·
=
_
(
"History"
)
...
...
app/views/projects/wikis/show.html.haml
浏览文件 @
2338a300
-
@content_class
=
"limit-container-width"
unless
fluid_layout
-
breadcrumb_title
@page
.
title
-
breadcrumb_title
@page
.
human_
title
-
wiki_breadcrumb_dropdown_links
(
@page
.
slug
)
-
page_title
@page
.
title
,
_
(
"Wiki"
)
-
page_title
@page
.
human_
title
,
_
(
"Wiki"
)
-
add_to_breadcrumbs
_
(
"Wiki"
),
get_project_wiki_path
(
@project
)
.wiki-page-header.has-sidebar-toggle
...
...
@@ -9,7 +9,7 @@
=
icon
(
'angle-double-left'
)
.nav-text
%h2
.wiki-page-title
=
@page
.
title
%h2
.wiki-page-title
=
@page
.
human_
title
%span
.wiki-last-edit-by
-
if
@page
.
last_version
=
(
_
(
"Last edited by %{name}"
)
%
{
name:
"<strong>
#{
@page
.
last_version
.
author_name
}
</strong>"
}).
html_safe
...
...
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
浏览文件 @
2338a300
...
...
@@ -215,7 +215,7 @@ describe "User creates wiki page" do
end
# Commit message field should have correct value.
expect
(
page
).
to
have_field
(
"wiki[message]"
,
with:
"Create
s
paces in the name"
)
expect
(
page
).
to
have_field
(
"wiki[message]"
,
with:
"Create
S
paces in the name"
)
page
.
within
(
".wiki-form"
)
do
fill_in
(
:wiki_content
,
with:
"My awesome wiki!"
)
...
...
@@ -246,7 +246,7 @@ describe "User creates wiki page" do
click_button
(
"Create page"
)
end
expect
(
page
).
to
have_content
(
"
Create
hyphens in the name"
)
expect
(
page
).
to
have_content
(
"hyphens in the name"
)
.
and
have_content
(
"Last edited by
#{
user
.
name
}
"
)
.
and
have_content
(
"My awesome wiki!"
)
end
...
...
spec/features/projects/wiki/user_updates_wiki_page_spec.rb
浏览文件 @
2338a300
...
...
@@ -41,9 +41,9 @@ describe 'User updates wiki page' do
expect
(
current_path
).
to
include
(
'one/two/three-test'
)
expect
(
find
(
'.wiki-pages'
)).
to
have_content
(
'three'
)
first
(
:link
,
text:
'
T
hree'
).
click
first
(
:link
,
text:
'
t
hree'
).
click
expect
(
find
(
'.nav-text'
)).
to
have_content
(
'
T
hree'
)
expect
(
find
(
'.nav-text'
)).
to
have_content
(
'
t
hree'
)
click_on
(
'Edit'
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录