4
0
Fork 2
mirror of https://gerrit.hackerspace.pl/hscloud synced 2024-10-18 05:17:45 +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:
radex 2024-05-15 13:43:09 +02:00 committed by q3k
parent c1f60e0a22
commit e8c0952f45
2 changed files with 10 additions and 1 deletions

View file

@ -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>

View file

@ -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()