From d39d79346071126d8d69ccf37597736c9758f037 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Tue, 16 Aug 2016 21:24:40 +0200 Subject: [PATCH] Support for notes --- digimarks.py | 3 +++ templates/bookmarks.html | 3 +++ templates/edit.html | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/digimarks.py b/digimarks.py index 5a1364e..07e4080 100644 --- a/digimarks.py +++ b/digimarks.py @@ -95,6 +95,7 @@ class Bookmark(db.Model): title = CharField(default='') url = CharField() + note = TextField(default='') #image = CharField(default='') url_hash = CharField(default='') tags = CharField(default='') @@ -346,6 +347,7 @@ def updatebookmark(userkey, request, urlhash = None): title = request.form.get('title') url = request.form.get('url') tags = request.form.get('tags') + note = request.form.get('note') starred = False if request.form.get('starred'): starred = True @@ -374,6 +376,7 @@ def updatebookmark(userkey, request, urlhash = None): bookmark.url = url bookmark.starred = starred bookmark.set_tags(tags) + bookmark.note = note bookmark.set_hash() #bookmark.fetch_image() if not title: diff --git a/templates/bookmarks.html b/templates/bookmarks.html index 1409efb..370775d 100644 --- a/templates/bookmarks.html +++ b/templates/bookmarks.html @@ -85,6 +85,9 @@ {% if bookmark.starred == True %} star {% endif %} + {% if bookmark.note %} +
description + {% endif %}
diff --git a/templates/edit.html b/templates/edit.html index 494fcc8..b6afc44 100644 --- a/templates/edit.html +++ b/templates/edit.html @@ -55,6 +55,12 @@
+ +
+ description + + +
{% if tags %}