From adbf2ef45036af690f9574d310506e0571d6cb88 Mon Sep 17 00:00:00 2001 From: Justin Hawkins Date: Thu, 26 May 2022 06:41:17 +0930 Subject: [PATCH] Add bookmarklet support, show tags in manage list. --- web/templates/_layout.html | 4 ++++ web/templates/add_url_form.html | 18 +++++++++++++----- web/templates/add_url_form_bulk.html | 7 ++++--- web/templates/bookmarklet.html | 7 +++++++ web/templates/manage.html | 21 ++++++++++++++------- web/templates/search.html | 10 +++++----- web/templates/tags_widget.html | 7 ++----- web/web.go | 13 +++++++++++-- 8 files changed, 60 insertions(+), 27 deletions(-) create mode 100644 web/templates/bookmarklet.html diff --git a/web/templates/_layout.html b/web/templates/_layout.html index 104af09..9975478 100644 --- a/web/templates/_layout.html +++ b/web/templates/_layout.html @@ -25,6 +25,8 @@
  • Export all URLs
  • +
  • Bookmarklet
  • +
    @@ -39,6 +41,8 @@
    {{ if eq .page "root" }} {{ template "search.html" . }} + {{ else if eq .page "bookmarklet_click" }} + {{ template "bookmarklet.html" . }} {{ else if eq .page "manage" }} {{ template "manage.html" . }} {{ end }} diff --git a/web/templates/add_url_form.html b/web/templates/add_url_form.html index 83999ae..9a52059 100644 --- a/web/templates/add_url_form.html +++ b/web/templates/add_url_form.html @@ -1,19 +1,27 @@
    -
    Add a new URL
    - [bulk] +
    +
    Add a new URL
    +

    [bulk add] +

    +
    -
    {{ template "tags_widget.html" . }}
    +
    +
    + add +
    +
    {{ if .error }}

    {{ .error }}

    diff --git a/web/templates/add_url_form_bulk.html b/web/templates/add_url_form_bulk.html index 1ea89e3..2a398cd 100644 --- a/web/templates/add_url_form_bulk.html +++ b/web/templates/add_url_form_bulk.html @@ -1,7 +1,8 @@
    -
    Add URLs in bulk
    - [single] -
    +
    +
    Add bulk URLs
    +

    [single add] +

    diff --git a/web/templates/bookmarklet.html b/web/templates/bookmarklet.html new file mode 100644 index 0000000..73c23d1 --- /dev/null +++ b/web/templates/bookmarklet.html @@ -0,0 +1,7 @@ +
    +
    + + {{ template "add_url_form.html" .}} + +
    +
    \ No newline at end of file diff --git a/web/templates/manage.html b/web/templates/manage.html index 91f6f73..8b83596 100644 --- a/web/templates/manage.html +++ b/web/templates/manage.html @@ -1,12 +1,16 @@
    -
    Manage: - -
    +
    Manage links
    - + + + + + + + {{ range .bookmarks }} @@ -15,11 +19,14 @@
    {{ niceURL .URL }} - - + + + {{ end }} diff --git a/web/templates/search.html b/web/templates/search.html index 1e3d84d..54057b3 100644 --- a/web/templates/search.html +++ b/web/templates/search.html @@ -1,9 +1,9 @@
    -
    +
    -
    Search: +
    Search - Searching... + Searching...
    @@ -19,9 +19,9 @@
    - +
    {{ template "add_url_form.html" . }} - +
    idurlcreatedscraped
    idtitle/urltagscreatedscraped
    {{ .ID }} {{ (nicetime .TimestampCreated).HumanDuration }} ago{{ (nicetime .TimestampLastScraped).HumanDuration }} ago + {{ join .Tags ", " }} + {{ (nicetime .TimestampCreated).HumanDuration }} ago{{ (nicetime .TimestampLastScraped).HumanDuration }} ago - + scrape