BUGFIX: don't show redirect reason if you aren't redirected

Move the redirect to top page logic server-side and make sure the reason
is not shown when top is not in the navigation menu (top_menu).
This commit is contained in:
Régis Hanol
2014-03-07 18:58:53 +01:00
parent c3e5ee1d7e
commit 8214536614
12 changed files with 122 additions and 117 deletions

View File

@ -17,7 +17,9 @@ class CurrentUserSerializer < BasicUserSerializer
:can_edit,
:can_invite_to_forum,
:no_password,
:can_delete_account
:can_delete_account,
:should_be_redirected_to_top,
:redirected_to_top_reason
def include_site_flagged_posts_count?
object.staff?
@ -63,4 +65,8 @@ class CurrentUserSerializer < BasicUserSerializer
true
end
def include_redirected_to_top_reason?
object.should_be_redirected_to_top
end
end