1
0
mirror of https://github.com/aquatix/digimarks.git synced 2025-12-06 20:55:10 +01:00

Show url domain name along with 'no title' for items without title

This commit is contained in:
2016-08-29 13:49:29 +02:00
parent 197cb776bf
commit 0894770f12
2 changed files with 5 additions and 1 deletions

View File

@@ -203,6 +203,10 @@ class Bookmark(db.Model):
else:
return None
def get_uri_domain(self):
parsed = urlparse(self.url)
return parsed.hostname
@classmethod
def strip_url_params(cls, url):
parsed = urlparse(url)

View File

@@ -107,7 +107,7 @@
{% if bookmark.title %}
{{ bookmark.title }}
{% else %}
[ no title ]
{{ bookmark.get_uri_domain() }} (no title)
{% endif %}
</a>
</div>