Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: afilina/gollum
base: 9ce4f0220e
...
head fork: afilina/gollum
compare: ddeb7ac31c
Checking mergeability… Don't worry, you can still create the pull request.
  • 5 commits
  • 9 files changed
  • 0 commit comments
  • 1 contributor
View
0  Super-Page.md
No changes.
View
1  Test.md
@@ -0,0 +1 @@
+test
View
7 lib/gollum/frontend/app.rb
@@ -122,6 +122,13 @@ class App < Sinatra::Base
@versions = @page.versions :page => @page_num
mustache :history
end
+
+ get '/timeline' do
+ @name = 'timeline'
+ wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
+ @entries = wiki.entries
+ mustache :timeline
+ end
post '/compare/:name' do
@versions = params[:versions] || []
View
2  lib/gollum/frontend/templates/page.mustache
@@ -12,6 +12,8 @@
{{/editable}}
<li class="minibutton"><a href="/history/{{escaped_name}}"
class="action-page-history">Page History</a></li>
+ <li class="minibutton"><a href="/timeline"
+ class="action-wiki-history">Wiki History</a></li>
</ul>
{{>searchbar}}
</div>
View
38 lib/gollum/frontend/templates/timeline.mustache
@@ -0,0 +1,38 @@
+<div id="wiki-wrapper" class="history">
+<div id="head">
+ <h1>{{title}}</h1>
+ {{>searchbar}}
+</div>
+<div id="wiki-history">
+
+ <table>
+ <tbody>
+ {{#commits}}
+ <tr>
+ <td class="author">
+ <a href="javascript:void(0)">
+ <img src="http://www.gravatar.com/avatar/{{gravatar}}?s=16"
+ alt="avatar: {{author}}" class="mini-gravatar">
+ <span class="username">{{author}}</span>
+ </a>
+ </td>
+ <td class="commit-name">
+ <span class="time-elapsed">{{date}}:</span>&nbsp;
+ {{message}}
+ [<a href="/{{page_link}}" title="View page">{{page_name}}</a>]
+ </td>
+ </tr>
+ {{/commits}}
+
+ </tbody>
+ </table>
+
+</div>
+<div id="footer">
+ <ul class="actions">
+ <!-- only show this button if we have more than 20 revisions -->
+ <li class="minibutton"><a href="#"
+ class="action-back-to-top">Back to Top</a></li>
+ </ul>
+</div>
+</div>
View
50 lib/gollum/frontend/views/timeline.rb
@@ -0,0 +1,50 @@
+module Precious
+ module Views
+ class Timeline < Layout
+ attr_reader :page, :page_num
+
+ def title
+ "Timeline"
+ end
+
+ def commits
+ commits = []
+ @entries.each do |v|
+ file_name = v.show[0].b_path.split('/').pop()
+ page_name = Gollum::Page.canonicalize_filename(file_name)
+ page_link = Gollum::Page.cname(page_name)
+ commits.push(
+ { :id => v.id,
+ :id7 => v.id[0..6],
+ :author => v.author.name,
+ :message => v.message,
+ :page_name=> page_name,
+ :page_link=> page_link,
+ :date => v.committed_date.strftime("%B %d, %Y"),
+ :gravatar => Digest::MD5.hexdigest(v.author.email) }
+ )
+ end
+
+ return commits
+ end
+
+ def previous_link
+ label = "&laquo; Previous"
+ if @page_num == 1
+ %(<span class="disabled">#{label}</span>)
+ else
+ %(<a href="/timeline?page=#{@page_num-1}" hotkey="h">#{label}</a>)
+ end
+ end
+
+ def next_link
+ label = "Next &raquo;"
+ if @versions.size == Gollum::Page.per_page
+ %(<a href="/timeline?page=#{@page_num+1}" hotkey="l">#{label}</a>)
+ else
+ %(<span class="disabled">#{label}</span>)
+ end
+ end
+ end
+ end
+end
View
12 lib/gollum/wiki.rb
@@ -549,6 +549,18 @@ def tree_list(ref)
[]
end
end
+
+ # Fill an array with a list of entries in chronological order.
+ #
+ # max_count - The number of entries to retrieve.
+ #
+ # Returns a flat Array of commit entries.
+ def entries(max_count = 10)
+ options = {:pretty => 'raw', :max_count => max_count}
+ args = [@page_file_dir]
+ log = repo.git.native "log", options, "--", args
+ return Grit::Commit.list_from_string(repo, log)
+ end
# Creates a reverse diff for the given SHAs on the given Gollum::Page.
#
View
0  wiki_files/My-Page.md
No changes.
View
0  wiki_files/Page.md
No changes.

No commit comments for this range

Something went wrong with that request. Please try again.