Skip to content
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

don't render nb-user-name if there's nothing to #508

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion blocks/user/user.yate
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ match .user nb-user-pic {
</span>
}

match .user nb-user-name {
match .user[!!.username || !!.email] nb-user-name {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А если указан только email, но не указан username — все равно нарисуем пустой спан для username? Кажется, что имеет смысл проверять только юзернейм, потому что это обязательный параметр: нет юзернейма, не получится указать только емаил.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут все в одном _nb-user-label лежит, посмотри

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Пустой _nb-user-name ни на что не влияет пока что, его можно всегда рисовать

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ок. Я бы разбил на два матча, для удобства:

<span class="_nb-user-label">
  apply .[.username] nb-user-username
  apply .[.email] nb-user-email
</span>

<span class="_nb-user-label">
<span class="_nb-user-name _link" title="{.username}">
.username
Expand Down