Skip to content
Browse files

small tweaks with history page, change paginating, and browsing older…

… files by commit revision in git
  • Loading branch information...
1 parent c1938e1 commit f103a0b12e74aff78a8e504d34bfe643945488fc @technoweenie technoweenie committed Feb 17, 2008
Showing with 5 additions and 6 deletions.
  1. +1 −1 app/controllers/browser_controller.rb
  2. +1 −0 app/models/change.rb
  3. +2 −5 app/views/history/index.html.erb
  4. +1 −0 config/environment.rb
View
2 app/controllers/browser_controller.rb
@@ -42,7 +42,7 @@ def repository_member_required
end
def find_node
- @revision = params[:rev][1..-1].to_i if params[:rev]
+ @revision = params[:rev][1..-1] if params[:rev]
@node = current_repository.node(params[:paths] * '/', @revision)
end
View
1 app/models/change.rb
@@ -1,4 +1,5 @@
class Change < ActiveRecord::Base
+ def self.per_page() 15 end
include PathAccessibility
validates_presence_of :changeset_id, :name
belongs_to :changeset
View
7 app/views/history/index.html.erb
@@ -6,7 +6,7 @@
<%= link_to_node "@#{changeset.revision}", @node, changeset.revision, :class => 'file-history' %>
<div class="cs-meta">
<%= avatar_for(user) %>
- <span class="change-number"><%= link_to(changeset.revision, hosted_url(:changeset, changeset.revision)) %></span>
+ <span class="change-number"><%= link_to(truncate(changeset.revision, 7, ''), hosted_url(:changeset, changeset.revision)) %></span>
</div>
<div class="cs-log clearfix">
<%= simple_format(h(changeset.message)) %>
@@ -16,7 +16,4 @@
<% end -%>
</ul>
-<%= will_paginate @changesets %>
-
-<% content_for :sidebar do -%>
-<% end -%>
+<%= will_paginate @changesets %>
View
1 config/environment.rb
@@ -57,6 +57,7 @@
# -- all .rb files in that directory is automatically loaded
config.after_initialize do
+ require 'diff-display'
Silo::Node.send :include, PathAccessibility
end
end

0 comments on commit f103a0b

Please sign in to comment.
Something went wrong with that request. Please try again.