From a996cc2e6d1e9185915b3353361a745ef2c17104 Mon Sep 17 00:00:00 2001 From: Mario Dian Date: Tue, 13 Nov 2018 15:29:18 +0800 Subject: [PATCH] Fix margins, change template (#397) --- .../Controllers/AppsController.PointOfSale.cs | 45 ++++++++++++------- .../Views/AppsPublic/ViewPointOfSale.cshtml | 12 +++-- 2 files changed, 35 insertions(+), 22 deletions(-) diff --git a/BTCPayServer/Controllers/AppsController.PointOfSale.cs b/BTCPayServer/Controllers/AppsController.PointOfSale.cs index 5678fb28f..99d47ef59 100644 --- a/BTCPayServer/Controllers/AppsController.PointOfSale.cs +++ b/BTCPayServer/Controllers/AppsController.PointOfSale.cs @@ -18,21 +18,36 @@ namespace BTCPayServer.Controllers Title = "My awesome Point of Sale"; Currency = "USD"; Template = - "tea:\n" + - " price: 0.02\n" + - " title: Green Tea # title is optional, defaults to the keys\n" + - " description: Lovely, fresh and tender, Meng Ding Gan Lu is grown in the lush Meng Ding Mountains of the southwestern province of Sichuan # description is optional, defalts to none\n" + - " image: https://cdn.pixabay.com/photo/2015/03/26/11/03/green-tea-692339__480.jpg # image is optional, defaults to none\n\n" + - "coffee:\n" + - " price: 1\n\n" + - "bamba:\n" + - " price: 3\n\n" + - "beer:\n" + - " price: 7\n\n" + - "hat:\n" + - " price: 15\n\n" + - "tshirt:\n" + - " price: 25"; + "green tea:\n" + + " price: 1\n" + + " title: Green Tea\n" + + " description: Lovely, fresh and tender, Meng Ding Gan Lu ('sweet dew') is grown in the lush Meng Ding Mountains of the southwestern province of Sichuan where it has been cultivated for over a thousand years.\n" + + " image: https://cdn.pixabay.com/photo/2015/03/26/11/03/green-tea-692339__480.jpg\n\n" + + "black tea:\n" + + " price: 1\n" + + " title: Black Tea\n" + + " description: Tian Jian Tian Jian means 'heavenly tippy tea' in Chinese, and it describes the finest grade of dark tea. Our Tian Jian dark tea is from Hunan province which is famous for making some of the best dark teas available.\n" + + " image: https://cdn.pixabay.com/photo/2016/11/29/13/04/beverage-1869716__480.jpg\n\n" + + "rooibos:\n" + + " price: 1.2\n" + + " title: Rooibos\n" + + " description: Rooibos is a dramatic red tea made from a South African herb that contains polyphenols and flavonoids. Often called 'African redbush tea', Rooibos herbal tea delights the senses and delivers potential health benefits with each caffeine-free sip.\n" + + " image: https://cdn.pixabay.com/photo/2017/01/08/08/14/water-1962388__480.jpg\n\n" + + "pu erh:\n" + + " price: 2\n" + + " title: Pu Erh\n" + + " description: This loose pur-erh tea is produced in Yunnan Province, China. The process in a relatively high humidity environment has mellowed the elemental character of the tea when compared to young Pu-erh.\n" + + " image: https://cdn.pixabay.com/photo/2018/07/21/16/56/tea-cup-3552917__480.jpg\n\n" + + "herbal tea:\n" + + " price: 1.8\n" + + " title: Herbal Tea\n" + + " description: Chamomile tea is made from the flower heads of the chamomile plant. The medicinal use of chamomile dates back to the ancient Egyptians, Romans and Greeks.\n" + + " image: https://cdn.pixabay.com/photo/2015/07/02/20/57/chamomile-829538__480.jpg\n\n" + + "fruit tea:\n" + + " price: 1.5\n" + + " title: Fruit Tea\n" + + " description: The Tibetan Himalayas, the land is majestic and beautiful—a spiritual place where, despite the perilous environment, many journey seeking enlightenment.\n" + + " image: https://cdn.pixabay.com/photo/2016/09/16/11/24/darts-1673812__480.jpg"; ShowCustomAmount = true; } public string Title { get; set; } diff --git a/BTCPayServer/Views/AppsPublic/ViewPointOfSale.cshtml b/BTCPayServer/Views/AppsPublic/ViewPointOfSale.cshtml index a6ceef075..7c2ec41ca 100644 --- a/BTCPayServer/Views/AppsPublic/ViewPointOfSale.cshtml +++ b/BTCPayServer/Views/AppsPublic/ViewPointOfSale.cshtml @@ -17,13 +17,13 @@
-
-

@Model.Title

+
+

@Model.Title

@for (int i = 0; i < Model.Items.Length; i++) { - var className = (Model.Items.Length - i) > (Model.Items.Length % 4) ? "col-sm-6 col-lg-3" : "col align-self-center"; + var className = (Model.Items.Length - i) > (Model.Items.Length % 4) ? "col-sm-6 col-lg-3" : "col-sm align-self-start"; var item = Model.Items[i]; var image = item.Image; var description = item.Description; @@ -49,17 +49,15 @@ @if (Model.ShowCustomAmount) {
-
 
-
+
-
+
-
 
}