Merge Edge with data #1
@ -15,7 +15,17 @@
|
||||
</head>
|
||||
<body>
|
||||
<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>
|
||||
{{ 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"/>
|
||||
<label class="hmb" for="nav-menu"><span class="hmb-line"></span></label>
|
||||
<nav class="nav">
|
||||
|
@ -53,6 +53,17 @@ func (p *Page) GetLastModified() time.Time {
|
||||
}
|
||||
|
||||
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 := ""
|
||||
if urlParameters.Has("order") {
|
||||
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 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, "&")
|
||||
}
|
||||
|
||||
@ -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
|
||||
}
|
||||
theMarshal := &Marshal{
|
||||
Data: *theData,
|
||||
Light: urlParameters.Has("light"),
|
||||
Data: *theData,
|
||||
Light: urlParameters.Has("light"),
|
||||
Parameters: p.getNonThemedCleanQuery(urlParameters),
|
||||
}
|
||||
switch strings.ToLower(urlParameters.Get("order")) {
|
||||
case "end":
|
||||
|
@ -4,6 +4,7 @@ import "sort"
|
||||
|
||||
type Marshal struct {
|
||||
Data DataYaml
|
||||
Parameters string
|
||||
OrderStartDate int8
|
||||
OrderEndDate int8
|
||||
OrderName int8
|
||||
|
Loading…
Reference in New Issue
Block a user