Skip to content

Commit

Permalink
ユーザー個別ページのカウントが0の場合はリンクしないようにした
Browse files Browse the repository at this point in the history
  • Loading branch information
unikounio committed Apr 24, 2024
1 parent 9541c33 commit 4824550
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions app/views/users/_activity_counts.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,40 @@ dl.card-counts__items
dt.card-counts__item-label
| 日報
dd.card-counts__item-value
= link_to user.reports.size, user_reports_path(user)
= link_to_if !user.reports.empty?,
user.reports.size, user_reports_path(user)
.card-counts__item
.card-counts__item-inner
dt.card-counts__item-label
| 提出物
dd.card-counts__item-value
= link_to user.products.size, user_products_path(user)
= link_to_if !user.products.empty?,
user.products.size, user_products_path(user)
.card-counts__item
.card-counts__item-inner
dt.card-counts__item-label
| コメント
dd.card-counts__item-value
= link_to user.comments.size, user_comments_path(user)
= link_to_if !user.comments.empty?,
user.comments.size, user_comments_path(user)
.card-counts__item
.card-counts__item-inner
dt.card-counts__item-label
| 質問
dd.card-counts__item-value
= link_to user.questions.size, user_questions_path(user)
= link_to_if !user.questions.empty?,
user.questions.size, user_questions_path(user)
.card-counts__item
.card-counts__item-inner
dt.card-counts__item-label
| 回答
dd.card-counts__item-value
= link_to user.answers.size, user_answers_path(user)
= link_to_if !user.answers.empty?,
user.answers.size, user_answers_path(user)
.card-counts__item
.card-counts__item-inner
dt.card-counts__item-label
| ポートフォリオ
dd.card-counts__item-value
= link_to user.works.size, user_portfolio_path(user)
= link_to_if !user.works.empty?,
user.works.size, user_portfolio_path(user)

0 comments on commit 4824550

Please sign in to comment.