diff --git a/Router.go b/Router.go index ff67938..7ed9a9e 100644 --- a/Router.go +++ b/Router.go @@ -105,8 +105,18 @@ func (this *ArchiveServer) ServeHTTP(w http.ResponseWriter, r *http.Request) { arc.renderError(w, fmt.Sprintf("Unknown source '%s'", matches[1])) } - } else if this.rxViewPage.MatchString(r.URL.Path) { - arc.renderError(w, "Not implemented.") // FIXME + } else if matches := this.rxViewPage.FindStringSubmatch(r.URL.Path); len(matches) > 0 { + if ls := this.lookupSource(matches[1]); ls != nil { + arc.selectSource(ls, matches[1]) + y, _ := strconv.Atoi(matches[2]) + m, _ := strconv.Atoi(matches[3]) + arc.ym = YearMonth{Year: y, Month: time.Month(m)} // 1-based months + arc.page, _ = strconv.Atoi(matches[4]) + arc.renderView(w) + + } else { + arc.renderError(w, fmt.Sprintf("Unknown source '%s'", matches[1])) + } } else if this.rxSearch.MatchString(r.URL.Path) { arc.renderError(w, "Not implemented.") // FIXME