diff options
author | Hiroyuki Sato <hiroyuki_sato@spiber.jp> | 2014-04-09 14:14:16 +0900 |
---|---|---|
committer | Hiroyuki Sato <hiroyuki_sato@spiber.jp> | 2014-04-10 15:14:02 +0900 |
commit | bca528a57c9276c0cd815d67fed4a72c514d53a2 (patch) | |
tree | 60a517c30bf3965b684be2ddcf3b8c4b9ea437ff /app | |
parent | 03472b4fc02a256c90c0285765e7da82c56e93a2 (diff) | |
download | gitlab-ce-bca528a57c9276c0cd815d67fed4a72c514d53a2.tar.gz |
Better title format for wiki page
The title format for wiki page may be unintelligible.
For example 'GitLab' is converted to 'Git Lab', 'MySQL' is converted to
'My Sql', etc.
Diffstat (limited to 'app')
-rw-r--r-- | app/models/wiki_page.rb | 6 | ||||
-rw-r--r-- | app/views/projects/wikis/edit.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/wikis/history.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/wikis/pages.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/wikis/show.html.haml | 2 |
5 files changed, 9 insertions, 5 deletions
diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb index 431c1e33f55..4d8cfd6368f 100644 --- a/app/models/wiki_page.rb +++ b/app/models/wiki_page.rb @@ -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. diff --git a/app/views/projects/wikis/edit.html.haml b/app/views/projects/wikis/edit.html.haml index 49dd7b00ca4..5347caf000a 100644 --- a/app/views/projects/wikis/edit.html.haml +++ b/app/views/projects/wikis/edit.html.haml @@ -3,7 +3,7 @@ = render 'main_links' %h3.page-title Editing - - %span.light #{@page.title.titleize} + %span.light #{@page.title} %hr = render 'form' diff --git a/app/views/projects/wikis/history.html.haml b/app/views/projects/wikis/history.html.haml index 7001bbd17c1..7bc566cf7f5 100644 --- a/app/views/projects/wikis/history.html.haml +++ b/app/views/projects/wikis/history.html.haml @@ -1,7 +1,7 @@ = 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 diff --git a/app/views/projects/wikis/pages.html.haml b/app/views/projects/wikis/pages.html.haml index 7a890816568..673e3078be8 100644 --- a/app/views/projects/wikis/pages.html.haml +++ b/app/views/projects/wikis/pages.html.haml @@ -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)} diff --git a/app/views/projects/wikis/show.html.haml b/app/views/projects/wikis/show.html.haml index 024ef068d08..cb923e4ca32 100644 --- a/app/views/projects/wikis/show.html.haml +++ b/app/views/projects/wikis/show.html.haml @@ -1,6 +1,6 @@ = render 'nav' %h3.page-title - = @page.title.titleize + = @page.title = render 'main_links' - if @page.historical? .warning_message |