add ability to bookmark posts and threads, courtesy of bitty
This commit is contained in:
@@ -28,6 +28,14 @@
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro bookmark_button(type, id, message = "Bookmark…", require_reload=false) %}
|
||||
{% set bid = type[0] + id | string %}
|
||||
<div class="bookmark-dropdown">
|
||||
<button type="button" class="contain-svg inline icon" data-bookmark-type="{{type}}" data-send="showBookmarkMenu" data-concept-id="{{id}}" data-bookmark-id="{{bid}}">{{ icn_bookmark(20) }}{{ message | safe }}</button>
|
||||
<div class="bookmark-dropdown-inner" data-receive="showBookmarkMenu" data-bookmark-id="{{bid}}" data-require-reload={{require_reload | int}}></div>
|
||||
</div>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro infobox(message, kind=InfoboxKind.INFO) %}
|
||||
<div class="{{ "infobox " + InfoboxHTMLClass[kind] }}">
|
||||
<span>
|
||||
@@ -104,7 +112,8 @@
|
||||
post, render_sig = True, is_latest = False,
|
||||
editing = False, active_user = None, no_reply = false,
|
||||
Reactions = none, show_thread_title = false,
|
||||
show_bookmark = false, memo = None, bookmark_message = "Bookmark…"
|
||||
show_bookmark = false, memo = None, bookmark_message = "Bookmark…",
|
||||
reload_after_bookmark = false
|
||||
) %}
|
||||
{% set postclass = "post" %}
|
||||
{% if editing %}
|
||||
@@ -182,7 +191,7 @@
|
||||
{% endif %}
|
||||
|
||||
{% if show_bookmark %}
|
||||
<button type="button" class="contain-svg inline icon">{{ icn_bookmark(20) }}{{ bookmark_message | safe }}</button>
|
||||
{{ bookmark_button(type="post", id=post.id, message=bookmark_message, require_reload=reload_after_bookmark)}}
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user