add bookmarks view
This commit is contained in:
56
app/templates/users/bookmarks.html
Normal file
56
app/templates/users/bookmarks.html
Normal file
@@ -0,0 +1,56 @@
|
||||
{%- from 'common/macros.html' import full_post, bookmark_menu with context -%}
|
||||
{%- from 'common/macros.html' import subheader, bookmark_button -%}
|
||||
{%- extends 'base.html' -%}
|
||||
{%- block title -%}bookmarks"{%- endblock -%}
|
||||
{%- block content -%}
|
||||
<bitty-8 data-connect="/static/js/bits/bookmark-menu.js"></bitty-8>
|
||||
<bitty-8 data-connect="/static/js/bits/bookmarks.js"></bitty-8>
|
||||
{%- call() subheader('Your bookmarks') -%}
|
||||
<fieldset class="plank even no-shadow minimal subheader-actions js-only" data-r="enhance">
|
||||
<legend>Actions</legend>
|
||||
<a href="{{url_for('users.bookmark_collections', username=get_active_user().username)}}" class="linkbutton">Manage collections</a>
|
||||
</fieldset>
|
||||
{%- endcall -%}
|
||||
<div class="plank">
|
||||
{%- for collection in collections -%}
|
||||
{%- set thread_count = collection.get_threads_count() -%}
|
||||
{%- set post_count = collection.get_posts_count() -%}
|
||||
<details class="separated" data-id="{{collection.id}}" data-r="restoreCollectionDetails setCollectionDetails" data-s="setCollectionDetails">
|
||||
<summary class="plank secondary-bg no-shadow even">{{collection.name}} ({{thread_count}} {{'thread' | pluralize(num=thread_count)}}, {{post_count}} {{'post' | pluralize(num=post_count)}})</summary>
|
||||
{%- if thread_count > 0 -%}
|
||||
<details class="inner" data-id="{{collection.id}}" data-r="restoreThreadDetails setThreadDetails" data-s="setThreadDetails">
|
||||
<summary class="plank no-shadow even">Threads</summary>
|
||||
<table class="three-cols">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="plank even no-shadow contrast-bg">Title</th>
|
||||
<th class="plank even no-shadow contrast-bg">Memo</th>
|
||||
<th class="plank even no-shadow contrast-bg">Manage</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{%- for bt in collection.get_threads() -%}
|
||||
{%- set thread = bt.get_thread() -%}
|
||||
<tr>
|
||||
<td class="plank even no-shadow minimal secondary-bg"><a href="{{url_for('threads.thread_by_id', thread_id=thread.id)}}">{{thread.title}}</a></td>
|
||||
<td class="plank even no-shadow minimal secondary-bg">{{bt.note}}</td>
|
||||
<td class="plank even no-shadow minimal secondary-bg">{{bookmark_button('thread', id=thread.id, text='Manage')}}</td>
|
||||
</tr>
|
||||
{%- endfor -%}
|
||||
</tbody>
|
||||
</table>
|
||||
</details>
|
||||
{%- endif -%}
|
||||
{%- if post_count > 0 -%}
|
||||
<details class="inner" data-id="{{collection.id}}" data-r="restorePostDetails setPostDetails" data-s="setPostDetails">
|
||||
<summary class="plank no-shadow even">Posts</summary>
|
||||
{%- for bp in collection.get_posts() -%}
|
||||
<div class="post plank no-shadow even">{{ full_post(bp.get_post().get_full_post_view(), render_sig=false, show_thread=true, show_reactions=false, tb_edit=false, tb_quote=false, tb_delete=false, bookmark_btn='Manage', tb_pretext=('memo: ' + bp.note) if bp.note else '') }}</div>
|
||||
{%- endfor -%}
|
||||
</details>
|
||||
{%- endif -%}
|
||||
</details>
|
||||
{%- endfor -%}
|
||||
</div>
|
||||
{{ bookmark_menu() }}
|
||||
{%- endblock -%}
|
||||
@@ -2,7 +2,7 @@
|
||||
{%- macro collection_item(name='', can_delete=true, id=-1, thread_count=0, post_count=0) -%}
|
||||
<input name="name[]" type="text" autocomplete="off" value="{{name}}" required maxlength=60 placeholder="Collection name">
|
||||
<input type="hidden" name="id[]" value="{{ 'new' if id == -1 else id}}" autocomplete="off">
|
||||
<span>{{thread_count}} {{'thread' | pluralize(num=thread_count)}}, {{post_count}} {{'post' | pluralize(num=post_count)}} </span>
|
||||
<span>{{thread_count}} {{'thread' | pluralize(num=thread_count)}}, {{post_count}} {{'post' | pluralize(num=post_count)}}</span>
|
||||
{%- if not can_delete -%}
|
||||
<i>Default collection</i>
|
||||
{%- else -%}
|
||||
@@ -20,7 +20,7 @@ Drag collections to reoder them. You cannot move or remove the default collectio
|
||||
<div data-r="enhanceHide">This page requires JS enabled to work correctly.</div>
|
||||
{%- endset -%}
|
||||
{%- call() subheader('Manage bookmark collections', sh) -%}
|
||||
<fieldset class="plank even no-shadow minimal thread-actions js-only" data-r="enhance">
|
||||
<fieldset class="plank even no-shadow minimal subheader-actions js-only" data-r="enhance">
|
||||
<legend>Actions</legend>
|
||||
<button data-s="addCollection">Add new collection</button>
|
||||
<input type="submit" class="alt" value="Save collections" form="collections-form">
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
{%- endset -%}
|
||||
{%- call() subheader("%s's posts" % target_user.get_readable_name(), td) -%}
|
||||
{%- if posts -%}
|
||||
<fieldset class="plank even no-shadow minimal thread-actions">
|
||||
<fieldset class="plank even no-shadow minimal subheader-actions">
|
||||
<legend>Page</legend>
|
||||
{{- pager(page, page_count) -}}
|
||||
</fieldset>
|
||||
@@ -19,7 +19,7 @@
|
||||
<div class="post plank">{{full_post(post, show_toolbar=false, show_thread=true, allow_reacting=false)}}</div>
|
||||
{%- endfor -%}
|
||||
<div class="plank">
|
||||
<fieldset class="plank even no-shadow minimal thread-actions">
|
||||
<fieldset class="plank even no-shadow minimal subheader-actions">
|
||||
<legend>Page</legend>
|
||||
{{- pager(page, page_count) -}}
|
||||
</fieldset>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
{%- endset -%}
|
||||
{%- call() subheader("%s's started threads" % target_user.get_readable_name(), td) -%}
|
||||
{%- if threads -%}
|
||||
<fieldset class="plank even no-shadow minimal thread-actions">
|
||||
<fieldset class="plank even no-shadow minimal subheader-actions">
|
||||
<legend>Page</legend>
|
||||
{{- pager(page, page_count) -}}
|
||||
</fieldset>
|
||||
@@ -22,7 +22,7 @@
|
||||
</div>
|
||||
{%- endfor -%}
|
||||
<div class="plank">
|
||||
<fieldset class="plank even no-shadow minimal thread-actions">
|
||||
<fieldset class="plank even no-shadow minimal subheader-actions">
|
||||
<legend>Page</legend>
|
||||
{{- pager(page, page_count) -}}
|
||||
</fieldset>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
{%- if is_logged_in() -%}
|
||||
|
||||
{%- if target_user.id == get_active_user().id -%}
|
||||
<fieldset class="plank even no-shadow minimal thread-actions">
|
||||
<fieldset class="plank even no-shadow minimal subheader-actions">
|
||||
<legend>Actions</legend>
|
||||
<form action="{{url_for('users.log_out')}}" method="POST">
|
||||
<input type="submit" class="warn" value="Log out">
|
||||
@@ -16,9 +16,9 @@
|
||||
{%- endif -%}
|
||||
|
||||
{%- if get_active_user().is_mod() and target_user.id != get_active_user().id and target_user.permission < get_active_user().permission -%}
|
||||
<fieldset class="plank even no-shadow minimal thread-actions">
|
||||
<fieldset class="plank even no-shadow minimal subheader-actions">
|
||||
<legend>Moderation actions</legend>
|
||||
<form class="thread-actions" method="POST">
|
||||
<form class="subheader-actions" method="POST">
|
||||
{{csrf_input() | safe}}
|
||||
{%- if target_user.is_guest() -%}
|
||||
<input class="warn" type="submit" value="Approve user" formaction="{{url_for('mod.make_user_regular', user_id=target_user.id)}}">
|
||||
|
||||
Reference in New Issue
Block a user