mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 22:25:28 +01:00
Rename and add to greenfield HtmlTags and HtmlMetaTags for apps (#6557)
This commit is contained in:
parent
2255da4a56
commit
92a92a7fff
15 changed files with 54 additions and 19 deletions
|
@ -32,6 +32,8 @@ public abstract class CrowdfundBaseData : AppBaseData
|
||||||
public bool? SortPerksByPopularity { get; set; }
|
public bool? SortPerksByPopularity { get; set; }
|
||||||
public string[]? Sounds { get; set; }
|
public string[]? Sounds { get; set; }
|
||||||
public string[]? AnimationColors { get; set; }
|
public string[]? AnimationColors { get; set; }
|
||||||
|
public string? HtmlLang { get; set; }
|
||||||
|
public string? HtmlMetaTags { get; set; }
|
||||||
public string? FormId { get; set; }
|
public string? FormId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,8 @@ public abstract class PointOfSaleBaseData : AppBaseData
|
||||||
public string? Description { get; set; }
|
public string? Description { get; set; }
|
||||||
public bool? RedirectAutomatically { get; set; }
|
public bool? RedirectAutomatically { get; set; }
|
||||||
public int[]? CustomTipPercentages { get; set; }
|
public int[]? CustomTipPercentages { get; set; }
|
||||||
|
public string? HtmlLang { get; set; }
|
||||||
|
public string? HtmlMetaTags { get; set; }
|
||||||
public string? FormId { get; set; }
|
public string? FormId { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -333,6 +333,8 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||||
SortPerksByPopularity = request.SortPerksByPopularity ?? false,
|
SortPerksByPopularity = request.SortPerksByPopularity ?? false,
|
||||||
Sounds = parsedSounds ?? new CrowdfundSettings().Sounds,
|
Sounds = parsedSounds ?? new CrowdfundSettings().Sounds,
|
||||||
AnimationColors = parsedColors ?? new CrowdfundSettings().AnimationColors,
|
AnimationColors = parsedColors ?? new CrowdfundSettings().AnimationColors,
|
||||||
|
HtmlMetaTags = request.HtmlMetaTags,
|
||||||
|
HtmlLang = request.HtmlLang,
|
||||||
FormId = request.FormId
|
FormId = request.FormId
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -360,6 +362,8 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||||
NotificationUrl = request.NotificationUrl,
|
NotificationUrl = request.NotificationUrl,
|
||||||
RedirectUrl = request.RedirectUrl,
|
RedirectUrl = request.RedirectUrl,
|
||||||
Description = request.Description,
|
Description = request.Description,
|
||||||
|
HtmlLang = request.HtmlLang,
|
||||||
|
HtmlMetaTags = request.HtmlMetaTags,
|
||||||
RedirectAutomatically = request.RedirectAutomatically,
|
RedirectAutomatically = request.RedirectAutomatically,
|
||||||
FormId = request.FormId
|
FormId = request.FormId
|
||||||
};
|
};
|
||||||
|
@ -421,6 +425,8 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||||
FormId = settings.FormId,
|
FormId = settings.FormId,
|
||||||
NotificationUrl = settings.NotificationUrl,
|
NotificationUrl = settings.NotificationUrl,
|
||||||
RedirectUrl = settings.RedirectUrl,
|
RedirectUrl = settings.RedirectUrl,
|
||||||
|
HtmlLang = settings.HtmlLang,
|
||||||
|
HtmlMetaTags = settings.HtmlMetaTags,
|
||||||
Description = settings.Description,
|
Description = settings.Description,
|
||||||
RedirectAutomatically = settings.RedirectAutomatically,
|
RedirectAutomatically = settings.RedirectAutomatically,
|
||||||
Items = items
|
Items = items
|
||||||
|
@ -484,6 +490,9 @@ namespace BTCPayServer.Controllers.Greenfield
|
||||||
SortPerksByPopularity = settings.SortPerksByPopularity,
|
SortPerksByPopularity = settings.SortPerksByPopularity,
|
||||||
Sounds = settings.Sounds,
|
Sounds = settings.Sounds,
|
||||||
AnimationColors = settings.AnimationColors,
|
AnimationColors = settings.AnimationColors,
|
||||||
|
HtmlLang = settings.HtmlLang,
|
||||||
|
HtmlMetaTags = settings.HtmlMetaTags,
|
||||||
|
FormId = settings.FormId,
|
||||||
Perks = perks
|
Perks = perks
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -410,7 +410,7 @@ namespace BTCPayServer.Plugins.Crowdfund.Controllers
|
||||||
EnforceTargetAmount = settings.EnforceTargetAmount,
|
EnforceTargetAmount = settings.EnforceTargetAmount,
|
||||||
StartDate = settings.StartDate,
|
StartDate = settings.StartDate,
|
||||||
HtmlMetaTags= settings.HtmlMetaTags,
|
HtmlMetaTags= settings.HtmlMetaTags,
|
||||||
Language = settings.Language,
|
Language = settings.HtmlLang,
|
||||||
TargetCurrency = settings.TargetCurrency,
|
TargetCurrency = settings.TargetCurrency,
|
||||||
MainImageUrl = settings.MainImageUrl == null ? null : await _uriResolver.Resolve(Request.GetAbsoluteRootUri(), settings.MainImageUrl),
|
MainImageUrl = settings.MainImageUrl == null ? null : await _uriResolver.Resolve(Request.GetAbsoluteRootUri(), settings.MainImageUrl),
|
||||||
Description = settings.Description,
|
Description = settings.Description,
|
||||||
|
@ -542,7 +542,7 @@ namespace BTCPayServer.Plugins.Crowdfund.Controllers
|
||||||
StartDate = vm.StartDate?.ToUniversalTime(),
|
StartDate = vm.StartDate?.ToUniversalTime(),
|
||||||
TargetCurrency = vm.TargetCurrency,
|
TargetCurrency = vm.TargetCurrency,
|
||||||
HtmlMetaTags= _safe.RawMeta(vm.HtmlMetaTags, out wasHtmlModified),
|
HtmlMetaTags= _safe.RawMeta(vm.HtmlMetaTags, out wasHtmlModified),
|
||||||
Language = vm.Language,
|
HtmlLang = vm.Language,
|
||||||
Description = vm.Description,
|
Description = vm.Description,
|
||||||
EndDate = vm.EndDate?.ToUniversalTime(),
|
EndDate = vm.EndDate?.ToUniversalTime(),
|
||||||
TargetAmount = vm.TargetAmount,
|
TargetAmount = vm.TargetAmount,
|
||||||
|
|
|
@ -194,7 +194,7 @@ namespace BTCPayServer.Plugins.Crowdfund
|
||||||
{
|
{
|
||||||
Title = settings.Title,
|
Title = settings.Title,
|
||||||
Tagline = settings.Tagline,
|
Tagline = settings.Tagline,
|
||||||
Lang = settings.Language,
|
HtmlLang = settings.HtmlLang,
|
||||||
HtmlMetaTags= settings.HtmlMetaTags,
|
HtmlMetaTags= settings.HtmlMetaTags,
|
||||||
Description = settings.Description,
|
Description = settings.Description,
|
||||||
StoreName = store.StoreName,
|
StoreName = store.StoreName,
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace BTCPayServer.Plugins.Crowdfund.Models
|
||||||
public string AppId { get; set; }
|
public string AppId { get; set; }
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
public string Lang { get; set; }
|
public string HtmlLang { get; set; }
|
||||||
public string HtmlMetaTags{ get; set; }
|
public string HtmlMetaTags{ get; set; }
|
||||||
public string MainImageUrl { get; set; }
|
public string MainImageUrl { get; set; }
|
||||||
public string StoreName { get; set; }
|
public string StoreName { get; set; }
|
||||||
|
|
|
@ -138,7 +138,7 @@ namespace BTCPayServer.Plugins.PointOfSale.Controllers
|
||||||
CustomTipPercentages = settings.CustomTipPercentages,
|
CustomTipPercentages = settings.CustomTipPercentages,
|
||||||
AppId = appId,
|
AppId = appId,
|
||||||
StoreId = store.Id,
|
StoreId = store.Id,
|
||||||
Lang = settings.Language,
|
HtmlLang = settings.HtmlLang,
|
||||||
HtmlMetaTags= settings.HtmlMetaTags,
|
HtmlMetaTags= settings.HtmlMetaTags,
|
||||||
Description = settings.Description,
|
Description = settings.Description,
|
||||||
});
|
});
|
||||||
|
@ -619,7 +619,7 @@ namespace BTCPayServer.Plugins.PointOfSale.Controllers
|
||||||
CustomButtonText = settings.CustomButtonText ?? PointOfSaleSettings.CUSTOM_BUTTON_TEXT_DEF,
|
CustomButtonText = settings.CustomButtonText ?? PointOfSaleSettings.CUSTOM_BUTTON_TEXT_DEF,
|
||||||
CustomTipText = settings.CustomTipText ?? PointOfSaleSettings.CUSTOM_TIP_TEXT_DEF,
|
CustomTipText = settings.CustomTipText ?? PointOfSaleSettings.CUSTOM_TIP_TEXT_DEF,
|
||||||
CustomTipPercentages = settings.CustomTipPercentages != null ? string.Join(",", settings.CustomTipPercentages) : string.Join(",", PointOfSaleSettings.CUSTOM_TIP_PERCENTAGES_DEF),
|
CustomTipPercentages = settings.CustomTipPercentages != null ? string.Join(",", settings.CustomTipPercentages) : string.Join(",", PointOfSaleSettings.CUSTOM_TIP_PERCENTAGES_DEF),
|
||||||
Language = settings.Language,
|
HtmlLang = settings.HtmlLang,
|
||||||
HtmlMetaTags= settings.HtmlMetaTags,
|
HtmlMetaTags= settings.HtmlMetaTags,
|
||||||
Description = settings.Description,
|
Description = settings.Description,
|
||||||
NotificationUrl = settings.NotificationUrl,
|
NotificationUrl = settings.NotificationUrl,
|
||||||
|
@ -716,7 +716,7 @@ namespace BTCPayServer.Plugins.PointOfSale.Controllers
|
||||||
CustomTipPercentages = ListSplit(vm.CustomTipPercentages),
|
CustomTipPercentages = ListSplit(vm.CustomTipPercentages),
|
||||||
NotificationUrl = vm.NotificationUrl,
|
NotificationUrl = vm.NotificationUrl,
|
||||||
RedirectUrl = vm.RedirectUrl,
|
RedirectUrl = vm.RedirectUrl,
|
||||||
Language = vm.Language,
|
HtmlLang = vm.HtmlLang,
|
||||||
HtmlMetaTags = _safe.RawMeta(vm.HtmlMetaTags, out wasHtmlModified),
|
HtmlMetaTags = _safe.RawMeta(vm.HtmlMetaTags, out wasHtmlModified),
|
||||||
Description = vm.Description,
|
Description = vm.Description,
|
||||||
RedirectAutomatically = string.IsNullOrEmpty(vm.RedirectAutomatically) ? null : bool.Parse(vm.RedirectAutomatically),
|
RedirectAutomatically = string.IsNullOrEmpty(vm.RedirectAutomatically) ? null : bool.Parse(vm.RedirectAutomatically),
|
||||||
|
|
|
@ -86,7 +86,8 @@ namespace BTCPayServer.Plugins.PointOfSale.Models
|
||||||
new() { Text = "Use Store Settings", Value = "" }
|
new() { Text = "Use Store Settings", Value = "" }
|
||||||
}, nameof(SelectListItem.Value), nameof(SelectListItem.Text), RedirectAutomatically);
|
}, nameof(SelectListItem.Value), nameof(SelectListItem.Text), RedirectAutomatically);
|
||||||
|
|
||||||
public string Language { get; set; }
|
[Display(Name = "HTML Lang")]
|
||||||
|
public string HtmlLang { get; set; }
|
||||||
|
|
||||||
[Display(Name = "HTML Meta Tags")]
|
[Display(Name = "HTML Meta Tags")]
|
||||||
public string HtmlMetaTags{ get; set; }
|
public string HtmlMetaTags{ get; set; }
|
||||||
|
|
|
@ -68,7 +68,7 @@ namespace BTCPayServer.Plugins.PointOfSale.Models
|
||||||
public string CustomButtonText { get; set; }
|
public string CustomButtonText { get; set; }
|
||||||
public string CustomTipText { get; set; }
|
public string CustomTipText { get; set; }
|
||||||
public int[] CustomTipPercentages { get; set; }
|
public int[] CustomTipPercentages { get; set; }
|
||||||
public string Lang { get; set; }
|
public string HtmlLang { get; set; }
|
||||||
public string HtmlMetaTags{ get; set; }
|
public string HtmlMetaTags{ get; set; }
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
public SelectList AllCategories { get; set; }
|
public SelectList AllCategories { get; set; }
|
||||||
|
|
|
@ -10,12 +10,11 @@ namespace BTCPayServer.Services.Apps
|
||||||
{
|
{
|
||||||
public CrowdfundSettings()
|
public CrowdfundSettings()
|
||||||
{
|
{
|
||||||
Language = "en";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
public string Language { get; set; }
|
public string HtmlLang { get; set; }
|
||||||
public string HtmlMetaTags{ get; set; }
|
public string HtmlMetaTags{ get; set; }
|
||||||
public bool Enabled { get; set; } = true;
|
public bool Enabled { get; set; } = true;
|
||||||
public DateTime? StartDate { get; set; }
|
public DateTime? StartDate { get; set; }
|
||||||
|
|
|
@ -8,7 +8,6 @@ namespace BTCPayServer.Services.Apps
|
||||||
public PointOfSaleSettings()
|
public PointOfSaleSettings()
|
||||||
{
|
{
|
||||||
Title = "Tea shop";
|
Title = "Tea shop";
|
||||||
Language = "en";
|
|
||||||
Template = AppService.SerializeTemplate([
|
Template = AppService.SerializeTemplate([
|
||||||
new AppItem
|
new AppItem
|
||||||
{
|
{
|
||||||
|
@ -100,7 +99,7 @@ namespace BTCPayServer.Services.Apps
|
||||||
public string CustomTipText { get; set; } = CUSTOM_TIP_TEXT_DEF;
|
public string CustomTipText { get; set; } = CUSTOM_TIP_TEXT_DEF;
|
||||||
public static readonly int[] CUSTOM_TIP_PERCENTAGES_DEF = { 15, 18, 20 };
|
public static readonly int[] CUSTOM_TIP_PERCENTAGES_DEF = { 15, 18, 20 };
|
||||||
public int[] CustomTipPercentages { get; set; } = CUSTOM_TIP_PERCENTAGES_DEF;
|
public int[] CustomTipPercentages { get; set; } = CUSTOM_TIP_PERCENTAGES_DEF;
|
||||||
public string Language { get; set; }
|
public string HtmlLang { get; set; }
|
||||||
public string HtmlMetaTags{ get; set; }
|
public string HtmlMetaTags{ get; set; }
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
public string NotificationUrl { get; set; }
|
public string NotificationUrl { get; set; }
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="@Model.Lang" class="h-100" @(Env.IsDeveloping ? " data-devenv" : "") id="Crowdfund-@Model.AppId">
|
<html lang="@Model.HtmlLang" class="h-100" @(Env.IsDeveloping ? " data-devenv" : "") id="Crowdfund-@Model.AppId">
|
||||||
<head>
|
<head>
|
||||||
<partial name="LayoutHead" />
|
<partial name="LayoutHead" />
|
||||||
<link href="~/vendor/bootstrap-vue/bootstrap-vue.min.css" asp-append-version="true" rel="stylesheet" />
|
<link href="~/vendor/bootstrap-vue/bootstrap-vue.min.css" asp-append-version="true" rel="stylesheet" />
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html class="h-100" lang="@Model.Lang" @(Env.IsDeveloping ? " data-devenv" : "") id="POS-@Model.AppId">
|
<html class="h-100" lang="@Model.HtmlLang" @(Env.IsDeveloping ? " data-devenv" : "") id="POS-@Model.AppId">
|
||||||
<head>
|
<head>
|
||||||
<partial name="LayoutHead" />
|
<partial name="LayoutHead" />
|
||||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||||
|
|
|
@ -208,10 +208,9 @@
|
||||||
<div id="additional-htmlheader" class="accordion-collapse collapse" aria-labelledby="additional-htmlheader-header">
|
<div id="additional-htmlheader" class="accordion-collapse collapse" aria-labelledby="additional-htmlheader-header">
|
||||||
<div class="accordion-body">
|
<div class="accordion-body">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label asp-for="Language" class="form-label"></label>
|
<label asp-for="HtmlLang" class="form-label"></label>
|
||||||
<input asp-for="Language" class="form-control" maxlength="2" required />
|
<input asp-for="HtmlLang" class="form-control"/>
|
||||||
<div class="form-text">Fix the HTML page language</div>
|
<span asp-validation-for="HtmlLang" class="text-danger"></span>
|
||||||
<span asp-validation-for="Language" class="text-danger"></span>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label asp-for="HtmlMetaTags" class="form-label"></label>
|
<label asp-for="HtmlMetaTags" class="form-label"></label>
|
||||||
|
|
|
@ -762,6 +762,18 @@
|
||||||
"example": true,
|
"example": true,
|
||||||
"nullable": true
|
"nullable": true
|
||||||
},
|
},
|
||||||
|
"htmlLang": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Used for SEO, the [HTML Lang](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang) of the page",
|
||||||
|
"nullable": true,
|
||||||
|
"example": "en"
|
||||||
|
},
|
||||||
|
"htmlMetaTags": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Used for SEO, the [Meta tags](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta) of the page",
|
||||||
|
"nullable": true,
|
||||||
|
"example": "<meta name=\"description\" content=\"Your description\">"
|
||||||
|
},
|
||||||
"formId": {
|
"formId": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Form ID to request customer data",
|
"description": "Form ID to request customer data",
|
||||||
|
@ -984,6 +996,18 @@
|
||||||
],
|
],
|
||||||
"nullable": true
|
"nullable": true
|
||||||
},
|
},
|
||||||
|
"htmlLang": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Used for SEO, the [HTML Lang](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang) of the page",
|
||||||
|
"nullable": true,
|
||||||
|
"example": "en"
|
||||||
|
},
|
||||||
|
"htmlMetaTags": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Used for SEO, the [Meta tags](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta) of the page",
|
||||||
|
"nullable": true,
|
||||||
|
"example": "<meta name=\"description\" content=\"Your description\">"
|
||||||
|
},
|
||||||
"formId": {
|
"formId": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"description": "Form ID to request customer data",
|
"description": "Form ID to request customer data",
|
||||||
|
|
Loading…
Add table
Reference in a new issue