mirror of
https://github.com/taigrr/gico.git
synced 2026-04-02 03:09:07 -07:00
add red square for failure to commit today
This commit is contained in:
@@ -18,6 +18,9 @@ func main() {
|
||||
r := mux.NewRouter()
|
||||
r.HandleFunc("/weekly.svg", func(w http.ResponseWriter, r *http.Request) {
|
||||
author := r.URL.Query().Get("author")
|
||||
highlight := r.URL.Query().Get("highlight")
|
||||
shouldHighlight := highlight != ""
|
||||
|
||||
w.Header().Add("Content-Type", "text/html")
|
||||
repoPaths, err := commits.GetMRRepos()
|
||||
if err != nil {
|
||||
@@ -27,7 +30,7 @@ func main() {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
svg := svg.GetWeekSVG(week)
|
||||
svg := svg.GetWeekSVG(week, shouldHighlight)
|
||||
svg.WriteTo(w)
|
||||
})
|
||||
r.HandleFunc("/stats.json", func(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -54,8 +57,13 @@ func main() {
|
||||
year := time.Now().Year()
|
||||
yst := r.URL.Query().Get("year")
|
||||
author := r.URL.Query().Get("author")
|
||||
highlight := r.URL.Query().Get("highlight")
|
||||
shouldHighlight := highlight != ""
|
||||
y, err := strconv.Atoi(yst)
|
||||
if err == nil {
|
||||
if year != y {
|
||||
shouldHighlight = false
|
||||
}
|
||||
year = y
|
||||
}
|
||||
repoPaths, err := commits.GetMRRepos()
|
||||
@@ -66,7 +74,7 @@ func main() {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
svg := svg.GetYearSVG(freq)
|
||||
svg := svg.GetYearSVG(freq, shouldHighlight)
|
||||
w.Header().Add("Content-Type", "text/html")
|
||||
svg.WriteTo(w)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user