Implement Page#footer and display footer in frontend.
This commit is contained in:
@@ -339,6 +339,11 @@ html {overflow-y: scroll;}
|
||||
|
||||
/* Special markup considerations */
|
||||
|
||||
.wikistyle.gollum.footer {
|
||||
border-top: 4px solid #f0f0f0;
|
||||
margin-top: 2em;
|
||||
}
|
||||
|
||||
.wikistyle.gollum > h1:first-child {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -4,9 +4,14 @@
|
||||
<a href="/">Home</a> | <a href="/edit/{{name}}">Edit</a>
|
||||
</div>
|
||||
<h1>{{human_name}}</h1>
|
||||
<div class="wikistyle gollum {{format}}">
|
||||
<div class="content wikistyle gollum {{format}}">
|
||||
{{{content}}}
|
||||
</div>
|
||||
{{#has_footer}}
|
||||
<div class="footer wikistyle gollum {{footer_format}}">
|
||||
{{{footer_content}}}
|
||||
</div>
|
||||
{{/has_footer}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="admin">
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module Precious
|
||||
module Views
|
||||
class Page < Layout
|
||||
attr_reader :content, :page
|
||||
attr_reader :content, :page, :footer
|
||||
|
||||
def human_name
|
||||
@page.title
|
||||
@@ -23,6 +23,21 @@ module Precious
|
||||
@page.version.authored_date.strftime("%Y-%m-%d %H:%M:%S")
|
||||
end
|
||||
|
||||
def has_footer
|
||||
@footer ||= @page.footer
|
||||
!@footer.nil?
|
||||
end
|
||||
|
||||
def footer_content
|
||||
@footer ||= @page.footer
|
||||
@footer.formatted_data
|
||||
end
|
||||
|
||||
def footer_format
|
||||
@footer ||= @page.footer
|
||||
@footer.format.to_s
|
||||
end
|
||||
|
||||
def versions
|
||||
i = @page.versions.size + 1
|
||||
@page.versions.map do |v|
|
||||
|
||||
Reference in New Issue
Block a user