Skip to content

Commit 08a5b3c

Browse files
add link to and rework visual blocks page
1 parent 36ec508 commit 08a5b3c

File tree

4 files changed

+18
-45
lines changed

4 files changed

+18
-45
lines changed

cmd/dcrdata/internal/explorer/explorerroutes.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -368,14 +368,16 @@ func (exp *explorerUI) VisualBlocks(w http.ResponseWriter, r *http.Request) {
368368

369369
str, err := exp.templates.exec("visualblocks", struct {
370370
*CommonPageData
371-
Info *types.HomeInfo
372-
Mempool *types.TrimmedMempoolInfo
373-
Blocks []*types.TrimmedBlockInfo
371+
Info *types.HomeInfo
372+
Mempool *types.TrimmedMempoolInfo
373+
Blocks []*types.TrimmedBlockInfo
374+
VisualBlocks bool
374375
}{
375376
CommonPageData: exp.commonData(r),
376377
Info: exp.pageData.HomeInfo,
377378
Mempool: mempoolInfo,
378379
Blocks: trimmedBlocks,
380+
VisualBlocks: true,
379381
})
380382

381383
exp.pageData.RUnlock()

cmd/dcrdata/public/scss/visualblocks.scss

-20
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
1-
#mainContainer {
2-
max-width: 100% !important;
3-
width: 100%;
4-
padding: 0 10%;
5-
display: flex;
6-
flex-wrap: wrap;
7-
margin: 30px 0;
8-
align-items: flex-start;
9-
}
10-
111
.blocks-section {
122
flex-grow: 1;
133
flex-basis: 250px;
@@ -186,10 +176,6 @@
186176
text-decoration: none;
187177
}
188178

189-
#mainContainer .decimal {
190-
margin-left: 0;
191-
}
192-
193179
.blockhchainWrapper {
194180
padding: 60px 0;
195181
}
@@ -326,12 +312,6 @@ body.darkBG {
326312
}
327313
}
328314

329-
@media only screen and (max-width: 768px) {
330-
#mainContainer {
331-
padding: 0 5%;
332-
}
333-
}
334-
335315
@media only screen and (max-width: 576px) {
336316
.blocks-section {
337317
padding: 0;

cmd/dcrdata/views/extras.tmpl

+5-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<link rel="preload" href="/images/connected.svg?x=65tv3" as="image" type="image/svg+xml" />
6262
<link rel="preload" href="/images/disconnected.svg?x=65tv3" as="image" type="image/svg+xml" />
6363

64-
<link href="/dist/css/style.d8a442444300a678.css" rel="stylesheet">
64+
<link href="/dist/css/style.6ce1a39635cc9c19.css" rel="stylesheet">
6565

6666
<script src="/js/vendor/turbolinks.min.js?v=65tv3"></script>
6767
</head>
@@ -365,6 +365,10 @@
365365
<span class="px-2{{if eq .TimeGrouping "Blocks"}} unstyled-link{{else}} text-secondary{{end}}">Blocks</span>
366366
<div class="blocks-selector{{if eq .TimeGrouping "Blocks"}} active{{end}}"></div>
367367
</a>
368+
<a class="d-inline-block position-relative me-4 py-2 unstyled-link" href="/visualblocks">
369+
<span class="px-2{{if .VisualBlocks}} unstyled-link{{else}} text-secondary{{end}}">Visual Blocks</span>
370+
<div class="blocks-selector{{if .VisualBlocks}} active{{end}}"></div>
371+
</a>
368372
<a class="d-inline-block position-relative me-4 py-2 unstyled-link" href="/ticketpricewindows">
369373
<span class="separator ps-2 pe-5{{if eq .TimeGrouping "Windows"}} unstyled-link{{else}} text-secondary{{end}}">Windows</span>
370374
<div class="separator blocks-selector{{if eq .TimeGrouping "Windows"}} active{{end}}"></div>

cmd/dcrdata/views/visualblocks.tmpl

+8-21
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,14 @@
33
<html lang="en">
44
{{ template "html-head" headData .CommonPageData "Decred Block Explorer by dcrdata.org"}}
55
{{ template "navbar" . }}
6-
7-
<div
8-
id="mainContainer"
9-
class="container py-1"
10-
data-controller="time"
11-
>
12-
<div
13-
class="blocks-section"
14-
data-controller="visualBlocks"
15-
data-visualBlocks-target="root"
16-
>
17-
<a
18-
class="no-underline title fw-bold"
19-
href="/blocks"
20-
data-visualBlocks-target="title"
21-
href="/blocks"
22-
>Latest Blocks</a>
23-
<div
24-
class="blocks-holder"
25-
data-visualBlocks-target="box"
26-
>
6+
{{template "blocksBanner" .}}
7+
<div id="mainContainer" class="container main px-1" data-controller="time">
8+
<div class="blocks-section" data-controller="visualBlocks" data-visualBlocks-target="root">
9+
<span class="h2 d-flex pt-4 px-1 pb-1 pe-2" data-visualBlocks-target="title">
10+
Visual Blocks
11+
<span class="dcricon-info fs24 ms-3 mt-2" data-visualBlocks-target="tooltip" title="Latest Decred Visual Blocks"></span>
12+
</span>
13+
<div class="blocks-holder px-md-4" data-visualBlocks-target="box">
2714
<!-- add mempool element -->
2815
{{with .Mempool}}
2916
<div class="block visible" data-visualBlocks-target="block">

0 commit comments

Comments
 (0)