Skip to content

Commit

Permalink
Fixed dashboard loader, fixed 404 for reporter on empty wiki page.
Browse files Browse the repository at this point in the history
Styled Wiki edit page
  • Loading branch information
dzaporozhets committed Jul 26, 2012
1 parent 14c9723 commit c27105f
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 27 deletions.
1 change: 0 additions & 1 deletion app/assets/javascripts/pager.js
Expand Up @@ -8,7 +8,6 @@ var Pager = {
this.limit=limit;
this.offset=limit;
this.initLoadMore();
$('.loading').show();
},

getOld:
Expand Down
16 changes: 7 additions & 9 deletions app/controllers/wikis_controller.rb
Expand Up @@ -13,18 +13,16 @@ def show
@wiki = @project.wikis.where(:slug => params[:id]).order("created_at").last
end

unless @wiki
return render_404 unless can?(current_user, :write_wiki, @project)
end

@note = @project.notes.new(:noteable => @wiki)

respond_to do |format|
if @wiki
format.html
else
if @wiki
render 'show'
else
if can?(current_user, :write_wiki, @project)
@wiki = @project.wikis.new(:slug => params[:id])
format.html { render "edit" }
render 'edit'
else
render 'empty'
end
end
end
Expand Down
2 changes: 0 additions & 2 deletions app/views/help/permissions.html.haml
Expand Up @@ -38,7 +38,6 @@
%li Push to non-protected branches
%li Remove non-protected branches
%li Add tags
%li Create new merge request
%li Write a wiki

.ui-box.span3
Expand All @@ -55,7 +54,6 @@
%li Push to non-protected branches
%li Remove non-protected branches
%li Add tags
%li Create new merge request
%li Write a wiki
%li Add new team members
%li Push to protected branches
Expand Down
2 changes: 1 addition & 1 deletion app/views/projects/files.html.haml
Expand Up @@ -14,6 +14,6 @@
ago
- else
.alert-message.block-message
%p All files attached to project wall, issues etc will be displayed here
%span All files attached to project wall, issues etc will be displayed here


28 changes: 15 additions & 13 deletions app/views/wikis/_form.html.haml
Expand Up @@ -6,19 +6,21 @@
- @wiki.errors.full_messages.each do |msg|
%li= msg

.alert-message.block-message.warning
%p
Wiki content is parsed with #{link_to "Markdown", "http://en.wikipedia.org/wiki/Markdown"}.
%br
To add link to new page you can just type
%code [Link Title](page-slug)
.clearfix
= f.label :title
.input= f.text_field :title, :class => :xxlarge
= f.hidden_field :slug
.clearfix
= f.label :content
.input= f.text_area :content, :class => :xxlarge
.main_box
.top_box_content
= f.label :title
.input= f.text_field :title, :class => 'span8'
= f.hidden_field :slug
.middle_box_content
.input
%span.cgray
Wiki content is parsed with #{link_to "Markdown", "http://en.wikipedia.org/wiki/Markdown"}.
To add link to new page you can just type
%code [Link Title](page-slug)

.bottom_box_content
= f.label :content
.input= f.text_area :content, :class => 'span8'
.actions
= f.submit 'Save', :class => "primary btn"
= link_to "Cancel", project_wiki_path(@project, :index), :class => "btn"
2 changes: 1 addition & 1 deletion app/views/wikis/edit.html.haml
@@ -1,3 +1,3 @@
%h3 Editing page
%h3.page_title Editing page
%hr
= render 'form'
4 changes: 4 additions & 0 deletions app/views/wikis/empty.html.haml
@@ -0,0 +1,4 @@
%h3.page_title Empty page
%hr
.alert-message.block-message.warning
%span You are not allowed to create wiki pages

1 comment on commit c27105f

@rtripault
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes the wiki part of issue #518

Please sign in to comment.