|
|
@@ -21,9 +21,6 @@ import (
|
|
|
)
|
|
|
|
|
|
func (h *handler) submitSubscription(w http.ResponseWriter, r *http.Request) {
|
|
|
- sess := session.New(h.store, request.SessionID(r))
|
|
|
- v := view.New(h.tpl, r, sess)
|
|
|
-
|
|
|
user, err := h.store.UserByID(request.UserID(r))
|
|
|
if err != nil {
|
|
|
html.ServerError(w, r, err)
|
|
|
@@ -36,6 +33,8 @@ func (h *handler) submitSubscription(w http.ResponseWriter, r *http.Request) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ sess := session.New(h.store, request.SessionID(r))
|
|
|
+ v := view.New(h.tpl, r, sess)
|
|
|
v.Set("categories", categories)
|
|
|
v.Set("menu", "feeds")
|
|
|
v.Set("user", user)
|
|
|
@@ -141,15 +140,15 @@ func (h *handler) submitSubscription(w http.ResponseWriter, r *http.Request) {
|
|
|
|
|
|
html.Redirect(w, r, route.Path(h.router, "feedEntries", "feedID", feed.ID))
|
|
|
case n > 1:
|
|
|
- v := view.New(h.tpl, r, sess)
|
|
|
- v.Set("subscriptions", subscriptions)
|
|
|
- v.Set("form", subscriptionForm)
|
|
|
- v.Set("menu", "feeds")
|
|
|
- v.Set("user", user)
|
|
|
- v.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
|
|
- v.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
|
|
- v.Set("hasProxyConfigured", config.Opts.HasHTTPClientProxyConfigured())
|
|
|
+ view := view.New(h.tpl, r, sess)
|
|
|
+ view.Set("subscriptions", subscriptions)
|
|
|
+ view.Set("form", subscriptionForm)
|
|
|
+ view.Set("menu", "feeds")
|
|
|
+ view.Set("user", user)
|
|
|
+ view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
|
|
+ view.Set("countErrorFeeds", h.store.CountUserFeedsWithErrors(user.ID))
|
|
|
+ view.Set("hasProxyConfigured", config.Opts.HasHTTPClientProxyConfigured())
|
|
|
|
|
|
- html.OK(w, r, v.Render("choose_subscription"))
|
|
|
+ html.OK(w, r, view.Render("choose_subscription"))
|
|
|
}
|
|
|
}
|