discourse/discourse — pull request #481 by ZogStriP (2013-03-16 23:07:54+00:00)
Title: FIX: allows the selection of the default landing tab

Meta: [Where does one select the default landing tab?](http://meta.discourse.org/t/where-does-one-select-the-default-landing-tab/4819)

![Screenshot_17_03_13_00_01](https://f.cloud.github.com/assets/362783/267490/70419b26-8e8d-11e2-9e4e-8084785285b0.png)

- [x] generates the top menu list using the site setting of the same name (1)
- [x] associates the `/` route to the **first** item in the `top_menu` site setting in order to mark the right item in the menu as `active` when visiting the homepage
- [x] prevents duplicate routes when the `categories` is the default landing page
- [x] removed duplicate static routes declaration
- [x] updated the `top_menu` site setting default values to integrate both the `read` and `posted` items.

(1) my solution to retrieve the `top_menu` data from the site settings feels a bit *hacky-ish*. Unfortunately, I can't use the default `PreloadStore` API as it's a *read-only-once* structure and would delete its content.

**Note:** while testing, I've found out that the following items are **mandatory**: popular, favorited and read. I'm not exactly sure as to why only those are mandatory *(would appreciate hints)*, but there should definitively be a test when the administrator saves this setting.