Skip to content

Commit

Permalink
Extracted a footer component which makes it easier to override
Browse files Browse the repository at this point in the history
  • Loading branch information
gregbell committed Feb 21, 2012
1 parent e389281 commit 2829d77
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/active_admin/view_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class ViewFactory < AbstractViewFactory
:action_items => ActiveAdmin::Views::ActionItems,
:title_bar => ActiveAdmin::Views::TitleBar,
:header => ActiveAdmin::Views::Header,
:footer => ActiveAdmin::Views::Footer,
:dashboard_section => ActiveAdmin::Views::DashboardSection,
:index_scopes => ActiveAdmin::Views::Scopes,
:blank_slate => ActiveAdmin::Views::BlankSlate
Expand Down
18 changes: 18 additions & 0 deletions lib/active_admin/views/footer.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module ActiveAdmin
module Views
class Footer < Component

def build
super :id => "footer"
powered_by_message
end

private

def powered_by_message
para "Powered by #{link_to("Active Admin", "http://www.activeadmin.info")} #{ActiveAdmin::VERSION}".html_safe
end

end
end
end
4 changes: 1 addition & 3 deletions lib/active_admin/views/pages/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ def skip_sidebar?

# Renders the content for the footer
def build_footer
div :id => "footer" do
para "Powered by #{link_to("Active Admin", "http://www.activeadmin.info")} #{ActiveAdmin::VERSION}".html_safe
end
insert_tag view_factory.footer
end

end
Expand Down

0 comments on commit 2829d77

Please sign in to comment.