Commit efa267602122dc2aa5ee789a87fe4039c7ffe484

Authored by Dmitriy Zaporozhets
1 parent a7fab42b

Render readme file in public project#show

app/controllers/public/projects_controller.rb
@@ -17,5 +17,8 @@ class Public::ProjectsController < ApplicationController @@ -17,5 +17,8 @@ class Public::ProjectsController < ApplicationController
17 17
18 @repository = @project.repository 18 @repository = @project.repository
19 @recent_tags = @repository.tags.first(10) 19 @recent_tags = @repository.tags.first(10)
  20 +
  21 + @commit = @repository.commit(params[:ref])
  22 + @tree = Tree.new(@repository, @commit.id, @ref, @path)
20 end 23 end
21 end 24 end
app/views/layouts/errors.html.haml
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 %html{ lang: "en"} 2 %html{ lang: "en"}
3 = render "layouts/head", title: "Error" 3 = render "layouts/head", title: "Error"
4 %body{class: "#{app_theme} application"} 4 %body{class: "#{app_theme} application"}
5 - = render "layouts/head_panel", title: "" 5 + = render "layouts/head_panel", title: "" if current_user
6 = render "layouts/flash" 6 = render "layouts/flash"
7 .container 7 .container
8 .content 8 .content
app/views/public/projects/_tree.html.haml 0 → 100644
@@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
  1 +- if false#tree.readme
  2 + = render "projects/tree/readme", readme: tree.readme
  3 +- else
  4 + .alert
  5 + %h3.nothing_here_message This project does not have README file
app/views/public/projects/show.html.haml
@@ -16,8 +16,7 @@ @@ -16,8 +16,7 @@
16 %br 16 %br
17 .row 17 .row
18 .span9 18 .span9
19 - .light-well  
20 - %h3.nothing_here_message Some awesome stuff here 19 + = render 'tree', tree: @tree
21 .span3 20 .span3
22 %h5 Repository: 21 %h5 Repository:
23 %div 22 %div