Add Bookmark.display_name, just like Album.

This commit is contained in:
voussoir 2020-10-13 10:37:12 -07:00
parent 4a1aad4622
commit 6fb6b1eeb0
2 changed files with 8 additions and 5 deletions

View file

@ -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):

View file

@ -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-}}
</a>
<a