diff --git a/web/html/feed.html b/web/html/feed.html
index 1aa62ce..8c22494 100644
--- a/web/html/feed.html
+++ b/web/html/feed.html
@@ -4,7 +4,7 @@
Home
-[Active | All]
+[Active | All]
diff --git a/web/source.go b/web/source.go
index 627f52b..a5801fd 100644
--- a/web/source.go
+++ b/web/source.go
@@ -1,6 +1,7 @@
package web
import (
+ "log"
"net/http"
"github.com/Jaculabilis/intake/core"
@@ -15,11 +16,20 @@ func (env *Env) getSource(writer http.ResponseWriter, req *http.Request) {
}
// TODO this needs to properly error if the source doesn't exist instead of just returning []
- items, err := core.GetAllItemsForSource(env.db, source)
+ var items []core.Item
+ var err error
+ inactive := req.URL.Query().Get("inactive") == "1"
+ log.Printf("inactive = %t", inactive)
+ if inactive {
+ items, err = core.GetAllItemsForSource(env.db, source)
+ } else {
+ items, err = core.GetActiveItemsForSource(env.db, source)
+ }
if err != nil {
http.Error(writer, err.Error(), 500)
return
}
+
data := html.FeedData{
Items: items,
}