-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Feat: friends link in community #14499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
app/views/base/topnav.scala
Outdated
| ctx.hasClas || ctx.me.exists(u => u.hasTitle || u.roles.contains("ROLE_COACH")) | ||
|
|
||
| def apply()(using ctx: PageContext) = | ||
| def apply(me: lila.user.Me)(using ctx: PageContext) = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fun fact, PageContext already contains me. So if you want, you can revert that change to layout.scala remove the apply parameter and do ctx.me.map(me => a(href := routes.Relation.following(me.username))(trans.friends())),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok, I haven't think about it. I just saw a similar approach with dasher component where me is being passed to dasher as an argument (it is also in the layout file). That's why I did it like that!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only knew that one because others correct my code all the time!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def apply(me: lila.user.Me)(using ctx: PageContext) would mean that only logged in users can have a top nav menu.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure where it should go in that menu, maybe last rather than inserting it into the middle, but I definitely think this makes the site better. Friends list should be more prominent on mobile.
|
This is probably a bit of a third rail, but if it's a slots issue - I think this is a better use of that 5th menu item than the additional Donate link. Everyone can see the Donate button right there on the front page. Nobody is going to be browsing the community menu and say "hey, looky here - I did not know this but I can give money to these folks". |
app/views/base/layout.scala
Outdated
| topnav(), | ||
| ctx.me map { me => | ||
| topnav(me) | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this removes the entire top nav menu for users that are not logged in. Also preventing them from logging in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it!
|
please auto-format the code: https://github.com/lichess-org/lila/wiki/Lichess-Development-Onboarding#code-formatting |
* master: (29 commits) remove snabbdom hack remove snabbdom hack check that keyboard functions are available during parsing mirror the keyboardMove optional functions remove unused functions Update play-json to 3.0.2 Fixed formatting Fixed berserk sound playing even when round doesn't support berserk Fixed berserk sound playing even when round doesn't support berserk Added condition for playing berserk sound Removed unnecessary comment use existing TS function instead of hardcoding game state ID use existing game & player scala functions Feat: friends link in community (lichess-org#14499) fix homepage simul link - closes lichess-org#14433 fix homepage feed display in bot mode, col-4 - closes lichess-org#14495 [Mobile] Add "follow" to single pref API Only select published updates for non-feed-curator users reveal pieces on main board on game completion show mini-board pieces for completed games ...
Solving issue with friends link
friends_link_in_community_tab.mp4