diff options
author | VirtualTam <virtualtam@flibidi.net> | 2016-04-10 17:34:07 +0200 |
---|---|---|
committer | VirtualTam <virtualtam@flibidi.net> | 2016-04-10 21:28:04 +0200 |
commit | cd5327bee83f3e9467d786752bbd447963b941f7 (patch) | |
tree | 7abb6d242fc551b33b1d5b9f066fdabf4ef64c4d /tpl | |
parent | 745304c842e6e1234aac41a3f1c496c4522f32c5 (diff) | |
download | Shaarli-cd5327bee83f3e9467d786752bbd447963b941f7.tar.gz Shaarli-cd5327bee83f3e9467d786752bbd447963b941f7.tar.zst Shaarli-cd5327bee83f3e9467d786752bbd447963b941f7.zip |
Refactor Netscape bookmark exporting
Relates to https://github.com/shaarli/netscape-bookmark-parser/issues/5
Fixes:
- respect the Netscape bookmark format "specification"
Modifications:
- [application] introduce the NetscapeBookmarkUtils class
- [template] export - improve formatting, rename export selection parameter
- [template] export.bookmarks - template for Netscape exports
- [tests] bookmark filtering, additional field generation
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/export.bookmarks.html | 10 | ||||
-rw-r--r-- | tpl/export.html | 26 |
2 files changed, 26 insertions, 10 deletions
diff --git a/tpl/export.bookmarks.html b/tpl/export.bookmarks.html new file mode 100644 index 00000000..da733257 --- /dev/null +++ b/tpl/export.bookmarks.html | |||
@@ -0,0 +1,10 @@ | |||
1 | <!DOCTYPE NETSCAPE-Bookmark-file-1> | ||
2 | <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> | ||
3 | <!-- This is an automatically generated file. | ||
4 | It will be read and overwritten. | ||
5 | Do Not Edit! -->{ignore}The RainTPL loop is formatted to avoid generating extra newlines{/ignore} | ||
6 | <TITLE>{$pagetitle}</TITLE> | ||
7 | <H1>Shaarli export of {$selection} bookmarks on {$date}</H1> | ||
8 | <DL><p>{loop="links"} | ||
9 | <DT><A HREF="{$value.url}" ADD_DATE="{$value.timestamp}" PRIVATE="{$value.private}" TAGS="{$value.taglist}">{$value.title}</A>{if="$value.description"}{$eol}<DD>{$value.description}{/if}{/loop} | ||
10 | </DL><p> | ||
diff --git a/tpl/export.html b/tpl/export.html index 9d101db4..9582627a 100644 --- a/tpl/export.html +++ b/tpl/export.html | |||
@@ -2,15 +2,21 @@ | |||
2 | <html> | 2 | <html> |
3 | <head>{include="includes"}</head> | 3 | <head>{include="includes"}</head> |
4 | <body> | 4 | <body> |
5 | <div id="pageheader"> | 5 | <div id="pageheader"> |
6 | {include="page.header"} | 6 | {include="page.header"} |
7 | <div id="toolsdiv"> | 7 | <div id="toolsdiv"> |
8 | <a href="?do=export&what=all"><b>Export all</b> <span>: Export all links</span></a><br><br> | 8 | <a href="?do=export&selection=all"> |
9 | <a href="?do=export&what=public"><b>Export public</b> <span>: Export public links only</span></a><br><br> | 9 | <b>Export all</b><span>: Export all links</span> |
10 | <a href="?do=export&what=private"><b>Export private</b> <span>: Export private links only</span></a> | 10 | </a><br> |
11 | <div class="clear"></div> | 11 | <a href="?do=export&selection=public"> |
12 | </div> | 12 | <b>Export public</b><span>: Only export public links</span> |
13 | </div> | 13 | </a><br> |
14 | {include="page.footer"} | 14 | <a href="?do=export&selection=private"> |
15 | <b>Export private</b><span>: Only export private links</span> | ||
16 | </a> | ||
17 | <div class="clear"></div> | ||
18 | </div> | ||
19 | </div> | ||
20 | {include="page.footer"} | ||
15 | </body> | 21 | </body> |
16 | </html> | 22 | </html> |