Commit c27105f8c3dc8b0baec0d36f339dbfc943ff155b
1 parent
14c97237
Exists in
master
and in
4 other branches
Fixed dashboard loader, fixed 404 for reporter on empty wiki page.
Styled Wiki edit page
Showing
7 changed files
with
28 additions
and
27 deletions
Show diff stats
app/assets/javascripts/pager.js
app/controllers/wikis_controller.rb
| @@ -13,18 +13,16 @@ class WikisController < ApplicationController | @@ -13,18 +13,16 @@ class WikisController < ApplicationController | ||
| 13 | @wiki = @project.wikis.where(:slug => params[:id]).order("created_at").last | 13 | @wiki = @project.wikis.where(:slug => params[:id]).order("created_at").last |
| 14 | end | 14 | end |
| 15 | 15 | ||
| 16 | - unless @wiki | ||
| 17 | - return render_404 unless can?(current_user, :write_wiki, @project) | ||
| 18 | - end | ||
| 19 | - | ||
| 20 | @note = @project.notes.new(:noteable => @wiki) | 16 | @note = @project.notes.new(:noteable => @wiki) |
| 21 | 17 | ||
| 22 | - respond_to do |format| | ||
| 23 | - if @wiki | ||
| 24 | - format.html | ||
| 25 | - else | 18 | + if @wiki |
| 19 | + render 'show' | ||
| 20 | + else | ||
| 21 | + if can?(current_user, :write_wiki, @project) | ||
| 26 | @wiki = @project.wikis.new(:slug => params[:id]) | 22 | @wiki = @project.wikis.new(:slug => params[:id]) |
| 27 | - format.html { render "edit" } | 23 | + render 'edit' |
| 24 | + else | ||
| 25 | + render 'empty' | ||
| 28 | end | 26 | end |
| 29 | end | 27 | end |
| 30 | end | 28 | end |
app/views/help/permissions.html.haml
| @@ -38,7 +38,6 @@ | @@ -38,7 +38,6 @@ | ||
| 38 | %li Push to non-protected branches | 38 | %li Push to non-protected branches |
| 39 | %li Remove non-protected branches | 39 | %li Remove non-protected branches |
| 40 | %li Add tags | 40 | %li Add tags |
| 41 | - %li Create new merge request | ||
| 42 | %li Write a wiki | 41 | %li Write a wiki |
| 43 | 42 | ||
| 44 | .ui-box.span3 | 43 | .ui-box.span3 |
| @@ -55,7 +54,6 @@ | @@ -55,7 +54,6 @@ | ||
| 55 | %li Push to non-protected branches | 54 | %li Push to non-protected branches |
| 56 | %li Remove non-protected branches | 55 | %li Remove non-protected branches |
| 57 | %li Add tags | 56 | %li Add tags |
| 58 | - %li Create new merge request | ||
| 59 | %li Write a wiki | 57 | %li Write a wiki |
| 60 | %li Add new team members | 58 | %li Add new team members |
| 61 | %li Push to protected branches | 59 | %li Push to protected branches |
app/views/projects/files.html.haml
| @@ -14,6 +14,6 @@ | @@ -14,6 +14,6 @@ | ||
| 14 | ago | 14 | ago |
| 15 | - else | 15 | - else |
| 16 | .alert-message.block-message | 16 | .alert-message.block-message |
| 17 | - %p All files attached to project wall, issues etc will be displayed here | 17 | + %span All files attached to project wall, issues etc will be displayed here |
| 18 | 18 | ||
| 19 | 19 |
app/views/wikis/_form.html.haml
| @@ -6,19 +6,21 @@ | @@ -6,19 +6,21 @@ | ||
| 6 | - @wiki.errors.full_messages.each do |msg| | 6 | - @wiki.errors.full_messages.each do |msg| |
| 7 | %li= msg | 7 | %li= msg |
| 8 | 8 | ||
| 9 | - .alert-message.block-message.warning | ||
| 10 | - %p | ||
| 11 | - Wiki content is parsed with #{link_to "Markdown", "http://en.wikipedia.org/wiki/Markdown"}. | ||
| 12 | - %br | ||
| 13 | - To add link to new page you can just type | ||
| 14 | - %code [Link Title](page-slug) | ||
| 15 | - .clearfix | ||
| 16 | - = f.label :title | ||
| 17 | - .input= f.text_field :title, :class => :xxlarge | ||
| 18 | - = f.hidden_field :slug | ||
| 19 | - .clearfix | ||
| 20 | - = f.label :content | ||
| 21 | - .input= f.text_area :content, :class => :xxlarge | 9 | + .main_box |
| 10 | + .top_box_content | ||
| 11 | + = f.label :title | ||
| 12 | + .input= f.text_field :title, :class => 'span8' | ||
| 13 | + = f.hidden_field :slug | ||
| 14 | + .middle_box_content | ||
| 15 | + .input | ||
| 16 | + %span.cgray | ||
| 17 | + Wiki content is parsed with #{link_to "Markdown", "http://en.wikipedia.org/wiki/Markdown"}. | ||
| 18 | + To add link to new page you can just type | ||
| 19 | + %code [Link Title](page-slug) | ||
| 20 | + | ||
| 21 | + .bottom_box_content | ||
| 22 | + = f.label :content | ||
| 23 | + .input= f.text_area :content, :class => 'span8' | ||
| 22 | .actions | 24 | .actions |
| 23 | = f.submit 'Save', :class => "primary btn" | 25 | = f.submit 'Save', :class => "primary btn" |
| 24 | = link_to "Cancel", project_wiki_path(@project, :index), :class => "btn" | 26 | = link_to "Cancel", project_wiki_path(@project, :index), :class => "btn" |
app/views/wikis/edit.html.haml