This commit is contained in:
parent
9be55ab6dc
commit
eecf2e9a70
@ -15,7 +15,17 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header class="header">
|
<header class="header">
|
||||||
|
{{ if .Light }}
|
||||||
|
<a href="?light" class="home-button no-dec"><b>⌂</b></a>
|
||||||
|
<a href="?{{ .Parameters }}" class="home-button no-dec"><b>☾</b></a>
|
||||||
|
{{ else }}
|
||||||
<a href="?" class="home-button no-dec"><b>⌂</b></a>
|
<a href="?" class="home-button no-dec"><b>⌂</b></a>
|
||||||
|
{{ if eq .Parameters "" }}
|
||||||
|
<a href="?light" class="home-button no-dec"><b>☉</b></a>
|
||||||
|
{{ else }}
|
||||||
|
<a href="?light&{{ .Parameters }}" class="home-button no-dec"><b>☉</b></a>
|
||||||
|
{{ end }}
|
||||||
|
{{ end }}
|
||||||
<input class="nav-menu" type="checkbox" id="nav-menu"/>
|
<input class="nav-menu" type="checkbox" id="nav-menu"/>
|
||||||
<label class="hmb" for="nav-menu"><span class="hmb-line"></span></label>
|
<label class="hmb" for="nav-menu"><span class="hmb-line"></span></label>
|
||||||
<nav class="nav">
|
<nav class="nav">
|
||||||
|
@ -53,6 +53,17 @@ func (p *Page) GetLastModified() time.Time {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *Page) GetCacheIDExtension(urlParameters url.Values) string {
|
func (p *Page) GetCacheIDExtension(urlParameters url.Values) string {
|
||||||
|
toReturn := p.getNonThemedCleanQuery(urlParameters)
|
||||||
|
if toReturn != "" {
|
||||||
|
toReturn += "&"
|
||||||
|
}
|
||||||
|
if urlParameters.Has("light") {
|
||||||
|
toReturn += "light"
|
||||||
|
}
|
||||||
|
return strings.TrimRight(toReturn, "&")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (p *Page) getNonThemedCleanQuery(urlParameters url.Values) string {
|
||||||
toReturn := ""
|
toReturn := ""
|
||||||
if urlParameters.Has("order") {
|
if urlParameters.Has("order") {
|
||||||
if theParameter := strings.ToLower(urlParameters.Get("order")); theParameter == "start" || theParameter == "end" || theParameter == "name" || theParameter == "duration" {
|
if theParameter := strings.ToLower(urlParameters.Get("order")); theParameter == "start" || theParameter == "end" || theParameter == "name" || theParameter == "duration" {
|
||||||
@ -61,12 +72,9 @@ func (p *Page) GetCacheIDExtension(urlParameters url.Values) string {
|
|||||||
}
|
}
|
||||||
if urlParameters.Has("sort") {
|
if urlParameters.Has("sort") {
|
||||||
if theParameter := strings.ToLower(urlParameters.Get("sort")); theParameter == "asc" || theParameter == "ascending" || theParameter == "desc" || theParameter == "descending" {
|
if theParameter := strings.ToLower(urlParameters.Get("sort")); theParameter == "asc" || theParameter == "ascending" || theParameter == "desc" || theParameter == "descending" {
|
||||||
toReturn += "sort=" + theParameter + "&"
|
toReturn += "sort=" + theParameter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if urlParameters.Has("light") {
|
|
||||||
toReturn += "light"
|
|
||||||
}
|
|
||||||
return strings.TrimRight(toReturn, "&")
|
return strings.TrimRight(toReturn, "&")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,8 +88,9 @@ func (p *Page) GetContents(urlParameters url.Values) (contentType string, conten
|
|||||||
return "text/plain", []byte("Cannot Get Data.\r\n" + err.Error()), false
|
return "text/plain", []byte("Cannot Get Data.\r\n" + err.Error()), false
|
||||||
}
|
}
|
||||||
theMarshal := &Marshal{
|
theMarshal := &Marshal{
|
||||||
Data: *theData,
|
Data: *theData,
|
||||||
Light: urlParameters.Has("light"),
|
Light: urlParameters.Has("light"),
|
||||||
|
Parameters: p.getNonThemedCleanQuery(urlParameters),
|
||||||
}
|
}
|
||||||
switch strings.ToLower(urlParameters.Get("order")) {
|
switch strings.ToLower(urlParameters.Get("order")) {
|
||||||
case "end":
|
case "end":
|
||||||
|
@ -4,6 +4,7 @@ import "sort"
|
|||||||
|
|
||||||
type Marshal struct {
|
type Marshal struct {
|
||||||
Data DataYaml
|
Data DataYaml
|
||||||
|
Parameters string
|
||||||
OrderStartDate int8
|
OrderStartDate int8
|
||||||
OrderEndDate int8
|
OrderEndDate int8
|
||||||
OrderName int8
|
OrderName int8
|
||||||
|
Loading…
Reference in New Issue
Block a user