mirror of
https://gerrit.hackerspace.pl/hscloud
synced 2024-10-18 03:07:44 +00:00
hswaw/site: show PIT banner only during tax season
Change-Id: Ida4b9e3a1efca19b6570ea33d217850fd351964f Reviewed-on: https://gerrit.hackerspace.pl/c/hscloud/+/1961 Reviewed-by: q3k <q3k@hackerspace.pl>
This commit is contained in:
parent
c1f60e0a22
commit
e8c0952f45
2 changed files with 10 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
{{ block "content" . }}
|
||||
{{ if .IsTaxSeason }}
|
||||
<section class="gallery-wrapper" id="pit">
|
||||
<div class="img-wrapper">
|
||||
<img src="/static/site/pit1.jpg" />
|
||||
|
@ -8,6 +9,7 @@
|
|||
<li data-name="pit2"><a href="#">Instrukcja</a></li>
|
||||
</ul>
|
||||
</section>
|
||||
{{ end }}
|
||||
<div class="about">
|
||||
<h2>Czym jest Warszawski Hackerspace?</h2>
|
||||
<p>
|
||||
|
@ -82,4 +84,4 @@ window.loadMap = () => {
|
|||
}
|
||||
</script>
|
||||
<script src="/static/leaflet/leaflet.js" crossorigin="" onload="loadMap()"></script>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
|
|
@ -6,6 +6,7 @@ import (
|
|||
"html/template"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/golang/glog"
|
||||
|
||||
|
@ -72,9 +73,15 @@ func (s *service) handleIndex(w http.ResponseWriter, r *http.Request) {
|
|||
"Events": s.getEvents(),
|
||||
"AtStatus": atStatus,
|
||||
"AtError": atError,
|
||||
"IsTaxSeason": isTaxSeason(),
|
||||
})
|
||||
}
|
||||
|
||||
func isTaxSeason() bool {
|
||||
today := time.Now()
|
||||
return today.Month() >= time.January && today.Month() <= time.April
|
||||
}
|
||||
|
||||
func (s *service) handleMerch(w http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
|
||||
|
|
Loading…
Reference in a new issue