Hide graph on Daily Notes page
This commit is contained in:
parent
950406deb4
commit
ff4f165c32
26
main.go
26
main.go
|
@ -93,11 +93,12 @@ type pageBaseInfo struct {
|
||||||
|
|
||||||
type indexPage struct {
|
type indexPage struct {
|
||||||
pageBaseInfo
|
pageBaseInfo
|
||||||
Session *Session
|
Session *Session
|
||||||
Title string
|
Title string
|
||||||
Name string
|
Name string
|
||||||
Content template.HTML
|
Content template.HTML
|
||||||
Backrefs map[string][]Backref
|
Backrefs map[string][]Backref
|
||||||
|
ShowGraph bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type Node struct {
|
type Node struct {
|
||||||
|
@ -123,12 +124,13 @@ type graphPage struct {
|
||||||
|
|
||||||
type editPage struct {
|
type editPage struct {
|
||||||
pageBaseInfo
|
pageBaseInfo
|
||||||
Session *Session
|
Session *Session
|
||||||
Title string
|
Title string
|
||||||
Content string
|
Content string
|
||||||
Name string
|
Name string
|
||||||
Editor template.HTML
|
Editor template.HTML
|
||||||
Backrefs map[string][]Backref
|
Backrefs map[string][]Backref
|
||||||
|
ShowGraph bool
|
||||||
}
|
}
|
||||||
|
|
||||||
type historyPage struct {
|
type historyPage struct {
|
||||||
|
@ -447,6 +449,7 @@ func (h *editHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
Editor: editor,
|
Editor: editor,
|
||||||
Name: page,
|
Name: page,
|
||||||
Backrefs: mpPage.Refs,
|
Backrefs: mpPage.Refs,
|
||||||
|
ShowGraph: page != "Daily_Notes",
|
||||||
}
|
}
|
||||||
|
|
||||||
t, err := template.ParseFiles("templates/layout.html", "templates/edit.html")
|
t, err := template.ParseFiles("templates/layout.html", "templates/edit.html")
|
||||||
|
@ -647,6 +650,7 @@ func (h *indexHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
Content: template.HTML(pageText),
|
Content: template.HTML(pageText),
|
||||||
Name: page,
|
Name: page,
|
||||||
Backrefs: mpPage.Refs,
|
Backrefs: mpPage.Refs,
|
||||||
|
ShowGraph: page != "Daily_Notes",
|
||||||
}
|
}
|
||||||
|
|
||||||
t, err := template.ParseFiles("templates/layout.html", "templates/view.html")
|
t, err := template.ParseFiles("templates/layout.html", "templates/view.html")
|
||||||
|
|
|
@ -30,7 +30,9 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="column">
|
<div class="column">
|
||||||
|
{{ if .ShowGraph }}
|
||||||
<div class="graph-network" data-name="{{ .Name }}" style="height:80vh; top:0; position: sticky"></div>
|
<div class="graph-network" data-name="{{ .Name }}" style="height:80vh; top:0; position: sticky"></div>
|
||||||
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
|
@ -24,7 +24,9 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="column">
|
<div class="column">
|
||||||
|
{{ if .ShowGraph }}
|
||||||
<div class="graph-network" data-name="{{ .Name }}" style="height:80vh; top:0; position: sticky"></div>
|
<div class="graph-network" data-name="{{ .Name }}" style="height:80vh; top:0; position: sticky"></div>
|
||||||
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user