storj/web/marketing/pages/referral-offers.html
Egon Elbre e8605d312e satellite/rewards: use USD type (#2384)
* fix String converison

* add method

* rename to USD

* fix types

* fix parsing of forms

* fix tests

* fix header

* use larger type

* use int64

* rename func

* move currency to separate package

* convert types, renames

* fix usercredits

* remove unnecessary conversion

* fix comment and named params
2019-07-01 15:16:49 -04:00

71 lines
3.0 KiB
HTML

<!-- Copyright (C) 2019 Storj Labs, Inc.
See LICENSE for copying information. -->
{{define "referralOffers"}}
<div class="offers-table mt-2 mb-5 container">
<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">Referrals Used</div>
<div class="col col-heading">Redeemable Capacity</div>
<div class="col col-heading">Created</div>
<div class="col col-heading">Expiration</div>
<div class="col col-heading">Status</div>
</div><hr>
<div class="row offer-heading ">
<p class="offer-type">Default&nbsp;Offer</p>
</div>
{{$defaultOffer := .ReferralOffers.GetDefaultFromSet}}
<div class="row data-row">
<div class="col ml-3">{{$defaultOffer.Name}}</div>
<div class="col">${{$defaultOffer.InviteeCredit}}</div>
<div class="col">${{$defaultOffer.AwardCredit}}</div>
<div class="col">{{$defaultOffer.NumRedeemed}}</div>
<div class="col">&#8734;</div>
<div class="col">{{printf "%.10s" $defaultOffer.CreatedAt}}</div>
<div class="col">&#8734;</div>
<div class="col"></div>
</div><hr>
<div class="row offer-heading ">
<p class="offer-type">Current&nbsp;Offer</p>
</div>
{{if gt (len .ReferralOffers.Set) 0}}
{{$currentOffer := .ReferralOffers.GetCurrentFromSet}}
<div class="row data-row">
<div class="col ml-3">{{$currentOffer.Name}}</div>
<div class="col">${{$currentOffer.InviteeCredit}}</div>
<div class="col">${{$currentOffer.AwardCredit}}</div>
<div class="col">{{$currentOffer.NumRedeemed}}</div>
<div class="col">{{$currentOffer.RedeemableCap}}</div>
<div class="col">{{printf "%.10s" $currentOffer.CreatedAt}}</div>
<div class="col">{{printf "%.10s" $currentOffer.ExpiresAt}}</div>
<div class="col stop-offer">
<span data-toggle="modal" data-target=".stop-referral-offer-modal">
<strong>Live &#183;</strong>
</span>
</div>
</div><hr>
{{end}}
<div class="row offer-heading ">
<p class="offer-type">Other&nbsp;Offers</p>
</div>
{{if gt (len .ReferralOffers.Set) 0}}
{{range .ReferralOffers.Set}}
{{$offer := .}}
{{if $offer.IsDone}}
<div class="row data-row">
<div class="col ml-3">{{$offer.Name}}</div>
<div class="col">${{$offer.InviteeCredit}}</div>
<div class="col">${{$offer.AwardCredit}}</div>
<div class="col">{{.NumRedeemed}}</div>
<div class="col">{{.RedeemableCap}}</div>
<div class="col">{{printf "%.10s" .CreatedAt}}</div>
<div class="col">{{printf "%.10s" .ExpiresAt}}</div>
<div class="col">off</div>
</div><hr>
{{end}}
{{end}}
{{end}}
</div>
{{end}}