make display order consistent (#2705)

This commit is contained in:
Yingrong Zhao 2019-08-06 10:41:25 -04:00 committed by GitHub
parent e5f30bddc0
commit c32fc283c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 4 deletions

View File

@ -3,6 +3,8 @@
package rewards
import "sort"
// OrganizedOffers contains a list of offers organized by status.
type OrganizedOffers struct {
Active Offer
@ -78,9 +80,18 @@ func (offers Offers) OrganizeOffersByType() OfferSet {
func createPartnerSet() PartnerSet {
partners := LoadPartnerInfos()
var ps PartnerSet
for _, partner := range partners {
keys := make([]string, len(partners))
i := 0
for k := range partners {
keys[i] = k
i++
}
sort.Strings(keys)
for _, key := range keys {
ps = append(ps, OpenSourcePartner{
PartnerInfo: partner,
PartnerInfo: partners[key],
})
}
return ps

View File

@ -37,7 +37,7 @@ See LICENSE for copying information. -->
<input type="number" class="form-control" name="InviteeCreditDurationDays" id="InviteeCreditDurationDays" min="1" placeholder="14 days" required>
</div>
<div class="form-group col-md-2">
<label for="AwardCredit">Award Credit</label>
<label for="AwardCredit">Get Credit</label>
<input type="number" class="form-control" name="AwardCredit" id="AwardCredit" placeholder="$50" min="1" required>
</div>
<div class="form-group col-md-3">

View File

@ -6,7 +6,7 @@ See LICENSE for copying information. -->
<div class="row">
<div class="col col-heading">Name</div>
<div class="col col-heading">Give Credit</div>
<div class="col col-heading">Award Credit</div>
<div class="col col-heading">Get Credit</div>
<div class="col col-heading">Redeemable Capacity</div>
<div class="col col-heading">Created</div>
<div class="col col-heading">Expiration</div>