Skip to content

Commit

Permalink
add link to and rework visual blocks page
Browse files Browse the repository at this point in the history
  • Loading branch information
ukane-philemon committed Dec 6, 2022
1 parent 36ec508 commit d0d6690
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 44 deletions.
8 changes: 5 additions & 3 deletions cmd/dcrdata/internal/explorer/explorerroutes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
VisualBlocks bool
}{
CommonPageData: exp.commonData(r),
Info: exp.pageData.HomeInfo,
Mempool: mempoolInfo,
Blocks: trimmedBlocks,
VisualBlocks: true,
})

exp.pageData.RUnlock()
Expand Down
20 changes: 0 additions & 20 deletions cmd/dcrdata/public/scss/visualblocks.scss
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -186,10 +176,6 @@
text-decoration: none;
}

#mainContainer .decimal {
margin-left: 0;
}

.blockhchainWrapper {
padding: 60px 0;
}
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions cmd/dcrdata/views/extras.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,10 @@
<span class="px-2{{if eq .TimeGrouping "Blocks"}} unstyled-link{{else}} text-secondary{{end}}">Blocks</span>
<div class="blocks-selector{{if eq .TimeGrouping "Blocks"}} active{{end}}"></div>
</a>
<a class="d-inline-block position-relative me-4 py-2 unstyled-link" href="/visualblocks">
<span class="px-2{{if .VisualBlocks}} unstyled-link{{else}} text-secondary{{end}}">Visual Blocks</span>
<div class="blocks-selector{{if .VisualBlocks}} active{{end}}"></div>
</a>
<a class="d-inline-block position-relative me-4 py-2 unstyled-link" href="/ticketpricewindows">
<span class="separator ps-2 pe-5{{if eq .TimeGrouping "Windows"}} unstyled-link{{else}} text-secondary{{end}}">Windows</span>
<div class="separator blocks-selector{{if eq .TimeGrouping "Windows"}} active{{end}}"></div>
Expand Down
29 changes: 8 additions & 21 deletions cmd/dcrdata/views/visualblocks.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,14 @@
<html lang="en">
{{ template "html-head" headData .CommonPageData "Decred Block Explorer by dcrdata.org"}}
{{ template "navbar" . }}

<div
id="mainContainer"
class="container py-1"
data-controller="time"
>
<div
class="blocks-section"
data-controller="visualBlocks"
data-visualBlocks-target="root"
>
<a
class="no-underline title fw-bold"
href="/blocks"
data-visualBlocks-target="title"
href="/blocks"
>Latest Blocks</a>
<div
class="blocks-holder"
data-visualBlocks-target="box"
>
{{template "blocksBanner" .}}
<div id="mainContainer" class="container main px-1" data-controller="time">
<div class="blocks-section" data-controller="visualBlocks" data-visualBlocks-target="root">
<span class="h2 d-flex pt-4 px-1 pb-1 pe-2" data-visualBlocks-target="title">
Visual Blocks
<span class="dcricon-info fs24 ms-3 mt-2" data-visualBlocks-target="tooltip" title="Latest Decred Visual Blocks"></span>
</span>
<div class="blocks-holder px-md-4" data-visualBlocks-target="box">
<!-- add mempool element -->
{{with .Mempool}}
<div class="block visible" data-visualBlocks-target="block">
Expand Down

0 comments on commit d0d6690

Please sign in to comment.