Commit fd836f54 authored by Riyad Preukschas's avatar Riyad Preukschas

Update empty error messages and warn if not viewing the most recent wiki page

parent b55ed840
...@@ -446,6 +446,19 @@ li.note { ...@@ -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 { .oauth_select_holder {
padding: 20px; padding: 20px;
img { img {
......
...@@ -8,14 +8,13 @@ class WikisController < ProjectResourceController ...@@ -8,14 +8,13 @@ class WikisController < ProjectResourceController
end end
def show def show
@most_recent_wiki = @project.wikis.where(slug: params[:id]).ordered.first
if params[:version_id] if params[:version_id]
@wiki = @project.wikis.find(params[:version_id]) @wiki = @project.wikis.find(params[:version_id])
else else
@wiki = @project.wikis.where(slug: params[:id]).ordered.first @wiki = @most_recent_wiki
end end
@note = @project.notes.new(noteable: @wiki)
if @wiki if @wiki
render 'show' render 'show'
else else
......
%h3.page_title Empty page %h3.page_title Empty page
%hr %hr
.alert-message.block-message.warning .error_message
%span You are not allowed to create wiki pages You are not allowed to create wiki pages
...@@ -10,6 +10,11 @@ ...@@ -10,6 +10,11 @@
%i.icon-edit %i.icon-edit
Edit Edit
%br %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_holder
.file_content.wiki .file_content.wiki
= preserve do = preserve do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment