From be28b7225f36c794c096bf38f3bf0f5333a3fabd Mon Sep 17 00:00:00 2001 From: Philemon Ukane Date: Tue, 6 Dec 2022 12:53:11 +0100 Subject: [PATCH] add link to and rework visual blocks page --- .../internal/explorer/explorerroutes.go | 8 +++-- cmd/dcrdata/public/scss/visualblocks.scss | 20 ------------- cmd/dcrdata/views/extras.tmpl | 6 +++- cmd/dcrdata/views/visualblocks.tmpl | 29 +++++-------------- 4 files changed, 18 insertions(+), 45 deletions(-) diff --git a/cmd/dcrdata/internal/explorer/explorerroutes.go b/cmd/dcrdata/internal/explorer/explorerroutes.go index 9ad50bdce..461792d13 100644 --- a/cmd/dcrdata/internal/explorer/explorerroutes.go +++ b/cmd/dcrdata/internal/explorer/explorerroutes.go @@ -368,14 +368,16 @@ func (exp *explorerUI) VisualBlocks(w http.ResponseWriter, r *http.Request) { str, err := exp.templates.exec("visualblocks", struct { *CommonPageData - Info *types.HomeInfo - Mempool *types.TrimmedMempoolInfo - Blocks []*types.TrimmedBlockInfo + Info *types.HomeInfo + Mempool *types.TrimmedMempoolInfo + Blocks []*types.TrimmedBlockInfo + TimeGrouping string }{ CommonPageData: exp.commonData(r), Info: exp.pageData.HomeInfo, Mempool: mempoolInfo, Blocks: trimmedBlocks, + TimeGrouping: "Visual Blocks", }) exp.pageData.RUnlock() diff --git a/cmd/dcrdata/public/scss/visualblocks.scss b/cmd/dcrdata/public/scss/visualblocks.scss index d06766eca..982bac877 100644 --- a/cmd/dcrdata/public/scss/visualblocks.scss +++ b/cmd/dcrdata/public/scss/visualblocks.scss @@ -1,13 +1,3 @@ -#mainContainer { - max-width: 100% !important; - width: 100%; - padding: 0 10%; - display: flex; - flex-wrap: wrap; - margin: 30px 0; - align-items: flex-start; -} - .blocks-section { flex-grow: 1; flex-basis: 250px; @@ -186,10 +176,6 @@ text-decoration: none; } -#mainContainer .decimal { - margin-left: 0; -} - .blockhchainWrapper { padding: 60px 0; } @@ -326,12 +312,6 @@ body.darkBG { } } -@media only screen and (max-width: 768px) { - #mainContainer { - padding: 0 5%; - } -} - @media only screen and (max-width: 576px) { .blocks-section { padding: 0; diff --git a/cmd/dcrdata/views/extras.tmpl b/cmd/dcrdata/views/extras.tmpl index d6675c363..4d197d440 100644 --- a/cmd/dcrdata/views/extras.tmpl +++ b/cmd/dcrdata/views/extras.tmpl @@ -61,7 +61,7 @@ - + @@ -365,6 +365,10 @@ Blocks
+ + Visual Blocks +
+
Windows
diff --git a/cmd/dcrdata/views/visualblocks.tmpl b/cmd/dcrdata/views/visualblocks.tmpl index 839c35af7..4eefd3a02 100644 --- a/cmd/dcrdata/views/visualblocks.tmpl +++ b/cmd/dcrdata/views/visualblocks.tmpl @@ -3,27 +3,14 @@ {{ template "html-head" headData .CommonPageData "Decred Block Explorer by dcrdata.org"}} {{ template "navbar" . }} - -
-
- Latest Blocks -
+ {{template "blocksBanner" .}} +
+
+ + Visual Blocks + + +
{{with .Mempool}}