mirror of
https://github.com/aquatix/digimarks.git
synced 2025-12-06 23:05:10 +01:00
Support read-only/editable and show/hide tags per view
This commit is contained in:
11
digimarks.py
11
digimarks.py
@@ -476,7 +476,16 @@ def bookmarks(userkey, filtermethod = None, sortmethod = None):
|
|||||||
bookmarks = Bookmark.select().where(Bookmark.userkey == userkey, Bookmark.status == Bookmark.VISIBLE).order_by(Bookmark.created_date.desc())
|
bookmarks = Bookmark.select().where(Bookmark.userkey == userkey, Bookmark.status == Bookmark.VISIBLE).order_by(Bookmark.created_date.desc())
|
||||||
|
|
||||||
theme = get_theme(userkey)
|
theme = get_theme(userkey)
|
||||||
return render_template('bookmarks.html', bookmarks=bookmarks, userkey=userkey, tags=tags, filter_text=filter_text, message=message, theme=theme)
|
return render_template('bookmarks.html',
|
||||||
|
bookmarks=bookmarks,
|
||||||
|
userkey=userkey,
|
||||||
|
tags=tags,
|
||||||
|
filter_text=filter_text,
|
||||||
|
message=message,
|
||||||
|
theme=theme,
|
||||||
|
editable=True, # bookmarks can be edited
|
||||||
|
showtags=True, # tags should be shown with the bookmarks
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -34,10 +34,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="card-reveal {{ theme.CARD_BACKGROUND }}">
|
<div class="card-reveal {{ theme.CARD_BACKGROUND }}">
|
||||||
<span class="card-title {{ theme.CARD_TEXT }}">Added @ {{ bookmark.created_date.strftime('%Y-%m-%d %H:%M') }}<i class="material-icons right">close</i></span>
|
<span class="card-title {{ theme.CARD_TEXT }}">Added @ {{ bookmark.created_date.strftime('%Y-%m-%d %H:%M') }}<i class="material-icons right">close</i></span>
|
||||||
|
{% if editable %}
|
||||||
<div class="{{ theme.CARD_TEXT }}" style="padding-top: 10px;">
|
<div class="{{ theme.CARD_TEXT }}" style="padding-top: 10px;">
|
||||||
<a href="{{ url_for('editbookmark', userkey=userkey, urlhash=bookmark.url_hash) }}" style="padding: 3px"><i class="tiny material-icons">mode_edit</i> EDIT</a>
|
<a href="{{ url_for('editbookmark', userkey=userkey, urlhash=bookmark.url_hash) }}" style="padding: 3px"><i class="tiny material-icons">mode_edit</i> EDIT</a>
|
||||||
<a href="{{ url_for('deletingbookmark', userkey=userkey, urlhash=bookmark.url_hash) }}" style="padding: 3px" class="red-text"><i class="tiny material-icons">delete</i> DELETE</a>
|
<a href="{{ url_for('deletingbookmark', userkey=userkey, urlhash=bookmark.url_hash) }}" style="padding: 3px" class="red-text"><i class="tiny material-icons">delete</i> DELETE</a>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
{% if showtags %}
|
||||||
<div class="digimark-card-header-tags">
|
<div class="digimark-card-header-tags">
|
||||||
{% for tag in bookmark.tags_list %}
|
{% for tag in bookmark.tags_list %}
|
||||||
<div class="chip">
|
<div class="chip">
|
||||||
@@ -45,6 +48,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user