From 7d7d781f06737b9263680c62ebb715740df880ca Mon Sep 17 00:00:00 2001 From: Vitaliy Vlasov Date: Tue, 16 Jan 2018 17:48:26 +0200 Subject: [PATCH] Correct 'Showing' label text; decrease default page size to 15 --- src/cljs/commiteth/bounties.cljs | 11 ++++++++--- src/cljs/commiteth/common.cljs | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/cljs/commiteth/bounties.cljs b/src/cljs/commiteth/bounties.cljs index 49bdd75..26957e3 100644 --- a/src/cljs/commiteth/bounties.cljs +++ b/src/cljs/commiteth/bounties.cljs @@ -2,6 +2,7 @@ (:require [re-frame.core :as rf] [commiteth.common :refer [moment-timestamp display-data-page + items-per-page issue-url]])) @@ -43,14 +44,18 @@ [:div.ui.tiny.circular.image [:img {:src avatar-url}]]]])) -(defn bounties-list [{:keys [items item-count total-count] :as bounty-page-data}] +(defn bounties-list [{:keys [items item-count page-number total-count] + :as bounty-page-data}] [:div.ui.container.open-bounties-container [:div.open-bounties-header "Bounties"] (if (empty? items) [:div.view-no-data-container [:p "No recent activity yet"]] - [:div [:div.item-counts-label - [:span (str "Showing " item-count " of " total-count)]] + [:div + (let [left (inc (* (dec page-number) items-per-page)) + right (dec (+ left item-count))] + [:div.item-counts-label + [:span (str "Showing " left "-" right " of " total-count)]]) (display-data-page bounty-page-data bounty-item :set-bounty-page-number)])]) (defn bounties-page [] diff --git a/src/cljs/commiteth/common.cljs b/src/cljs/commiteth/common.cljs index ce8588b..6eed787 100644 --- a/src/cljs/commiteth/common.cljs +++ b/src/cljs/commiteth/common.cljs @@ -30,7 +30,7 @@ (defn issue-url [owner repo number] (str "https://github.com/" owner "/" repo "/issues/" number)) -(def items-per-page 20) +(def items-per-page 15) (defn draw-page-numbers [page-number page-count set-page-kw] "Draw page numbers for the pagination component.