mirror of
https://github.com/sissbruecker/linkding.git
synced 2025-08-07 10:58:25 +02:00

* add bundle model and query logic * cleanup tests * add basic form * add success message * Add form tests * Add bundle list view * fix edit view * Add remove button * Add basic preview logic * Make pagination use absolute URLs * Hide bookmark edits when rendering preview * Render bookmark list in preview * Reorder bundles * Show bundles in bookmark view * Make bookmark search respect selected bundle * UI tweaks * Fix bookmark scope * Improve bundle preview * Skip preview if form is submitted * Show correct preview after invalid form submission * Add option to hide bundles * Merge new migrations * Add tests for bundle menu * Improve check for preview being removed
51 lines
1.8 KiB
Python
51 lines
1.8 KiB
Python
from bookmarks.models import BookmarkSearch
|
|
from bookmarks.views import contexts, turbo
|
|
|
|
|
|
def render_bookmark_update(request, bookmark_list, tag_cloud, details):
|
|
return turbo.stream(
|
|
request,
|
|
"bookmarks/updates/bookmark_view_stream.html",
|
|
{
|
|
"bookmark_list": bookmark_list,
|
|
"tag_cloud": tag_cloud,
|
|
"details": details,
|
|
},
|
|
)
|
|
|
|
|
|
def active_bookmark_update(request):
|
|
search = BookmarkSearch.from_request(
|
|
request, request.GET, request.user_profile.search_preferences
|
|
)
|
|
bookmark_list = contexts.ActiveBookmarkListContext(request, search)
|
|
tag_cloud = contexts.ActiveTagCloudContext(request, search)
|
|
details = contexts.get_details_context(
|
|
request, contexts.ActiveBookmarkDetailsContext
|
|
)
|
|
return render_bookmark_update(request, bookmark_list, tag_cloud, details)
|
|
|
|
|
|
def archived_bookmark_update(request):
|
|
search = BookmarkSearch.from_request(
|
|
request, request.GET, request.user_profile.search_preferences
|
|
)
|
|
bookmark_list = contexts.ArchivedBookmarkListContext(request, search)
|
|
tag_cloud = contexts.ArchivedTagCloudContext(request, search)
|
|
details = contexts.get_details_context(
|
|
request, contexts.ArchivedBookmarkDetailsContext
|
|
)
|
|
return render_bookmark_update(request, bookmark_list, tag_cloud, details)
|
|
|
|
|
|
def shared_bookmark_update(request):
|
|
search = BookmarkSearch.from_request(
|
|
request, request.GET, request.user_profile.search_preferences
|
|
)
|
|
bookmark_list = contexts.SharedBookmarkListContext(request, search)
|
|
tag_cloud = contexts.SharedTagCloudContext(request, search)
|
|
details = contexts.get_details_context(
|
|
request, contexts.SharedBookmarkDetailsContext
|
|
)
|
|
return render_bookmark_update(request, bookmark_list, tag_cloud, details)
|