Class: Precious::Views::Page
- Inherits:
-
Layout
- Object
- Mustache
- Layout
- Precious::Views::Page
show all
- Defined in:
- lib/gollum/frontend/views/page.rb
Constant Summary
collapse
- DATE_FORMAT =
"%Y-%m-%d %H:%M:%S"
- DEFAULT_AUTHOR =
'you'
Instance Attribute Summary collapse
Attributes inherited from Layout
#name
Instance Method Summary
collapse
Methods inherited from Layout
#base_path, #escaped_name, #rtfm_root
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
4
5
6
|
# File 'lib/gollum/frontend/views/page.rb', line 4
def content
@content
end
|
Returns the value of attribute footer.
4
5
6
|
# File 'lib/gollum/frontend/views/page.rb', line 4
def
@footer
end
|
#page ⇒ Object
Returns the value of attribute page.
4
5
6
|
# File 'lib/gollum/frontend/views/page.rb', line 4
def page
@page
end
|
Instance Method Details
#author ⇒ Object
16
17
18
19
|
# File 'lib/gollum/frontend/views/page.rb', line 16
def author
return DEFAULT_AUTHOR unless @page.version
@page.version.author.name
end
|
#date ⇒ Object
21
22
23
24
|
# File 'lib/gollum/frontend/views/page.rb', line 21
def date
return Time.now.strftime(DATE_FORMAT) unless @page.version
@page.version.authored_date.strftime(DATE_FORMAT)
end
|
31
32
33
|
# File 'lib/gollum/frontend/views/page.rb', line 31
def
&& @footer.formatted_data
end
|
35
36
37
|
# File 'lib/gollum/frontend/views/page.rb', line 35
def
&& @footer.format.to_s
end
|
12
13
14
|
# File 'lib/gollum/frontend/views/page.rb', line 12
def format
@page.format.to_s
end
|
26
27
28
29
|
# File 'lib/gollum/frontend/views/page.rb', line 26
def
@footer = (@page. || false) if @footer.nil?
!!@footer
end
|
39
40
41
42
|
# File 'lib/gollum/frontend/views/page.rb', line 39
def
@sidebar = (@page. || false) if @sidebar.nil?
!!@sidebar
end
|
44
45
46
|
# File 'lib/gollum/frontend/views/page.rb', line 44
def
&& @sidebar.formatted_data
end
|
48
49
50
|
# File 'lib/gollum/frontend/views/page.rb', line 48
def
&& @sidebar.format.to_s
end
|
#title ⇒ Object
8
9
10
|
# File 'lib/gollum/frontend/views/page.rb', line 8
def title
@page.title
end
|