From 41978f1c5953a901728b59b4da1dc5763ee93835 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Thu, 19 Apr 2018 18:39:39 +0900 Subject: [PATCH 1/9] Remove useless line in invoice.cshtml --- BTCPayServer/Views/Invoice/Invoice.cshtml | 1 - 1 file changed, 1 deletion(-) diff --git a/BTCPayServer/Views/Invoice/Invoice.cshtml b/BTCPayServer/Views/Invoice/Invoice.cshtml index bcd147989..2c0c7234e 100644 --- a/BTCPayServer/Views/Invoice/Invoice.cshtml +++ b/BTCPayServer/Views/Invoice/Invoice.cshtml @@ -29,7 +29,6 @@

@ViewData["Title"]


-

Invoice details

From ba7e8cfe786fce349e79f44968a6a1702ccbec80 Mon Sep 17 00:00:00 2001 From: lepipele Date: Thu, 19 Apr 2018 10:04:59 -0500 Subject: [PATCH 2/9] Removing Merriweather as default body font, back to Arial Ref: https://forkbitpay.slack.com/archives/C6PSCRFAM/p1524130675000104 --- BTCPayServer/bundleconfig.json | 1 - .../bootstrap4-creativestart/Merriweather.css | 320 ------------------ .../bootstrap4-creativestart/creative.css | 2 +- 3 files changed, 1 insertion(+), 322 deletions(-) delete mode 100644 BTCPayServer/wwwroot/vendor/bootstrap4-creativestart/Merriweather.css diff --git a/BTCPayServer/bundleconfig.json b/BTCPayServer/bundleconfig.json index a7d76b4bd..1482fbb1b 100644 --- a/BTCPayServer/bundleconfig.json +++ b/BTCPayServer/bundleconfig.json @@ -2,7 +2,6 @@ { "outputFileName": "wwwroot/bundles/main-bundle.min.css", "inputFiles": [ - "wwwroot/vendor/bootstrap4-creativestart/Merriweather.css", "wwwroot/vendor/bootstrap4-creativestart/Open-Sans.css", "wwwroot/vendor/magnific-popup/magnific-popup.css", "wwwroot/vendor/font-awesome/css/font-awesome.css", diff --git a/BTCPayServer/wwwroot/vendor/bootstrap4-creativestart/Merriweather.css b/BTCPayServer/wwwroot/vendor/bootstrap4-creativestart/Merriweather.css deleted file mode 100644 index adcf68e82..000000000 --- a/BTCPayServer/wwwroot/vendor/bootstrap4-creativestart/Merriweather.css +++ /dev/null @@ -1,320 +0,0 @@ -/* cyrillic-ext */ -@font-face { - font-family: 'Merriweather'; - font-style: italic; - font-weight: 300; - src: local('Merriweather Light Italic'), local('Merriweather-LightItalic'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4l0qyriQwlOrhSvowK_l5-eR7lXff1jvzRPA.woff2) format('woff2'); - unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; -} -/* cyrillic */ -@font-face { - font-family: 'Merriweather'; - font-style: italic; - font-weight: 300; - src: local('Merriweather Light Italic'), local('Merriweather-LightItalic'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4l0qyriQwlOrhSvowK_l5-eR7lXff8jvzRPA.woff2) format('woff2'); - unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; -} -/* vietnamese */ -@font-face { - font-family: 'Merriweather'; - font-style: italic; - font-weight: 300; - src: local('Merriweather Light Italic'), local('Merriweather-LightItalic'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4l0qyriQwlOrhSvowK_l5-eR7lXff3jvzRPA.woff2) format('woff2'); - unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB; -} -/* latin-ext */ -@font-face { - font-family: 'Merriweather'; - font-style: italic; - font-weight: 300; - src: local('Merriweather Light Italic'), local('Merriweather-LightItalic'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4l0qyriQwlOrhSvowK_l5-eR7lXff2jvzRPA.woff2) format('woff2'); - unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; -} -/* latin */ -@font-face { - font-family: 'Merriweather'; - font-style: italic; - font-weight: 300; - src: local('Merriweather Light Italic'), local('Merriweather-LightItalic'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4l0qyriQwlOrhSvowK_l5-eR7lXff4jvw.woff2) format('woff2'); - unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; -} -/* cyrillic-ext */ -@font-face { - font-family: 'Merriweather'; - font-style: italic; - font-weight: 400; - src: local('Merriweather Italic'), local('Merriweather-Italic'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4m0qyriQwlOrhSvowK_l5-eRZDf-LHrw.woff2) format('woff2'); - unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; -} -/* cyrillic */ -@font-face { - font-family: 'Merriweather'; - font-style: italic; - font-weight: 400; - src: local('Merriweather Italic'), local('Merriweather-Italic'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4m0qyriQwlOrhSvowK_l5-eRZKf-LHrw.woff2) format('woff2'); - unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; -} -/* vietnamese */ -@font-face { - font-family: 'Merriweather'; - font-style: italic; - font-weight: 400; - src: local('Merriweather Italic'), local('Merriweather-Italic'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4m0qyriQwlOrhSvowK_l5-eRZBf-LHrw.woff2) format('woff2'); - unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB; -} -/* latin-ext */ -@font-face { - font-family: 'Merriweather'; - font-style: italic; - font-weight: 400; - src: local('Merriweather Italic'), local('Merriweather-Italic'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4m0qyriQwlOrhSvowK_l5-eRZAf-LHrw.woff2) format('woff2'); - unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; -} -/* latin */ -@font-face { - font-family: 'Merriweather'; - font-style: italic; - font-weight: 400; - src: local('Merriweather Italic'), local('Merriweather-Italic'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4m0qyriQwlOrhSvowK_l5-eRZOf-I.woff2) format('woff2'); - unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; -} -/* cyrillic-ext */ -@font-face { - font-family: 'Merriweather'; - font-style: italic; - font-weight: 700; - src: local('Merriweather Bold Italic'), local('Merriweather-BoldItalic'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4l0qyriQwlOrhSvowK_l5-eR71Wvf1jvzRPA.woff2) format('woff2'); - unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; -} -/* cyrillic */ -@font-face { - font-family: 'Merriweather'; - font-style: italic; - font-weight: 700; - src: local('Merriweather Bold Italic'), local('Merriweather-BoldItalic'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4l0qyriQwlOrhSvowK_l5-eR71Wvf8jvzRPA.woff2) format('woff2'); - unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; -} -/* vietnamese */ -@font-face { - font-family: 'Merriweather'; - font-style: italic; - font-weight: 700; - src: local('Merriweather Bold Italic'), local('Merriweather-BoldItalic'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4l0qyriQwlOrhSvowK_l5-eR71Wvf3jvzRPA.woff2) format('woff2'); - unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB; -} -/* latin-ext */ -@font-face { - font-family: 'Merriweather'; - font-style: italic; - font-weight: 700; - src: local('Merriweather Bold Italic'), local('Merriweather-BoldItalic'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4l0qyriQwlOrhSvowK_l5-eR71Wvf2jvzRPA.woff2) format('woff2'); - unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; -} -/* latin */ -@font-face { - font-family: 'Merriweather'; - font-style: italic; - font-weight: 700; - src: local('Merriweather Bold Italic'), local('Merriweather-BoldItalic'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4l0qyriQwlOrhSvowK_l5-eR71Wvf4jvw.woff2) format('woff2'); - unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; -} -/* cyrillic-ext */ -@font-face { - font-family: 'Merriweather'; - font-style: italic; - font-weight: 900; - src: local('Merriweather Black Italic'), local('Merriweather-BlackItalic'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4l0qyriQwlOrhSvowK_l5-eR7NWPf1jvzRPA.woff2) format('woff2'); - unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; -} -/* cyrillic */ -@font-face { - font-family: 'Merriweather'; - font-style: italic; - font-weight: 900; - src: local('Merriweather Black Italic'), local('Merriweather-BlackItalic'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4l0qyriQwlOrhSvowK_l5-eR7NWPf8jvzRPA.woff2) format('woff2'); - unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; -} -/* vietnamese */ -@font-face { - font-family: 'Merriweather'; - font-style: italic; - font-weight: 900; - src: local('Merriweather Black Italic'), local('Merriweather-BlackItalic'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4l0qyriQwlOrhSvowK_l5-eR7NWPf3jvzRPA.woff2) format('woff2'); - unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB; -} -/* latin-ext */ -@font-face { - font-family: 'Merriweather'; - font-style: italic; - font-weight: 900; - src: local('Merriweather Black Italic'), local('Merriweather-BlackItalic'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4l0qyriQwlOrhSvowK_l5-eR7NWPf2jvzRPA.woff2) format('woff2'); - unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; -} -/* latin */ -@font-face { - font-family: 'Merriweather'; - font-style: italic; - font-weight: 900; - src: local('Merriweather Black Italic'), local('Merriweather-BlackItalic'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4l0qyriQwlOrhSvowK_l5-eR7NWPf4jvw.woff2) format('woff2'); - unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; -} -/* cyrillic-ext */ -@font-face { - font-family: 'Merriweather'; - font-style: normal; - font-weight: 300; - src: local('Merriweather Light'), local('Merriweather-Light'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4n0qyriQwlOrhSvowK_l521wRZVcf6lvg.woff2) format('woff2'); - unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; -} -/* cyrillic */ -@font-face { - font-family: 'Merriweather'; - font-style: normal; - font-weight: 300; - src: local('Merriweather Light'), local('Merriweather-Light'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4n0qyriQwlOrhSvowK_l521wRZXMf6lvg.woff2) format('woff2'); - unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; -} -/* vietnamese */ -@font-face { - font-family: 'Merriweather'; - font-style: normal; - font-weight: 300; - src: local('Merriweather Light'), local('Merriweather-Light'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4n0qyriQwlOrhSvowK_l521wRZV8f6lvg.woff2) format('woff2'); - unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB; -} -/* latin-ext */ -@font-face { - font-family: 'Merriweather'; - font-style: normal; - font-weight: 300; - src: local('Merriweather Light'), local('Merriweather-Light'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4n0qyriQwlOrhSvowK_l521wRZVsf6lvg.woff2) format('woff2'); - unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; -} -/* latin */ -@font-face { - font-family: 'Merriweather'; - font-style: normal; - font-weight: 300; - src: local('Merriweather Light'), local('Merriweather-Light'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4n0qyriQwlOrhSvowK_l521wRZWMf6.woff2) format('woff2'); - unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; -} -/* cyrillic-ext */ -@font-face { - font-family: 'Merriweather'; - font-style: normal; - font-weight: 400; - src: local('Merriweather Regular'), local('Merriweather-Regular'), url(https://fonts.gstatic.com/s/merriweather/v19/u-440qyriQwlOrhSvowK_l5-cSZMZ-Y.woff2) format('woff2'); - unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; -} -/* cyrillic */ -@font-face { - font-family: 'Merriweather'; - font-style: normal; - font-weight: 400; - src: local('Merriweather Regular'), local('Merriweather-Regular'), url(https://fonts.gstatic.com/s/merriweather/v19/u-440qyriQwlOrhSvowK_l5-eCZMZ-Y.woff2) format('woff2'); - unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; -} -/* vietnamese */ -@font-face { - font-family: 'Merriweather'; - font-style: normal; - font-weight: 400; - src: local('Merriweather Regular'), local('Merriweather-Regular'), url(https://fonts.gstatic.com/s/merriweather/v19/u-440qyriQwlOrhSvowK_l5-cyZMZ-Y.woff2) format('woff2'); - unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB; -} -/* latin-ext */ -@font-face { - font-family: 'Merriweather'; - font-style: normal; - font-weight: 400; - src: local('Merriweather Regular'), local('Merriweather-Regular'), url(https://fonts.gstatic.com/s/merriweather/v19/u-440qyriQwlOrhSvowK_l5-ciZMZ-Y.woff2) format('woff2'); - unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; -} -/* latin */ -@font-face { - font-family: 'Merriweather'; - font-style: normal; - font-weight: 400; - src: local('Merriweather Regular'), local('Merriweather-Regular'), url(https://fonts.gstatic.com/s/merriweather/v19/u-440qyriQwlOrhSvowK_l5-fCZM.woff2) format('woff2'); - unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; -} -/* cyrillic-ext */ -@font-face { - font-family: 'Merriweather'; - font-style: normal; - font-weight: 700; - src: local('Merriweather Bold'), local('Merriweather-Bold'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4n0qyriQwlOrhSvowK_l52xwNZVcf6lvg.woff2) format('woff2'); - unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; -} -/* cyrillic */ -@font-face { - font-family: 'Merriweather'; - font-style: normal; - font-weight: 700; - src: local('Merriweather Bold'), local('Merriweather-Bold'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4n0qyriQwlOrhSvowK_l52xwNZXMf6lvg.woff2) format('woff2'); - unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; -} -/* vietnamese */ -@font-face { - font-family: 'Merriweather'; - font-style: normal; - font-weight: 700; - src: local('Merriweather Bold'), local('Merriweather-Bold'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4n0qyriQwlOrhSvowK_l52xwNZV8f6lvg.woff2) format('woff2'); - unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB; -} -/* latin-ext */ -@font-face { - font-family: 'Merriweather'; - font-style: normal; - font-weight: 700; - src: local('Merriweather Bold'), local('Merriweather-Bold'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4n0qyriQwlOrhSvowK_l52xwNZVsf6lvg.woff2) format('woff2'); - unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; -} -/* latin */ -@font-face { - font-family: 'Merriweather'; - font-style: normal; - font-weight: 700; - src: local('Merriweather Bold'), local('Merriweather-Bold'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4n0qyriQwlOrhSvowK_l52xwNZWMf6.woff2) format('woff2'); - unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; -} -/* cyrillic-ext */ -@font-face { - font-family: 'Merriweather'; - font-style: normal; - font-weight: 900; - src: local('Merriweather Black'), local('Merriweather-Black'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4n0qyriQwlOrhSvowK_l52_wFZVcf6lvg.woff2) format('woff2'); - unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; -} -/* cyrillic */ -@font-face { - font-family: 'Merriweather'; - font-style: normal; - font-weight: 900; - src: local('Merriweather Black'), local('Merriweather-Black'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4n0qyriQwlOrhSvowK_l52_wFZXMf6lvg.woff2) format('woff2'); - unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; -} -/* vietnamese */ -@font-face { - font-family: 'Merriweather'; - font-style: normal; - font-weight: 900; - src: local('Merriweather Black'), local('Merriweather-Black'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4n0qyriQwlOrhSvowK_l52_wFZV8f6lvg.woff2) format('woff2'); - unicode-range: U+0102-0103, U+0110-0111, U+1EA0-1EF9, U+20AB; -} -/* latin-ext */ -@font-face { - font-family: 'Merriweather'; - font-style: normal; - font-weight: 900; - src: local('Merriweather Black'), local('Merriweather-Black'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4n0qyriQwlOrhSvowK_l52_wFZVsf6lvg.woff2) format('woff2'); - unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; -} -/* latin */ -@font-face { - font-family: 'Merriweather'; - font-style: normal; - font-weight: 900; - src: local('Merriweather Black'), local('Merriweather-Black'), url(https://fonts.gstatic.com/s/merriweather/v19/u-4n0qyriQwlOrhSvowK_l52_wFZWMf6.woff2) format('woff2'); - unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; -} diff --git a/BTCPayServer/wwwroot/vendor/bootstrap4-creativestart/creative.css b/BTCPayServer/wwwroot/vendor/bootstrap4-creativestart/creative.css index afc9390b3..b6070ce46 100644 --- a/BTCPayServer/wwwroot/vendor/bootstrap4-creativestart/creative.css +++ b/BTCPayServer/wwwroot/vendor/bootstrap4-creativestart/creative.css @@ -9,7 +9,7 @@ html { } body { - font-family: 'Merriweather', 'Helvetica Neue', Arial, sans-serif; + font-family: 'Helvetica Neue', Arial, sans-serif; } hr { From 38223580960eef468e102838475ce7fec0035343 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Fri, 20 Apr 2018 01:01:39 +0900 Subject: [PATCH 3/9] Show more info about bitcoin average quota --- .../Controllers/InvoiceController.UI.cs | 26 +------------------ BTCPayServer/Extensions.cs | 22 ++++++++++++++++ .../Services/Rates/CoinAverageRateProvider.cs | 16 ++++++++++++ BTCPayServer/Views/Server/Rates.cshtml | 10 ++++--- 4 files changed, 46 insertions(+), 28 deletions(-) diff --git a/BTCPayServer/Controllers/InvoiceController.UI.cs b/BTCPayServer/Controllers/InvoiceController.UI.cs index 369165e01..4fb199d07 100644 --- a/BTCPayServer/Controllers/InvoiceController.UI.cs +++ b/BTCPayServer/Controllers/InvoiceController.UI.cs @@ -374,7 +374,7 @@ namespace BTCPayServer.Controllers model.Invoices.Add(new InvoiceModel() { Status = invoice.Status, - Date = Prettify(invoice.InvoiceTime), + Date = (DateTimeOffset.UtcNow - invoice.InvoiceTime).Prettify() + " ago", InvoiceId = invoice.Id, OrderId = invoice.OrderId ?? string.Empty, RedirectUrl = invoice.RedirectURL ?? string.Empty, @@ -387,30 +387,6 @@ namespace BTCPayServer.Controllers return View(model); } - private string Prettify(DateTimeOffset invoiceTime) - { - var ago = DateTime.UtcNow - invoiceTime; - - if (ago.TotalMinutes < 1) - { - return $"{(int)ago.TotalSeconds} second{Plural((int)ago.TotalSeconds)} ago"; - } - if (ago.TotalHours < 1) - { - return $"{(int)ago.TotalMinutes} minute{Plural((int)ago.TotalMinutes)} ago"; - } - if (ago.Days < 1) - { - return $"{(int)ago.TotalHours} hour{Plural((int)ago.TotalHours)} ago"; - } - return $"{(int)ago.TotalDays} day{Plural((int)ago.TotalDays)} ago"; - } - - private string Plural(int totalDays) - { - return totalDays > 1 ? "s" : string.Empty; - } - [HttpGet] [Route("invoices/create")] [Authorize(AuthenticationSchemes = "Identity.Application")] diff --git a/BTCPayServer/Extensions.cs b/BTCPayServer/Extensions.cs index 40fe847e5..1746562ea 100644 --- a/BTCPayServer/Extensions.cs +++ b/BTCPayServer/Extensions.cs @@ -34,6 +34,28 @@ namespace BTCPayServer { public static class Extensions { + public static string Prettify(this TimeSpan timeSpan) + { + if (timeSpan.TotalMinutes < 1) + { + return $"{(int)timeSpan.TotalSeconds} second{Plural((int)timeSpan.TotalSeconds)}"; + } + if (timeSpan.TotalHours < 1) + { + return $"{(int)timeSpan.TotalMinutes} minute{Plural((int)timeSpan.TotalMinutes)}"; + } + if (timeSpan.Days < 1) + { + return $"{(int)timeSpan.TotalHours} hour{Plural((int)timeSpan.TotalHours)}"; + } + return $"{(int)timeSpan.TotalDays} day{Plural((int)timeSpan.TotalDays)}"; + } + + private static string Plural(int totalDays) + { + return totalDays > 1 ? "s" : string.Empty; + } + public static string PrettyPrint(this TimeSpan expiration) { StringBuilder builder = new StringBuilder(); diff --git a/BTCPayServer/Services/Rates/CoinAverageRateProvider.cs b/BTCPayServer/Services/Rates/CoinAverageRateProvider.cs index ebaa5bde0..6ec20b634 100644 --- a/BTCPayServer/Services/Rates/CoinAverageRateProvider.cs +++ b/BTCPayServer/Services/Rates/CoinAverageRateProvider.cs @@ -183,7 +183,21 @@ namespace BTCPayServer.Services.Rates var jobj = JObject.Parse(await resp.Content.ReadAsStringAsync()); var response = new GetRateLimitsResponse(); response.CounterReset = TimeSpan.FromSeconds(jobj["counter_reset"].Value()); + var totalPeriod = jobj["total_period"].Value(); + if (totalPeriod == "24h") + { + response.TotalPeriod = TimeSpan.FromHours(24); + } + else if (totalPeriod == "30d") + { + response.TotalPeriod = TimeSpan.FromDays(30); + } + else + { + response.TotalPeriod = TimeSpan.FromSeconds(jobj["total_period"].Value()); + } response.RequestsLeft = jobj["requests_left"].Value(); + response.RequestsPerPeriod = jobj["requests_per_period"].Value(); return response; } @@ -213,5 +227,7 @@ namespace BTCPayServer.Services.Rates { public TimeSpan CounterReset { get; set; } public int RequestsLeft { get; set; } + public int RequestsPerPeriod { get; set; } + public TimeSpan TotalPeriod { get; set; } } } diff --git a/BTCPayServer/Views/Server/Rates.cshtml b/BTCPayServer/Views/Server/Rates.cshtml index 89e145778..e6e3eff14 100644 --- a/BTCPayServer/Views/Server/Rates.cshtml +++ b/BTCPayServer/Views/Server/Rates.cshtml @@ -40,12 +40,16 @@
Current Bitcoin Average Quotas:
- - + + + + + + - +
Requests left@Model.RateLimits.RequestsLeftQuota period@Model.RateLimits.TotalPeriod.Prettify()
Requests quota@Model.RateLimits.RequestsLeft/@Model.RateLimits.RequestsPerPeriod
Quota reset in@Model.RateLimits.CounterReset@Model.RateLimits.CounterReset.Prettify()
} From b87ec4f3d925957d2e0fd3b9315058b6b1cc9b8b Mon Sep 17 00:00:00 2001 From: lepipele Date: Thu, 19 Apr 2018 11:15:45 -0500 Subject: [PATCH 4/9] Primitive versioning of css files to ensure update on change --- BTCPayServer/HostedServices/CssThemeManager.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/BTCPayServer/HostedServices/CssThemeManager.cs b/BTCPayServer/HostedServices/CssThemeManager.cs index bb873f174..60d909fbd 100644 --- a/BTCPayServer/HostedServices/CssThemeManager.cs +++ b/BTCPayServer/HostedServices/CssThemeManager.cs @@ -33,7 +33,7 @@ namespace BTCPayServer.HostedServices UpdateCreativeStart(data.CreativeStartCssUri); } - private string _bootstrapUri; + private string _bootstrapUri = "/vendor/bootstrap4/css/bootstrap.css?v=" + DateTime.Now.Ticks; public string BootstrapUri { get { return _bootstrapUri; } @@ -41,12 +41,12 @@ namespace BTCPayServer.HostedServices public void UpdateBootstrap(string newUri) { if (String.IsNullOrWhiteSpace(newUri)) - _bootstrapUri = "/vendor/bootstrap4/css/bootstrap.css"; + _bootstrapUri = "/vendor/bootstrap4/css/bootstrap.css?v="+ DateTime.Now.Ticks; else _bootstrapUri = newUri; } - private string _creativeStartUri; + private string _creativeStartUri = "/vendor/bootstrap4-creativestart/creative.css?v=" + DateTime.Now.Ticks; public string CreativeStartUri { get { return _creativeStartUri; } @@ -54,7 +54,7 @@ namespace BTCPayServer.HostedServices public void UpdateCreativeStart(string newUri) { if (String.IsNullOrWhiteSpace(newUri)) - _creativeStartUri = "/vendor/bootstrap4-creativestart/creative.css"; + _creativeStartUri = "/vendor/bootstrap4-creativestart/creative.css?v=" + DateTime.Now.Ticks; else _creativeStartUri = newUri; } From 97b59be9bfd4b8618d5b1a4123ac66325ddbc938 Mon Sep 17 00:00:00 2001 From: lepipele Date: Thu, 19 Apr 2018 11:39:51 -0500 Subject: [PATCH 5/9] Adding page for Theme settings --- BTCPayServer/Controllers/ServerController.cs | 17 +++++++- .../HostedServices/CssThemeManager.cs | 4 +- BTCPayServer/Services/ThemesSettings.cs | 17 ++++++++ BTCPayServer/Views/Server/Policies.cshtml | 18 -------- BTCPayServer/Views/Server/Theme.cshtml | 43 +++++++++++++++++++ 5 files changed, 78 insertions(+), 21 deletions(-) create mode 100644 BTCPayServer/Services/ThemesSettings.cs create mode 100644 BTCPayServer/Views/Server/Theme.cshtml diff --git a/BTCPayServer/Controllers/ServerController.cs b/BTCPayServer/Controllers/ServerController.cs index 8a3214f05..180bc8af0 100644 --- a/BTCPayServer/Controllers/ServerController.cs +++ b/BTCPayServer/Controllers/ServerController.cs @@ -216,12 +216,27 @@ namespace BTCPayServer.Controllers [Route("server/policies")] [HttpPost] public async Task Policies(PoliciesSettings settings) + { + await _SettingsRepository.UpdateSetting(settings); + TempData["StatusMessage"] = "Policies updated successfully"; + return View(settings); + } + + [Route("server/theme")] + public async Task Theme() + { + var data = (await _SettingsRepository.GetSettingAsync()) ?? new ThemeSettings(); + return View(data); + } + [Route("server/theme")] + [HttpPost] + public async Task Theme(ThemeSettings settings) { await _SettingsRepository.UpdateSetting(settings); // TODO: remove controller/class-level property and have only reference to // CssThemeManager here in this method _CssThemeManager.Update(settings); - TempData["StatusMessage"] = "Policies upadated successfully"; + TempData["StatusMessage"] = "Theme settings updated successfully"; return View(settings); } diff --git a/BTCPayServer/HostedServices/CssThemeManager.cs b/BTCPayServer/HostedServices/CssThemeManager.cs index 60d909fbd..09f733d44 100644 --- a/BTCPayServer/HostedServices/CssThemeManager.cs +++ b/BTCPayServer/HostedServices/CssThemeManager.cs @@ -23,11 +23,11 @@ namespace BTCPayServer.HostedServices private async void Update(SettingsRepository settingsRepository) { - var data = (await settingsRepository.GetSettingAsync()) ?? new PoliciesSettings(); + var data = (await settingsRepository.GetSettingAsync()) ?? new ThemeSettings(); Update(data); } - public void Update(PoliciesSettings data) + public void Update(ThemeSettings data) { UpdateBootstrap(data.BootstrapCssUri); UpdateCreativeStart(data.CreativeStartCssUri); diff --git a/BTCPayServer/Services/ThemesSettings.cs b/BTCPayServer/Services/ThemesSettings.cs new file mode 100644 index 000000000..a13787e71 --- /dev/null +++ b/BTCPayServer/Services/ThemesSettings.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Newtonsoft.Json; + +namespace BTCPayServer.Services +{ + public class ThemeSettings + { + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] + public string BootstrapCssUri { get; set; } + + [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] + public string CreativeStartCssUri { get; set; } + } +} diff --git a/BTCPayServer/Views/Server/Policies.cshtml b/BTCPayServer/Views/Server/Policies.cshtml index 4c66ed20a..a1760788d 100644 --- a/BTCPayServer/Views/Server/Policies.cshtml +++ b/BTCPayServer/Views/Server/Policies.cshtml @@ -15,24 +15,6 @@
- -
- - - -

- Creative Start theme - is used on top of Bootstrap -

-
diff --git a/BTCPayServer/Views/Server/Theme.cshtml b/BTCPayServer/Views/Server/Theme.cshtml new file mode 100644 index 000000000..870a2ac1d --- /dev/null +++ b/BTCPayServer/Views/Server/Theme.cshtml @@ -0,0 +1,43 @@ +@model BTCPayServer.Services.ThemeSettings +@{ + ViewData.SetActivePageAndTitle(ServerNavPages.Pages.Theme); +} + + +

@ViewData["Title"]

+@Html.Partial("_StatusMessage", TempData["StatusMessage"]) +
+
+
+
+
+
+
+ + +
+ + + +

+ Creative Start theme + is used on top of Bootstrap +

+
+ + + +
+
+ +@section Scripts { + @await Html.PartialAsync("_ValidationScriptsPartial") +} From 8075273ec847c58bd6202dbef90ff2da2d2162c0 Mon Sep 17 00:00:00 2001 From: lepipele Date: Thu, 19 Apr 2018 11:40:12 -0500 Subject: [PATCH 6/9] Refactoring pills navigation --- BTCPayServer/Services/PoliciesSettings.cs | 6 ---- BTCPayServer/Views/Server/Emails.cshtml | 3 +- BTCPayServer/Views/Server/ListUsers.cshtml | 3 +- BTCPayServer/Views/Server/Policies.cshtml | 3 +- BTCPayServer/Views/Server/Rates.cshtml | 3 +- BTCPayServer/Views/Server/ServerNavPages.cs | 36 ++++++++------------- BTCPayServer/Views/Server/User.cshtml | 3 +- BTCPayServer/Views/Server/_Nav.cshtml | 11 ++++--- 8 files changed, 25 insertions(+), 43 deletions(-) diff --git a/BTCPayServer/Services/PoliciesSettings.cs b/BTCPayServer/Services/PoliciesSettings.cs index 9073e3d26..431e902eb 100644 --- a/BTCPayServer/Services/PoliciesSettings.cs +++ b/BTCPayServer/Services/PoliciesSettings.cs @@ -15,11 +15,5 @@ namespace BTCPayServer.Services [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] public bool LockSubscription { get; set; } - - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] - public string BootstrapCssUri { get; set; } - - [JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)] - public string CreativeStartCssUri { get; set; } } } diff --git a/BTCPayServer/Views/Server/Emails.cshtml b/BTCPayServer/Views/Server/Emails.cshtml index 04694abd1..80943c605 100644 --- a/BTCPayServer/Views/Server/Emails.cshtml +++ b/BTCPayServer/Views/Server/Emails.cshtml @@ -1,7 +1,6 @@ @model EmailsViewModel @{ - ViewData["Title"] = ServerNavPages.Emails; - ViewData.AddActivePage(ServerNavPages.Emails); + ViewData.SetActivePageAndTitle(ServerNavPages.Pages.Emails); } diff --git a/BTCPayServer/Views/Server/ListUsers.cshtml b/BTCPayServer/Views/Server/ListUsers.cshtml index 5a6fc702a..29e78670e 100644 --- a/BTCPayServer/Views/Server/ListUsers.cshtml +++ b/BTCPayServer/Views/Server/ListUsers.cshtml @@ -1,7 +1,6 @@ @model UsersViewModel @{ - ViewData["Title"] = "Users"; - ViewData.AddActivePage(ServerNavPages.Users); + ViewData.SetActivePageAndTitle(ServerNavPages.Pages.Users); } diff --git a/BTCPayServer/Views/Server/Policies.cshtml b/BTCPayServer/Views/Server/Policies.cshtml index a1760788d..be96a93d6 100644 --- a/BTCPayServer/Views/Server/Policies.cshtml +++ b/BTCPayServer/Views/Server/Policies.cshtml @@ -1,7 +1,6 @@ @model BTCPayServer.Services.PoliciesSettings @{ - ViewData["Title"] = ServerNavPages.Policies; - ViewData.AddActivePage(ServerNavPages.Policies); + ViewData.SetActivePageAndTitle(ServerNavPages.Pages.Policies); } diff --git a/BTCPayServer/Views/Server/Rates.cshtml b/BTCPayServer/Views/Server/Rates.cshtml index 89e145778..5f61ecf34 100644 --- a/BTCPayServer/Views/Server/Rates.cshtml +++ b/BTCPayServer/Views/Server/Rates.cshtml @@ -1,7 +1,6 @@ @model RatesViewModel @{ - ViewData["Title"] = ServerNavPages.Rates; - ViewData.AddActivePage(ServerNavPages.Rates); + ViewData.SetActivePageAndTitle(ServerNavPages.Pages.Rates); } diff --git a/BTCPayServer/Views/Server/ServerNavPages.cs b/BTCPayServer/Views/Server/ServerNavPages.cs index 45dfe7887..c0023715e 100644 --- a/BTCPayServer/Views/Server/ServerNavPages.cs +++ b/BTCPayServer/Views/Server/ServerNavPages.cs @@ -9,30 +9,22 @@ namespace BTCPayServer.Views.Server { public static class ServerNavPages { - public static string ActivePageKey => "ActivePage"; - public static string Index => "Index"; - - - public static string Users => "Users"; - public static string Rates => "Rates"; - public static string Emails => "Email server"; - public static string Policies => "Policies"; - public static string Hangfire => "Hangfire"; - - public static string UsersNavClass(ViewContext viewContext) => PageNavClass(viewContext, Users); - public static string EmailsNavClass(ViewContext viewContext) => PageNavClass(viewContext, Emails); - public static string RatesNavClass(ViewContext viewContext) => PageNavClass(viewContext, Rates); - public static string PoliciesNavClass(ViewContext viewContext) => PageNavClass(viewContext, Policies); - public static string HangfireNavClass(ViewContext viewContext) => PageNavClass(viewContext, Hangfire); - - public static string IndexNavClass(ViewContext viewContext) => PageNavClass(viewContext, Index); - - public static string PageNavClass(ViewContext viewContext, string page) + public enum Pages { - var activePage = viewContext.ViewData["ActivePage"] as string; - return string.Equals(activePage, page, StringComparison.OrdinalIgnoreCase) ? "active" : null; + Index, Users, Rates, Emails, Policies, Theme, Hangfire } - public static void AddActivePage(this ViewDataDictionary viewData, string activePage) => viewData[ActivePageKey] = activePage; + public const string ACTIVE_PAGE_KEY = "ActivePage"; + public static void SetActivePageAndTitle(this ViewDataDictionary viewData, Pages activePage, string titleOverride = null) + { + viewData["Title"] = titleOverride ?? activePage.ToString(); + viewData[ACTIVE_PAGE_KEY] = activePage; + } + + public static string IsActivePage(this ViewDataDictionary viewData, Pages page) + { + var activePage = viewData[ACTIVE_PAGE_KEY] as Pages?; + return activePage == page ? "active" : null; + } } } diff --git a/BTCPayServer/Views/Server/User.cshtml b/BTCPayServer/Views/Server/User.cshtml index 8cf3b44d4..81559e81f 100644 --- a/BTCPayServer/Views/Server/User.cshtml +++ b/BTCPayServer/Views/Server/User.cshtml @@ -1,7 +1,6 @@ @model UserViewModel @{ - ViewData["Title"] = Model.Email; - ViewData.AddActivePage(ServerNavPages.Users); + ViewData.SetActivePageAndTitle(ServerNavPages.Pages.Users, Model.Email); } diff --git a/BTCPayServer/Views/Server/_Nav.cshtml b/BTCPayServer/Views/Server/_Nav.cshtml index ed3bf77cc..1597e2ef1 100644 --- a/BTCPayServer/Views/Server/_Nav.cshtml +++ b/BTCPayServer/Views/Server/_Nav.cshtml @@ -1,10 +1,11 @@ @using BTCPayServer.Views.Server From cd1a4c4749a8343d2accb14f46e9386b2306f05a Mon Sep 17 00:00:00 2001 From: lepipele Date: Thu, 19 Apr 2018 11:44:24 -0500 Subject: [PATCH 7/9] Fixing modify user page and it's title --- BTCPayServer/Controllers/ServerController.cs | 1 + BTCPayServer/Views/Server/ServerNavPages.cs | 4 ++-- BTCPayServer/Views/Server/User.cshtml | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/BTCPayServer/Controllers/ServerController.cs b/BTCPayServer/Controllers/ServerController.cs index 180bc8af0..b13839ab7 100644 --- a/BTCPayServer/Controllers/ServerController.cs +++ b/BTCPayServer/Controllers/ServerController.cs @@ -132,6 +132,7 @@ namespace BTCPayServer.Controllers var roles = await _UserManager.GetRolesAsync(user); var userVM = new UserViewModel(); userVM.Id = user.Id; + userVM.Email = user.Email; userVM.IsAdmin = IsAdmin(roles); return View(userVM); } diff --git a/BTCPayServer/Views/Server/ServerNavPages.cs b/BTCPayServer/Views/Server/ServerNavPages.cs index c0023715e..9a51cbc0c 100644 --- a/BTCPayServer/Views/Server/ServerNavPages.cs +++ b/BTCPayServer/Views/Server/ServerNavPages.cs @@ -15,9 +15,9 @@ namespace BTCPayServer.Views.Server } public const string ACTIVE_PAGE_KEY = "ActivePage"; - public static void SetActivePageAndTitle(this ViewDataDictionary viewData, Pages activePage, string titleOverride = null) + public static void SetActivePageAndTitle(this ViewDataDictionary viewData, Pages activePage) { - viewData["Title"] = titleOverride ?? activePage.ToString(); + viewData["Title"] = activePage.ToString(); viewData[ACTIVE_PAGE_KEY] = activePage; } diff --git a/BTCPayServer/Views/Server/User.cshtml b/BTCPayServer/Views/Server/User.cshtml index 81559e81f..970edb8bc 100644 --- a/BTCPayServer/Views/Server/User.cshtml +++ b/BTCPayServer/Views/Server/User.cshtml @@ -1,10 +1,10 @@ @model UserViewModel @{ - ViewData.SetActivePageAndTitle(ServerNavPages.Pages.Users, Model.Email); + ViewData.SetActivePageAndTitle(ServerNavPages.Pages.Users); } -

@ViewData["Title"]

+

Modify User - @Model.Email

@Html.Partial("_StatusMessage", Model.StatusMessage) From 76cd9a7b252283c1a63dc25e206a406da842c3be Mon Sep 17 00:00:00 2001 From: lepipele Date: Thu, 19 Apr 2018 15:42:12 -0500 Subject: [PATCH 8/9] Abstracting navigation so it can use any enums --- BTCPayServer/Views/Server/Emails.cshtml | 2 +- BTCPayServer/Views/Server/ListUsers.cshtml | 2 +- BTCPayServer/Views/Server/Policies.cshtml | 2 +- BTCPayServer/Views/Server/Rates.cshtml | 2 +- BTCPayServer/Views/Server/ServerNavPages.cs | 30 ------------------ BTCPayServer/Views/Server/Theme.cshtml | 2 +- BTCPayServer/Views/Server/User.cshtml | 2 +- BTCPayServer/Views/Server/_Nav.cshtml | 16 +++++----- BTCPayServer/Views/Server/_ViewImports.cshtml | 3 +- BTCPayServer/Views/ViewsRazor.cs | 31 +++++++++++++++++++ BTCPayServer/Views/_ViewImports.cshtml | 1 + 11 files changed, 46 insertions(+), 47 deletions(-) delete mode 100644 BTCPayServer/Views/Server/ServerNavPages.cs create mode 100644 BTCPayServer/Views/ViewsRazor.cs diff --git a/BTCPayServer/Views/Server/Emails.cshtml b/BTCPayServer/Views/Server/Emails.cshtml index 80943c605..f52bda25c 100644 --- a/BTCPayServer/Views/Server/Emails.cshtml +++ b/BTCPayServer/Views/Server/Emails.cshtml @@ -1,6 +1,6 @@ @model EmailsViewModel @{ - ViewData.SetActivePageAndTitle(ServerNavPages.Pages.Emails); + ViewData.SetActivePageAndTitle(ServerNavPages.Emails); } diff --git a/BTCPayServer/Views/Server/ListUsers.cshtml b/BTCPayServer/Views/Server/ListUsers.cshtml index 29e78670e..5326eefff 100644 --- a/BTCPayServer/Views/Server/ListUsers.cshtml +++ b/BTCPayServer/Views/Server/ListUsers.cshtml @@ -1,6 +1,6 @@ @model UsersViewModel @{ - ViewData.SetActivePageAndTitle(ServerNavPages.Pages.Users); + ViewData.SetActivePageAndTitle(ServerNavPages.Users); } diff --git a/BTCPayServer/Views/Server/Policies.cshtml b/BTCPayServer/Views/Server/Policies.cshtml index be96a93d6..69767f659 100644 --- a/BTCPayServer/Views/Server/Policies.cshtml +++ b/BTCPayServer/Views/Server/Policies.cshtml @@ -1,6 +1,6 @@ @model BTCPayServer.Services.PoliciesSettings @{ - ViewData.SetActivePageAndTitle(ServerNavPages.Pages.Policies); + ViewData.SetActivePageAndTitle(ServerNavPages.Policies); } diff --git a/BTCPayServer/Views/Server/Rates.cshtml b/BTCPayServer/Views/Server/Rates.cshtml index 824dad284..61641a7c4 100644 --- a/BTCPayServer/Views/Server/Rates.cshtml +++ b/BTCPayServer/Views/Server/Rates.cshtml @@ -1,6 +1,6 @@ @model RatesViewModel @{ - ViewData.SetActivePageAndTitle(ServerNavPages.Pages.Rates); + ViewData.SetActivePageAndTitle(ServerNavPages.Rates); } diff --git a/BTCPayServer/Views/Server/ServerNavPages.cs b/BTCPayServer/Views/Server/ServerNavPages.cs deleted file mode 100644 index 9a51cbc0c..000000000 --- a/BTCPayServer/Views/Server/ServerNavPages.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc.Rendering; -using Microsoft.AspNetCore.Mvc.ViewFeatures; - -namespace BTCPayServer.Views.Server -{ - public static class ServerNavPages - { - public enum Pages - { - Index, Users, Rates, Emails, Policies, Theme, Hangfire - } - - public const string ACTIVE_PAGE_KEY = "ActivePage"; - public static void SetActivePageAndTitle(this ViewDataDictionary viewData, Pages activePage) - { - viewData["Title"] = activePage.ToString(); - viewData[ACTIVE_PAGE_KEY] = activePage; - } - - public static string IsActivePage(this ViewDataDictionary viewData, Pages page) - { - var activePage = viewData[ACTIVE_PAGE_KEY] as Pages?; - return activePage == page ? "active" : null; - } - } -} diff --git a/BTCPayServer/Views/Server/Theme.cshtml b/BTCPayServer/Views/Server/Theme.cshtml index 870a2ac1d..b9f71fae4 100644 --- a/BTCPayServer/Views/Server/Theme.cshtml +++ b/BTCPayServer/Views/Server/Theme.cshtml @@ -1,6 +1,6 @@ @model BTCPayServer.Services.ThemeSettings @{ - ViewData.SetActivePageAndTitle(ServerNavPages.Pages.Theme); + ViewData.SetActivePageAndTitle(ServerNavPages.Theme); } diff --git a/BTCPayServer/Views/Server/User.cshtml b/BTCPayServer/Views/Server/User.cshtml index 970edb8bc..47f4225ac 100644 --- a/BTCPayServer/Views/Server/User.cshtml +++ b/BTCPayServer/Views/Server/User.cshtml @@ -1,6 +1,6 @@ @model UserViewModel @{ - ViewData.SetActivePageAndTitle(ServerNavPages.Pages.Users); + ViewData.SetActivePageAndTitle(ServerNavPages.Users); } diff --git a/BTCPayServer/Views/Server/_Nav.cshtml b/BTCPayServer/Views/Server/_Nav.cshtml index 1597e2ef1..6d4de07fb 100644 --- a/BTCPayServer/Views/Server/_Nav.cshtml +++ b/BTCPayServer/Views/Server/_Nav.cshtml @@ -1,11 +1,9 @@ -@using BTCPayServer.Views.Server - -