AgileVentures/LocalSupport — pull request #42 by dcorking (2014-04-30 13:22:48+00:00)
Title: Editable footer links

This adds a basic function to allow an admin user to hide and show the links for the static pages that are in the footer.

For example, the admin can make the "About Us" link visible by visiting /pages/about/edit and checking the "Show a public link to this page" checkbox then saving/update the page. Similarly, they can hide the footer link to "404".

Note that the order the links appear in the footer is undefined. This is a regression of normal but unspecced behaviour so please ask me to add a feature flag (or postpone the pull request) if such a regression would be undesirable.

It implements the first part of the functionality requested in the user story "I want to be able to edit static page links" https://www.pivotaltracker.com/story/show/52536437

Future pull requests may improve the UI, add a function for the admin user to customize the order the links display in.

Requires `bundle exec rake db:migrate` to add a new database column `link_visible`.

Note that when you run this migration, all your links will be hidden from the footer. Either use the edit page to fix them, or run this ruby in the rails console:
```(ruby)
# Make all links visible
Page.all.each { |p| p.link_visible = true; p.save! }
# Then hide the 404 link
Page.find_by_permalink("404").link_visible = false
```
(Sorry, that is an n+1 database query, but with a few pages it won't matter.)