1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-07-12 16:58:36 +00:00

Improve OPML import/export

This commit is contained in:
Frédéric Guillot 2017-11-20 14:35:11 -08:00
parent ace7524905
commit a76c2a8c22
15 changed files with 51 additions and 31 deletions

View file

@ -1,5 +1,5 @@
// Code generated by go generate; DO NOT EDIT.
// 2017-11-20 13:44:53.696612572 -0800 PST m=+0.008696070
// 2017-11-20 14:18:33.249018092 -0800 PST m=+0.005104170
package static

View file

@ -1,5 +1,5 @@
// Code generated by go generate; DO NOT EDIT.
// 2017-11-20 13:44:53.70263347 -0800 PST m=+0.014716968
// 2017-11-20 14:18:33.25118969 -0800 PST m=+0.007275768
package static

View file

@ -1,5 +1,5 @@
// Code generated by go generate; DO NOT EDIT.
// 2017-11-20 13:44:53.707892515 -0800 PST m=+0.019976013
// 2017-11-20 14:18:33.255571671 -0800 PST m=+0.011657749
package static

View file

@ -1,5 +1,5 @@
// Code generated by go generate; DO NOT EDIT.
// 2017-11-20 13:44:53.731951822 -0800 PST m=+0.044035320
// 2017-11-20 14:18:33.28176883 -0800 PST m=+0.037854908
package template

View file

@ -6,11 +6,6 @@ package template
import (
"bytes"
"github.com/miniflux/miniflux2/errors"
"github.com/miniflux/miniflux2/locale"
"github.com/miniflux/miniflux2/server/route"
"github.com/miniflux/miniflux2/server/template/helper"
"github.com/miniflux/miniflux2/server/ui/filter"
"html/template"
"io"
"log"
@ -18,6 +13,12 @@ import (
"strings"
"time"
"github.com/miniflux/miniflux2/errors"
"github.com/miniflux/miniflux2/locale"
"github.com/miniflux/miniflux2/server/route"
"github.com/miniflux/miniflux2/server/template/helper"
"github.com/miniflux/miniflux2/server/ui/filter"
"github.com/gorilla/mux"
)
@ -61,11 +62,13 @@ func (t *TemplateEngine) ParseAll() {
},
"t": func(key interface{}, args ...interface{}) string {
switch key.(type) {
case string, error:
case string:
return t.currentLocale.Get(key.(string), args...)
case errors.LocalizedError:
err := key.(errors.LocalizedError)
return err.Localize(t.currentLocale)
case error:
return key.(error).Error()
default:
return ""
}

View file

@ -1,5 +1,5 @@
// Code generated by go generate; DO NOT EDIT.
// 2017-11-20 13:44:53.712375345 -0800 PST m=+0.024458843
// 2017-11-20 14:18:33.257809595 -0800 PST m=+0.013895673
package template

View file

@ -5,8 +5,9 @@
package controller
import (
"github.com/miniflux/miniflux2/server/core"
"log"
"github.com/miniflux/miniflux2/server/core"
)
func (c *Controller) Export(ctx *core.Context, request *core.Request, response *core.Response) {
@ -52,7 +53,7 @@ func (c *Controller) UploadOPML(ctx *core.Context, request *core.Request, respon
}
response.Html().Render("import", args.Merge(tplParams{
"errorMessage": impErr.Error(),
"errorMessage": impErr,
"menu": "feeds",
}))