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 {
}
}
.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 {
......
......@@ -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
......
%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
......@@ -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
......
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