diff options
| author | randx <dmitriy.zaporozhets@gmail.com> | 2012-07-26 14:45:17 +0300 |
|---|---|---|
| committer | randx <dmitriy.zaporozhets@gmail.com> | 2012-07-26 14:45:17 +0300 |
| commit | c27105f8c3dc8b0baec0d36f339dbfc943ff155b (patch) | |
| tree | 677c3d3b37e1a6d70603261b4503c093e5ded664 | |
| parent | 14c97237246f01da60ad73d9efd2c08c45927f09 (diff) | |
| download | gitlab-ce-c27105f8c3dc8b0baec0d36f339dbfc943ff155b.tar.gz | |
Fixed dashboard loader, fixed 404 for reporter on empty wiki page.
Styled Wiki edit page
| -rw-r--r-- | app/assets/javascripts/pager.js | 1 | ||||
| -rw-r--r-- | app/controllers/wikis_controller.rb | 16 | ||||
| -rw-r--r-- | app/views/help/permissions.html.haml | 2 | ||||
| -rw-r--r-- | app/views/projects/files.html.haml | 2 | ||||
| -rw-r--r-- | app/views/wikis/_form.html.haml | 28 | ||||
| -rw-r--r-- | app/views/wikis/edit.html.haml | 2 | ||||
| -rw-r--r-- | app/views/wikis/empty.html.haml | 4 |
7 files changed, 28 insertions, 27 deletions
diff --git a/app/assets/javascripts/pager.js b/app/assets/javascripts/pager.js index d42ae1e05d1..769e8a62343 100644 --- a/app/assets/javascripts/pager.js +++ b/app/assets/javascripts/pager.js @@ -8,7 +8,6 @@ var Pager = { this.limit=limit; this.offset=limit; this.initLoadMore(); - $('.loading').show(); }, getOld: diff --git a/app/controllers/wikis_controller.rb b/app/controllers/wikis_controller.rb index 06e3564be56..1fa38034c66 100644 --- a/app/controllers/wikis_controller.rb +++ b/app/controllers/wikis_controller.rb @@ -13,18 +13,16 @@ class WikisController < ApplicationController @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 diff --git a/app/views/help/permissions.html.haml b/app/views/help/permissions.html.haml index 860cfc8669c..7511d15d995 100644 --- a/app/views/help/permissions.html.haml +++ b/app/views/help/permissions.html.haml @@ -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 @@ -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 diff --git a/app/views/projects/files.html.haml b/app/views/projects/files.html.haml index d171b0d09a1..52424ae4353 100644 --- a/app/views/projects/files.html.haml +++ b/app/views/projects/files.html.haml @@ -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 diff --git a/app/views/wikis/_form.html.haml b/app/views/wikis/_form.html.haml index dbb8648d664..20b5b112819 100644 --- a/app/views/wikis/_form.html.haml +++ b/app/views/wikis/_form.html.haml @@ -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" diff --git a/app/views/wikis/edit.html.haml b/app/views/wikis/edit.html.haml index 26cbd52a9a8..27d2a8f915f 100644 --- a/app/views/wikis/edit.html.haml +++ b/app/views/wikis/edit.html.haml @@ -1,3 +1,3 @@ -%h3 Editing page +%h3.page_title Editing page %hr = render 'form' diff --git a/app/views/wikis/empty.html.haml b/app/views/wikis/empty.html.haml new file mode 100644 index 00000000000..32b1c9258c5 --- /dev/null +++ b/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 |
