Add empty hints for user pages

This commit is contained in:
Andreas Nedbal 2023-12-10 21:53:12 +01:00 committed by Andreas Nedbal
parent eb56ab87be
commit 499b525a0e
4 changed files with 14 additions and 0 deletions

View File

@ -1,4 +1,7 @@
#questions
- if @questions.empty?
= render "shared/empty", icon: "fa-regular fa-comment", translation_key: ".user.questions"
- @questions.each do |q|
= render 'shared/question', q: q, type: nil

View File

@ -7,6 +7,9 @@
= render "answerbox", a:
#answers
- if @answers.empty?
= render "shared/empty", icon: "fa-regular fa-comments", translation_key: ".user.answers"
- @answers.each do |a|
= render "answerbox", a:

View File

@ -1,3 +1,6 @@
- if @users.empty?
= render "shared/empty", icon: "fa-regular fa-user", translation_key: ".user.#{type}"
.row.row-cols-1.row-cols-sm-2.row-cols-md-3#users
- @users.each do |user|
.col.pb-3

View File

@ -573,6 +573,11 @@ en:
show: "Show full question"
hide: "Hide full question"
empty:
user:
answers: "This user hasn't answered any questions yet."
questions: "This user hasn't asked any questions yet."
follower: "This user has no followers."
friend: "This user is not following anyone."
formatting:
body_html: |
<p>%{app_name} uses <b>Markdown</b> for formatting</p>