new: user: open in new tab
This commit is contained in:
parent
9aee5652f0
commit
087184771b
@ -57,6 +57,7 @@ Following are available os env config available for bukuserver.
|
|||||||
| URL_RENDER_MODE | url render mode | `full` or `netloc` [default: `full`] |
|
| URL_RENDER_MODE | url render mode | `full` or `netloc` [default: `full`] |
|
||||||
| DB_FILE | full path to db file | path string [default: standard path for buku] |
|
| DB_FILE | full path to db file | path string [default: standard path for buku] |
|
||||||
| DISABLE_FAVICON | disable favicon | boolean [default: `false`] |
|
| DISABLE_FAVICON | disable favicon | boolean [default: `false`] |
|
||||||
|
| OPEN_IN_NEW_TAB | url link open in new tab | boolean [default: `false`] |
|
||||||
|
|
||||||
Note: `BUKUSERVER_` is the common prefix.
|
Note: `BUKUSERVER_` is the common prefix.
|
||||||
|
|
||||||
|
@ -100,7 +100,10 @@ class BookmarkModelView(BaseModelView):
|
|||||||
res = netloc_tmpl.format(
|
res = netloc_tmpl.format(
|
||||||
'http://www.google.com/s2/favicons?domain=', netloc)
|
'http://www.google.com/s2/favicons?domain=', netloc)
|
||||||
title = model.title if model.title else '<EMPTY TITLE>'
|
title = model.title if model.title else '<EMPTY TITLE>'
|
||||||
if is_scheme_valid:
|
open_in_new_tab = current_app.config.get('BUKUSERVER_OPEN_IN_NEW_TAB', False)
|
||||||
|
if is_scheme_valid and open_in_new_tab:
|
||||||
|
res += '<a href="{0.url}" target="_blank">{1}</a>'.format(model, title)
|
||||||
|
elif is_scheme_valid and not open_in_new_tab:
|
||||||
res += '<a href="{0.url}">{1}</a>'.format(model, title)
|
res += '<a href="{0.url}">{1}</a>'.format(model, title)
|
||||||
else:
|
else:
|
||||||
res += title
|
res += title
|
||||||
|
Loading…
Reference in New Issue
Block a user