Commit graph

5911 commits

Author SHA1 Message Date
Mouse Reeve
fed6bcd375
Merge pull request #2314 from chambersh1129/2194-normalize-stored-ISNI
Closes #2194 Normalize stored ISNI
2022-10-14 12:20:07 -07:00
Mouse Reeve
b02ad2ec68
Merge pull request #2316 from redshiftss/bugfix/reading-status-future
Make it so that finishing a book cannot happen in the future
2022-10-14 12:17:42 -07:00
Mouse Reeve
b06c35b7dd
Update forms.py 2022-10-14 12:06:54 -07:00
Laura Pircalaboiu
f97b6f3da2 fix pylint complaint 2022-10-12 11:25:03 +02:00
Laura Pircalaboiu
4ab5e4b5d9 re-format code 2022-10-11 14:40:52 +02:00
Laura Pircalaboiu
b895fbd8f2 fix bug, can no longer finish a book in the future 2022-10-11 14:40:45 +02:00
Laura Pircalaboiu
aeeb2c3442 WIP: fix reading status ending in the future 2022-10-11 14:40:32 +02:00
Hunter Chambers
32f68c3f62 remove trailing whitespace causing pylint/black errors 2022-10-10 14:13:57 -04:00
Hunter Chambers
02c7397eaf Closes #2194 Normalize stored ISNI 2022-10-09 19:36:24 -04:00
Mouse Reeve
74b89b2d4a That test didn't work 2022-10-04 12:09:05 -07:00
Mouse Reeve
5b5e15d48b Just adds a couple tests 2022-10-04 11:40:01 -07:00
Mouse Reeve
78d36ebc39 Fixes typo in tour 2022-09-24 19:41:37 -07:00
Mouse Reeve
3a73ced5fa Adds a couple tests to annual review views
Also I tweaked the save functions so they don't broadcast
2022-09-19 14:38:30 -07:00
Mouse Reeve
fdc477afdf
Merge pull request #2258 from bookwyrm-social/form-perms
Check permissions automatically on form save
2022-09-19 13:32:41 -07:00
Mouse Reeve
7d61cb55bc Ignore pylint complaints about argument counts to form saves 2022-09-19 13:23:18 -07:00
Mouse Reeve
35aebacf70 Fixes theme form and adds view tests 2022-09-19 13:13:21 -07:00
Mouse Reeve
bf092ec44e Small fixes 2022-09-19 12:10:27 -07:00
Mouse Reeve
4c099afc63 Python formatting 2022-09-19 11:23:40 -07:00
Mouse Reeve
37dacaff6f Fixes creating notifications for auto-moderation reports 2022-09-19 11:11:08 -07:00
Mouse Reeve
6947f3b787 Uses class method to get list of instance admins
Re-writing this query over and over is a bad approach
2022-09-19 10:43:52 -07:00
Mouse Reeve
9d8d85ebc1 Invite perms checks 2022-09-19 10:26:40 -07:00
Mouse Reeve
1e988cae6c More edit book lines 2022-09-19 10:26:29 -07:00
Mouse Reeve
be480e40f0 Updates links form saves 2022-09-19 10:18:30 -07:00
Mouse Reeve
3fd573c0da Check perms on site model form 2022-09-19 10:16:38 -07:00
Mouse Reeve
b0d8697006 Adds missing save in edit book view 2022-09-19 10:16:29 -07:00
Mouse Reeve
330be16516 Adds permissions checking for admin models 2022-09-19 10:12:47 -07:00
Mouse Reeve
e51980bc12 Use BookWyrmModel as parent for admin models
This will make them more internally consistent and give them built-in
permissions checking
2022-09-19 09:35:38 -07:00
Mouse Reeve
b0236b95bd Merge branch 'main' into form-perms 2022-09-19 09:32:48 -07:00
Mouse Reeve
3f5eb6c682 Adds raise_not_editable to User model
This model doens't inherit from BookwyrmModel for various reasons, but
it still needs to editability check.
2022-09-19 09:26:01 -07:00
Mouse Reeve
aa67f23b03 Override raise_not_editable for report model
This model uses "reporter" as the field that represents the onwer of the
object, and "user" and the subject. In retrospect, maybe not the ideal
way to do it.
2022-09-19 09:20:44 -07:00
Mouse Reeve
81d5195d20 Adds test 2022-09-15 11:12:05 -07:00
Mouse Reeve
fcd96c332d Null state 2022-09-15 11:09:07 -07:00
Mouse Reeve
d76eae358f Show queues and runtime instead of start time 2022-09-15 10:53:08 -07:00
Mouse Reeve
3739bdbf81 Better comments 2022-09-15 09:49:58 -07:00
Mouse Reeve
0f55b76a93 Adds celery status view 2022-09-14 18:58:51 -07:00
Mouse Reeve
fcf796abe1 Null state for review view during imports
Without this, it will show an empty progress bar and no info about why
the table is empty.
2022-09-14 18:08:16 -07:00
Hugh Rundle
aa18179dbc add migration 2022-09-10 10:27:17 +10:00
Hugh Rundle
0ad3dc6245 allow 0.5 star ratings 2022-09-10 07:24:11 +10:00
Hugh Rundle
230d30abb8 sidebar review stars should default to zero
PR #2283 surfaced an existing formerly-hidden issue with star rating defaults in the sidebar of book pages.
This commit ensures the default rating is zero, not half a star.

Fixes #2291
2022-09-10 07:03:12 +10:00
Mouse Reeve
543d13af6e Removes explicit calls to raise_not_editable from views
These raises are handled implicitly in the form, so they don't have to
be called outright.
2022-09-08 11:03:06 -07:00
Mouse Reeve
351292fcda Catches places where form.save() needs the request
Thank you, tests.
2022-09-08 11:02:17 -07:00
Mouse Reeve
c71d133d2c
Merge pull request #2288 from mooseyboots/del-notifs-button
conditional display of notifs button
2022-09-08 10:16:07 -07:00
Mouse Reeve
834c7e9cd5
Merge pull request #2282 from hughrun/normalise-isbn
Normalise ISBNs for searching
2022-09-08 10:14:30 -07:00
marty hiatt
b4cc9f5753 conditional display of notifs button 2022-09-01 11:54:49 +02:00
Hugh Rundle
1ee2ff4811 normalise isbn on local book search
- uppercase ISBN before checking it's a number to account for trailing 'x'
- check maybe_isbn for search_identifiers search. Without this we are only searching external connectors, not locally!
2022-08-30 20:00:09 +10:00
Hugh Rundle
68d91086ed add wonky ISBN test 2022-08-30 19:57:25 +10:00
Mouse Reeve
1f93dc9c62
Merge pull request #2260 from bookwyrm-social/mentions
Refactors how mentions are collected
2022-08-29 15:17:40 -07:00
Mouse Reeve
e782b3f360 Fixes logic that displays search remote or manually add link 2022-08-29 14:03:47 -07:00
Mouse Reeve
98562dc92f Allow x in isbn path 2022-08-29 13:41:49 -07:00
Mouse Reeve
775ee6f590
Merge pull request #2283 from hughrun/halfstars
fix visibility of stars when editing a review
2022-08-29 13:39:47 -07:00
Mouse Reeve
f0effb9d3e Uses theme in remote follow template 2022-08-29 07:10:36 -07:00
Hugh Rundle
252fe7fd6a fix visibility of stars when editing a review
Previously the star rating appeared to be five stars when editing a review, regardless of what value was actually stored.
Now it will show the actual rating, including half stars.

Fixes #2213
2022-08-29 14:02:04 +10:00
Hugh Rundle
18d3d2f85d linting 2022-08-28 17:30:46 +10:00
Hugh Rundle
f219851f3a strip leading and following spaces from ISBN 2022-08-28 17:28:00 +10:00
Hugh Rundle
da5fd32196 normalise isbn searching
ISBNs are always numeric except for when the check digit in ISBN-10s is a ten, indicated with a capital X.
These changes ensure that ISBNs are always upper-case so that a lower-case 'x' is not used when searching.

Additionally some ancient ISBNs have been printed without a leading zero (i.e. they only have 9 characters on the physical book). This change prepends a zero if something looks like an ISBN but only has 9 chars.
2022-08-28 11:05:40 +10:00
Mouse Reeve
58c3a4c2bc
Merge pull request #2277 from hughrun/permissions
hide replies to posts user cannot see
2022-08-23 19:48:36 -07:00
Hugh Rundle
cc97c52d12 make get_audience logic clearer
Retains 'direct' messages at the top of the logic tree to make it easier to understand.
In practice because direct messages are excluded from feeds anyway, this doesn't seem to make much difference, but it's easier to read.
2022-08-21 09:33:43 +10:00
Hugh Rundle
8d593e4498 hide replies to posts user cannot see
This is in response to #1870

Users should not see links to posts they are not allowed to see, in their feed. The main question is how to stop that happening.
This commit hides all replies to posts if the original post was "followers only" and the user is not a follower of the original poster. The privacy of the reply is not considered relevant (except "direct").

I believe this is the cleanest way to deal with the problem, as it avoids orphaned replies and confusing 404s, and a reply without access to the context of the original post is not particularly useful to anyone. This also feels like it respects the wishes of the original poster more accurately, as it does not draw attention from non-followers to the original followers-only post.

A less draconian approach might be to remove the link to the original status in the feed interface, however that simply leads to confusion of another kind since it will make the interface inconsistent.

This commit does not change any ActivityPub behaviour - it only affects the Bookwyrm user feeds. This means orphaned posts may be sent to external apps like Mastodon.
2022-08-14 14:17:10 +10:00
Hugh Rundle
22495e40bd strip spaces from user search
Strips leading and trailing spaces from user search to prevent errors when doing webfinger lookup.
Prior to this, webfinger user queries included everything after the second '@' as part of the hostname. This resulted in failed webfinger requests when there was one or more trailing spaces.
Fixes #2205
2022-08-13 15:40:53 +10:00
Mouse Reeve
d58282bc37
Merge pull request #2263 from bookwyrm-social/safer-book-description
Safer display of book descriptions
2022-08-09 10:21:11 -07:00
Mouse Reeve
0cf9e1033b Safer display of book descriptions 2022-08-07 13:26:05 -07:00
Mouse Reeve
1581491471 Removes duplicate version warning 2022-08-05 17:03:56 -07:00
Mouse Reeve
c8fc907705 Update version 2022-08-05 16:54:55 -07:00
Mouse Reeve
5c3bb2da13 Refactors how mentions are collected
This should be quicker, because it queries the users in one go instead
of jumping straight to iterating over them, and it checks if a user
blocks the poster before allowing them to be tagged.
2022-08-05 14:06:39 -07:00
Mouse Reeve
9d7ece47ef
Merge pull request #2254 from bookwyrm-social/fixes-search-pagination
Fixes search pagination
2022-08-05 12:32:47 -07:00
Mouse Reeve
9fad5b5623 Fixes isbn view 2022-08-05 11:44:10 -07:00
Mouse Reeve
bdf563748c
Merge pull request #2255 from joachimesque/front/mobile-header
Add notifications count on mobile header
2022-08-05 11:28:42 -07:00
Mouse Reeve
7c7df99cef Fixes template syntax error 2022-08-05 11:14:14 -07:00
Mouse Reeve
20572688ba Removes test exception 2022-08-05 11:04:32 -07:00
Mouse Reeve
1ba69acc49 Adds unit tests that checks if rel field is set on links 2022-08-05 11:01:02 -07:00
Mouse Reeve
4dd7f88e0a Updates all links that open in new tabs 2022-08-05 10:20:43 -07:00
Mouse Reeve
9407695328 Updates footer links
Adds a missing rel="nofollow noopener noreferrer" attribute for the
Patreon link, and makes the github link open in a new tab (and updates
the url, which was out of date)
2022-08-05 10:06:12 -07:00
Mouse Reeve
8f79b362f8 Check permissions automatically on form save 2022-08-05 09:56:32 -07:00
Mouse Reeve
2894aa37a2 Fixes perms checks for groups 2022-08-05 09:12:48 -07:00
Mouse Reeve
b4cfda0587 Updates tests 2022-08-05 08:56:24 -07:00
Joachim
610d8fdf5b Add notifications count on mobile header 2022-08-05 11:15:11 +02:00
Mouse Reeve
ed71b791c9 Python formatting 2022-08-04 12:19:26 -07:00
Mouse Reeve
48df5076e7 Use elided page range and paginate user and list results 2022-08-04 12:11:39 -07:00
Mouse Reeve
06d1936ac9 Fixes pagination of local search results 2022-08-04 12:04:13 -07:00
Mouse Reeve
3270d0a7d4
Merge pull request #2247 from bookwyrm-social/followers-following-views
Merges follower/following views
2022-08-02 11:59:06 -07:00
Mouse Reeve
0bc3c3b5f6 Adds locale migration 2022-08-02 11:09:58 -07:00
Mouse Reeve
f9b772e234 Adds polish locale 2022-08-02 10:59:40 -07:00
Mouse Reeve
6d258d5445 Fixes test mocks 2022-07-30 10:07:13 -07:00
Mouse Reeve
d7bf348c77
Merge pull request #2249 from bookwyrm-social/crsf-exempt
Removes improperly placed csrf_exempt decorator
2022-07-29 13:49:29 -07:00
Mouse Reeve
8e2a8ec6e0 Removes improperly places csrf_exempt decorator 2022-07-29 13:40:40 -07:00
Mouse Reeve
96f1521239
Merge pull request #2248 from bookwyrm-social/list-suggestions
Move list suggestions into helper function
2022-07-29 13:27:04 -07:00
Mouse Reeve
844023f104
Merge pull request #2246 from bookwyrm-social/goal-model
Moves annual goal to its own file
2022-07-29 13:22:12 -07:00
Mouse Reeve
d301cecc9f Move list suggestions into helper function
The view was complicated, this makes it a little easier to read and
test.
2022-07-29 13:15:24 -07:00
Mouse Reeve
23188dfc5f
Merge branch 'main' into followers-following-views 2022-07-29 13:09:30 -07:00
Mouse Reeve
d458001491 Merges follower/following views
They were almost identical!
2022-07-29 13:07:15 -07:00
Mouse Reeve
2298a478cf Moves annual goal to its own file
The user model file is just,, very long
2022-07-29 13:00:59 -07:00
Mouse Reeve
f52965b8f4 Fixes a couple typos 2022-07-29 12:08:36 -07:00
Mouse Reeve
29db9c68a1 Fixes typo and spacing 2022-07-29 11:31:35 -07:00
Mouse Reeve
868ab62863 Fixes template string quote escapes
It seems totally reasonable that using an escape slash would make
apostrophes in words work, but the translation system works in
mysterious ways that do not include supporting that. I've used backticks
as a third quote type to escape everything in a way that both
javascript and gettext understand.

While I was there I split up some strings that have more complicated
html in them, since that can be fragile when passed through translation,
and confusing for translators.
2022-07-29 11:22:31 -07:00
Mouse Reeve
2837d0148f Checks permissions when saving a list 2022-07-28 11:44:04 -07:00
Mouse Reeve
85dce81b6a Adds unit test or list create perms 2022-07-28 11:42:27 -07:00
Mouse Reeve
ed20587695
Merge pull request #2168 from hughrun/tour
Add guided tour / walkthrough
2022-07-28 11:08:49 -07:00
Hugh Rundle
2455aadbfd add scrollTo where needed
A couple of tour steps could benefit from a scrollTo for users on smallers screens.
2022-07-27 15:53:54 +10:00
Hugh Rundle
a4714f097f fix anchors not working on homepage tour
Fixes bug on larger screens.

We need to use a function to set the anchor for tour steps when using menus and other elements that become visible or hidden responsively. Because the element is still in the DOM, we can't just rely on it disappearing completely, we have to assign a different (visible) element otherwise the step will simply disappear and the user cannot continue the tour. Previously this used a simple selector which didn't work due to the above.
2022-07-27 15:14:28 +10:00
Mouse Reeve
f3bc7d759f Only show pending follow requests from active users 2022-07-24 12:26:58 -07:00
Mouse Reeve
0217d36f7b Show lists to logged out viewers
The activitystreams for lists require a logged in user, so this just
uses a simple database query of all public lists when there is no logged
in user.
2022-07-23 20:42:40 -07:00
Mouse Reeve
639b727c92 Fixes perms check for ratings 2022-07-17 16:21:43 -07:00
Mouse Reeve
3f5bb41380 Unit test for creating rating status 2022-07-17 16:18:59 -07:00
Hugh Rundle
356c1c0b62 fix migration dependency order
Show_guided_tour needs to come after alter_user_preferred_language due to conficts. I think.
2022-07-17 16:34:42 +10:00
Hugh Rundle
17dc5e7eb1 Merge branch 'main' into tour
- we need to do this because of conflicting migrations
2022-07-17 16:30:45 +10:00
Hugh Rundle
c48ddf419d cleanup 2022-07-17 16:19:55 +10:00
Hugh Rundle
bec2943aad remove console logs 2022-07-17 16:17:08 +10:00
Hugh Rundle
387f2a70c9 update tour text
- new classname for posting guide
- various improvements to wording
- use function to find responsive menu elements
- add scrollTo transitions where needed
2022-07-17 16:13:12 +10:00
Hugh Rundle
43c598d92c remove DMs from guided tour 2022-07-17 11:11:34 +10:00
Mouse Reeve
d3f35fb691 Adds Catalan 2022-07-15 12:28:31 -07:00
Mouse Reeve
4a82bef9a6 Ticks version number 2022-07-15 12:21:25 -07:00
Mouse Reeve
086ec10849
Merge pull request #2229 from bookwyrm-social/password-validation
Password validation
2022-07-15 11:53:27 -07:00
Mouse Reeve
65117fe3c6 Use manual password field to customize id 2022-07-15 11:41:39 -07:00
Mouse Reeve
b1f5171502 Updates reset password tests 2022-07-15 11:39:29 -07:00
Mouse Reeve
3846b201bd Updates reset password flow to use validators 2022-07-15 11:39:18 -07:00
Mouse Reeve
1bb0a9d998 Updates tests 2022-07-15 11:18:47 -07:00
Mouse Reeve
b62f8eff42 Updates method decorators 2022-07-15 10:59:35 -07:00
Mouse Reeve
659ee96002 Use password validation in change password flow
This also moves the form validation into a form instead of doing it in
the view.
2022-07-15 10:51:58 -07:00
Mouse Reeve
4a65ee326a Use password validation in register view 2022-07-15 09:59:57 -07:00
Mouse Reeve
d74d59a57b Disable pylint complaint 2022-07-15 09:33:13 -07:00
Mouse Reeve
7fdfd0c9c7 Check permissions when creating a status 2022-07-15 09:26:52 -07:00
Mouse Reeve
5ecd75ee24 Remove redirecting to "next"
This wasn't even particularly working
2022-07-14 12:54:02 -07:00
Mouse Reeve
aa579605e0
Merge pull request #2224 from bookwyrm-social/email-not-found-text
Remove error reporting on resend to invalid email address
2022-07-14 12:34:14 -07:00
Mouse Reeve
69728439c8 Remove error reporting on resend to invalid email address 2022-07-14 12:23:43 -07:00
Mouse Reeve
317a239d40 Update shelf test now that it has multiple users 2022-07-14 12:10:29 -07:00
Mouse Reeve
3f47cca5e6 Python formatting 2022-07-14 11:56:18 -07:00
Mouse Reeve
c21864a1ac Merge branch 'main' into shelf-edit-perms 2022-07-14 11:50:27 -07:00
Mouse Reeve
95a72ae902
Merge pull request #2222 from bookwyrm-social/redirects
Removes insecure redirects
2022-07-14 11:46:47 -07:00
Mouse Reeve
73c4a01a6e Test for PermissionDenied error, not isNone 2022-07-14 11:45:59 -07:00
Mouse Reeve
4f1283ff52 Check editability before creating shelf 2022-07-14 11:42:59 -07:00
Mouse Reeve
05716c3578 Adds unit test for creating shelves for another user 2022-07-14 11:38:53 -07:00
Mouse Reeve
661865de87 Remmoves insecure redirects
This should really fundamentally work differently, but this is a quick
for for now to avoid an insecure redirect. There will be a negative
impact on user experience from this, and a followup change should look
into these views and improve their flow.
2022-07-14 11:22:17 -07:00
Mouse Reeve
235e877b3d Reverse order of notification users lists
Should show newest first
2022-07-14 11:00:05 -07:00
Mouse Reeve
3670ae46ec Reverse order of notification related users 2022-07-12 10:32:56 -07:00
Mouse Reeve
77bff3b263
Merge pull request #2217 from bookwyrm-social/connector-exceptions
Log failing to connect as info instead of exception
2022-07-11 09:04:01 -07:00
Mouse Reeve
5706028656 Log failing to connect as info instead of exception
These are normal, expected errors, and while we should probably
re-evaluate the connectors in some way, pending that, there's no need to
log these as unepected errors, which causes confusion and clutters my
error logging.
2022-07-11 08:47:18 -07:00
Mouse Reeve
f1ae64543f
Merge pull request #2216 from bookwyrm-social/export-post
Use HTTP post for CSV export
2022-07-11 08:14:47 -07:00
Mouse Reeve
9104d1f8db Fixes reference to renamed view 2022-07-11 08:05:32 -07:00
Mouse Reeve
42e29e40b3 Use HTTP post for csv export
Also fixes a missing translation string
2022-07-11 07:51:51 -07:00
Mouse Reeve
a0e01af2ca Updates tests 2022-07-10 20:22:54 -07:00
Mouse Reeve
f44b3cc4b2 Improves change password flow
There are two changes: one is to require the current password to change
your password (which is a security improvement), and the other is error
reporting when you either get your current password wrong or your new
password doesn't match it's second entry.
2022-07-10 20:05:54 -07:00
Mouse Reeve
64bfe5934f Tick version number
This was reported as a security issue, so updating the version number
to indicate where the issue has been fixed.
2022-07-10 09:39:51 -07:00
Mouse Reeve
7a772c7d3e Use POST instead of GET for logout function 2022-07-10 09:30:39 -07:00
Hugh Rundle
6b1fcc3cbb use class instead of id for spoilers tour 2022-07-10 13:16:28 +10:00
Hugh Rundle
126fd4e634 various wording updates to guided tour 2022-07-10 11:27:01 +10:00
Hugh Rundle
a84deff119 add scrollTo for link step on home tour 2022-07-10 11:26:14 +10:00
Hugh Rundle
142c0e1a59 fix template error in search tour 2022-07-10 10:58:48 +10:00
Hugh Rundle
37c2ad11b6 fix border radius on shepherd messages
remove bottom border radius from message text and top border radius from message footer on guided tour popovers.
2022-07-10 09:54:19 +10:00
Hugh Rundle
e1acdd0062 fix migrations
There was a conflict due to the order of migrations. Hopefully this commit fixes it!
2022-07-10 09:53:43 +10:00
Mouse Reeve
591c4d9b75 Fixes numbering on book lists 2022-07-09 13:33:58 -07:00
Mouse Reeve
85f811022f
Merge pull request #2210 from bookwyrm-social/notification-cw
Show content warning in notification status previews
2022-07-09 13:29:22 -07:00
Mouse Reeve
be5e1be5f6 Use content warnings in notifications 2022-07-09 13:12:46 -07:00
Mouse Reeve
11a0c1691b Move status_preview snippet to notifications directory
That's the only place it's used, always nice to de-clutter the snippets
directory
2022-07-09 12:40:21 -07:00
Mouse Reeve
f92b4548b1 Fixes get_or_create error when multiple matching notifications exist 2022-07-09 12:30:05 -07:00
Mouse Reeve
c092d952bd Adds test to catch notification error 2022-07-09 12:29:29 -07:00
Mouse Reeve
a7553c0b8c Return HttpResponse instead of redirects for AJAX follows
This is more efficient, and most follow activities are ajax
2022-07-09 12:20:18 -07:00
Mouse Reeve
923495e454 More accurate button display
Now, a follow button will show as pending even if the user doesn't
manually approve followers, if that's the state the request is in.
2022-07-09 12:19:28 -07:00
Hugh Rundle
ab5e4128e6 Merge branch 'main' into tour
Also fixes conflict
2022-07-09 20:54:48 +10:00
Hugh Rundle
8fbd634ee8 add id to dm box 2022-07-09 20:52:03 +10:00
Hugh Rundle
48bcb85e24 resolve conflict 2022-07-09 20:12:46 +10:00
Hugh Rundle
02c6932409 lint migration file 2022-07-09 20:10:28 +10:00
Hugh Rundle
245120e7ca resolve git conflict with main branch 2022-07-09 20:08:23 +10:00
Hugh Rundle
baad1314d8 default existing users to no tour 2022-07-09 19:51:05 +10:00
Hugh Rundle
495bac2b50 transfer tour from group to DM 2022-07-09 19:38:44 +10:00
Hugh Rundle
2f2ab5c24a add DM tour
- rearrange script includes on feed pages
- add DM tour to close
2022-07-09 19:27:42 +10:00
Hugh Rundle
791847d75e add timeline info to home tour 2022-07-09 19:27:12 +10:00
Hugh Rundle
c68c7216f3 minor wording updates for tour 2022-07-09 17:49:56 +10:00
Hugh Rundle
6df09eb5d7 update user groups tour
- use strong instead of code
- clean up templates
- use notification styling for actions
- update wording
2022-07-09 17:39:22 +10:00
Hugh Rundle
07a882692c update lists tour
- cleaner templates
- send user directly to their Groups page at end of section
2022-07-09 17:31:04 +10:00
Hugh Rundle
d67c6dc92b user books tour update
- add element highlights
- fix template text
- replace code with strong
2022-07-09 16:56:07 +10:00
Hugh Rundle
e85e4a5467 update book page tour
- styling for next action
- replace code with strong
- clean up wording
- make translation templates cleaner
2022-07-09 15:30:45 +10:00
Hugh Rundle
bb85d3cdb2 update search tour
- action styling
- code to strong
2022-07-09 15:16:27 +10:00
Hugh Rundle
bb4b1a14fd update user profile tour styles 2022-07-09 15:10:52 +10:00
Hugh Rundle
5472cdcad7 update homepage tour
- add highlights to some elements
- consolidate message text for easier translation
- emphasise action with notification style
2022-07-09 15:00:30 +10:00
Hugh Rundle
b36968166e fix import message
import files don't import shelves, only books.
2022-07-09 14:47:31 +10:00
Hugh Rundle
3c317d509d fix sass styles import bug
Using @import caused styles to double up on elements, in some cases preventing the correct override behaviour.
Usint @use instead fixes this, and is recommended by Sass for exactly this reason.
2022-07-09 14:42:42 +10:00
Hugh Rundle
b41c826a0d custom style for highlighting tour anchorpoints 2022-07-09 14:29:04 +10:00
Hugh Rundle
68308aaa79 update tour colour scheme
- use info instead of default
- increase box shadow
- arrows at top should match header colour
2022-07-09 12:35:06 +10:00
Hugh Rundle
56b91f4c6d fix incorrect tour step header 2022-07-09 10:37:08 +10:00
Hugh Rundle
4d843b583d move shelve button tour id to prevent duplicates 2022-07-09 10:32:04 +10:00
Hugh Rundle
389da79af4 fix missing hyphen 2022-07-09 10:31:40 +10:00
Hugh Rundle
53a89f69e7 guided tour only for request.user 2022-07-09 10:23:09 +10:00
Hugh Rundle
3365bb6d35 show_guided_tour is not added to AP serialisation 2022-07-09 10:17:10 +10:00
Mouse Reeve
bd6774fca8
Merge pull request #2202 from bookwyrm-social/settings-warnings
New and improved warnings on the admin dashboard
2022-07-08 15:39:23 -07:00
Mouse Reeve
147d092eac Removes line breaks from warning links 2022-07-08 15:29:55 -07:00
Mouse Reeve
36553ef2a9 Suppress protected-access warning on admin dashboard 2022-07-08 12:22:23 -07:00
Mouse Reeve
d0e986c283 Hide DMs from profile page 2022-07-08 12:19:51 -07:00
Mouse Reeve
441fef9e86 Use javascript to send DMs
This fixes the draft cache issue and also the weird redirects
2022-07-08 12:11:00 -07:00
Mouse Reeve
ba7ae46c75 Adds warnings for missing privacy policies and codes of conduct 2022-07-08 11:59:21 -07:00
Mouse Reeve
4a2e191d92 Refactors dashboard warnings
This cleans up the display so that they don't get all squished when a
bunch are present, and creates a layout to make them more DRY
2022-07-08 11:38:27 -07:00
Mouse Reeve
b62bb157c0 Fixes links to documentation pages 2022-07-08 09:44:41 -07:00
Mouse Reeve
65f55fe324 Fixes link to remote instance user list 2022-07-08 09:26:11 -07:00
Mouse Reeve
be86fef42d Move deleted users to a separate tab
Since there's nothing to be done with them, they get their own tab.
2022-07-08 09:21:48 -07:00
Mouse Reeve
5bb001e15f Show avatars in user admin view
I find this helpful as a rough hueristic for how engaged a user is -- if
they've never added an avatar, it's often the case that they never
really got further in to using the app than just registering a username.
Also, on one occassion, a user had an avatar that violated the instance
ToS, which would have been handy to see at a glance in this list.
2022-07-08 09:10:29 -07:00
Mouse Reeve
a972c58f3b Fixes errors in permissions 2022-07-07 14:01:51 -07:00
Mouse Reeve
948f2964ac Updates admin tests to use perms instead of superuser
Superuser overrides all perms, so this was hiding simple typo-related
bugs in the permissions system
2022-07-07 14:01:05 -07:00
Mouse Reeve
742d97b177 Python formatting 2022-07-07 12:23:10 -07:00
Mouse Reeve
76c466ee45 Fixes cache invalidation for editions
Your reading status is shown across all editions of a work, so when you
change your status in relation to the edition you're currently reading,
it needs to invalidate the cached values for all editions of that work.
2022-07-07 12:21:24 -07:00
Mouse Reeve
076ba6f0ae Dramatically reduce cache duration for reading statuses
I originally set this for a very long timeout because this value should
be invalidated when it needs to be by the models, and if that worked
perfectly, this would reduce queries dramatically for books that show up
in ones feed frequently, but don't change status (for example, a book
you read and your friend is currently posting about). In practice, of
course, there are errors in invalidating this cache which leave this
value appearing extremely broken and it's next to impossible to fix.

This change makes each of the timeouts related to reading an hour, which
will still give performance benefit when browsing the site (especially
for loading the same book multiple times on a page), but resolve
naturally if the cache gets into a bad state.
2022-07-07 12:06:06 -07:00
Mouse Reeve
1a082b5ee8 Settings 2022-07-07 11:37:34 -07:00
Mouse Reeve
634ed50044 Tests for image generator file
This isn't what I need to be working on right now but it bugs me
immensely that the test coverage is at 89% and not 90% and this was the
lowest hanging fruit to get more coverage. Truly a me problem.
2022-07-07 10:24:19 -07:00
Mouse Reeve
0b7c8e8dc0
Merge pull request #2082 from bookwyrm-social/notifications
Notifications refactor
2022-07-07 09:34:19 -07:00
Mouse Reeve
a5e761b134 Group accept and leave notification 2022-07-07 08:55:17 -07:00
Mouse Reeve
fd5e513ad6 Update password reset copy so as not to reveal whether the email exists
A malicious user could use this to test which email addresses are in the
user database.
2022-07-06 19:34:00 -07:00
Mouse Reeve
cded3e973d Fixes html on notifications page 2022-07-06 19:16:14 -07:00
Mouse Reeve
26a1f75e91 Group notification types by feature 2022-07-06 19:15:48 -07:00
Mouse Reeve
6a5323c6e7 More tests for more notification types 2022-07-06 19:15:35 -07:00
Mouse Reeve
96bf99034c
Merge pull request #2189 from bookwyrm-social/extraneous_page_number
Removed incorrect and duplicate page indicator from content status
2022-07-06 16:38:09 -07:00
Mouse Reeve
4bb3a7e4cd Removed incorrect and duplicate page indicator from content status 2022-07-06 15:27:48 -07:00
Mouse Reeve
04f9b9180d Adds test file for utils 2022-07-06 15:07:46 -07:00
Mouse Reeve
d3023f350d Adds tests to site admin view 2022-07-06 15:04:27 -07:00
Mouse Reeve
221b5138e8 Adds merge migration 2022-07-06 14:42:58 -07:00
Mouse Reeve
5a6ef7ccd8 Merge branch 'main' into notifications 2022-07-06 14:41:15 -07:00
Mouse Reeve
dda6126329 Fixes typo in group notification 2022-07-06 14:33:45 -07:00
Mouse Reeve
2cda9d5567 Test leaving a group (as opposed to being removed)
This test will catch my typo in generating the notifications
2022-07-06 14:31:38 -07:00
Mouse Reeve
079f6d304e Python formatting 2022-07-06 12:22:07 -07:00
Mouse Reeve
9fceeb3eda Adds another missing migration 2022-07-06 12:17:24 -07:00
Mouse Reeve
b2a8a04092 Removes unnecessary imports 2022-07-06 11:24:04 -07:00
Mouse Reeve
9c21d1c06f Adds more automod tests 2022-07-06 11:15:30 -07:00
Mouse Reeve
7a9d320afd Expands automod view test 2022-07-06 10:52:50 -07:00
Mouse Reeve
574c1db732 Adds more templatetag tests 2022-07-06 10:52:45 -07:00
Mouse Reeve
87434fbb9d Adds a couple more edit book views tests 2022-07-06 10:38:22 -07:00
Mouse Reeve
f5638c1e44 Removed unused helper function 2022-07-06 10:05:55 -07:00
Mouse Reeve
f4dd14acad Adds more webfinger tests for helper functions 2022-07-06 10:05:47 -07:00
Mouse Reeve
c48fbd8753 Separates reporting and report admins tests 2022-07-06 09:47:48 -07:00
Mouse Reeve
b61a4ab994 Adds tests for unnotify 2022-07-06 08:51:35 -07:00
Mouse Reeve
003ef65db5 Adds missing migration 2022-07-05 18:01:10 -07:00
Mouse Reeve
d4f8a5f448 Fixes links to report modals 2022-07-05 17:43:03 -07:00
Mouse Reeve
4f386e8c4e Allow reports with no associated user 2022-07-05 17:19:03 -07:00
Mouse Reeve
0be4fec167 Don't assume that link domains have a known user
This is an edge case, and they OUGHT to have a user, but if the user was
deleted for a remote link, the field won't be able to resolve and the
user will be unset.
2022-07-05 16:51:03 -07:00
Mouse Reeve
24349b0a4c Updates notification view tests 2022-07-05 16:20:27 -07:00
Mouse Reeve
37bcb031f7 Adds notification model unit tests 2022-07-05 16:03:25 -07:00
Mouse Reeve
7fe722b595 Fixes follow request notifications
Since the main way to interact with them is by approving them in the
notification, I didn't group them
2022-07-05 15:04:14 -07:00
Mouse Reeve
e54c563865 Consistent use of plurals 2022-07-05 14:49:04 -07:00
Mouse Reeve
7508ae9eae Separate vars for user count and display counts 2022-07-05 14:25:42 -07:00
Mouse Reeve
8cbf8f62c7 List add notifications 2022-07-05 14:15:12 -07:00
Mouse Reeve
41f42e33ed Moves list add notification into notification model
Right now notifications are a mix of post-save signals and clauses in
the save function of the model. I'm not actually sure which is better,
but I'm moving them to signals where it's straightforward to be
consistent.
2022-07-05 13:28:09 -07:00
Mouse Reeve
736d29ea20 Updates group leave and remove notifications 2022-07-05 13:05:28 -07:00
Mouse Reeve
c65381adf9 Comma format count of other users in a notification 2022-07-05 12:49:02 -07:00
Mouse Reeve
79f3382ece Updates reports notification 2022-07-05 12:48:10 -07:00
Mouse Reeve
9e94a13acf Updates mention and reply notifications 2022-07-05 12:40:41 -07:00
Mouse Reeve
ee71f5df21 Updates language on boosts 2022-07-05 12:28:48 -07:00
Mouse Reeve
fc375bbab4 Finishes fav status translation strings 2022-07-05 12:21:22 -07:00
Mouse Reeve
97b53d4998
Merge pull request #2180 from bookwyrm-social/set-access-level-user
Fixes setting access level to "user"
2022-07-05 12:08:30 -07:00
Mouse Reeve
e2a50230c7 Fixes setting acces level to "user"
This wasn't working because "user" isn't a group, it's the absense of
any group.
2022-07-04 21:44:55 -07:00
Mouse Reeve
f76d661e07 Updates templates for fav notifications 2022-07-04 21:32:53 -07:00
Mouse Reeve
971bed9942 Notification field is read, not unread
Oops
2022-07-04 21:32:35 -07:00
Mouse Reeve
801ba03aaf Keep group as a foreign key field 2022-07-04 20:32:13 -07:00
Mouse Reeve
9948dd2356 Use enums in more models 2022-07-04 20:27:56 -07:00
Mouse Reeve
aeefd5a3e9 Use signal for creating group invite notification 2022-07-04 20:24:29 -07:00
Mouse Reeve
03f5a3f2c1 Use enums for notification types 2022-07-04 20:19:18 -07:00
Mouse Reeve
72a8229a5c Updates group notifications 2022-07-04 20:05:39 -07:00
Mouse Reeve
b193652a67 Python formatting 2022-07-04 19:58:27 -07:00
Mouse Reeve
dc8e61f316 Updates reports created in automod task 2022-07-04 19:57:58 -07:00
Mouse Reeve
62e57ac931 Adds notify and unnotify helper class methods
In the new paradigm, a notification related to a status has users added
to it and removed from it, rather than a new notification being added
every time. These helper functions make this behavior consistent.
2022-07-04 19:48:10 -07:00
Mouse Reeve
a9a2da0957 Keep status as a single field 2022-07-04 19:20:04 -07:00
Mouse Reeve
0cc2bc269e Updates view 2022-07-04 18:51:07 -07:00
Mouse Reeve
c7ecbb2fdf New migration file
I don't know why it felt important to do this but it did. The migrations
are in one file now and don't need a merge migration.
2022-07-04 18:42:56 -07:00
Mouse Reeve
a718a168a3 Merge branch 'main' into notifications 2022-07-04 17:38:21 -07:00
Mouse Reeve
5672c73ac4 Show deleted users as red in the user list
It can be hard to differentiate at a glance if a user is deleted or
suspended -- without this, you would have to read the deactivation
reason. By making deletions (moderator and self deletions) red, it's
clear at a glance if an account has been permanently deleted or just
temporarily suspended.
2022-07-04 17:33:10 -07:00
Mouse Reeve
9d9b7f366a Use "strip" in bleach
This removes forbidden html, rather than leaving them in place but
unrendered.
2022-07-04 13:55:58 -07:00
Mouse Reeve
70beb24d95 Removed misleading test
This wasn't really testing what I wanted it to.
2022-07-04 13:34:09 -07:00
Mouse Reeve
13376f8970 Catches missing reference to previous sanitizer 2022-07-04 13:24:13 -07:00
Mouse Reeve
62aa4bf869 Tick version number 2022-07-04 13:21:18 -07:00
Mouse Reeve
7f78140015 Uses library for html cleanup 2022-07-04 13:21:13 -07:00
Mouse Reeve
5d363da175 Handle getting edition data as dict or string 2022-07-03 11:05:20 -07:00
Mouse Reeve
0b900dc1ac
Merge pull request #2166 from bookwyrm-social/email-config-warning
Add warning to dashboard if email sender looks misconfigured
2022-07-03 10:49:14 -07:00
Mouse Reeve
89165fd909 Creates helper function for creating charts 2022-07-03 08:28:24 -07:00
Hugh Rundle
d1180d4216 linting fix for linting fix 2022-07-03 17:24:33 +10:00
Hugh Rundle
b82cf887e2 linting fixes 2022-07-03 17:14:13 +10:00
Hugh Rundle
f8e51b5826 format guided tour js with prettier 2022-07-03 16:24:34 +10:00
Hugh Rundle
0e9dc66ffa Merge branch 'main' into tour
Merging in latest changes from main, since I got covid and missed a few weeks.
2022-07-03 16:18:50 +10:00
Hugh Rundle
04324c00b4 back button on all tour modals 2022-07-03 16:12:17 +10:00
Hugh Rundle
39efb90870 add noscript message for guided tour 2022-07-03 16:10:32 +10:00
Hugh Rundle
3f67bc3b61 standardise ids for tour anchors
To make it harder to accidentally mess up the tour when making changes to pages, this commit adds ids with 'tour' prefixes to (nearly) all elements used by the guided tour as anchor points. The exception is where an element already had an id that is being used by something else in Bookwyrm.

Some minor changes also made to clean up the wording of the tour.
2022-07-03 15:57:10 +10:00
Hugh Rundle
a8940b8e12 Fix order of tour
The tour now shows users how to add a book first, then bookshelves, lists, and finally groups.
2022-07-03 14:48:23 +10:00
Mouse Reeve
e16506c1df Fixes logic error in checking relationships
I had the logic backwards for pending relationships.
2022-07-02 21:25:07 -07:00
Mouse Reeve
516c4a9790 Add warning to dashboard if email sender looks misconfigured
This can be a really obscure error, hopefully this warning will catch
potential issues.
2022-07-02 21:11:23 -07:00
Mouse Reeve
4ccbfb6b31
Merge pull request #2057 from bookwyrm-social/list-privacy
Re-consider list privacy on edit
2022-07-02 20:07:00 -07:00
Mouse Reeve
6e70ceb094 More mocks 2022-07-02 19:43:59 -07:00
Hugh Rundle
06b4a55979 add lists to guided tour
Takes user through the main /list page, as well as the options for creating a list.
2022-07-03 09:10:43 +10:00
Mouse Reeve
46421f9672 Mocks for lists model 2022-07-02 13:48:15 -07:00
Mouse Reeve
495bf203b0 Mocks inbox and search tests 2022-07-02 13:45:53 -07:00
Mouse Reeve
3ad0a5d073 Use update_fields to limit remove_list_tasks
If we know what fields were updated, we can avoid running this task.
This also adds some mocks where they are needed for the list view.
2022-07-02 13:23:23 -07:00
Mouse Reeve
13605b7d6a
Merge pull request #2164 from bookwyrm-social/federated-servers-admin
Federated servers admin
2022-07-02 12:17:14 -07:00
Mouse Reeve
aae02dff9a Merge branch 'main' into list-privacy 2022-07-02 12:16:39 -07:00
Mouse Reeve
94a6675dc4 Pylint fixes 2022-07-02 12:07:22 -07:00
Mouse Reeve
13e23a868d Adds instance name filter to federated instance list view
This lets you look for a specific server in your (probably very long)
instance list.
2022-07-02 11:12:15 -07:00
Mouse Reeve
e0a67f5e18 Uses := syntax in user admin view
I learned this! It's cool.
2022-07-02 11:06:48 -07:00
Mouse Reeve
cbb979242d
Revert "Use async requests for broadcasting" 2022-07-02 10:56:18 -07:00
Mouse Reeve
f5d6a18ce0 Alphabetize list of software options in federated instances list 2022-07-02 10:49:57 -07:00
Mouse Reeve
be76fe1494
Merge pull request #2143 from bookwyrm-social/async_broadcast
Use async requests for broadcasting
2022-07-02 10:23:02 -07:00
Hugh Rundle
827a63b4eb add shelves to guided tour 2022-07-02 18:46:16 +10:00
Hugh Rundle
d1079a1f7d remove console log from guided_tour.js 2022-07-02 18:44:18 +10:00
Mouse Reeve
e7b0a84ded
Merge pull request #2142 from bookwyrm-social/load-data-duration
Split expand book data task into per-edition tasks
2022-06-30 11:47:23 -07:00
Hugh Rundle
bc4a1c6c41 Guided tour of book page
This is intended to be one of the earlier pages in the tour. It should show users the concept of reading status, editions, and other useful points.
2022-06-19 14:06:36 +10:00
Hugh Rundle
ff37b77be9 clean up search guided tour code 2022-06-19 11:13:04 +10:00
Hugh Rundle
fef66a7cfe guided tour for book search
Adds a guided tour for book search page including logic for differing messages depending on what results are visible.
2022-06-19 11:08:01 +10:00
Hugh Rundle
0e06143c31 add guided tour to user shelves 2022-06-18 17:17:22 +10:00
Hugh Rundle
044a173095 remove CSRF from tour scripts 2022-06-18 17:16:43 +10:00
Hugh Rundle
57965973dc make guided tour cancel button DRY
Move cancel button function into a separate JS file.
The selector JS for this function cannot be within bookwyrm.js because the guided tour elements load after bookwyrm.js.
2022-06-18 13:27:00 +10:00
Hugh Rundle
5bf835b965 fix typos 2022-06-18 10:49:42 +10:00
Hugh Rundle
d36dd9ce96 guided tour for user groups
Includes adding creating a new group.
2022-06-18 10:48:14 +10:00
Hugh Rundle
00df3c94df add guided tour for user groups page
- add ID for add group button
- add tour steps for user groups page
- trigger tour steps if guided tour is turned on
2022-06-13 20:27:36 +10:00
Hugh Rundle
7fbc9914de change cancel buttons for guided tour
The first pop up in the guided tour on each page should provide a button to switch off the guided tour altogether, not simply cancel the current iteration.
If we don't do this, then the only way to turn off the guided tour is to go right to the end, which could be really irritating, especially for people who star the tour and then start exploring on their own.
2022-06-13 20:25:42 +10:00
Hugh Rundle
fbf7f37664 user profile tour only on activity tab 2022-06-13 19:36:14 +10:00
Hugh Rundle
aebeac9112 add guided tour to user profile
- adds ids to relevant elements to enable tour
- adds guided tour using Shepherd
2022-06-13 17:26:53 +10:00
Hugh Rundle
83e7302bc1 update home feed guided tour 2022-06-13 16:56:07 +10:00
Hugh Rundle
2030dc834f clean up tour files 2022-06-13 16:48:49 +10:00
Hugh Rundle
5f0e14934f add guided tour to main feed page
This uses an embedded script tag so that we can use django templates for logic - most importantly, we need to be able to use translations within the tour text.
2022-06-13 15:29:20 +10:00
Hugh Rundle
6ffb0863d1 update tour link in main template 2022-06-13 15:27:05 +10:00
Hugh Rundle
8cadb3dc3b fix guided tour url
Use a url fragment (<tour>) instead of a classic url param (/?tour=True)
2022-06-13 15:22:23 +10:00
Hugh Rundle
07225c6ddc add guided tour link 2022-06-13 13:14:31 +10:00
Hugh Rundle
6b7caa9c71 url for setting show_guided_tour
Uses a URL param to indicate whether the value should be set to True or False.
Redirects to home page.
2022-06-13 13:10:31 +10:00
Hugh Rundle
80c71928c3 add show_guided_tour value to User
This boolean value indicates whether the user wishes to be show the guided tour.
It defaults to True but will be able to be easily set to False.
2022-06-13 13:07:48 +10:00
Hugh Rundle
2b431986d6 help tour button styling updates 2022-06-12 20:39:37 +10:00
Hugh Rundle
e768cf49a3 add barcode reader to home feed tour 2022-06-12 20:11:21 +10:00
Hugh Rundle
c614aeb28e add shepherd tours
This file creates and triggers tours using shepherd.

Initially this is a tour on the home feed page, triggered by clicking on the help button in the top nav.
2022-06-12 19:43:21 +10:00
Hugh Rundle
806e2778df add help button if page has tour
- include logic in main layout to add button if there is a page tour available
- add button for main user feed page
2022-06-12 19:41:50 +10:00
Hugh Rundle
f81095cb64 give suggested books block an id 2022-06-12 19:40:36 +10:00
Hugh Rundle
cfa659748c add shepherd styles for guided tour
Adds a sass file based on the v10.0.0 Shepherd CSS. Original Shepherd styles are kept where appropriate, otherwise this is intended to inherit whatever styles are being used through the Bulma and Bookwyrm SASS, so that it uses appropriate colours in both light and dark modes.
2022-06-12 13:42:06 +10:00
Hugh Rundle
b6cd64f82a add Shepherd version 10.0.0 2022-06-11 14:19:03 +10:00
Mouse Reeve
e3471fcc35
Merge pull request #2148 from hughrun/quotes
add page numbers to comment and quote statuses
2022-06-10 17:35:15 -07:00
Joel Bradshaw
7f5d47a36f Use values_list with flat, yay! 2022-06-07 23:15:34 -07:00
Mouse Reeve
3aa159bc89
Merge branch 'main' into preview-generation-memory 2022-06-05 18:39:59 -07:00
Mouse Reeve
8d082bc189
Merge branch 'main' into quotes 2022-06-05 15:42:01 -07:00
Mouse Reeve
7320375f0c
Merge branch 'main' into ignore-does-not-exist 2022-06-05 15:41:39 -07:00
Mouse Reeve
08231f52ff
Merge pull request #2150 from cincodenada/fix-pylint
Fix pylint config for pylint 2.14.0
2022-06-05 15:41:32 -07:00
Joel Bradshaw
6d6ab9a531 Add .pylintrc with fixes for new pylint version 2022-06-05 14:38:03 -07:00
Joel Bradshaw
7014786fe0 Run formatters 2022-06-05 13:41:00 -07:00
Joel Bradshaw
b744ff7836 Run black 2022-06-05 13:40:01 -07:00
Joel Bradshaw
482005f304 Update preview image generation to only query ids
Previously we were querying the full book objects just to get a list of
id's, which is much slower and also takes a lot more memory, which can
cause the process to be killed on memory-limited machines with a large
number of books.

Instead, since we're just dispatching jobs here, we can just ask for the
id's, which is faster and much more practical memory-wise.

The map is a little annoying, I didn't see a way to directly get just a
list of the value of one field, so we have to get a list of
dictionairies with one key and then pull that key out. Whatevs.
2022-06-05 13:07:44 -07:00
Hugh Rundle
4de9989d8e add page numbers to comment and quote statuses
This adds the page number for quote and comment statuses where a page number is provided:

- all ActivityPub posts
- Explore cards for comments (quotes already have the page number)

This responds to #2136
2022-06-05 16:02:25 +10:00
Mouse Reeve
9d5e113b92
Merge pull request #2145 from bookwyrm-social/about-layout
Clip column in about page
2022-05-31 14:05:43 -07:00
Mouse Reeve
c738eaa2c2 Use async requests for broadcasting
When an activity needs to be broadcast to the whole wide fediverse, the
number of requests can get enormous and the broadcast task ends up
taking ages to run. This change sends these requests out in one aiohttp
session, to improve performance.
2022-05-31 13:09:27 -07:00
Mouse Reeve
d149e57494 Split expand book data task into per-edition tasks
Loading every edition in one task takes ages, and produces a large task
that clogs up the queue. This will create more, smaller tasks that will
finish more quickly.
2022-05-31 12:41:57 -07:00
Mouse Reeve
20f452ebf4 Clip column in about page
Text in the superlatives section can cause this column to expand outside
the container.
2022-05-31 12:23:59 -07:00
Mouse Reeve
374fdcf467 Use relative list order ranking in openlibrary search
Set OpenLibrary search condifidence based on the provided result order,
just using 1/(list index), so the first has rank 1, the second 0.5, the
third 0.33, et cetera.
2022-05-31 10:22:49 -07:00
Mouse Reeve
355e7039f0
Merge pull request #2139 from bookwyrm-social/search-refactor
Search refactor
2022-05-31 10:22:17 -07:00
Mouse Reeve
c3b35760a2 Updates test mocks for remote search 2022-05-31 09:37:54 -07:00
Mouse Reeve
969db13ff2 Safely return None in remote search return_first 2022-05-31 08:49:23 -07:00
Mouse Reeve
05fd30cfcf Pylint fixes in connector tests 2022-05-31 08:37:07 -07:00
Mouse Reeve
5e99002aad Raise priority for external connectors in initdb
By default, OpenLibrary and Inventaire were prioritzed below other
BookWyrm nodes. In practice, people have gotten better search results
from these connectors, hence the change. With the search refactor, this
has much less impact, but it will show these search results higher in
the list.

If the results page shows all the connectors' results integrated, this
field should be removed entirely.
2022-05-31 08:25:02 -07:00
Mouse Reeve
a053f20961 Re-implements return first option
Since we get all the results quickly now, this aggregates all the
results that came back and sorts them by confidence, and returns the
highest confidence result. The confidences aren't great on free text
search, but conceptually that's how it should work at least.

It may make sense to aggregate the search results in all contexts, but
I'll propose that in a separate PR.
2022-05-31 08:20:59 -07:00
Mouse Reeve
98ed03b6b4 Python formatting and test update 2022-05-30 17:00:34 -07:00
Mouse Reeve
83ee5a756f Filter intentaire results by confidence 2022-05-30 16:42:37 -07:00
Mouse Reeve
af19d728d2 Removes outdated unit tests 2022-05-30 16:16:10 -07:00
Mouse Reeve
87fe984462 Combines search formatter and parser function
The parser was extracting the list of search results from the json
object returned by the search endpoint, and the formatter was converting
an individual json entry into a SearchResult object. This just merged
them into one function, because they are never used separately.
2022-05-30 12:52:31 -07:00
Mouse Reeve
525e2a591d More error handing
Adds logging and error handling for some of the numerous ways a request
could fail (the remote site is down, the url is blocked, etc).

I also have the results boxes open by default, which makes it more
legible imo.
2022-05-30 12:40:13 -07:00
Joel Bradshaw
7ae0db7f4a Ignore VariableDoesNotExist errors in debug logging
They're so noisy as to make debug logging useless otherwise
2022-05-30 12:15:50 -07:00