Update empty error messages and warn if not viewing the most recent wiki page
This commit is contained in:
parent
b55ed840e6
commit
fd836f5490
4 changed files with 22 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue