mirror of
https://github.com/miniflux/v2.git
synced 2025-08-01 17:38:37 +00:00
Move UI middlewares and routes to ui package
This commit is contained in:
parent
0925899cee
commit
5a69a61d48
70 changed files with 739 additions and 769 deletions
|
@ -13,28 +13,27 @@ import (
|
|||
"miniflux.app/ui/view"
|
||||
)
|
||||
|
||||
// ShowFeedsPage shows the page with all subscriptions.
|
||||
func (c *Controller) ShowFeedsPage(w http.ResponseWriter, r *http.Request) {
|
||||
user, err := c.store.UserByID(request.UserID(r))
|
||||
func (h *handler) showFeedsPage(w http.ResponseWriter, r *http.Request) {
|
||||
user, err := h.store.UserByID(request.UserID(r))
|
||||
if err != nil {
|
||||
html.ServerError(w, r, err)
|
||||
return
|
||||
}
|
||||
|
||||
feeds, err := c.store.Feeds(user.ID)
|
||||
feeds, err := h.store.Feeds(user.ID)
|
||||
if err != nil {
|
||||
html.ServerError(w, r, err)
|
||||
return
|
||||
}
|
||||
|
||||
sess := session.New(c.store, request.SessionID(r))
|
||||
view := view.New(c.tpl, r, sess)
|
||||
sess := session.New(h.store, request.SessionID(r))
|
||||
view := view.New(h.tpl, r, sess)
|
||||
view.Set("feeds", feeds)
|
||||
view.Set("total", len(feeds))
|
||||
view.Set("menu", "feeds")
|
||||
view.Set("user", user)
|
||||
view.Set("countUnread", c.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", c.store.CountErrorFeeds(user.ID))
|
||||
view.Set("countUnread", h.store.CountUnreadEntries(user.ID))
|
||||
view.Set("countErrorFeeds", h.store.CountErrorFeeds(user.ID))
|
||||
|
||||
html.OK(w, r, view.Render("feeds"))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue