Hide graph on Daily Notes page

This commit is contained in:
Peter Stuifzand 2020-07-19 15:09:15 +02:00
parent 950406deb4
commit ff4f165c32
3 changed files with 19 additions and 11 deletions

View File

@ -98,6 +98,7 @@ type indexPage struct {
Name string
Content template.HTML
Backrefs map[string][]Backref
ShowGraph bool
}
type Node struct {
@ -129,6 +130,7 @@ type editPage struct {
Name string
Editor template.HTML
Backrefs map[string][]Backref
ShowGraph bool
}
type historyPage struct {
@ -447,6 +449,7 @@ func (h *editHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
Editor: editor,
Name: page,
Backrefs: mpPage.Refs,
ShowGraph: page != "Daily_Notes",
}
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),
Name: page,
Backrefs: mpPage.Refs,
ShowGraph: page != "Daily_Notes",
}
t, err := template.ParseFiles("templates/layout.html", "templates/view.html")

View File

@ -30,7 +30,9 @@
</div>
<div class="column">
{{ if .ShowGraph }}
<div class="graph-network" data-name="{{ .Name }}" style="height:80vh; top:0; position: sticky"></div>
{{ end }}
</div>
</div>
{{ end }}

View File

@ -24,7 +24,9 @@
</div>
<div class="column">
{{ if .ShowGraph }}
<div class="graph-network" data-name="{{ .Name }}" style="height:80vh; top:0; position: sticky"></div>
{{ end }}
</div>
</div>
{{ end }}