Commit 4146e885dde2338b25c1a176ede2f5a2d0946f96
1 parent
cb69baed
Exists in
spb-stable
and in
2 other branches
Fix styling issues.
Showing
1 changed file
with
10 additions
and
8 deletions
Show diff stats
app/controllers/projects/wikis_controller.rb
| ... | ... | @@ -12,19 +12,21 @@ class Projects::WikisController < Projects::ApplicationController |
| 12 | 12 | |
| 13 | 13 | def show |
| 14 | 14 | @page = @project_wiki.find_page(params[:id], params[:version_id]) |
| 15 | + gollum_wiki = @project_wiki.wiki | |
| 16 | + file = gollum_wiki.file(params[:id], gollum_wiki.ref, true) | |
| 15 | 17 | |
| 16 | 18 | if @page |
| 17 | 19 | render 'show' |
| 18 | - elsif file = @project_wiki.wiki.file(params[:id], @project_wiki.wiki.ref, true) | |
| 20 | + elsif file | |
| 19 | 21 | if file.on_disk? |
| 20 | - send_file file.on_disk_path, :disposition => 'inline' | |
| 22 | + send_file file.on_disk_path, disposition: 'inline' | |
| 21 | 23 | else |
| 22 | - send_data( | |
| 23 | - file.raw_data, | |
| 24 | - type: file.mime_type, | |
| 25 | - disposition: 'inline', | |
| 26 | - filename: file.name | |
| 27 | - ) | |
| 24 | + send_data( | |
| 25 | + file.raw_data, | |
| 26 | + type: file.mime_type, | |
| 27 | + disposition: 'inline', | |
| 28 | + filename: file.name | |
| 29 | + ) | |
| 28 | 30 | end |
| 29 | 31 | else |
| 30 | 32 | return render('empty') unless can?(current_user, :write_wiki, @project) | ... | ... |