Skip to content

Commit

Permalink
Change number of remaining examples #30
Browse files Browse the repository at this point in the history
  • Loading branch information
Cherudek committed Mar 15, 2019
1 parent e0eb913 commit 990b26a
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ public String index(Model model) {
ctaBuilder.append(", ");
}
}
ctaBuilder.append(" and ");
Long totalCount = flashCardService.getCurrentCount();
ctaBuilder.append(totalCount);
ctaBuilder.append(" more");
if (totalCount > AMOUNT_TO_SHOW) {
ctaBuilder.append(" and ");
ctaBuilder.append(totalCount - AMOUNT_TO_SHOW);
ctaBuilder.append(" more");
}
model.addAttribute("cta", ctaBuilder.toString());
model.addAttribute("flashCardCount", totalCount);
return "index";
Expand Down

0 comments on commit 990b26a

Please sign in to comment.