add rank badge to minimal and fix css in minimal

This commit is contained in:
Kukks 2019-01-10 14:54:41 +01:00
parent 89bb6d1268
commit 4f64193e85
4 changed files with 47 additions and 38 deletions

View file

@ -1,50 +1,56 @@
@using Microsoft.EntityFrameworkCore.Internal
@model BTCPayServer.Models.AppViewModels.ContributeToCrowdfund
<form method="post">
@foreach (var item in Model.ViewCrowdfundViewModel.Perks)
{
<div class="card mb-4 perk expanded" id="@item.Id">
@if (Model.ViewCrowdfundViewModel.DisplayPerksRanking && Model.ViewCrowdfundViewModel.PerkCount.ContainsKey(item.Id))
{
<span class="btn btn-sm rounded-circle px-0 btn-primary perk-badge">#@(Model.ViewCrowdfundViewModel.Perks.IndexOf(item)+1)</span>
}
@if (!string.IsNullOrEmpty(item.Image))
{
<img class="card-img-top" src="@item.Image"/>
}
<div class="card-body">
<div class="card-title d-flex justify-content-between">
<label class="h5">
@if (!string.IsNullOrEmpty(item.Image))
{
<img class="card-img-top" src="@item.Image" />
}
<div class="card-body">
<div class="card-title d-flex justify-content-between" >
<label class="h5">
@if (Model.ViewCrowdfundViewModel.Started && !Model.ViewCrowdfundViewModel.Ended && (item.Price.Value > 0 || item.Custom))
{
<input type="radio" asp-for="ChoiceKey" value="@item.Id"/>
}
@(string.IsNullOrEmpty(item.Title) ? item.Id : item.Title)
</label>
<span class="text-muted">
@if (item.Price.Value > 0)
{
@item.Price.Value
if (item.Custom)
@if (Model.ViewCrowdfundViewModel.Started && !Model.ViewCrowdfundViewModel.Ended && (item.Price.Value > 0 || item.Custom))
{
Html.Raw("or more");
<input type="radio" asp-for="ChoiceKey" value="@item.Id"/>
}
@(string.IsNullOrEmpty(item.Title) ? item.Id : item.Title)
</label>
<span class="text-muted">
@if (item.Price.Value > 0)
{
@item.Price.Value
if (item.Custom)
{
Html.Raw("or more");
}
}
else if (item.Custom)
{
Html.Raw("Any amount");
}
}else if (item.Custom)
{
Html.Raw("Any amount");
}
</span>
</div>
<p class="card-text overflow-hidden" >@Html.Raw(item.Description)</p>
</span>
</div>
<p class="card-text overflow-hidden">@Html.Raw(item.Description)</p>
</div>
@if (Model.ViewCrowdfundViewModel.PerkCount.ContainsKey(item.Id))
{
<div class="card-footer text-right">
@Model.ViewCrowdfundViewModel.PerkCount[item.Id] Contributors
</div>
}
</div>
@if (Model.ViewCrowdfundViewModel.PerkCount.ContainsKey(item.Id))
{
<div class="card-footer d-flex justify-content-between">
<span></span>
<span> @Model.ViewCrowdfundViewModel.PerkCount[item.Id] Contributors</span>
</div>
}
</div>
}
@if (Model.ViewCrowdfundViewModel.Started && !Model.ViewCrowdfundViewModel.Ended)
{

View file

@ -81,7 +81,7 @@
<h5>@(Model.Info.PendingProgressPercentage.GetValueOrDefault(0) + Model.Info.ProgressPercentage.GetValueOrDefault(0))%</h5>
<h5 class="text-muted">Of Goal</h5>
</div>
<div class="col-sm border-right">
<div class="col-sm text-right">
<h5>
@Model.Info.TotalContributors
</h5>

View file

@ -231,7 +231,9 @@
<script type="text/x-template" id="perk-template">
<div class="card mb-4 perk" v-bind:class="{ 'expanded': expanded, 'unexpanded': !expanded }" v-on:click="expand" :id="perk.id">
<span v-if="displayPerksRanking && perk.sold" class="btn btn-sm rounded-circle px-0 perk-badge" v-bind:class="{ 'btn-primary': index==0, 'btn-secondary': index!=0}">#{{index+1}}</span>
<span v-if="displayPerksRanking && perk.sold"
class="btn btn-sm rounded-circle px-0 perk-badge"
v-bind:class="{ 'btn-primary': index==0, 'btn-secondary': index!=0}">#{{index+1}}</span>
<div class="perk-zoom " v-if="canExpand">

View file

@ -25,8 +25,9 @@
</script>
<bundle name="wwwroot/bundles/crowdfund-bundle-1.min.js"></bundle>
<bundle name="wwwroot/bundles/crowdfund-bundle-2.min.js"></bundle>
<bundle name="wwwroot/bundles/crowdfund-bundle.min.css"></bundle>
}
<bundle name="wwwroot/bundles/crowdfund-bundle.min.css"></bundle>
@if (!string.IsNullOrEmpty(Model.EmbeddedCSS))
{
<style>