Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AO3-5901 Pseud switcher text on the New Pseud page (#4579)
* AO3-5901 Pseud switcher text on the New Pseud page Provide fallback text for the edge case of the New Pseud page, where `@pseud` is defined, but doesn't have a `name` yet. * Update app/views/users/_sidebar.html.erb Co-authored-by: sarken <[email protected]> * AO3-5901 Ensure pseud switcher shows current pseud When we started limiting the number of pseuds in the sidebar, the way to guarantee that the current pseud would show up in the sidebar was to show it at the top of the pseud switcher. However, [AO3-6249](https://otwarchive.atlassian.net/browse/AO3-6249) decided that the pseud switcher should always say "Pseuds" at the top. We broke this behaviour in #4554. Fixing it in c3e4ab9 resulted in the current pseud not showing in the sidebar in some conditions. Move or add the current pseud at the beginning of the list, whether or not it is present in the abbreviated list. We are aware that this could make the abbreviated list in the pseud switcher show `ITEMS_PER_PAGE` + 1 pseuds in some cases, discuss with @sarken if you disagree. * AO3-5901 Don't use instance vars in helpers The Hound has arisen from its slumber as soon as I touched some ancient scrolls, and so I've tried to appease it with the following sacrifices: - add spaces after and before curly bois (`{` and `}`) - IN-TER-PO-LATE! IN-TER-PO-LATE! (AKA prefer interpolation to string concatenation) - stop using instance vars in helper method The latter change has morally forced my hand to: - separate the method that determines which pseuds to show in the sidebar selector from the method that outputs the HTML - remove the `print_` prefix from the method that I touched, as [per precedent](50f7b7e) * AO3-5901 Remove code unused since 2013 This method has had no callers since c10ef8a#diff-638a702b43ccba6b5dcb42edd2c6f8bb4ba56c492cb2ef7ccf56815663743e07. Tacking it onto this issue because its presence confused me when deciding whether the `pseuds_for_sidebar` method belonged in the user helper or the pseud helper. --------- Co-authored-by: sarken <[email protected]>
- Loading branch information