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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
352bb972
Commit
352bb972
authored
Apr 13, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6731 from hiroponz/better-title-format-for-wiki-page
Better title format for wiki page
parents
53b52b11
bca528a5
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
26 additions
and
6 deletions
+26
-6
app/models/wiki_page.rb
app/models/wiki_page.rb
+5
-1
app/views/projects/wikis/edit.html.haml
app/views/projects/wikis/edit.html.haml
+1
-1
app/views/projects/wikis/history.html.haml
app/views/projects/wikis/history.html.haml
+1
-1
app/views/projects/wikis/pages.html.haml
app/views/projects/wikis/pages.html.haml
+1
-1
app/views/projects/wikis/show.html.haml
app/views/projects/wikis/show.html.haml
+1
-1
features/steps/project/wiki.rb
features/steps/project/wiki.rb
+1
-1
spec/models/wiki_page_spec.rb
spec/models/wiki_page_spec.rb
+16
-0
No files found.
app/models/wiki_page.rb
View file @
352bb972
...
...
@@ -47,7 +47,11 @@ class WikiPage
# The formatted title of this page.
def
title
@attributes
[
:title
]
||
""
if
@attributes
[
:title
]
@attributes
[
:title
].
gsub
(
/-+/
,
' '
)
else
""
end
end
# Sets the title of this page.
...
...
app/views/projects/wikis/edit.html.haml
View file @
352bb972
...
...
@@ -3,7 +3,7 @@
=
render
'main_links'
%h3
.page-title
Editing -
%span
.light
#{
@page
.
title
.
titleize
}
%span
.light
#{
@page
.
title
}
%hr
=
render
'form'
...
...
app/views/projects/wikis/history.html.haml
View file @
352bb972
=
render
'nav'
%h3
.page-title
%span
.light
History for
=
link_to
@page
.
title
.
titleize
,
project_wiki_path
(
@project
,
@page
)
=
link_to
@page
.
title
,
project_wiki_path
(
@project
,
@page
)
%table
.table
%thead
...
...
app/views/projects/wikis/pages.html.haml
View file @
352bb972
...
...
@@ -5,7 +5,7 @@
-
@wiki_pages
.
each
do
|
wiki_page
|
%li
%h4
=
link_to
wiki_page
.
title
.
titleize
,
project_wiki_path
(
@project
,
wiki_page
)
=
link_to
wiki_page
.
title
,
project_wiki_path
(
@project
,
wiki_page
)
%small
(
#{
wiki_page
.
format
}
)
.pull-right
%small
Last edited
#{
time_ago_with_tooltip
(
wiki_page
.
commit
.
created_at
)
}
app/views/projects/wikis/show.html.haml
View file @
352bb972
=
render
'nav'
%h3
.page-title
=
@page
.
title
.
titleize
=
@page
.
title
=
render
'main_links'
-
if
@page
.
historical?
.warning_message
...
...
features/steps/project/wiki.rb
View file @
352bb972
...
...
@@ -83,7 +83,7 @@ class Spinach::Features::ProjectWiki < Spinach::FeatureSteps
Then
'I should see the existing page in the pages list'
do
page
.
should
have_content
current_user
.
name
page
.
should
have_content
@page
.
title
.
titleize
page
.
should
have_content
@page
.
title
end
def
wiki
...
...
spec/models/wiki_page_spec.rb
View file @
352bb972
...
...
@@ -155,4 +155,20 @@ describe WikiPage do
end
end
describe
"#title"
do
before
do
create_page
(
"Title"
,
"content"
)
@page
=
wiki
.
find_page
(
"Title"
)
end
after
do
destroy_page
(
"Title"
)
end
it
"should be replace a hyphen to a space"
do
@page
.
title
=
"Import-existing-repositories-into-GitLab"
@page
.
title
.
should
==
"Import existing repositories into GitLab"
end
end
end
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