fix file seller

This commit is contained in:
Kukks
2023-08-03 20:49:42 +02:00
parent 2232f74ac5
commit a5b83ad38b
3 changed files with 9 additions and 7 deletions

View File

@@ -9,7 +9,7 @@
<PropertyGroup> <PropertyGroup>
<Product>File Seller</Product> <Product>File Seller</Product>
<Description>Allows you to sell files through the point of sale/crowdfund apps.</Description> <Description>Allows you to sell files through the point of sale/crowdfund apps.</Description>
<Version>1.0.0</Version> <Version>1.0.1</Version>
</PropertyGroup> </PropertyGroup>
<!-- Plugin development properties --> <!-- Plugin development properties -->
<PropertyGroup> <PropertyGroup>

View File

@@ -9,7 +9,7 @@ public class FileSellerPlugin : BaseBTCPayServerPlugin
{ {
public override IBTCPayServerPlugin.PluginDependency[] Dependencies { get; } = public override IBTCPayServerPlugin.PluginDependency[] Dependencies { get; } =
{ {
new() { Identifier = nameof(BTCPayServer), Condition = ">=1.10.3" } new() { Identifier = nameof(BTCPayServer), Condition = ">=1.11.1" }
}; };
public override void Execute(IServiceCollection applicationBuilder) public override void Execute(IServiceCollection applicationBuilder)
{ {

View File

@@ -12,8 +12,10 @@
UserIds = await UserService.IsAdminUser(userId) ? Array.Empty<string>() : new[] {userId}, UserIds = await UserService.IsAdminUser(userId) ? Array.Empty<string>() : new[] {userId},
})).Select(file => new SelectListItem(file.FileName, file.Id)).Prepend(new SelectListItem("No file", "")); })).Select(file => new SelectListItem(file.FileName, file.Id)).Prepend(new SelectListItem("No file", ""));
} }
<div class="form-group"> <template v-if="editingItem">
<div class="form-group">
<label class="form-label">Downloadable file</label> <label class="form-label">Downloadable file</label>
<select :value="editingItem['file'] || ''" asp-items="files" class="form-select w-auto" v-on:change=" if(event.target.value) editingItem['file']= event.target.value; else delete editingItem['file'];"></select> <select :value="editingItem['file'] || ''" asp-items="files" class="form-select w-auto" v-on:change=" if(event.target.value) editingItem['file']= event.target.value; else delete editingItem['file'];"></select>
<span class="form-text">If a file is selected, when a user buys this item, a download link is generated in the payment receipt once the invoice is settled. <a target="_blank" asp-action="Files" asp-controller="UIServer">Upload files here</a></span> <span class="form-text">If a file is selected, when a user buys this item, a download link is generated in the payment receipt once the invoice is settled. <a target="_blank" asp-action="Files" asp-controller="UIServer">Upload files here</a></span>
</div> </div>
</template>