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