mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-19 06:54:19 +01:00
fix choice key and currency data
This commit is contained in:
@@ -318,6 +318,7 @@ namespace BTCPayServer.Hubs
|
|||||||
ResetEveryAmount = settings.ResetEveryAmount,
|
ResetEveryAmount = settings.ResetEveryAmount,
|
||||||
PerkCount = perkCount,
|
PerkCount = perkCount,
|
||||||
ResetEvery = Enum.GetName(typeof(CrowdfundResetEvery),settings.ResetEvery),
|
ResetEvery = Enum.GetName(typeof(CrowdfundResetEvery),settings.ResetEvery),
|
||||||
|
CurrencyData = _AppsHelper.GetCurrencyData(settings.TargetCurrency, true),
|
||||||
Info = new ViewCrowdfundViewModel.CrowdfundInfo()
|
Info = new ViewCrowdfundViewModel.CrowdfundInfo()
|
||||||
{
|
{
|
||||||
TotalContributors = invoices.Length,
|
TotalContributors = invoices.Length,
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using BTCPayServer.Services.Rates;
|
||||||
|
|
||||||
namespace BTCPayServer.Models.AppViewModels
|
namespace BTCPayServer.Models.AppViewModels
|
||||||
{
|
{
|
||||||
@@ -33,6 +34,8 @@ namespace BTCPayServer.Models.AppViewModels
|
|||||||
public string ResetEvery { get; set; }
|
public string ResetEvery { get; set; }
|
||||||
|
|
||||||
public Dictionary<string, int> PerkCount { get; set; }
|
public Dictionary<string, int> PerkCount { get; set; }
|
||||||
|
|
||||||
|
public CurrencyData CurrencyData { get; set; }
|
||||||
|
|
||||||
public class CrowdfundInfo
|
public class CrowdfundInfo
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -49,11 +49,11 @@
|
|||||||
|
|
||||||
<div class="row py-2 text-center">
|
<div class="row py-2 text-center">
|
||||||
<div class="col-sm border-right" id="raised-amount">
|
<div class="col-sm border-right" id="raised-amount">
|
||||||
<h5>{{srvModel.info.currentAmount + srvModel.info.currentPendingAmount }} {{targetCurrency}} </h5>
|
<h5>{{ raisedAmount }} {{targetCurrency}} </h5>
|
||||||
<h5 class="text-muted">Raised</h5>
|
<h5 class="text-muted">Raised</h5>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm border-right" id="goal-raised">
|
<div class="col-sm border-right" id="goal-raised">
|
||||||
<h5>{{srvModel.info.progressPercentage + srvModel.info.pendingProgressPercentage }}%</h5>
|
<h5>{{ percentageRaisedAmount }}%</h5>
|
||||||
<h5 class="text-muted">Of Goal</h5>
|
<h5 class="text-muted">Of Goal</h5>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm border-right">
|
<div class="col-sm border-right">
|
||||||
|
|||||||
@@ -49,7 +49,8 @@ addLoadEvent(function (ev) {
|
|||||||
if(!this.active){
|
if(!this.active){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
eventAggregator.$emit("contribute", {amount: this.amount, choiceKey: this.choiceKey});
|
|
||||||
|
eventAggregator.$emit("contribute", {amount: this.amount, choiceKey: this.perk.id});
|
||||||
},
|
},
|
||||||
expand: function(){
|
expand: function(){
|
||||||
if(this.canExpand){
|
if(this.canExpand){
|
||||||
@@ -88,6 +89,12 @@ addLoadEvent(function (ev) {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
raisedAmount: function(){
|
||||||
|
return parseFloat(this.srvModel.info.currentAmount + this.srvModel.info.currentPendingAmount ).toFixed(this.srvModel.currencyData.divisibility) ;
|
||||||
|
},
|
||||||
|
percentageRaisedAmount: function(){
|
||||||
|
return parseFloat(this.srvModel.info.progressPercentage + this.srvModel.info.pendingProgressPercentage ).toFixed(2);
|
||||||
|
},
|
||||||
targetCurrency: function(){
|
targetCurrency: function(){
|
||||||
return this.srvModel.targetCurrency.toUpperCase();
|
return this.srvModel.targetCurrency.toUpperCase();
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user