Class: Precious::Views::History
- Defined in:
- lib/gollum/frontend/views/history.rb
Instance Attribute Summary collapse
-
#page ⇒ Object
readonly
Returns the value of attribute page.
-
#page_num ⇒ Object
readonly
Returns the value of attribute page_num.
Attributes inherited from Layout
Instance Method Summary collapse
Methods inherited from Layout
Instance Attribute Details
#page ⇒ Object (readonly)
Returns the value of attribute page.
4 5 6 |
# File 'lib/gollum/frontend/views/history.rb', line 4 def page @page end |
#page_num ⇒ Object (readonly)
Returns the value of attribute page_num.
4 5 6 |
# File 'lib/gollum/frontend/views/history.rb', line 4 def page_num @page_num end |
Instance Method Details
#next_link ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/gollum/frontend/views/history.rb', line 34 def next_link label = "Next »" if @versions.size == Gollum::Page.per_page %(<a href="/history/#{@page.name}?page=#{@page_num+1}" hotkey="l">#{label}</a>) else %(<span class="disabled">#{label}</span>) end end |
#previous_link ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/gollum/frontend/views/history.rb', line 25 def previous_link label = "« Previous" if @page_num == 1 %(<span class="disabled">#{label}</span>) else %(<a href="/history/#{@page.name}?page=#{@page_num-1}" hotkey="h">#{label}</a>) end end |
#title ⇒ Object
6 7 8 |
# File 'lib/gollum/frontend/views/history.rb', line 6 def title @page.title end |
#versions ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/gollum/frontend/views/history.rb', line 10 def versions i = @versions.size + 1 @versions.map do |v| i -= 1 { :id => v.id, :id7 => v.id[0..6], :num => i, :selected => @page.version.id == v.id, :author => v..name, :message => v., :date => v.committed_date.strftime("%B %d, %Y"), :gravatar => Digest::MD5.hexdigest(v..email) } end end |