diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index b72c9e93d9e..f7a93436b3c 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -446,6 +446,19 @@ li.note { } } +.warning_message { + border-left: 4px solid #ed9; + color: #b90; + padding: 10px; + margin-bottom: 10px; + background: #ffffe6; + padding-left: 20px; + + &.centered { + text-align: center; + } +} + .oauth_select_holder { padding: 20px; img { diff --git a/app/controllers/wikis_controller.rb b/app/controllers/wikis_controller.rb index 1ca7e4af24d..69280291003 100644 --- a/app/controllers/wikis_controller.rb +++ b/app/controllers/wikis_controller.rb @@ -8,14 +8,13 @@ class WikisController < ProjectResourceController end def show + @most_recent_wiki = @project.wikis.where(slug: params[:id]).ordered.first if params[:version_id] @wiki = @project.wikis.find(params[:version_id]) else - @wiki = @project.wikis.where(slug: params[:id]).ordered.first + @wiki = @most_recent_wiki end - @note = @project.notes.new(noteable: @wiki) - if @wiki render 'show' else diff --git a/app/views/wikis/empty.html.haml b/app/views/wikis/empty.html.haml index 32b1c9258c5..08b59f0328b 100644 --- a/app/views/wikis/empty.html.haml +++ b/app/views/wikis/empty.html.haml @@ -1,4 +1,4 @@ %h3.page_title Empty page %hr -.alert-message.block-message.warning - %span You are not allowed to create wiki pages +.error_message + You are not allowed to create wiki pages diff --git a/app/views/wikis/show.html.haml b/app/views/wikis/show.html.haml index ea23f62c262..d3bd58bbeec 100644 --- a/app/views/wikis/show.html.haml +++ b/app/views/wikis/show.html.haml @@ -10,6 +10,11 @@ %i.icon-edit Edit %br +- if @wiki != @most_recent_wiki + .warning_message + This is an old version of this page. + You can view the #{link_to "most recent version", project_wiki_path(@project, @wiki)} or browse the #{link_to "history", history_project_wiki_path(@project, @wiki)}. + .file_holder .file_content.wiki = preserve do