Show claim count for bounty if > 0

Show number of claims for an issue in "open issues" view if there are
any. Styling may need improvement.

Related to issue #154
This commit is contained in:
Teemu Patja 2017-11-08 12:38:22 +02:00
parent d2c63c59cc
commit 0619b4b519
No known key found for this signature in database
GPG Key ID: F5B7035E6580FD4C
3 changed files with 12 additions and 3 deletions

View File

@ -409,7 +409,8 @@ SELECT
i.updated AS updated, i.updated AS updated,
r.owner AS repo_owner, r.owner AS repo_owner,
r.owner_avatar_url AS repo_owner_avatar_url, r.owner_avatar_url AS repo_owner_avatar_url,
r.repo AS repo_name r.repo AS repo_name,
(SELECT count(*) FROM pull_requests WHERE issue_id = i.issue_id AND state = 0) AS claim_count
FROM issues i, repositories r FROM issues i, repositories r
WHERE WHERE
r.repo_id = i.repo_id r.repo_id = i.repo_id

View File

@ -13,7 +13,8 @@
updated :updated updated :updated
tokens :tokens tokens :tokens
balance-eth :balance-eth balance-eth :balance-eth
value-usd :value-usd} bounty value-usd :value-usd
open-claims :open-claims} bounty
full-repo (str owner "/" repo-name) full-repo (str owner "/" repo-name)
repo-url (str "https://github.com/" full-repo) repo-url (str "https://github.com/" full-repo)
repo-link [:a {:href repo-url} full-repo] repo-link [:a {:href repo-url} full-repo]
@ -33,7 +34,9 @@
^{:key (random-uuid)} ^{:key (random-uuid)}
[:div.balance-badge.token [:div.balance-badge.token
(str (subs (str tla) 1) " " balance)]) (str (subs (str tla) 1) " " balance)])
[:span.usd-value-label "Value "] [:span.usd-balance-label (str "$" value-usd)]]] [:span.usd-value-label "Value "] [:span.usd-balance-label (str "$" value-usd)]
(when (> open-claims 0)
[:span.open-claims-label (str open-claims " open claims")]) ]]
[:div.open-bounty-item-icon [:div.open-bounty-item-icon
[:div.ui.tiny.circular.image [:div.ui.tiny.circular.image
[:img {:src avatar-url}]]]])) [:img {:src avatar-url}]]]]))

View File

@ -495,6 +495,11 @@
color: #42505c; color: #42505c;
} }
.open-claims-label {
padding-left: 5px;
font-size: 15px;
color: #8d99a4;
}
.activity-item-container { .activity-item-container {