diff --git a/app/controllers/public/projects_controller.rb b/app/controllers/public/projects_controller.rb index 5d830de..ed90d03 100644 --- a/app/controllers/public/projects_controller.rb +++ b/app/controllers/public/projects_controller.rb @@ -17,5 +17,8 @@ class Public::ProjectsController < ApplicationController @repository = @project.repository @recent_tags = @repository.tags.first(10) + + @commit = @repository.commit(params[:ref]) + @tree = Tree.new(@repository, @commit.id, @ref, @path) end end diff --git a/app/views/layouts/errors.html.haml b/app/views/layouts/errors.html.haml index b939587..df2350b 100644 --- a/app/views/layouts/errors.html.haml +++ b/app/views/layouts/errors.html.haml @@ -2,7 +2,7 @@ %html{ lang: "en"} = render "layouts/head", title: "Error" %body{class: "#{app_theme} application"} - = render "layouts/head_panel", title: "" + = render "layouts/head_panel", title: "" if current_user = render "layouts/flash" .container .content diff --git a/app/views/public/projects/_tree.html.haml b/app/views/public/projects/_tree.html.haml new file mode 100644 index 0000000..cc701df --- /dev/null +++ b/app/views/public/projects/_tree.html.haml @@ -0,0 +1,5 @@ +- if false#tree.readme + = render "projects/tree/readme", readme: tree.readme +- else + .alert + %h3.nothing_here_message This project does not have README file diff --git a/app/views/public/projects/show.html.haml b/app/views/public/projects/show.html.haml index e2c8755..c4d8a4f 100644 --- a/app/views/public/projects/show.html.haml +++ b/app/views/public/projects/show.html.haml @@ -16,8 +16,7 @@ %br .row .span9 - .light-well - %h3.nothing_here_message Some awesome stuff here + = render 'tree', tree: @tree .span3 %h5 Repository: %div -- libgit2 0.21.2