Use jinja filter to set default title.

This commit is contained in:
Imran Sobir 2017-02-23 19:29:49 +05:00
parent 4b643f0b74
commit 34abad27c4
2 changed files with 1 additions and 6 deletions

View File

@ -156,11 +156,6 @@ def qute_bookmarks(_url):
quickmarks = sorted(objreg.get('quickmark-manager').marks.items(),
key=lambda x: x[0]) # Sort by name
# bookmark title is url if bookmark has no title
for i, item in enumerate(bookmarks):
if not item[1]:
bookmarks[i] = (item[0], item[0])
html = jinja.render('bookmarks.html',
title='Bookmarks',
bookmarks=bookmarks,

View File

@ -53,7 +53,7 @@ th {
<tbody>
{% for url, title in bookmarks %}
<tr>
<td class="name"><a href="{{url}}">{{title}}</a></td>
<td class="name"><a href="{{url}}">{{title | default(url, true)}}</a></td>
<td class="url"><a href="{{url}}">{{url}}</a></td>
</tr>
{% endfor %}