Add Bookmark.display_name, just like Album.
This commit is contained in:
parent
4a1aad4622
commit
6fb6b1eeb0
2 changed files with 8 additions and 5 deletions
|
@ -639,6 +639,13 @@ class Bookmark(ObjectBase):
|
||||||
self._uncache()
|
self._uncache()
|
||||||
self.deleted = True
|
self.deleted = True
|
||||||
|
|
||||||
|
@property
|
||||||
|
def display_name(self):
|
||||||
|
if self.title:
|
||||||
|
return self.title
|
||||||
|
else:
|
||||||
|
return self.id
|
||||||
|
|
||||||
@decorators.required_feature('bookmark.edit')
|
@decorators.required_feature('bookmark.edit')
|
||||||
@decorators.transaction
|
@decorators.transaction
|
||||||
def edit(self, title=None, url=None):
|
def edit(self, title=None, url=None):
|
||||||
|
|
|
@ -58,11 +58,7 @@
|
||||||
data-editor-placeholder="title (optional)"
|
data-editor-placeholder="title (optional)"
|
||||||
data-editor-empty-text="{{bookmark.id}}"
|
data-editor-empty-text="{{bookmark.id}}"
|
||||||
>
|
>
|
||||||
{%- if bookmark.title -%}
|
{{-bookmark.display_name-}}
|
||||||
{{bookmark.title}}
|
|
||||||
{%- else -%}
|
|
||||||
{{bookmark.id}}
|
|
||||||
{%- endif -%}
|
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a
|
<a
|
||||||
|
|
Loading…
Reference in a new issue