diff --git a/etiquette/objects.py b/etiquette/objects.py index 05530aa..38a15b5 100644 --- a/etiquette/objects.py +++ b/etiquette/objects.py @@ -639,6 +639,13 @@ class Bookmark(ObjectBase): self._uncache() self.deleted = True + @property + def display_name(self): + if self.title: + return self.title + else: + return self.id + @decorators.required_feature('bookmark.edit') @decorators.transaction def edit(self, title=None, url=None): diff --git a/frontends/etiquette_flask/templates/bookmarks.html b/frontends/etiquette_flask/templates/bookmarks.html index dff02a5..70bbd3c 100644 --- a/frontends/etiquette_flask/templates/bookmarks.html +++ b/frontends/etiquette_flask/templates/bookmarks.html @@ -58,11 +58,7 @@ data-editor-placeholder="title (optional)" data-editor-empty-text="{{bookmark.id}}" > - {%- if bookmark.title -%} - {{bookmark.title}} - {%- else -%} - {{bookmark.id}} - {%- endif -%} + {{-bookmark.display_name-}}