29 lines
1.6 KiB
HTML
29 lines
1.6 KiB
HTML
{% set bookmark_url = None %}
|
|
{% if type == 'post' %}
|
|
{% set bookmark_url = url_for('api.bookmark_post', post_id=id) %}
|
|
{% else %}
|
|
{% set bookmark_url = url_for('api.bookmark_thread', thread_id=id) %}
|
|
{% endif %}
|
|
<div class="bookmarks-dropdown" data-bookmark-type="{{type}}" data-receive="saveBookmarks" data-bookmark-endpoint="{{bookmark_url}}" data-originally-contained-in="{{ selected.id if selected else ""}}" data-require-reload={{require_reload | int}} popover=auto>
|
|
<div class="bookmarks-dropdown-header">
|
|
<span>Bookmark collections</span>
|
|
{% if not require_reload %}
|
|
<a href="{{ url_for('users.bookmarks', username=get_active_user().username) }}">View bookmarks</a>
|
|
{% endif %}
|
|
</div>
|
|
<div class="bookmark-dropdown-items-container">
|
|
{%- for collection in collections -%}
|
|
{%- set pc = collection.get_posts_count() -%}
|
|
{%- set tc = collection.get_threads_count() -%}
|
|
<div class="bookmark-dropdown-item {{ "selected" if selected and (selected.id | int) == (collection.id | int) else ""}}" data-send="selectBookmarkCollection" data-receive="selectBookmarkCollection" data-collection-id="{{collection.id}}">
|
|
<span class="bookmark-dropdown-item-name">{{collection.name}}</span>
|
|
<span class="bookmark-dropdown-item-stats"><abbr title="{{ pc }} {{('post' | pluralize(pc))}}">{{ pc }}p</abbr>, <abbr title="{{ tc }} {{('thread' | pluralize(tc))}}">{{ tc }}t</abbr></span>
|
|
</div>
|
|
{%- endfor -%}
|
|
</div>
|
|
<span>
|
|
<input type="text" placeholder="Memo" class="bookmark-memo-input" value="{{memo}}"></input>
|
|
<button type="button" data-send="saveBookmarks">Save</button>
|
|
</span>
|
|
</div>
|