swap TopicCountInForums's implementation out for a saner one...
clean up repetition in route legends
This commit is contained in:
parent
ae8c27fc2d
commit
b1c9e0d11c
|
@ -402,5 +402,8 @@ func ArgQToTopicCount(argList []interface{}, qlist string) (topicCount int, err
|
|||
}
|
||||
|
||||
func TopicCountInForums(forums []Forum) (topicCount int, err error) {
|
||||
return ArgQToTopicCount(ForumListToArgQ(forums))
|
||||
for _, f := range forums {
|
||||
topicCount += f.TopicCount
|
||||
}
|
||||
return topicCount, nil
|
||||
}
|
||||
|
|
|
@ -842,8 +842,9 @@ func AnalyticsRoutesPerf(w http.ResponseWriter, r *http.Request, user c.User) c.
|
|||
viewList = append(viewList, ovitem.viewMap[value])
|
||||
}
|
||||
vList = append(vList, viewList)
|
||||
legendList = append(legendList, ovitem.name)
|
||||
if i >= 6 {
|
||||
shortName := strings.Replace(ovitem.name, "routes.", "r.", -1)
|
||||
legendList = append(legendList, shortName)
|
||||
if i >= 7 {
|
||||
break
|
||||
}
|
||||
i++
|
||||
|
@ -1082,8 +1083,9 @@ func AnalyticsRoutes(w http.ResponseWriter, r *http.Request, user c.User) c.Rout
|
|||
viewList = append(viewList, ovitem.viewMap[value])
|
||||
}
|
||||
vList = append(vList, viewList)
|
||||
legendList = append(legendList, ovitem.name)
|
||||
if i >= 6 {
|
||||
shortName := strings.Replace(ovitem.name, "routes.", "r.", -1)
|
||||
legendList = append(legendList, shortName)
|
||||
if i >= 7 {
|
||||
break
|
||||
}
|
||||
i++
|
||||
|
|
Loading…
Reference in New Issue