Commit graph

43 commits

Author SHA1 Message Date
Bart Schuurmans e04cd79ff8 Redirect to new URL when a merged object is requested 2024-03-23 19:28:57 +01:00
Mouse Reeve d9f6449767 Pre-populate sort title in edit book form if not provided
It's confusing to edit a book when this isn't set, so this provides the
best-guess version of the sort title if there isn't one provided, and
allows the user to change it as needed.
2023-08-06 17:57:57 -07:00
Joeri de Ruiter 220cad8661 Only show author confirmation if new authors are added, show suggestions for parent work and set it correctly. 2023-08-01 15:12:50 +02:00
Hugh Rundle 5c9b962639 retain additional authors on form failure when editing book 2023-04-29 09:42:57 +10:00
Hugh Rundle 5f5886edea Actually fix ensure_transient_values_persist call
oops
2023-04-16 19:58:53 +10:00
Hugh Rundle 6f025af99f fix ensure_transient_values_persist call 2023-04-16 19:06:04 +10:00
Hugh Rundle fb3cb229e9 Fixes #2571
Persist book.subjects and add_author when form validation fails.

This does not resolve the problem of cover image uploads being dropped because this is a broader problem and is covered separately in #2760
(we should investigate the plugin ` django-file-resubmit`)
2023-04-16 17:58:03 +10:00
Josh Soref be31a4b576 spelling: creating
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-04 20:02:54 -04:00
Christof Dorner 1c6548a0ad Ensure transient cover_url field value gets persisted across form renders
Given this field doesn't map to an `Edition` model field it lost its values when re-rendering the form.
It worked only when the form was valid and rendered as part of the confirmation screen, which is due to
the context data value being set in `add_authors` which was only getting called after the form validation.

I've opted to pull it out into a separate new function that gets called before form validation.
2023-01-04 18:02:04 +01:00
Mouse Reeve 1e988cae6c More edit book lines 2022-09-19 10:26:29 -07:00
Mouse Reeve b0d8697006 Adds missing save in edit book view 2022-09-19 10:16:29 -07:00
Mouse Reeve 6d5923bb8f
Merge pull request #2128 from bookwyrm-social/multiple-authors
Multiple authors not added when editing book
2022-05-23 14:07:54 -07:00
Mouse Reeve 69f192e78c Fixes error in add author code returning too soon 2022-05-23 13:57:14 -07:00
Mouse Reeve efd1fd82a9 Corrects redirect to confirm mode when adding book 2022-05-23 13:02:06 -07:00
Mouse Reeve a701bfcf8e Uses custom date select widget for publication dates 2022-03-19 08:45:10 -07:00
Mouse Reeve a684d86d15 Fixes subjects in add edition view 2022-03-17 08:02:59 -07:00
Mouse Reeve eea7d9d4e5 Retain author across saves 2022-02-25 17:57:18 -08:00
Mouse Reeve 29a6d74ff2 Python formatting 2022-02-25 17:23:13 -08:00
Mouse Reeve b001c31f97 Save author along with added edition 2022-02-25 16:54:03 -08:00
Mouse Reeve c67f92af46 Add editions view 2022-02-25 16:40:34 -08:00
Mouse Reeve 6d1d62cf2f View for starting to edit a book with existing data 2022-02-25 11:50:25 -08:00
Chad Nelson 91997b6f4c Linting after merge conflict 2021-11-30 17:42:31 -05:00
Chad Nelson e59a480065
Merge branch 'main' into 1203-better-ui-for-adding-authors 2021-11-30 17:30:00 -05:00
Chad Nelson 66e414be3c Standardize JS, use button, & filter empty authors 2021-11-30 17:22:35 -05:00
Hugh Rundle d8e83ffe82
moar code linting 2021-11-22 13:01:58 +11:00
Hugh Rundle a9d921cc06
code cleanup 2021-11-22 12:52:59 +11:00
Chad Nelson 6be9ac4f70 Abstract JS for multivalue form fields 2021-11-21 17:32:48 -05:00
Hugh Rundle fd2ade2313
refactor isni author enrichment
- use activitypub.Author instead of custom dict
- prefer to display "Author of [title]" from ISNI data instead of short description
- merge isni and db authors for edit_book display
- fix edit_book template to use changed data
- rename some functions in utils/isni.py
2021-11-22 08:49:22 +11:00
Hugh Rundle 1e6e4b0f8d
use activitypub dataclass for isni authors
- add timeout to isni API call
- use activitypub.Author dataclass instead of bespoke dict
- display isni authors as "Author of" first title in ISNI record if possible
- sensible fallbacks if title info unavailable in isni record
2021-11-21 19:55:55 +11:00
Hugh Rundle c3ba7ba547 pylint Y U like this? 2021-11-01 20:04:25 +11:00
Hugh Rundle 6556090524 Update existing authors when isni data available
When an existing author is selected as a new author when editing a book,
if they have an ISNI ID recorded we check the record and augment the local
database record from the ISNI data.

Also dedupes author aliases for this feature and when adding a completely
new author.
2021-11-01 19:50:49 +11:00
Hugh Rundle c845b7a5d0 code cleanup 2021-11-01 16:00:34 +11:00
Hugh Rundle 775470a852 normalise isnis
Some isnis are imported with spaces and some not.
This normalises them for comparison and creating URLs
2021-11-01 15:48:52 +11:00
Hugh Rundle 55ac80cc16 ugh pylint 2021-11-01 12:01:57 +11:00
Hugh Rundle 1533b55a32 lint code 2021-11-01 11:58:08 +11:00
Hugh Rundle 552980e208 select correct isni record when adding authors
The original implementation of this was so, so broken.
Now it's not.
2021-11-01 11:34:32 +11:00
Hugh Rundle 37148c5127 display isni bio with existing author name
If an existing author has an isni on record and it matches an author from the isni api call,
display the isni short description to aid with identifying the appropriate author.
2021-11-01 10:26:17 +11:00
Hugh Rundle 3cfd31f1fe hide isni authors if isni in local db
Check the authors suggested from the local DB for a matching ISNI when pulling authors from ISNI.
i.e. we do not want to suggest the same author twice when we *know* it is the same author.
2021-10-31 20:48:47 +11:00
Hugh Rundle bce5f3f3b5 populate new authors with isni data
If a user selects an author pulled from the ISNI service when editing a book, use any relevant data from ISNI to populate the new author record.

This includes
- bio
- aliases
- isni
- wikipedia url
- viaf
2021-10-31 17:58:15 +11:00
Hugh Rundle 87ed6f8380 code formatting 2021-10-29 21:14:32 +11:00
Hugh Rundle f2e4865adf check isni sources when editing book authors 2021-10-29 16:13:05 +11:00
Mouse Reeve 889930aa69 Fixes create book flow for search refactor 2021-10-03 11:55:16 -07:00
Mouse Reeve 6902ffc4c3 Adds missing view file 2021-09-30 22:22:32 -07:00