Allowing for POS to be displayed at website root (#853)

* Allowing for POS to be displayed at website root

* Switching to asp attributes for form post action

* Applying default formatting rules on HTML
This commit is contained in:
Rockstar Developer
2019-05-24 01:07:09 -05:00
committed by Nicolas Dorier
parent 5a73358bca
commit de1c2b0150
3 changed files with 429 additions and 412 deletions

View File

@@ -24,7 +24,7 @@ namespace BTCPayServer.Controllers
HttpClientFactory = httpClientFactory;
_cachedServerSettings = cachedServerSettings;
}
public async Task<IActionResult> Index()
{
if (_cachedServerSettings.RootAppType is Services.Apps.AppType.Crowdfund)
@@ -40,6 +40,20 @@ namespace BTCPayServer.Controllers
return res; // return
}
}
else if (_cachedServerSettings.RootAppType is Services.Apps.AppType.PointOfSale)
{
var serviceProvider = HttpContext.RequestServices;
var controller = (AppsPublicController)serviceProvider.GetService(typeof(AppsPublicController));
controller.Url = Url;
controller.ControllerContext = ControllerContext;
var res = await controller.ViewPointOfSale(_cachedServerSettings.RootAppId) as ViewResult;
if (res != null)
{
res.ViewName = "/Views/AppsPublic/ViewPointOfSale.cshtml";
return res; // return
}
}
return View("Home");
}