Skip to content

Instantly share code, notes, and snippets.

/-

Created March 7, 2014 08:24
Show Gist options
  • Save anonymous/9407550 to your computer and use it in GitHub Desktop.
Save anonymous/9407550 to your computer and use it in GitHub Desktop.
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index 6ec109b..054a929 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -57,11 +57,17 @@ class ProjectsController < ApplicationController
def show
return authenticate_user! unless @project.public? || current_user
- limit = (params[:limit] || 20).to_i
+ limit = (params[:limit] || 6).to_i
@events = @project.events.recent
@events = event_filter.apply_filter(@events)
@events = @events.limit(limit).offset(params[:offset] || 0)
+ repo = @project.repository
+ commit = repo.commit('HEAD')
+ if commit
+ @tree = repo.tree(commit.id, '/')
+ end
+
respond_to do |format|
format.html do
if @project.empty_repo?
diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml
index 8a1e1d3..75274fd 100644
--- a/app/views/projects/show.html.haml
+++ b/app/views/projects/show.html.haml
@@ -6,6 +6,9 @@
= render 'shared/event_filter'
.content_list
= spinner
+
+ - if @tree.readme
+ = render "projects/tree/readme", readme: @tree.readme
.col-md-3.project-side.hidden-sm
.clearfix
- if @project.archived?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment