Compare commits

..

2097 commits

Author SHA1 Message Date
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
Mouse Reeve
2993989d27
Merge pull request #2149 from cincodenada/preview-generation-memory
Update preview image generation to only query ids
2022-06-10 17:25:05 -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
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
6584cb6404 Go back to one requirements.txt, simplify workflow
The workflow can now use .pylintrc and the pylint req in
requirements.txt rather than having the options inline and installing it
separately
2022-06-05 14:57:42 -07:00
Joel Bradshaw
b3603c04c5 Add pylint to bw-dev
Because pylint requires the app to be fully parseable with all its
dependencies, we run it in the web container, and add pylint as a dev
dependency.
2022-06-05 14:49:21 -07:00
Joel Bradshaw
6d6ab9a531 Add .pylintrc with fixes for new pylint version 2022-06-05 14:38:03 -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
d5bbb759e0
Merge pull request #2146 from bookwyrm-social/locales
Updates locales for stopped reading strings
2022-05-31 17:09:44 -07:00
Mouse Reeve
077c9bfe46 Updates locales for stopped reading strings 2022-05-31 16:53:46 -07: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
4c050d0999
Merge pull request #2141 from bookwyrm-social/ol-search-rank
Use relative list order ranking in OpenLibrary search
2022-05-31 13:11:49 -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
Mouse Reeve
45f2199c71 Gather and wait on async requests
This sends out the request tasks all at once and then aggregates the
results, instead of just running them one after another asynchronously.
2022-05-30 12:05:22 -07:00
Mouse Reeve
5e81ec75fb Set request headers in async search get request
Gotta ask for json
2022-05-30 11:19:16 -07:00
Mouse Reeve
9a9cef7766 Verify url before async search
The database lookup doesn't work during the asyn process, so this change
loops through the connectors and grabs the formatted urls before sending
it to the async handler.
2022-05-30 11:16:05 -07:00
Mouse Reeve
0adda36da7 Remove search endpoints from Connector
Instead of having individual search functions that make individual
requests, the connectors will always be searched asynchronously
together. The process_seach_response combines the parse and format
functions, which could probably be merged into one over-rideable
function.

The current to-do on this is to remove Inventaire search results that
are below the confidence threshhold after search, which used to happen
in the `search` function.
2022-05-30 10:37:24 -07:00
Mouse Reeve
9c03bf782e Make an async request to all search connectors
This is the untest first pass at re-arranging remote search to work in
parallel rather than sequence. It moves a couple functions around
(raise_not_valid_url, for example, needs to be in connector_manager.py
now to avoid circular imports). It adds a function to Connector objects
that generates a search result (either to the isbn endpoint or the free
text endpoint) based on the query, which was previously done as part of
the search.

I also lowered the timeout to 8 seconds by default.
2022-05-30 10:15:22 -07:00
Mouse Reeve
7905be7de2
Merge pull request #2138 from bookwyrm-social/ratings-query
Use general ratings rather than privacy filtered
2022-05-30 09:33:05 -07:00
Mouse Reeve
fb3c7205af Updates unit tests 2022-05-30 09:17:51 -07:00
Mouse Reeve
fc3b609ada Use general ratings rather than privacy filtered
The original system customized how a rating is displayed to every user
based on the privacy settings of the reviews and, relatedly, who the
user follows. This is cool, but the query is too complicated to load in
sessions, and the initial load, which isn't mitigated by caching, is too
much and causes timeouts for many users. Also the cache clearing wasn't
working correctly because I put in a wildcard, which does not work.
2022-05-30 08:42:48 -07:00
Mouse Reeve
4e3c346780
Merge pull request #2134 from bookwyrm-social/stopped-shelf-fixes
Stopped shelf fixes
2022-05-26 13:12:57 -07:00
Mouse Reeve
74925a379a Prettier 2022-05-26 12:54:31 -07:00
Mouse Reeve
4e0e6ed5a4 Tick javascript cache and version number 2022-05-26 12:49:04 -07:00
Mouse Reeve
09db4e48f4 Hide rather than remove current shelve list items 2022-05-26 12:46:34 -07:00
Mouse Reeve
c5f5d4d994 Only show "stop" option when a book is in progress 2022-05-26 12:27:44 -07:00
Mouse Reeve
4905652e22 Handle stopped reading special case in javascript
This should be refactored, but maybe not today
2022-05-26 12:23:13 -07:00
Mouse Reeve
4c5d2570ab Save and display stopped date in readthrough 2022-05-26 11:53:33 -07:00
Mouse Reeve
dfe0656eb4 Typo fix 2022-05-26 11:38:36 -07:00
Mouse Reeve
375c5a8789 Adds stopped date separate from finish date on readthrough 2022-05-26 11:36:37 -07:00
Mouse Reeve
1f6fbd8d29 Fixes stopped reading button logic
The stopped state is similar to finished
2022-05-26 11:28:54 -07:00
Mouse Reeve
9b4a498661 Don't show a button for the shelf a book is currently on
This will lead to nonsensical modal states
2022-05-26 11:19:49 -07:00
Mouse Reeve
92dbfec5f8 Adds status header for stopped reading statuses 2022-05-26 11:10:14 -07:00
Mouse Reeve
6848616ff1 Fixes reading status field in stop modal
The value of the reading status needs to match one of the database
options for `reading_status` in the `Comment` model
2022-05-26 11:09:11 -07:00
Mouse Reeve
007751c8cb Adds error logging to status views 2022-05-26 10:58:11 -07:00
Mouse Reeve
23c6019340 Adds merge migration 2022-05-26 10:23:32 -07:00
Mouse Reeve
77a7dfa924
Merge pull request #2133 from bookwyrm-social/activitypub-connection-erorr
Don't throw an error when unable to connect to remote data
2022-05-26 10:12:18 -07:00
Mouse Reeve
88b2cffcf2
Merge pull request #2035 from bookwyrm-social/stopped-shelf
Stopped shelf
2022-05-26 10:11:32 -07:00
Mouse Reeve
9d275db322 Updates ignore boost logic that no longer produces errors 2022-05-26 09:57:39 -07:00
Mouse Reeve
3e54a5f4a3 Python formatting 2022-05-26 09:00:45 -07:00
Mouse Reeve
0bfe1e9dfc Don't throw an error when unable to connect to remote data 2022-05-25 13:24:11 -07:00
Mouse Reeve
f4226b050f
Merge pull request #2129 from bookwyrm-social/locales
Updates locales (changes to German, Romanian)
2022-05-23 18:02:45 -07:00
Mouse Reeve
b8ddafffbe
Merge pull request #2130 from bookwyrm-social/followers-hidden
Make an exception for yourself when followers are hidden
2022-05-23 18:02:34 -07:00
Mouse Reeve
0f7317f8fe Make an exception for yourself when followers are hidden 2022-05-23 15:31:05 -07:00
Mouse Reeve
867981b2a4 Updates locales (changes to German, Romanian) 2022-05-23 15:20:35 -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
3ed685e341
Merge pull request #2126 from bookwyrm-social/black-update
Updates black version
2022-05-23 13:59:19 -07:00
Mouse Reeve
9172d7ff4e
Merge pull request #2127 from bookwyrm-social/add-book
Corrects redirect to confirm mode when adding book
2022-05-23 13:59:12 -07:00
Mouse Reeve
69f192e78c Fixes error in add author code returning too soon 2022-05-23 13:57:14 -07:00
Mouse Reeve
b2c587e082 Adds unit test for add author code when editing book 2022-05-23 13:51:58 -07:00
Mouse Reeve
efd1fd82a9 Corrects redirect to confirm mode when adding book 2022-05-23 13:02:06 -07:00
Mouse Reeve
ae2006c726 Updates black version 2022-05-23 12:46:45 -07:00
Mouse Reeve
1843959d10
Merge pull request #2093 from Ryuno-Ki/calibre-import
Calibre import. Fixes #627
2022-05-23 12:37:50 -07:00
Mouse Reeve
212bd49e6c
Merge pull request #2125 from bookwyrm-social/edit-author
Fixes edit author paths
2022-05-23 12:26:07 -07:00
André Jaenisch
d837146b66
Make black happy
Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2022-05-23 20:59:28 +02:00
André Jaenisch
b564e514fd
Handle parsed dates that already have a timezone on import.
Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2022-05-23 20:52:57 +02:00
André Jaenisch
12541d5f1c
Map timestamp to date_added to avoid integrity error.
Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2022-05-23 20:52:26 +02:00
Mouse Reeve
d8b2ab74d1 Fixes edit author paths 2022-05-23 11:08:04 -07:00
Mouse Reeve
065095776f
Merge pull request #2119 from bookwyrm-social/edit-book
Fixes urls in edit book form
2022-05-19 10:47:10 -07:00
Mouse Reeve
6d7bb33683 Fixes urls in edit book form 2022-05-19 09:32:01 -07:00
Mouse Reeve
cbd43c42a9
Merge pull request #2115 from bookwyrm-social/book-langs
Prevent error when a book language has a null value
2022-05-16 11:41:07 -07:00
Mouse Reeve
8d2da587d9 Prevent error when a book language has a null value 2022-05-16 11:06:11 -07:00
Mouse Reeve
39b6364e62
Merge pull request #2114 from bookwyrm-social/sentry-error-article
Fixes exception when receiving Article type activities
2022-05-16 10:38:15 -07:00
Mouse Reeve
b2775c5160 Check unsupported types before attempting to serialize 2022-05-16 10:21:54 -07:00
Mouse Reeve
fd43b56d31 Fixes celery error encountering Article type activities 2022-05-16 10:17:21 -07:00
Mouse Reeve
17864da8a2
Merge pull request #2113 from bookwyrm-social/status-priority
Fixes how backdated statuses are prioritized
2022-05-16 09:49:39 -07:00
Mouse Reeve
fdd4691e00 Adds unit test 2022-05-16 09:41:34 -07:00
Mouse Reeve
876d9c2695 Fixes how backdated statuses are prioritized 2022-05-16 09:24:01 -07:00
Mouse Reeve
fd66961ab8
Merge pull request #2104 from maxheadroom/main
add automatic restart of containers
2022-05-16 08:07:49 -07:00
Mouse Reeve
ae8edce197
Merge pull request #2111 from maeserichar/fix_broken_links
Fix broken links in README
2022-05-16 08:05:44 -07:00
Mouse Reeve
241169650d
Merge pull request #2007 from viviicat/url-names
Add names of books/lists/authors/etc as slugs, redirect to slugified version of the page
2022-05-16 08:04:58 -07:00
Mouse Reeve
23eb1c1b10
Merge pull request #1942 from willhoh/isbn_search
Isbn check befor search
2022-05-16 08:01:31 -07:00
Ricardo Rodríguez
643a3509dd docs: Fix broken links in README 2022-05-15 13:01:25 +02:00
Mouse Reeve
a5f9efc2b5
Merge pull request #2110 from bookwyrm-social/locales
Updates locales
2022-05-14 08:43:35 -07:00
Mouse Reeve
8c0ad7e73d Updates locales 2022-05-14 08:29:25 -07:00
Falko Zurell
d0b7474744
add automatic restart of containers
Added ```restart: unless-stopped``` to keep containers up and running after a reboot.
2022-05-09 11:00:28 +02:00
Mouse Reeve
49e6eb8f68
Merge pull request #2092 from bookwyrm-social/locale-updates
Updates locales
2022-05-06 12:50:49 -07:00
Mouse Reeve
ba7c39404b
Merge pull request #2103 from denmch/bugfix-profile-link
Replace user|username with request.user.localname
2022-05-06 12:19:34 -07:00
Den McHenry
80b0206e0d Replace user|username with request.user.localname 2022-05-06 10:29:25 -07:00
André Jaenisch
62c7661fb9
Reformat tests using black
Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2022-05-05 21:31:56 +02:00
André Jaenisch
22fcb61fb2
Write tests for Calibre importer
Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2022-05-05 13:08:01 +02:00
André Jaenisch
6bd9b725e2
Refactor hard-coded strings with a reference to a static property
Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2022-05-05 13:07:25 +02:00
André Jaenisch
eeb1cc7197
Use a default shelf because Calibre indicates no reading status
Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2022-04-30 19:08:31 +02:00
André Jaenisch
3626db3c1a
Add Calibre importer for CSV exports
Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2022-04-30 15:25:35 +02:00
Mouse Reeve
95c043cc92 Updates locales 2022-04-29 15:44:31 -07:00
Mouse Reeve
a4a06fa32c
Merge pull request #2090 from bookwyrm-social/dashboard-warning
Fixes invite request alert count
2022-04-29 15:41:57 -07:00
Mouse Reeve
966bec1d18 Fixes invite request alert count 2022-04-26 08:33:15 -07:00
Mouse Reeve
708dc4d613
Merge pull request #2089 from bookwyrm-social/no-confirmation
Show clearer behavior when no email confirmation is needed after all
2022-04-26 08:24:35 -07:00
Mouse Reeve
a6cb46356f Show clearer behavior when no email confirmation is needed after all 2022-04-26 08:14:31 -07:00
Mouse Reeve
34be995125
Merge pull request #2087 from bookwyrm-social/locales
Updates locales
2022-04-26 07:50:16 -07:00
Mouse Reeve
676a51411f Updates locales 2022-04-26 07:41:23 -07:00
Mouse Reeve
93ec53f523
Merge pull request #2085 from bookwyrm-social/dependabot/pip/django-3.2.13
Bump django from 3.2.12 to 3.2.13
2022-04-25 09:20:12 -07:00
dependabot[bot]
3559bb5630
Bump django from 3.2.12 to 3.2.13
Bumps [django](https://github.com/django/django) from 3.2.12 to 3.2.13.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/3.2.12...3.2.13)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-22 22:47:05 +00:00
Mouse Reeve
358c507839
Merge pull request #2080 from viviicat/dark-read-hist-editions
Further dark theme fixes
2022-04-09 07:53:17 -07:00
Vivianne Langdon
64b623df32 fixes for bulma not having good dark support 2022-04-09 00:06:10 -07:00
Vivianne Langdon
d3992802f2 use a new has-text-default instead of has-text-black 2022-04-08 23:14:30 -07:00
Vivianne Langdon
b0d3eaeb40 allow empty slugs, for non-url-friendly book names 2022-04-08 22:11:05 -07:00
Vivianne
5a2bf64864
Merge branch 'bookwyrm-social:main' into url-names 2022-04-08 21:45:37 -07:00
Mouse Reeve
300eea3b94
Merge pull request #2074 from bookwyrm-social/pylint-tests-dir
Include test files in pylint
2022-04-08 14:39:44 -07:00
Mouse Reeve
8b7f664da3
Merge pull request #2078 from bookwyrm-social/locales
Consistent formatting for "BookWyrm" name
2022-04-08 14:34:46 -07:00
Mouse Reeve
2c394a2518 Fixes typo 2022-04-08 14:29:42 -07:00
Mouse Reeve
8ea1171764 Python formatting 2022-04-08 14:24:14 -07:00
Mouse Reeve
9921a1e754 Various pylint complaince fixes 2022-04-08 14:23:37 -07:00
Mouse Reeve
a92bf785dd Updates init files for pylint 2022-04-08 14:16:05 -07:00
Mouse Reeve
3c1f95a83a Updates locales 2022-04-08 14:01:13 -07:00
Mouse Reeve
6455476df7 Consistent formatting for "BookWyrm" name 2022-04-08 13:59:10 -07:00
Mouse Reeve
e0fa0b859a
Merge pull request #2077 from bookwyrm-social/main-dropdown
Uses details for user menu in main navbar
2022-04-08 13:58:15 -07:00
Mouse Reeve
ae8fed3e82 Removes stray dash from template 2022-04-08 13:50:06 -07:00
Mouse Reeve
51f5c9562d Uses details for user menu in main navbar 2022-04-08 13:45:17 -07:00
Mouse Reeve
1a6e98b546
Merge pull request #2073 from bookwyrm-social/update-locales
Updates locales
2022-04-04 15:38:21 -07:00
Mouse Reeve
fe85784ceb
Merge pull request #2072 from bookwyrm-social/zsh-complete
Adds zsh-specific completions file
2022-04-04 15:26:31 -07:00
Mouse Reeve
9e803043b2 Include test files in pylint 2022-04-04 15:24:39 -07:00
Mouse Reeve
bada50cee9 Updates locales 2022-04-04 15:20:15 -07:00
Mouse Reeve
b718e01a5c Adds zsh-specific completions file 2022-04-04 15:17:18 -07:00
Mouse Reeve
4c09477aa2
Improves instance list admin view (#2068)
* Removes irrelevent initial federated server data

* Adds secondary search order to instance list

* Show last updated date

* Adds filters to federated server view

* Updates unit tests
2022-04-02 09:16:07 -07:00
Mouse Reeve
ae86829a7e
Adds Finnish locale (#2069)
* Adds Finnish locale
2022-03-31 08:20:52 -07:00
Mouse Reeve
c7261780a8
Updates locales (#2065) 2022-03-26 14:34:15 -07:00
Mouse Reeve
71cbe611de Merge migration 2022-03-26 13:07:27 -07:00
Mouse Reeve
ec21d20b90 Merge branch 'main' into stopped-shelf 2022-03-26 13:06:06 -07:00
Mouse Reeve
701a644c31
Export user book data as csv (#1556)
Simple book data export
2022-03-26 13:04:59 -07:00
Mouse Reeve
0728864fe0
Merge pull request #2064 from bookwyrm-social/ui-fixes
Misc theme fixes
2022-03-26 11:48:59 -07:00
Mouse Reeve
3ebc800a9b Fixes progress bar color in dark mode 2022-03-26 11:38:00 -07:00
Mouse Reeve
23ff58a62b Fixes scrollbar colors in dark mode 2022-03-26 11:35:24 -07:00
Mouse Reeve
0666a2d02f Remove transparent class on interaction buttons 2022-03-26 11:07:58 -07:00
Mouse Reeve
b23f4a7e18 Clip statuses 2022-03-26 11:00:53 -07:00
Mouse Reeve
7cbf78c5fd
Merge pull request #2056 from bookwyrm-social/duplicate-follow-requests
Trigger rebroadcast of follow requests
2022-03-26 10:42:06 -07:00
Mouse Reeve
00c36de745
Merge pull request #2062 from bookwyrm-social/locales
Adds Romanian locale
2022-03-26 10:41:07 -07:00
Mouse Reeve
85f507d6b9 Python formatting 2022-03-26 10:34:02 -07:00
Mouse Reeve
5cf52cff54 Formats migration 2022-03-26 10:32:07 -07:00
Mouse Reeve
c527e0e411
Merge pull request #2061 from bookwyrm-social/link-typo
Fixes typo in about link
2022-03-26 10:30:59 -07:00
Mouse Reeve
a1487ccae5
Merge branch 'main' into duplicate-follow-requests 2022-03-26 10:28:58 -07:00
Mouse Reeve
2d7902ff89 Resolve second integrity error 2022-03-26 10:27:49 -07:00
Mouse Reeve
dc171776f8
Merge branch 'main' into link-typo 2022-03-26 10:21:52 -07:00
Mouse Reeve
44af09336c
Merge branch 'main' into locales 2022-03-26 10:21:43 -07:00
Mouse Reeve
566182c046
Merge pull request #2063 from bookwyrm-social/pylint-warning
Avoid new pylint complaint
2022-03-26 10:21:34 -07:00
Mouse Reeve
90277a1697 Avoid new pylint complaint 2022-03-26 10:07:06 -07:00
Mouse Reeve
a6ae55608a Adds Romanian locale 2022-03-26 10:03:50 -07:00
Mouse Reeve
27e23e76ae Fixes typo in about link 2022-03-26 09:43:49 -07:00
Mouse Reeve
4f24b05d60 Clear cache regardless of view success 2022-03-24 13:10:49 -07:00
Mouse Reeve
6808b70d3f
Merge pull request #2055 from bookwyrm-social/reports
Paginate reports
2022-03-24 11:35:48 -07:00
Mouse Reeve
a3b9c621af Trigger rebroadcast of follow requests 2022-03-24 11:35:05 -07:00
Mouse Reeve
0166cca0b7 Show created date and follower counts in admin view
Adds "admin_mode" to user_preview
2022-03-24 11:17:35 -07:00
Mouse Reeve
82f87a3ff5 Adds colored icon for user status in admin table 2022-03-24 10:55:32 -07:00
Mouse Reeve
533642bf7e Adds link to admin view 2022-03-24 10:43:17 -07:00
Mouse Reeve
951b611881 Paginates results 2022-03-24 10:40:42 -07:00
Mouse Reeve
88e915409b
Merge pull request #2048 from bookwyrm-social/import-help
Import help
2022-03-21 13:09:51 -07:00
Mouse Reeve
43cc017b44 Removes tooltip component 2022-03-21 12:32:53 -07:00
Mouse Reeve
9e792a8901 Italics for null state text on import page, to be consistent 2022-03-21 12:26:07 -07:00
Mouse Reeve
34166b8a2f Uses help instead of tooltip for goodreads export info 2022-03-21 12:24:47 -07:00
Mouse Reeve
3f7afc9014 Adds prompt to import books in null state of suggested books 2022-03-21 12:24:31 -07:00
Mouse Reeve
a29db4840c
Merge pull request #2046 from bookwyrm-social/resend-flow
Resend flow
2022-03-19 15:28:30 -07:00
Mouse Reeve
1b53c81351 Updates tests 2022-03-19 15:16:20 -07:00
Mouse Reeve
78ac252dae Python formatting 2022-03-19 12:08:57 -07:00
Mouse Reeve
f2ab890b5a Adds fallback form to modal 2022-03-19 12:07:07 -07:00
Mouse Reeve
4386d2ddb9 Switches resend email to modal 2022-03-19 12:00:16 -07:00
Mouse Reeve
5655b94bad
Merge pull request #2044 from bookwyrm-social/date-picker
Uses custom date select widget for publication dates
2022-03-19 09:33:53 -07:00
Mouse Reeve
b134c0c2fd
Merge pull request #2045 from bookwyrm-social/dashboard-display
Dashboard display small fixes
2022-03-19 09:33:19 -07:00
Mouse Reeve
f0a87e2a20 Use fullwidth tables in admin views 2022-03-19 09:16:28 -07:00
Mouse Reeve
7f6a98e764 Don't let site settings form get too wide 2022-03-19 09:11:59 -07:00
Mouse Reeve
1cfe3b3f94 Re-orders site settings registration toggles
Having require email confirm next to allow registration seems better to
me
2022-03-19 09:09:25 -07:00
Mouse Reeve
45672c2b70 Adds missing widgets file 2022-03-19 09:04:50 -07:00
Mouse Reeve
68e3a71b18 Consistent height for instance stats 2022-03-19 09:01:04 -07:00
Mouse Reeve
09e040ec11 Equal height for dashboard notifications 2022-03-19 08:59:41 -07:00
Mouse Reeve
dc9f8fccb7 Adds widgets file 2022-03-19 08:48:10 -07:00
Mouse Reeve
a701bfcf8e Uses custom date select widget for publication dates 2022-03-19 08:45:10 -07:00
Mouse Reeve
db5f509475
Merge pull request #2042 from bookwyrm-social/progress-updates
Fixes progress updates
2022-03-18 19:30:54 -07:00
Mouse Reeve
55dc998d03 Retain start date when updating from modal 2022-03-18 19:20:43 -07:00
Mouse Reeve
287b5603d6 Fixes progress updates 2022-03-18 19:11:58 -07:00
Mouse Reeve
f52b8fc028
Merge pull request #2040 from bookwyrm-social/edit-book
Fixes edit book page
2022-03-18 07:37:32 -07:00
Mouse Reeve
713391f468 Fixes edit book page 2022-03-18 07:28:07 -07:00
Mouse Reeve
576d0ee189
Merge pull request #2038 from bookwyrm-social/build-script
Comments out build script step in update command
2022-03-17 10:36:23 -07:00
Mouse Reeve
184a463097 Comments out build script step in update command 2022-03-17 10:25:03 -07:00
Mouse Reeve
ee78cc7393
Merge pull request #2037 from bookwyrm-social/celery-queues
Adds auto-create queues option to config
2022-03-17 10:06:49 -07:00
Mouse Reeve
ee1850ed15
Merge pull request #2034 from bookwyrm-social/locales
Updates locales
2022-03-17 10:01:38 -07:00
Mouse Reeve
20e71dc0cd
Merge pull request #2036 from bookwyrm-social/author-performance
Simplifies query possibly causing author page performance issues
2022-03-17 10:01:26 -07:00
Mouse Reeve
117db78983 Adds auto-create queues option to config 2022-03-17 09:57:25 -07:00
Mouse Reeve
a584f077b7 Simplifies query likely causing author page performance issues 2022-03-17 09:51:54 -07:00
Mouse Reeve
c8fa031c23 Updates locales 2022-03-17 09:21:06 -07:00
Mouse Reeve
2047365d31
Merge pull request #1973 from bookwyrm-social/add-edition
Create another edition for existing work
2022-03-17 08:51:13 -07:00
Mouse Reeve
ef4e06ad52
Merge pull request #2033 from bookwyrm-social/author-sort
Reverts author view changes
2022-03-17 08:51:06 -07:00
Mouse Reeve
9e0d6ed512
Merge branch 'main' into author-sort 2022-03-17 08:31:45 -07:00
Mouse Reeve
0101d2561a Python formatting 2022-03-17 08:18:44 -07:00
Mouse Reeve
a684d86d15 Fixes subjects in add edition view 2022-03-17 08:02:59 -07:00
Mouse Reeve
26f0501e2f SHow editions link on all book pages 2022-03-17 07:40:55 -07:00
Mouse Reeve
997a671cfb Consistent style for edit book confirm mode 2022-03-17 07:34:59 -07:00
Mouse Reeve
3ca611fb7c
Merge pull request #2031 from viviicat/dark-theme-fixes
Fixes for dark theme
2022-03-17 07:27:19 -07:00
Mouse Reeve
cf58d0ad5c Reverts author view changes 2022-03-17 07:22:22 -07:00
Vivianne Langdon
3050b33084 add success-light and warning-light! 2022-03-16 20:21:13 -07:00
Mouse Reeve
5255abb2af Fixes create book view unit test 2022-03-16 17:55:41 -07:00
Mouse Reeve
0617b9424b
Merge pull request #2029 from bookwyrm-social/merge-error
Removes file added by merge
2022-03-16 17:31:02 -07:00
Mouse Reeve
178f26192b Removes file added by merge 2022-03-16 17:15:53 -07:00
Mouse Reeve
0688dfa3aa
Merge pull request #2028 from bookwyrm-social/user-question-resolve
Resolves merge conflicts on user invite question PR
2022-03-16 17:09:35 -07:00
Mouse Reeve
8b061f9432 Manually updates migration 2022-03-16 16:53:16 -07:00
Mouse Reeve
7b3b357756 Merge branch 'main' into form-conflict 2022-03-16 16:51:57 -07:00
Mouse Reeve
44e68cd0a4 Whitespace fix 2022-03-16 16:50:34 -07:00
Mouse Reeve
922cc61a5f
Merge pull request #1998 from oragegu/question_invite_correct
Custom question option and field for spammed bookwyrm instances
2022-03-16 16:49:00 -07:00
Mouse Reeve
108981a226 Creates fresh migration and removes merges 2022-03-16 16:35:03 -07:00
Mouse Reeve
0cf2c07069
Merge branch 'main' into url-names 2022-03-16 16:32:07 -07:00
Mouse Reeve
ffec47ad9a
Merge pull request #2027 from bookwyrm-social/locales
Adds context and fixes whitespace in translation strings
2022-03-16 16:29:38 -07:00
Mouse Reeve
68dc5962ee Merge branch 'main' into add-edition 2022-03-16 16:16:55 -07:00
Mouse Reeve
da100cd114 Adds context and fixes whitespace in translation strings
Also updates locales
2022-03-16 16:13:15 -07:00
Mouse Reeve
159b73d860 Fixes errors in migration 2022-03-16 13:54:25 -07:00
Mouse Reeve
819458e82a Improves error reporting on activitypub parser 2022-03-16 13:53:54 -07:00
Mouse Reeve
f2b0b306e9
Merge pull request #1934 from tversteeg/partially-read-shelf
Add 'Stopped Reading' shelf
2022-03-16 13:51:15 -07:00
Mouse Reeve
eee325b662
Merge pull request #2026 from bookwyrm-social/missing-file
Adds missing update script
2022-03-16 13:41:43 -07:00
Mouse Reeve
ea69f9087f Adds missing update script 2022-03-16 13:32:37 -07:00
Mouse Reeve
8969958e51
Merge pull request #2025 from bookwyrm-social/upgrade-scripts
Run miscellaneous scripts during update
2022-03-16 13:03:38 -07:00
Mouse Reeve
2b2aa078ad
Merge branch 'main' into upgrade-scripts 2022-03-16 12:54:25 -07:00
Mouse Reeve
f4e828e2fb
Merge pull request #1974 from bookwyrm-social/celerybeat
Schedules automod tasks
2022-03-16 12:54:06 -07:00
Mouse Reeve
ee973c7d72 Adds celerybeat update script 2022-03-16 12:53:27 -07:00
Mouse Reeve
78b03efe45 Updates bw-dev command and ticks version number 2022-03-16 12:53:05 -07:00
Mouse Reeve
820279166a Adds update script 2022-03-16 12:39:49 -07:00
Thomas Versteeg
b3f03164cc Apply black 2022-03-15 09:28:40 +01:00
Thomas Versteeg
ee414598bf
Merge branch 'main' into partially-read-shelf 2022-03-15 08:28:02 +00:00
Mouse Reeve
81b7dca4b9 Merge branch 'main' into celerybeat 2022-03-14 15:13:09 -07:00
Mouse Reeve
13b82c2740
Merge pull request #2020 from bookwyrm-social/multi-input
Array input field for forms
2022-03-14 15:07:00 -07:00
Mouse Reeve
a37f83c458 Get the field working 2022-03-14 14:55:41 -07:00
Mouse Reeve
716e357060 Use plus icon on add field button 2022-03-14 12:54:50 -07:00
Mouse Reeve
35e6dede09 Script to remove input fields 2022-03-14 12:41:41 -07:00
Mouse Reeve
a2f2104a08 Create non-functional UI for editing array fields 2022-03-14 12:41:41 -07:00
Mouse Reeve
916d6a417d
Merge pull request #2018 from bookwyrm-social/locales
Adds scanner translation strings
2022-03-14 12:40:53 -07:00
Mouse Reeve
486f70c7fb Adds scanner translation strings 2022-03-14 12:31:29 -07:00
Mouse Reeve
d848b950dc
Merge pull request #2017 from bookwyrm-social/forms
Moves forms into separate files
2022-03-14 12:21:42 -07:00
Mouse Reeve
19202e2cd7 Fixes name of user forms file 2022-03-14 12:12:51 -07:00
Mouse Reeve
d3f723a07d Splits forms into separate files 2022-03-14 12:06:50 -07:00
Mouse Reeve
7169f7ba20 Creates forms directory 2022-03-14 11:43:58 -07:00
Mouse Reeve
c0db081120
Merge pull request #2016 from bookwyrm-social/duplicate-script
Moves duplicate field script into its own file
2022-03-14 11:09:48 -07:00
Mouse Reeve
bfb8fc800a Moves duplicate field script into its own file 2022-03-14 10:59:24 -07:00
Mouse Reeve
e0c0bebf65
Merge pull request #2015 from bookwyrm-social/admin-view-fix
Improves user admin view
2022-03-14 09:50:31 -07:00
Mouse Reeve
6ddf1aad91
Merge pull request #2000 from Tak/edit-subjects
Allow book subjects to be edited
2022-03-14 09:46:05 -07:00
Mouse Reeve
f42e863434 Updates user admin filters 2022-03-14 09:38:03 -07:00
Mouse Reeve
488d702473 Separate admin user list into tabbed lists 2022-03-14 09:27:18 -07:00
Mouse Reeve
bf68b70fba Use breadcrumbs in use admin view 2022-03-14 09:10:48 -07:00
Mouse Reeve
e4f94780eb Uses translated fields in admin user info 2022-03-14 09:10:42 -07:00
Corentin Feys
771fa5a00a
Merge branch 'main' into question_invite_correct 2022-03-13 23:44:20 +01:00
corentin-feys
a0ae96923c fix to pass invite request pytest 2022-03-13 23:34:49 +01:00
corentin-feys
74a1697cda fix to pass register pytest 2022-03-13 23:04:14 +01:00
corentin-feys
3e9cb2acb1 Revert to stable commit
This reverts commit d542be943f.
2022-03-13 22:56:41 +01:00
Mouse Reeve
57cba4eb7a
Merge pull request #2013 from bookwyrm-social/theme-path
Manually add theme path rather than options
2022-03-13 13:30:32 -07:00
Mouse Reeve
c08459cf5d Tick version number 2022-03-13 13:19:40 -07:00
Mouse Reeve
37beb5a8f4 Tick javascript cache buster 2022-03-13 13:19:02 -07:00
Mouse Reeve
3885ae789b Manually add theme path rather than options 2022-03-13 13:15:42 -07:00
Mouse Reeve
753cd36f86
Merge pull request #2012 from bookwyrm-social/catch-update-book-error
Catch update book error
2022-03-13 12:53:09 -07:00
Mouse Reeve
c7efa23405 Display error message for remote failure 2022-03-13 12:38:29 -07:00
Mouse Reeve
739b394ccc Catch error when trying to update book 2022-03-13 12:31:21 -07:00
Mouse Reeve
b32f3c1b7b
Merge pull request #1976 from viviicat/code-scanning
Add barcode scanning support
2022-03-13 12:26:31 -07:00
Mouse Reeve
5bd25ba740
Merge pull request #2011 from bookwyrm-social/update-locales
Updates locales
2022-03-13 12:14:42 -07:00
Mouse Reeve
2f124e00d1 Updates locales 2022-03-13 11:57:46 -07:00
Mouse Reeve
a69a9a401b
Merge pull request #2010 from bookwyrm-social/themes-text
Fixes instructions on admin themes view
2022-03-13 11:47:58 -07:00
Mouse Reeve
0c87ee1d4b Fixes instructions on admin themes view 2022-03-13 11:36:31 -07:00
Mouse Reeve
9f19fb698b
Merge pull request #2009 from viviicat/sass-in-prod
add SASS_PROCESSOR_ENABLED = True
2022-03-13 11:31:24 -07:00
Orage Pika
bcdee8071c fixing errors from check 2022-03-13 15:49:09 +01:00
Orage Pika
c99fe2bdc3 fixing errors from checks 2022-03-13 13:37:09 +01:00
Orage Pika
d2e6dfc07b fixing errors from checks 2022-03-13 13:31:38 +01:00
Orage Pika
4fb3cbfc29 fixing errors from checks 2022-03-13 13:30:37 +01:00
Orage Pika
d542be943f bw-dev black and fixing things according to the warning messages of the checks. 2022-03-13 13:23:58 +01:00
OragePika, aka "FANS DON'T CARE
974c569fc1
Merge branch 'main' into question_invite_correct 2022-03-13 13:14:23 +01:00
Vivianne Langdon
306f177d55 add SASS_PROCESSOR_ENABLED = True 2022-03-12 21:12:25 -07:00
Mouse Reeve
4cfa4046a1
Merge pull request #2008 from viviicat/fish-completions
Add autocompletions for fish shell
2022-03-12 06:39:09 -08:00
Vivianne Langdon
3358c233ea remove no-up autocomplete 2022-03-12 04:38:42 -08:00
Vivianne Langdon
4530d4917a make more compact with a function 2022-03-12 04:34:03 -08:00
Vivianne Langdon
822868bf87 fish autocompletions 2022-03-12 04:34:03 -08:00
Thomas Versteeg
5d8404f797 Add merge migration 2022-03-12 11:45:09 +01:00
Thomas Versteeg
9e6dfb4706
Merge branch 'main' into partially-read-shelf 2022-03-12 10:38:56 +00:00
corentin-feys
1b4e532f90 Added invite question migration 2022-03-12 11:19:14 +01:00
corentin-feys
5dbee33185 invite_question_text resets to default question when left blank 2022-03-12 11:13:42 +01:00
corentin-feys
7337f378c0 Hide the answer column from invites when invite questions are disabled 2022-03-12 11:10:44 +01:00
Vivianne Langdon
a4391f35c1 black 2022-03-11 22:31:40 -08:00
Vivianne Langdon
d6767e42fc fix variable clash 2022-03-11 22:28:05 -08:00
Vivianne Langdon
cf53134577 disable linting unused-argument 2022-03-11 21:19:20 -08:00
Vivianne Langdon
598a0587cf Fix issue with tabs on bottom of book page 2022-03-11 21:10:22 -08:00
Vivianne Langdon
f2d7bdbf27 in progress fixes for pylint 2022-03-11 20:14:45 -08:00
Vivianne Langdon
594fa5d058 Black 2022-03-11 20:00:13 -08:00
Vivianne
9fa8caba45
Merge branch 'bookwyrm-social:main' into url-names 2022-03-11 19:55:06 -08:00
Mouse Reeve
02a93bd730
Merge pull request #2006 from bookwyrm-social/log-level
Log info, not exception, for expected errors
2022-03-11 16:05:03 -08:00
Mouse Reeve
72d6a4ce52 Log info, not exception, for expected errors 2022-03-11 14:55:54 -08:00
Vivianne Langdon
5d25da93d5 revert previously changed unit tests 2022-03-11 04:25:50 -08:00
Vivianne Langdon
d9ac326c29 No more remote id with slug, just add slug in local path. 2022-03-11 04:18:52 -08:00
Mouse Reeve
e0ffcddd3c
Merge pull request #2003 from bookwyrm-social/modal-button-pattern
Consistent positioning of success buttons
2022-03-10 14:29:39 -08:00
Mouse Reeve
f2bf52ccb9
Merge pull request #2002 from bookwyrm-social/cw-refactor
Refactors content warning field
2022-03-10 14:29:16 -08:00
Mouse Reeve
dbf925f176 Removes trailing whitespace 2022-03-10 10:52:39 -08:00
Mouse Reeve
9977b33a8d Group, list, and shelve form buttons 2022-03-10 10:49:33 -08:00
Mouse Reeve
d4be0ca58b Report modal 2022-03-10 10:02:18 -08:00
Mouse Reeve
20453a9977 Delete readthrough and add cover modals 2022-03-10 09:57:55 -08:00
Mouse Reeve
8b4c9483ea Udates sync modals 2022-03-10 09:49:27 -08:00
Mouse Reeve
cbcd5c7a57 Adds elided page range to editions 2022-03-10 09:49:17 -08:00
Mouse Reeve
672eee9c9c Updates add file link modal 2022-03-10 09:41:32 -08:00
Mouse Reeve
d7eb118a07 Updates readthrough modal 2022-03-10 09:35:05 -08:00
Mouse Reeve
1657f28c5e Updates verification modal button positions 2022-03-10 09:30:39 -08:00
Mouse Reeve
cc2b774fb5 Updates wording on content warning field 2022-03-10 09:16:50 -08:00
Mouse Reeve
bcd83ee802 Fixes list notes icon 2022-03-10 09:16:44 -08:00
Mouse Reeve
a922b8fd04 Uses details to show/hide content warning field 2022-03-10 09:03:24 -08:00
Mouse Reeve
e2476d1ad3 Move content warning toggle out of post options block 2022-03-10 08:38:06 -08:00
OragePika, aka "FANS DON'T CARE
3868421bed
Merge branch 'main' into question_invite_correct 2022-03-10 01:42:47 +01:00
Orage Pika
0c429ee6d7 bw-dev blacked 2022-03-09 16:04:58 +01:00
Levi Bard
0c0d0b6299 Allow book subjects to be edited 2022-03-09 10:33:59 +01:00
Mouse Reeve
ad1969162f
Merge pull request #1999 from bookwyrm-social/locales
Locale updates
2022-03-08 12:43:33 -08:00
Mouse Reeve
a751884762 Locale updates 2022-03-08 12:12:39 -08:00
corentin-feys
bb7d080f65 Replaced tabs with spaces 2022-03-07 21:20:42 +01:00
corentin-feys
35f115bc0a removed unneeded code for invite question 2022-03-07 19:42:57 +01:00
corentin-feys
e1e03ebd22 removed unneded migrations 2022-03-07 19:41:24 +01:00
Orage Pika
5fbb5c655b custom questions 2022-03-07 18:49:59 +01:00
Mouse Reeve
34a4c18397
Merge branch 'main' into partially-read-shelf 2022-03-05 19:23:35 -08:00
Mouse Reeve
723ec8d461
Merge pull request #1994 from bookwyrm-social/theme-file
Adds custom compile management command
2022-03-04 17:58:46 -08:00
Mouse Reeve
f26106fffd Python formatting 2022-03-04 12:42:43 -08:00
Mouse Reeve
b0c0af9617 Adds custom compile management command 2022-03-04 12:40:06 -08:00
Vivianne Langdon
8838875879 Fix failure to 404 2022-03-02 04:07:13 -08:00
Vivianne Langdon
81594892ef Fix test for unit test requests 2022-03-02 03:42:29 -08:00
Vivianne Langdon
05f11e68c5 Hopefully knocking out many of the unit test fails 2022-03-02 03:11:02 -08:00
Vivianne Langdon
440e2f8806 black 2022-03-02 01:47:08 -08:00
Vivianne Langdon
2b483488aa Remove slugs from shelf as their id has text in it already 2022-03-02 01:37:58 -08:00
Vivianne Langdon
846963ad18 Fix accidental change to post 2022-03-02 01:16:30 -08:00
Vivianne Langdon
d8181d6d66 Redirect to correct url with slug 2022-03-02 01:12:32 -08:00
Vivianne Langdon
ebf463fc91 Generation of slugs and new urls to handle slugs
- TODO: redirect to correct slug if not found.
2022-03-02 00:21:23 -08:00
Vivianne
3ee3e9a13c
Merge branch 'main' into code-scanning 2022-03-01 18:33:40 -08:00
Mouse Reeve
0751a56474
Merge pull request #1990 from bookwyrm-social/themes-fix
Temporary fix for broken themes
2022-03-01 14:52:47 -08:00
Mouse Reeve
a99d482167 Temporary fix 2022-03-01 14:38:50 -08:00
Mouse Reeve
f7c6c70c5e Ticks version 2022-03-01 12:15:56 -08:00
Mouse Reeve
12ad88ac29
Merge pull request #1975 from bookwyrm-social/themes
Themes
2022-03-01 12:03:22 -08:00
Mouse Reeve
886448efc4
Merge pull request #1988 from bookwyrm-social/superlives
Keeps "superlatives" on about page local
2022-03-01 12:03:12 -08:00
Mouse Reeve
04ab584082 Update locales 2022-03-01 11:49:58 -08:00
Mouse Reeve
07daa24a72 Merge branch 'main' into themes 2022-03-01 11:46:02 -08:00
Mouse Reeve
89c8aa83f4 Tweaks preferences wording 2022-03-01 11:44:39 -08:00
Mouse Reeve
38535f811c Python formatting 2022-03-01 11:39:08 -08:00
Mouse Reeve
41ea7db8b6 Removes hardcoded white in announcements 2022-03-01 11:06:15 -08:00
Mouse Reeve
55f1ce12cf Second attempt at fixing tests using context processors 2022-03-01 11:05:47 -08:00
Mouse Reeve
4cdbdd8d0b
Merge pull request #1977 from viviicat/dark-theme
Dark theme
2022-03-01 11:00:05 -08:00
Mouse Reeve
9422a07414 Safer query for request user for tests 2022-03-01 10:36:19 -08:00
Mouse Reeve
5d7e6b872a Fixes localizing query for superlatives 2022-03-01 10:34:17 -08:00
Mouse Reeve
d1d743281a Cleans up display of superlatives on about page 2022-03-01 10:28:51 -08:00
Mouse Reeve
c7c90f9e9b Removes test print statement 2022-03-01 10:09:53 -08:00
Mouse Reeve
39fb402456
Merge pull request #1987 from viviicat/fix-reply-exception
Fix for TypeError/no focus when clicking on a reply
2022-03-01 09:58:31 -08:00
Mouse Reeve
f4dc07b6b9 Select theme in context processors 2022-03-01 09:53:02 -08:00
Vivianne Langdon
8e9bacc527 Fix red for <code> being too harsh 2022-02-28 23:31:57 -08:00
Vivianne Langdon
b4222bead4 Remove uuid for status reply panel
- The focus target did not include this uuid, so was throwing `Uncaught TypeError: node is null` when clicking on Reply button.
- I wasn't able to figure out how to share the uuid between blocks but it doesn't seem like the uuid is really needed -- the same block has other ids that do not have the uuid in them.
2022-02-28 23:01:33 -08:00
Vivianne Langdon
c0fed31fb0 eslint 2022-02-28 21:28:33 -08:00
Vivianne Langdon
40bb9112fd .prettierignore to vendor 2022-02-28 21:23:44 -08:00
Vivianne Langdon
62b4133e58 Move quagga to vendor. 2022-02-28 21:22:49 -08:00
Vivianne
8c92869fc0
Merge branch 'main' into code-scanning 2022-02-28 21:17:32 -08:00
Mouse Reeve
2c8fa5cd9b
Merge branch 'themes' into dark-theme 2022-02-28 13:32:37 -08:00
Mouse Reeve
a6883b5b87 Adds merge migration 2022-02-28 13:30:02 -08:00
Mouse Reeve
043fd54d70
Merge branch 'main' into themes 2022-02-28 13:27:05 -08:00
Mouse Reeve
e1ea847441
Merge pull request #1986 from bookwyrm-social/instance-refresh
Instance refresh
2022-02-28 13:26:22 -08:00
Mouse Reeve
142ecdf6aa
Merge pull request #1984 from bookwyrm-social/hide-follows
Option for users to hide their followers/following lists
2022-02-28 13:13:40 -08:00
Mouse Reeve
9efd67f6bf
Merge pull request #1985 from Strubbl/patch-1
Update README.md
2022-02-28 13:13:15 -08:00
Mouse Reeve
81cfcff939 Reload instance data 2022-02-28 13:11:01 -08:00
Mouse Reeve
c91b08303b More breadcrumbs 2022-02-28 12:31:28 -08:00
Mouse Reeve
f4aa202292 Adds counts of blocked and federated instances 2022-02-28 12:27:54 -08:00
Mouse Reeve
991461221d Adds breadcrumbs instead of "back" link 2022-02-28 12:24:45 -08:00
Strubbl
1888e8c8ed
Update README.md
fix link to instances
2022-02-28 21:23:00 +01:00
Mouse Reeve
00d0d9d5de Avoid whitespace when adding instance 2022-02-28 12:20:04 -08:00
Mouse Reeve
3dbbe0089c Show if user follows you 2022-02-28 12:07:06 -08:00
Mouse Reeve
ec93d1812a Block access to follow views 2022-02-28 12:04:47 -08:00
Thomas Versteeg
1e3f9246d6 Produce a proper status 2022-02-28 20:56:59 +01:00
Mouse Reeve
5837c37a32 Hide followers info slug 2022-02-28 11:55:54 -08:00
Mouse Reeve
e90cb52f23 Add option to hide follows 2022-02-28 11:48:49 -08:00
Thomas Versteeg
539775f370 Merge remote-tracking branch 'upstream/main' into partially-read-shelf 2022-02-28 20:44:55 +01:00
Mouse Reeve
6c17aa7630
Merge pull request #1983 from bookwyrm-social/shelf-name-translation
Shelf name translation
2022-02-28 11:28:53 -08:00
Mouse Reeve
5cdcac0682
Merge pull request #1981 from bookwyrm-social/list-duplicate-books
Show meaningful message when you try to add a duplicate book to a list
2022-02-28 11:21:18 -08:00
Mouse Reeve
b7111589c3
Merge pull request #1982 from bookwyrm-social/deleted-user-reviews
Remove reviews from deleted users
2022-02-28 11:20:44 -08:00
Mouse Reeve
7d6032e110 Fixes calls to filter 2022-02-28 11:18:03 -08:00
Mouse Reeve
ffb4098cfb Fixes translation of "remove from shelf" string 2022-02-28 11:07:12 -08:00
Mouse Reeve
0f5fd6be15 Move translations to filter 2022-02-28 11:05:12 -08:00
Mouse Reeve
374dd24fa8 Remove reviews from deleted users 2022-02-28 10:47:08 -08:00
Mouse Reeve
142cc5437a Move sorting to separate function 2022-02-28 10:41:40 -08:00
Mouse Reeve
99fc3aaf25 Avoid showing success and failure 2022-02-28 10:31:58 -08:00
Mouse Reeve
b2b3ba653e Refactors how success/failure messages how on list page 2022-02-28 10:29:58 -08:00
Mouse Reeve
202696f913 Don't show lists a book is already on in add form 2022-02-28 10:03:24 -08:00
Mouse Reeve
c82042f506 Delete themes 2022-02-28 09:55:23 -08:00
Mouse Reeve
106ef2e3a4 Fixes reference to theme in layout 2022-02-28 09:46:05 -08:00
Mouse Reeve
295d9c42d7 Adds theme to user settings form 2022-02-28 09:45:34 -08:00
Mouse Reeve
a00ee8a706 Adds link to set instance-wide theme 2022-02-28 09:43:31 -08:00
Mouse Reeve
f54d4863fe Updates .gitignore for themes 2022-02-28 09:37:51 -08:00
Mouse Reeve
2d516812b4 Fixes icons by moving import to theme 2022-02-28 09:34:54 -08:00
Mouse Reeve
f5fb5ae045 Removes instance config file
I'd be happy to re-add this if it's useful, but I think it's confusing
to have in addition to themes
2022-02-28 09:34:30 -08:00
Mouse Reeve
4d3e709b2a
Update layout.html 2022-02-28 09:23:03 -08:00
Mouse Reeve
3283302093
Merge branch 'themes' into dark-theme 2022-02-27 20:21:17 -08:00
Vivianne Langdon
3a9ff2c2ea Refer to canvas by type
- Fixes stylelint without adding an exclusion
2022-02-27 14:08:11 -08:00
Vivianne Langdon
c0380cca5a stylelint 2022-02-27 14:04:30 -08:00
Vivianne Langdon
1d4539c4c0 Don't pretty the min.js file 2022-02-27 14:03:45 -08:00
Vivianne Langdon
fbe7e860e8 Prettier 2022-02-27 14:01:25 -08:00
Mouse Reeve
8259d16ee9 Check available themes in form 2022-02-27 11:20:11 -08:00
Mouse Reeve
005b69177c
Merge branch 'themes' into dark-theme 2022-02-27 10:54:15 -08:00
Mouse Reeve
c8d3222c33
Rename dark.scss to bookwyrm-dark.scss 2022-02-27 10:52:07 -08:00
Mouse Reeve
fd0f739418
Rename light.scss to bookwyrm-light.scss 2022-02-27 10:51:49 -08:00
Mouse Reeve
8850b68b52 Show theme options 2022-02-27 10:48:33 -08:00
Mouse Reeve
cc015536fa Adds theme instructions 2022-02-27 10:12:47 -08:00
Mouse Reeve
3dfbb3272e Theme selector 2022-02-27 10:00:50 -08:00
Mouse Reeve
6e96c1eee7 Avoid linter error 2022-02-27 08:09:17 -08:00
Vivianne Langdon
e4d7dd7ee4 Fix progress bar 2022-02-27 05:29:33 -08:00
Vivianne Langdon
40319302b7 Initial theme 2022-02-27 05:20:29 -08:00
Vivianne Langdon
789626a9da Stray line 2022-02-27 00:39:45 -08:00
Vivianne Langdon
f5c66b5b4a Adjust layout more
Ensure camera select box is never hidden.
2022-02-27 00:33:54 -08:00
Vivianne Langdon
43f62ef5d7 d'oh, fix event leak 2022-02-27 00:18:38 -08:00
Vivianne Langdon
9f67a74340 Show grant access dialog every time we initialize 2022-02-27 00:04:25 -08:00
Vivianne Langdon
e71a5e3bdf Add barcode icon and use other icons
Minor formatting and messaging tweaks
2022-02-27 00:00:22 -08:00
Vivianne Langdon
f4d5b7b4d2 Adjusted message 2022-02-26 23:28:52 -08:00
Vivianne Langdon
9b0874f889 Fix barcode button 2022-02-26 23:28:13 -08:00
Vivianne Langdon
cdddf73e29 Improve layout for some camera types 2022-02-26 23:22:44 -08:00
Vivianne Langdon
464050deaa Implement switching cameras
Also, use session storage to remember last selected camera deviceId, if any
2022-02-26 21:32:01 -08:00
Vivianne Langdon
fee6ffcbd8 Fix formatting in chrome
Was using experimental selector, forget about it.
Also reduce jumping around of video size
2022-02-26 21:29:18 -08:00
Vivianne Langdon
8d0e549480 Improve visuals and quality of scanning 2022-02-26 20:19:26 -08:00
Vivianne Langdon
649ffe571a Fix typos with searching 2022-02-26 18:29:38 -08:00
Vivianne Langdon
fcc8b6aaab Move to sass 2022-02-26 18:19:12 -08:00
Vivianne Langdon
340b306d2e Fix path 2022-02-26 18:08:07 -08:00
Vivianne Langdon
48c8166e58 Merge branch 'main' into code-scanning 2022-02-26 17:54:33 -08:00
Mouse Reeve
43269429ac Use selected theme 2022-02-26 13:40:06 -08:00
Mouse Reeve
e15193e100 Adds themes 2022-02-26 12:44:20 -08:00
Mouse Reeve
6b5bebdf78 Cleans up scheduler form 2022-02-26 10:45:43 -08:00
Mouse Reeve
0870eccad9 Adds unscheduler 2022-02-26 10:24:23 -08:00
Mouse Reeve
2a436800c4 Schedules automod task 2022-02-26 10:14:47 -08:00
Mouse Reeve
95e9119817 Adds django celery beat 2022-02-26 08:44:19 -08:00
Mouse Reeve
a5571c65bc
Update 0134_alter_stopped_reading.py 2022-02-25 18:25:41 -08:00
Mouse Reeve
b511928400
Create 0134_alter_stopped_reading.py 2022-02-25 18:08:30 -08: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
1d99e455e8 Adds link to add edition to editions page 2022-02-25 16:40:21 -08:00
Thomas Versteeg
8deee2220e Fix stopped reading status model in non-javascript environment 2022-02-25 22:39:42 +01:00
Mouse Reeve
ab1c7c6d0a
Merge pull request #1971 from bookwyrm-social/scroll-bug
Removes scrollIntoView script behavior for tabs
2022-02-25 13:21:20 -08:00
Thomas Versteeg
5eb113af6b Create merge migration 2022-02-25 22:03:49 +01:00
Thomas Versteeg
e9dfa42e11
Merge branch 'main' into partially-read-shelf 2022-02-25 21:00:29 +00:00
Mouse Reeve
02808f88e6 eslint fixes 2022-02-25 13:00:23 -08:00
Mouse Reeve
65bd3945e7 Prettify tabs file 2022-02-25 12:52:35 -08:00
Mouse Reeve
cec7625e1e Moves tabs script to main scripts directory
It's our own custom script at this point
2022-02-25 12:47:46 -08:00
Mouse Reeve
5d4efd457a Removes scrollIntoView script behavior for tabs 2022-02-25 12:39:44 -08:00
Mouse Reeve
ac36aa9327
Merge pull request #1969 from bookwyrm-social/author-book-sort
Sort author books by rating
2022-02-25 12:30:06 -08:00
Mouse Reeve
ad1d768be9
Merge pull request #1970 from bookwyrm-social/locales
Updates locales
2022-02-25 12:29:54 -08:00
Mouse Reeve
ee8c1659ab Updates locales 2022-02-25 12:13:20 -08:00
Mouse Reeve
8ca2b55e7e Sort author books by rating 2022-02-25 12:04:21 -08:00
Mouse Reeve
6d1d62cf2f View for starting to edit a book with existing data 2022-02-25 11:50:25 -08:00
Mouse Reeve
f1f7b21d43
Merge pull request #1968 from bookwyrm-social/automod
Automod
2022-02-24 17:51:40 -08:00
Mouse Reeve
689be8c94b Only scan local data 2022-02-24 17:42:28 -08:00
Mouse Reeve
84ef214ca1 Valid template markup 2022-02-24 17:36:49 -08:00
Mouse Reeve
eb8b9fdaed Fixes bugs in model task 2022-02-24 17:33:22 -08:00
Mouse Reeve
1aa6b99d1f Adds tests 2022-02-24 17:33:05 -08:00
Mouse Reeve
f446828175 Fixes template typo 2022-02-24 14:39:09 -08:00
Mouse Reeve
84b9a19339 Expands scanned fields 2022-02-24 13:29:17 -08:00
Mouse Reeve
93f82fbf18 Adds notifications 2022-02-24 13:20:18 -08:00
Mouse Reeve
ad41f19dc5 Updates report model 2022-02-24 13:00:41 -08:00
Mouse Reeve
3ce8b3390e Adds task 2022-02-24 12:16:18 -08:00
Mouse Reeve
e837da37db Adds task 2022-02-24 12:15:08 -08:00
Mouse Reeve
12f67dc0ce Adds automod view 2022-02-24 11:18:43 -08:00
Mouse Reeve
c8b4d5ecf1 Adds model for creating automated moderation flags 2022-02-24 09:58:37 -08:00
Mouse Reeve
20df7cbdd6
Merge pull request #1966 from bookwyrm-social/missing-tag
Adds missing tag
2022-02-21 09:24:19 -08:00
Mouse Reeve
2457315ed8 Adds missing tag 2022-02-21 08:44:04 -08:00
Mouse Reeve
70601612f8
Removes unused dependency (#1965) 2022-02-20 18:42:14 -08:00
Mouse Reeve
4672294d7c
Cache fix (#1961) 2022-02-19 16:34:48 -08:00
Mouse Reeve
c77e5a1a90
Split css (#1959)
Divides the css into sub-files and normalizes how colors are defined.

Co-authored-by: Joachim <joachim.robert@protonmail.com>
2022-02-19 16:34:17 -08:00
Mouse Reeve
6daaffeaa7
Compiles css framework from sass (#1956)
* Compiles css framework from sass

* Adds watch commands

* Copies existing css to sass file

* Moves sass out of static path

* Removes global linter

I wasn't sure how to customize this, and it's not providing a lot of
additional value on top of the domain-specific linters

* Reverts invalid change to dockerfile

* Changes stylelint path

* Remove unused bulma files

* Properly minifies generated css

* Fixes regression in thread display

* rgba function only works with percents for whatever reason

* Hush stylelint

* Removes trailing zeros

* Compile sass in Django

Co-authored-by: Joachim <joachim.robert@protonmail.com>

* Python formatting

* Updates linter

* Updates commands

* Adds css-config file

Co-authored-by: Joachim <joachim.robert@protonmail.com>

* Stylelint fix

* Removes unused compiled bulma files

Co-authored-by: Joachim <joachim.robert@protonmail.com>
2022-02-19 15:29:47 -08:00
Mouse Reeve
c5f8715c59
Merge pull request #1957 from bookwyrm-social/env-errors
Removes inline comments that are causing errors
2022-02-19 08:11:29 -08:00
Mouse Reeve
57fd675857 Ticks javscript cache buster 2022-02-19 07:52:05 -08:00
Mouse Reeve
275f3cbedb Removes inline comments that are causing erros 2022-02-18 21:07:39 -08:00
Mouse Reeve
cd65cfafce
Merge pull request #1955 from bookwyrm-social/dev-tools-tweaks
Updates dev tools
2022-02-18 09:21:45 -08:00
Mouse Reeve
7d68c23ce5 Updates dev tools 2022-02-18 08:48:44 -08:00
Mouse Reeve
1d44c2bf1f
Merge pull request #1954 from bookwyrm-social/locales
Updates locales for new view
2022-02-17 21:14:28 -08:00
Mouse Reeve
3d2ea40ad4 Updates locales for new view 2022-02-17 20:24:03 -08:00
Mouse Reeve
731ab88604
Merge pull request #1953 from bookwyrm-social/cache-translation
Fixes cache translation
2022-02-17 19:13:35 -08:00
Mouse Reeve
98736925f7 Fixes cache translation 2022-02-17 18:59:35 -08:00
Mouse Reeve
9eb798e932
Merge pull request #1952 from bookwyrm-social/settings
Fixes admin settings view
2022-02-17 18:10:17 -08:00
Mouse Reeve
edf3b61602 Show error or success states 2022-02-17 18:00:19 -08:00
Mouse Reeve
1aac665094 Fixes settings form 2022-02-17 17:50:57 -08:00
Mouse Reeve
64a83b38b5
Merge pull request #1951 from bookwyrm-social/accessibility-fixes
Accessibility fixes
2022-02-17 17:21:17 -08:00
Mouse Reeve
1b63c19a9c Fixes error in previous PR 2022-02-17 17:10:12 -08:00
Mouse Reeve
5d098b3c10 Removes duplicate selector 2022-02-17 17:01:21 -08:00
Mouse Reeve
31a61713d9 Runs stylelint fix 2022-02-17 16:53:53 -08:00
Mouse Reeve
d510299ae4 Reverts change to shelve button dropdown 2022-02-17 16:51:54 -08:00
Mouse Reeve
561eaeaf54
Merge pull request #1935 from joachimesque/accessibility/fixes
[Accessibility] Fixes
2022-02-17 16:50:32 -08:00
Mouse Reeve
98cad7c51a
Merge pull request #1950 from bookwyrm-social/release-notice
Adds notice to admin about available updates
2022-02-17 16:37:22 -08:00
Mouse Reeve
3869f0cc1a Python formatting 2022-02-17 16:28:55 -08:00
Mouse Reeve
9132c054f2 Adds notice to admin about available updates 2022-02-17 16:23:15 -08:00
Mouse Reeve
ebf905e20b
Merge pull request #1949 from bookwyrm-social/admin-setup
Flow for creating the admin account on a new instance
2022-02-17 16:04:30 -08:00
Mouse Reeve
92f3357977 Anchor link to dev chat 2022-02-17 15:53:58 -08:00
Mouse Reeve
31d362d715 Adds setup views tests 2022-02-17 14:55:48 -08:00
Mouse Reeve
3b0fc9785e Removes unused file 2022-02-17 13:31:38 -08:00
Mouse Reeve
08e378a539 Fixes register tests 2022-02-17 13:27:44 -08:00
Mouse Reeve
be479fe4cb Adds warnings about misconfigurations 2022-02-17 13:22:33 -08:00
Mouse Reeve
f6e2ec02aa Adds overview page to setup 2022-02-17 13:02:07 -08:00
Mouse Reeve
1b9688832a Don't use my name as the default flower user 2022-02-17 12:18:35 -08:00
Mouse Reeve
bf75dff338 Contextualize admin code command output 2022-02-17 11:53:29 -08:00
Mouse Reeve
637f7c9cb9 Initialize site settings in install mode 2022-02-17 11:51:48 -08:00
Mouse Reeve
679b55d9ad Updates bw-dev and adds setup command 2022-02-17 11:50:16 -08:00
Mouse Reeve
63558bb75e Python formatting 2022-02-17 11:31:52 -08:00
Mouse Reeve
54b0bf02b5
Merge pull request #1948 from bookwyrm-social/locales
Updates locales
2022-02-17 11:29:36 -08:00
Mouse Reeve
2883c42534 Disable registration by default 2022-02-17 11:27:05 -08:00
Mouse Reeve
23d0d3e2b7 Register admin user 2022-02-17 11:25:11 -08:00
Mouse Reeve
ed536e6b41 Adds command to get admin code 2022-02-17 10:59:28 -08:00
Mouse Reeve
b4e0749f73 Disallow registration in install mode and adds redirects 2022-02-17 10:52:12 -08:00
Mouse Reeve
8e3c39d319 Adds admin key field to admin user setup form 2022-02-17 10:39:08 -08:00
Mouse Reeve
4eb4efee9d Create admin account markup 2022-02-17 10:22:44 -08:00
Mouse Reeve
c31ec7dbd5 Adds setup view 2022-02-17 10:03:02 -08:00
Mouse Reeve
e9397eaedd Adds setup templates 2022-02-17 10:02:27 -08:00
Mouse Reeve
1a8f4a916e
Merge pull request #1891 from bookwyrm-social/openlibrary-author-fields
Openlibrary author fields
2022-02-17 09:00:04 -08:00
Mouse Reeve
0da759bfd5 Updates locales 2022-02-17 08:59:05 -08:00
Mouse Reeve
c04d2d285b Python formatting 2022-02-17 08:42:12 -08:00
Thomas Versteeg
d67dac4519
Merge branch 'main' into partially-read-shelf 2022-02-17 16:34:10 +00:00
Mouse Reeve
88999168bc
Merge pull request #1946 from bookwyrm-social/use-https-defualt
Sets default USE_HTTPS value based on debug
2022-02-17 08:30:49 -08:00
Mouse Reeve
a2c4dd4f9f Updates migration and database fields 2022-02-17 08:25:01 -08:00
Mouse Reeve
39691bed3a Merge branch 'main' into openlibrary-author-fields 2022-02-16 18:06:04 -08:00
Mouse Reeve
839d91e4d4
Merge pull request #1941 from bookwyrm-social/dev-tools
Adds dev tools docker image
2022-02-16 18:05:22 -08:00
Mouse Reeve
cfc1302b23 Fixes spacing 2022-02-16 17:53:03 -08:00
Mouse Reeve
954e914638 Linebreaks? who knows. 2022-02-16 17:50:30 -08:00
Mouse Reeve
7afb5bc493 Stylelint needs libraries 2022-02-16 17:47:58 -08:00
Mouse Reeve
862b6f49bd Correct npm package names 2022-02-16 17:45:04 -08:00
Mouse Reeve
4b2ac4fa10 Re-adds yarn.lock 2022-02-16 17:40:59 -08:00
Mouse Reeve
e23e108e3a Merge branch 'main' into dev-tools 2022-02-16 17:39:03 -08:00
Mouse Reeve
c054ccc84b Try ci with yarn instead of npx 2022-02-16 17:36:44 -08:00
Mouse Reeve
60b2453d4d Fixes bw-dev stylelint command 2022-02-16 17:34:14 -08:00
Mouse Reeve
9038afd7f1 Changes npm install 2022-02-16 13:16:05 -08:00
Mouse Reeve
c1853e03ab Updates stylelint command 2022-02-16 13:14:48 -08:00
Mouse Reeve
6f90c80494 Gets stylelint command working 2022-02-16 13:13:11 -08:00
Mouse Reeve
1412fa507c Gets prettier command working 2022-02-16 12:54:03 -08:00
Mouse Reeve
d593a3a503 Sets default USE_HTTPS value based on debug 2022-02-15 13:15:04 -08:00
Mouse Reeve
55177990e3 Adds stylelint-config-recommended 2022-02-15 12:47:15 -08:00
Mouse Reeve
c19b9d7575 Updates stylelintrc filename and removes yarn 2022-02-15 12:46:28 -08:00
Mouse Reeve
f28d60b94f Tries adding packages 2022-02-15 12:41:22 -08:00
Mouse Reeve
450d4cdace Try using npx instead of yarn for stylelint 2022-02-15 12:39:14 -08:00
Mouse Reeve
7ff1ad7c83 Try again with yarn added as separate step 2022-02-15 12:37:28 -08:00
Mouse Reeve
4428c0f14d Remoes yarn line 2022-02-15 12:34:28 -08:00
Mouse Reeve
09978fc195 Tries npm install with yarn 2022-02-15 12:29:59 -08:00
Mouse Reeve
714bb081ea Updates workflows 2022-02-15 12:25:35 -08:00
Mouse Reeve
a07239c6a9
Merge pull request #1933 from bookwyrm-social/announcements
Cleans up code for announcements
2022-02-15 10:40:56 -08:00
Mouse Reeve
6fa29a6293 Fixes tests 2022-02-15 10:32:04 -08:00
Vivianne Langdon
82cb170a91 Switch version of quagga to new fork quagga2 2022-02-15 02:39:16 -08:00
Vivianne Langdon
1e04385f0c Worked more on visuals of modal
Need to finish camera selection mode.
2022-02-15 02:38:57 -08:00
Thomas Versteeg
d63e5ab2d2 Fix tests 2022-02-14 18:12:08 +01:00
Willi Hohenstein
03ff8c248d Added input control and better char replacement 2022-02-14 17:38:45 +01:00
Vivianne Langdon
5ae4eb9b8f Super messy initial working version. To clean up. 2022-02-14 02:56:05 -08:00
Willi Hohenstein
0b02287378 add docstring 2022-02-13 20:49:44 +01:00
Willi Hohenstein
526a1c6ef4 removed unnecessary code 2022-02-13 20:31:06 +01:00
Willi Hohenstein
54eeeb5798 fix style to pass tests 2022-02-13 20:30:11 +01:00
Willi Hohenstein
3c05cecb50 function moved 2022-02-13 19:07:25 +01:00
Willi Hohenstein
a4b08d7213 add test with valid isbn10 2022-02-13 17:10:32 +01:00
Willi Hohenstein
5801ef011f add isbn check 2022-02-13 09:35:15 +01:00
Willi Hohenstein
27c26b4d16 add test for dashed ISBN 2022-02-13 09:34:28 +01:00
Mouse Reeve
b601ac6f91 Adds dev tools docker image 2022-02-12 14:06:18 -08:00
Mouse Reeve
1a2c85a327
Merge pull request #1938 from willhoh/main
Change cover class
2022-02-12 11:03:32 -08:00
Mouse Reeve
5df8bf03e6 Fixes black versioning error 2022-02-12 11:00:24 -08:00
Mouse Reeve
7fdf07c6ec Updates tests 2022-02-12 10:56:55 -08:00
Thomas Versteeg
c88b34814f Rename 'Partially Read' to 'Stopped Reading' 2022-02-12 19:49:54 +01:00
Willi Hohenstein
164e0686b9 add class for correct display 2022-02-12 19:35:44 +01:00
Mouse Reeve
9827cef9a9 Python formatting 2022-02-12 10:34:16 -08:00
Mouse Reeve
1761db5444
Merge pull request #1920 from bookwyrm-social/branch-convergence
Moves towards single branch setup
2022-02-12 10:31:55 -08:00
Mouse Reeve
72818d4ab2
Merge pull request #1939 from bookwyrm-social/list-bug
Fixes display name of list contributor comments
2022-02-12 10:29:41 -08:00
Mouse Reeve
a2d9bf50c5 Fixes display name of list contributor comments 2022-02-12 10:18:14 -08:00
Mouse Reeve
df0467a662
Merge pull request #1930 from bookwyrm-social/dependabot/pip/django-3.2.12
Bump django from 3.2.11 to 3.2.12
2022-02-12 10:10:38 -08:00
Mouse Reeve
6bf6b118bf
Merge pull request #1937 from bookwyrm-social/stylelint-prettier
Adds stylelint fix to bw-dev
2022-02-12 09:58:26 -08:00
Mouse Reeve
d49e9b4dcd Updates packages 2022-02-12 09:41:18 -08:00
Mouse Reeve
30ad3bba0b Suggest stylelint --fix in CI and add to bw-dev 2022-02-12 09:00:38 -08:00
Willi Hohenstein
67ea18c840 Changed cover class for proper image size in mobile 2022-02-12 17:58:36 +01:00
Joachim
c33cf60624 aria-hidden elements do not contain focusable elements
https://dequeuniversity.com/rules/axe/4.3/aria-hidden-focus
2022-02-12 16:33:16 +01:00
Joachim
7877524116 ARIA button, link, and menuitem must have an accessible name
https://dequeuniversity.com/rules/axe/4.3/aria-command-name

In this case, the menuitem wasn't displayed (because the div was hidden). I prefer not to include the menuitem in that situation.
2022-02-12 16:25:40 +01:00
Joachim
f742cc023b ARIA attributes must conform to valid values
https://dequeuniversity.com/rules/axe/4.3/aria-valid-attr-value
2022-02-12 16:18:56 +01:00
Joachim
b27b6a5980 Certain ARIA roles must contain particular children
https://dequeuniversity.com/rules/axe/4.3/aria-required-children

In order to make this work, I had to translate Bulma's style so it doesn't use `ul` and `li` anymore.

The JS code had to be adapted, I also changed `button` to `tab` (seemed like a more relevant name) and added a `scrollIntoView()` on load the active tab is always visible.
2022-02-12 16:14:35 +01:00
Joachim
bbb89605a5 Page must have one main landmark
https://dequeuniversity.com/rules/axe/4.3/landmark-one-main
2022-02-12 16:10:40 +01:00
Willi Hohenstein
6cb480d111 Merge branch 'main' of github.com:willhoh/bookwyrm 2022-02-12 15:36:30 +01:00
Thomas Versteeg
bc89dd7041 Change shelf Finished label
When the shelf is read the label is 'Finished', otherwise it's 'Until'.
2022-02-12 11:19:00 +01:00
Mouse Reeve
89de03bffe Adds breadcrumbs 2022-02-11 14:58:40 -05:00
Mouse Reeve
b95f0ed287 Use color in announcement 2022-02-11 14:43:37 -05:00
Mouse Reeve
01b52f023a Adds edit announcement view 2022-02-11 14:42:47 -05:00
Mouse Reeve
cfa91e2570 Adds color options to announcements 2022-02-11 14:00:01 -05:00
Mouse Reeve
ee23aba994 Use details and summary for announcement panel 2022-02-11 13:50:55 -05:00
Mouse Reeve
62741a5d2e Allow html in announcement header 2022-02-11 13:36:08 -05:00
Mouse Reeve
059fd84d06 Adds delete button to announcements list view
It's handy to have it there
2022-02-11 13:33:42 -05:00
Thomas Versteeg
2b27889457 Add 'Partially Read' shelf 2022-02-11 14:33:46 +01:00
dependabot[bot]
046f516091
Bump django from 3.2.11 to 3.2.12
Bumps [django](https://github.com/django/django) from 3.2.11 to 3.2.12.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/3.2.11...3.2.12)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-10 13:02:16 +00:00
Mouse Reeve
542957364c
Merge pull request #1929 from bookwyrm-social/link-federation
Use correct model type for federated links
2022-02-09 09:30:26 -08:00
Mouse Reeve
bd846bba34
Merge pull request #1927 from bookwyrm-social/update-command
Refresh web and celery in update command
2022-02-09 09:25:15 -08:00
Mouse Reeve
c06817e9ff Python formatting 2022-02-09 12:23:01 -05:00
Mouse Reeve
6323b0e700 Use correct model type for federated links 2022-02-09 12:20:11 -05:00
Mouse Reeve
e9e4f70ae4 Refresh web and celery in update command 2022-02-08 09:17:42 -05:00
Mouse Reeve
74fd13fb22 Consistent ordering of items in docker-compose file 2022-02-06 06:37:03 -08:00
Mouse Reeve
4b88ea142f
Merge pull request #1922 from bookwyrm-social/version
Tick version number
2022-02-04 20:21:49 -08:00
Mouse Reeve
73b611d68d Tick version number 2022-02-04 20:12:26 -08:00
Mouse Reeve
d65a80d9ea
Merge pull request #1921 from bookwyrm-social/author-page-query
Fixes author page query
2022-02-04 19:51:24 -08:00
Mouse Reeve
a73960a0da Python formatting 2022-02-04 19:44:03 -08:00
Mouse Reeve
49ceb2a978 Fixes warning in author view tests 2022-02-04 19:41:21 -08:00
Mouse Reeve
a9a6fd1242 Adds test for author page bug 2022-02-04 19:34:37 -08:00
Mouse Reeve
28a8edfdc4 Fixes author page query 2022-02-04 19:06:47 -08:00
Mouse Reeve
bc7aa91b97 Fixes pylint complaints 2022-02-04 18:50:57 -08:00
Mouse Reeve
28fe0b0bc6
Merge pull request #1919 from bookwyrm-social/locales
Updates locales
2022-02-04 18:37:05 -08:00
Mouse Reeve
7811a9920e Copy config from prod branch to main 2022-02-04 18:36:12 -08:00
Mouse Reeve
d8c3699adc Updates locales 2022-02-04 18:21:48 -08:00
Mouse Reeve
0601f68685
Merge pull request #1918 from bookwyrm-social/ports
Don't expose unnecessary ports
2022-02-04 18:12:05 -08:00
Mouse Reeve
ea035b9fbe Don't expose unnecessary ports 2022-02-04 17:58:29 -08:00
Mouse Reeve
70bd6b9a65
Merge pull request #1917 from bookwyrm-social/list-page-error
Fixes errors in how lists with notes display
2022-02-04 15:44:49 -08:00
Mouse Reeve
18768a23f3 Fixes test 2022-02-04 15:30:58 -08:00
Mouse Reeve
0c3b6e6938
Merge pull request #1900 from willhoh/main
Added check for bocked or pending domains. Fixes #1850
2022-02-04 12:11:41 -08:00
Mouse Reeve
547d246375 Fixes 500 error 2022-02-04 12:09:20 -08:00
Mouse Reeve
0683ce1c33 Proper markdown formatting 2022-02-04 12:07:26 -08:00
Mouse Reeve
fefb7e582a Fixes list note display 2022-02-04 12:02:10 -08:00
Mouse Reeve
719df5621c Unit test to catch error on list page 2022-02-04 11:58:03 -08:00
Mouse Reeve
82aacf8f2a
Update forms.py 2022-02-04 11:47:18 -08:00
Mouse Reeve
e80a4c16f0
Merge pull request #1915 from bookwyrm-social/url-validation
Adds some simple url validation
2022-02-04 08:45:43 -08:00
Willi Hohenstein
495af09c4c
Merge branch 'bookwyrm-social:main' into main 2022-02-04 14:11:50 +01:00
Willi Hohenstein
a3e2cd77a1 Merge branch 'main' of github.com:bookwyrm-social/bookwyrm 2022-02-04 14:09:15 +01:00
Mouse Reeve
da8e07057c
Merge pull request #1916 from bookwyrm-social/user-view
Fixes duplicted shelves on user view
2022-02-03 19:31:49 -08:00
Mouse Reeve
7c0d51ed14 Fixes duplicted shelves on user view 2022-02-03 18:59:08 -08:00
Mouse Reeve
3e635f497e Adds some simple url validation 2022-02-03 15:11:01 -08:00
Willi Hohenstein
58fb9ba0d4
Merge branch 'bookwyrm-social:main' into main 2022-02-03 23:55:17 +01:00
Mouse Reeve
ebc3f14f22
Merge pull request #1914 from bookwyrm-social/static-close-buttons
Show cancel buttons on modals in static mode
2022-02-03 14:08:36 -08:00
Mouse Reeve
f545184c5b
Merge pull request #1913 from bookwyrm-social/import-ui-fixes
Fixes links on import page
2022-02-03 14:01:28 -08:00
Mouse Reeve
9013b1417a Show cancel buttons on modals in static mode 2022-02-03 13:59:53 -08:00
Mouse Reeve
3b12af63b6 Fixes links on import page 2022-02-03 13:49:33 -08:00
Mouse Reeve
582b84ecaa
Merge pull request #1911 from bookwyrm-social/more-tests
Activitystreams tests
2022-02-03 13:33:15 -08:00
Mouse Reeve
8518b4f877
Merge pull request #1912 from bookwyrm-social/sanitize-tags
Adds allowlist for html attrs
2022-02-03 13:29:40 -08:00
Mouse Reeve
85aad7c219 Another sorting order error 2022-02-03 13:25:44 -08:00
Mouse Reeve
cae7191a2b Python formatting 2022-02-03 13:19:56 -08:00
Mouse Reeve
2c7a6e8518 Correct status order 2022-02-03 13:17:16 -08:00
Mouse Reeve
1f6ecc39ac Adds allowlist for html attrs 2022-02-03 13:15:06 -08:00
Mouse Reeve
7b5bee8d7b Merge branch 'main' into more-tests 2022-02-03 12:48:11 -08:00
Mouse Reeve
3b48d986d5
Merge pull request #1910 from bookwyrm-social/superlative-rating
Fixes rating in about page superlatives
2022-02-03 12:46:07 -08:00
Mouse Reeve
5a3ce5e328 Fixes rating in about page superlatives 2022-02-03 11:48:56 -08:00
Mouse Reeve
a370602903
Merge pull request #1860 from cincodenada/image-generation-add-cjk
Use Source Han Sans for preview images generation (bis)
2022-02-03 11:11:38 -08:00
Mouse Reeve
c58a3ac114
Merge branch 'main' into main 2022-02-03 10:40:27 -08:00
Mouse Reeve
e4b53266b3
Merge pull request #1909 from bookwyrm-social/list-notes-edit
Fixes add/edit notes form on list page
2022-02-03 10:39:22 -08:00
Mouse Reeve
a46ab96d9b Fixes add/edit notes form on list page 2022-02-03 10:30:30 -08:00
Mouse Reeve
baf28c523a
Merge pull request #1908 from bookwyrm-social/fix-shelf-view
Fix shelf names on books page
2022-02-03 08:58:16 -08:00
Mouse Reeve
2c16b8f33b Fix shelf names on books page 2022-02-03 08:44:51 -08:00
Willi Hohenstein
1b313c2b62 added check of existing url for book
sould also fix #1899
2022-02-02 22:34:30 +01:00
Mouse Reeve
4a299bd5d0
Merge pull request #1905 from bookwyrm-social/locale-migration
Adds migration for locale name update
2022-02-02 13:25:23 -08:00
Mouse Reeve
e18f6fbfaf Adds migration for locale name update 2022-02-02 12:44:11 -08:00
Mouse Reeve
f8bd0800f1
Merge pull request #1904 from bookwyrm-social/book-page-add-list
Fixes adding book to list from book page
2022-02-02 12:40:44 -08:00
Mouse Reeve
fedc8deaa1
Merge pull request #1901 from bookwyrm-social/swedish-locale-name
Fixes name of Swedish locale
2022-02-02 12:30:47 -08:00
Mouse Reeve
36a52019fb Fixes adding book to list from book page 2022-02-02 12:29:01 -08:00
Mouse Reeve
36a47760cd Updates locales 2022-02-02 12:15:00 -08:00
Mouse Reeve
e9370fe4c9 Fixes name of Swedish locale 2022-02-02 11:43:54 -08:00
Willi Hohenstein
c2c33fe1e8 fixed merge conflict 2022-02-02 20:20:16 +01:00
Mouse Reeve
b5baf1620f
Merge pull request #1897 from bookwyrm-social/verify-image-types
Check image extensions before saving
2022-02-02 11:04:52 -08:00
Willi Hohenstein
4503dd6864 Merge branch 'main' of github.com:willhoh/bookwyrm 2022-02-02 19:51:23 +01:00
Willi Hohenstein
e37982d285 added domain pending or blocked check
fixes #1850
2022-02-02 19:35:26 +01:00
Mouse Reeve
6fd3ac0cb1 Changes how test image data is loaded 2022-02-02 09:36:47 -08:00
Mouse Reeve
f84241b085
Merge pull request #1804 from cincodenada/run-not-exec
Use run --rm instead of exec for initdb
2022-02-02 09:10:28 -08:00
Mouse Reeve
194c69f512 Fixes return values of null responses 2022-02-02 07:09:35 -08:00
Joel Bradshaw
060f515aea Be even more conservative on errors
This runs at startup of anything, so we should be extra sure to not
break anything, and lots of things can go wrong downloading files from
the internet
2022-02-01 21:59:07 -08:00
Joel Bradshaw
d6abd9b32d Ensure directory exists, don't crash if we fail to write
We should be creating the directory because the static tree from the
repo isn't actually copied into the container, so we can't rely on it
existing.

And if we can't write it, we should catch that error instead of crashing
the whole thing, oops!
2022-02-01 21:45:13 -08:00
Mouse Reeve
754e24812b Check image extensions before saving 2022-02-01 21:18:25 -08:00
Mouse Reeve
9611815b44 Extract wikipedia and inventaire ids 2022-01-30 12:02:18 -08:00
Mouse Reeve
44dad43f36 Load new fields via connector 2022-01-30 11:41:33 -08:00
Mouse Reeve
c4b8e7949d Add more book identifier fields 2022-01-30 11:41:31 -08:00
Mouse Reeve
1dfe4d0f52
Merge pull request #1890 from bookwyrm-social/shelf-display
Don't display empty shelves on user page
2022-01-30 11:39:25 -08:00
Mouse Reeve
e674f85d4e Don't display empty shelves on user page 2022-01-30 11:23:23 -08:00
Mouse Reeve
4e607d38eb
Merge pull request #1888 from bookwyrm-social/ap-delete
More resilient hanlding of deletions
2022-01-30 11:21:16 -08:00
Mouse Reeve
ef44b407e5
Merge pull request #1889 from bookwyrm-social/dm-button
Fixes display of dm button
2022-01-30 11:21:04 -08:00
Mouse Reeve
a7afd4c47b Fixes display of dm button 2022-01-30 11:10:18 -08:00
Mouse Reeve
f2d2d050f5
Merge pull request #1886 from bookwyrm-social/filter-panels-display
Fixes form element display inside details panel
2022-01-30 10:45:26 -08:00
Mouse Reeve
2d5b6ba0e9
Merge pull request #1887 from bookwyrm-social/locale-updates
Updates locales
2022-01-30 10:44:53 -08:00
Mouse Reeve
18b53a608c More resilient hanlding of deletions 2022-01-30 10:42:29 -08:00
Mouse Reeve
65496fea49 Fixes black regression 2022-01-30 10:26:28 -08:00
Mouse Reeve
f52fd25313 Updates locales 2022-01-30 10:19:12 -08:00
Mouse Reeve
79be02230b
Merge pull request #1885 from bookwyrm-social/reporting-improvements
Reporting improvements
2022-01-30 09:55:37 -08:00
Mouse Reeve
ae0e67f076 Fixes form element display inside details panel 2022-01-30 09:31:57 -08:00
Mouse Reeve
68f9ee9d8a Fixes access level control in report view 2022-01-30 09:20:26 -08:00
Mouse Reeve
24c1d5a168 Add prompt to respond to reporter 2022-01-30 09:17:12 -08:00
Mouse Reeve
c04bf4638f Avoid duplicate emails 2022-01-30 08:59:32 -08:00
Mouse Reeve
8a07f5c396 Fixes report remote id 2022-01-30 08:50:53 -08:00
Mouse Reeve
ae53b479f5 Fixes status field on report modal form 2022-01-30 08:36:20 -08:00
Mouse Reeve
dd39046ff9
Merge pull request #1884 from bookwyrm-social/dependabot/pip/django-3.2.11
Bump django from 3.2.10 to 3.2.11
2022-01-30 07:39:53 -08:00
Mouse Reeve
6983884eaa
Merge pull request #1883 from bookwyrm-social/cache-fix
Fixes bad cache on status shelve buttons
2022-01-30 07:19:30 -08:00
Mouse Reeve
aaccab6dce Merge branch 'main' into cache-fix 2022-01-30 07:09:32 -08:00
dependabot[bot]
36d2a7cc1d
Bump django from 3.2.10 to 3.2.11
Bumps [django](https://github.com/django/django) from 3.2.10 to 3.2.11.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/3.2.10...3.2.11)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-30 15:09:29 +00:00
Mouse Reeve
65e4e6418e
Merge pull request #1882 from bookwyrm-social/fix-urls
Bring prod and main into sync on urls
2022-01-30 07:09:07 -08:00
Mouse Reeve
f86016ba33 Python formatting for black update 2022-01-30 07:01:38 -08:00
Mouse Reeve
3c2aa72424 Fixes bad cache on status shelve buttons 2022-01-30 06:56:15 -08:00
Mouse Reeve
29a7c59d5f Bring prod and main into sync on urls 2022-01-30 06:43:50 -08:00
Mouse Reeve
224dc4100a Activitstreams tests 2022-01-28 17:32:41 -08:00
Mouse Reeve
8fc23ba184
Merge pull request #1878 from bookwyrm-social/tests
Some tests
2022-01-28 06:54:51 -08:00
Mouse Reeve
c6c1534c85 Adds id to report page 2022-01-27 20:05:17 -08:00
Mouse Reeve
e8e2cb08a5
Merge pull request #1877 from bookwyrm-social/locale-updates
Updates locales and adds new strings
2022-01-27 19:55:03 -08:00
Mouse Reeve
1d45e8b4cc Updates ip blocklists tests 2022-01-27 19:43:42 -08:00
Mouse Reeve
778975d492 Merge branch 'misc-tests' into user-view 2022-01-27 19:39:19 -08:00
Mouse Reeve
89aa1673b2 Admin views tests 2022-01-27 19:39:07 -08:00
Mouse Reeve
afdaa776e2 Fixes syntax 2022-01-27 19:38:51 -08:00
Mouse Reeve
e7ecae0f96 Adds annual review test 2022-01-27 18:57:18 -08:00
Mouse Reeve
8ec1b49800 Updates locales and adds new strings 2022-01-27 18:52:33 -08:00
Mouse Reeve
40a14a05ad
Merge pull request #1865 from bookwyrm-social/unread-status-translation
Calculate and translate unread status counts in view
2022-01-27 18:47:35 -08:00
Mouse Reeve
107f02e4e5
Merge pull request #1876 from bookwyrm-social/initdb-tests
Adds tests for initdb command
2022-01-27 18:38:55 -08:00
Mouse Reeve
59b5369654 Updates tests 2022-01-27 18:23:31 -08:00
Mouse Reeve
d711c7a5a2 Test fixes 2022-01-27 13:32:49 -08:00
Mouse Reeve
047e3a324a
Merge pull request #1855 from bookwyrm-social/instance-default-language
Makes default language configurable
2022-01-27 13:25:12 -08:00
Mouse Reeve
ba18e1e34b Adds tests for initdb command 2022-01-27 13:23:29 -08:00
Mouse Reeve
b3d9a46c98
Merge pull request #1869 from bookwyrm-social/list-notes
Let users add info about their list entry submissions
2022-01-27 13:04:08 -08:00
Mouse Reeve
d925395f9d
Merge pull request #1874 from willhoh/main
This fixes #1871 and fixes #1873
2022-01-27 13:01:50 -08:00
Mouse Reeve
a80c19d3e5 Screen reader fixes for list view 2022-01-27 12:55:53 -08:00
Mouse Reeve
2cf10b932d
Merge pull request #1875 from bookwyrm-social/get-started-books
Don't check suggested books against shelved books
2022-01-27 12:43:04 -08:00
Mouse Reeve
8a8d09fc30
Merge pull request #1872 from officialkzhang/main
Added a class for fixing onboarding logo's size
2022-01-27 12:42:46 -08:00
Willi Hohenstein
72c22cdcc0 reformatted file 2022-01-27 21:21:28 +01:00
Mouse Reeve
577bc18a47 Minor simplification for user shelf view 2022-01-27 12:05:26 -08:00
officialkzhang
f62e66f5ee
Revised HTML element for onboarding logo
Added navbar class to the parent header of the onboarding logo and removed the previously appended icon class from the image.
2022-01-27 14:51:57 -05:00
Mouse Reeve
c0dabeee04 Don't check suggested books against shelved books
It takes too long, and ideally this is your first action so you don't
have any books shelved yet.
2022-01-27 11:45:40 -08:00
Mouse Reeve
d62473c432 Tests that list item notes federate 2022-01-27 11:04:30 -08:00
Willi Hohenstein
dd35c90042 fix linging errors 2022-01-27 19:54:12 +01:00
Willi Hohenstein
f8afdfc6a9 This fixes #1871 huge amount of traffic from bots
and closes #1873 that leaves a file after testing.
2022-01-27 17:30:02 +01:00
officialkzhang
13edeffb53
Added a class for fixing onboarding logo's size
Added a CSS class for fixing the onboarding logo's size to a reasonable dimension (about 3rem).
2022-01-27 00:22:50 -05:00
Mouse Reeve
0d69d9b48b Adds more unit tests for list views 2022-01-26 12:02:48 -08:00
Mouse Reeve
65b9872c72 Fixes approving curated submissions 2022-01-26 10:37:50 -08:00
Mouse Reeve
eddd9ccc32 Refer to user by id in form tests 2022-01-25 13:57:12 -08:00
Mouse Reeve
2eabe29401 Show notes on curation page 2022-01-25 13:54:44 -08:00
Mouse Reeve
3f9a401d98 Put list action tests in correct files 2022-01-25 13:54:38 -08:00
Mouse Reeve
3a5289a999 Separate lists view test files 2022-01-25 13:38:13 -08:00
Mouse Reeve
dd16fb2a26 Move embed view to separate file 2022-01-25 13:37:57 -08:00
Mouse Reeve
d456ab7306 Move lists tests into directory 2022-01-25 13:22:04 -08:00
Mouse Reeve
f85158191b Use form for saving list items 2022-01-25 12:11:17 -08:00
Mouse Reeve
a43731b335 Fixes tests for list actions 2022-01-25 10:08:54 -08:00
Mouse Reeve
e1599384b0 Fixes list views tests 2022-01-25 09:46:00 -08:00
Mouse Reeve
38ccc23cd5 Add notes form 2022-01-25 09:40:03 -08:00
Mouse Reeve
6009593b6b Migration formatting 2022-01-25 09:17:00 -08:00
Mouse Reeve
037cc35eeb Adds merge migration and python formatting 2022-01-25 08:45:22 -08:00
Mouse Reeve
de4576bc44 Merge branch 'main' into list-notes 2022-01-25 08:44:29 -08:00
Mouse Reeve
9902794bbd Adds edit note view 2022-01-25 08:44:04 -08:00
Joel Bradshaw
0c53f4e003 Fix linting and formatting 2022-01-25 01:09:27 -08:00
Joel Bradshaw
a1a3aa45f4 Don't log autoload debug
This is just too much
2022-01-25 00:53:15 -08:00
Joel Bradshaw
9e6390662b Download fonts at app startup instead
We can't bake the font into the Docker image as such, because we mount
the volumes which blows away anything we have in the app tree
beforehand.

We could stash it somewhere in the image and then copy it from there on
app startup or something, but at that point we might as well just
download it as part of the app startup.
2022-01-25 00:53:01 -08:00
Joachim
766a0cc652 Fix tests 2022-01-24 23:16:15 -08:00
Joachim
6f5115c716 Use Source Han Sans for preview images generation 2022-01-24 23:16:15 -08:00
Joel Bradshaw
284eb620dd Add Source Han font for preview generation to Docker image
Include the license and a README explaining things in the repo itself.

Depending on an external source for this is intended to be temporary,
the goal is to have a Bookywrm-managed source for these, but this should
be stable enough for now.

We build it into the Dockerfile to make it available without adding it
to the git repo itself, because git history is forever and we don't want
to bake large files into the history.

Theoretically it would make sense to gate this download on the
ENABLE_PREVIEW_IMAGES environment variable, but ENV variables aren't
available at Docker image build time (for sensible reasons), so we just
unconditonally download it.

This does mean users will ultimately download it anyway, but the benefit
to doing this over adding it to the git history is that if we switch
fonts, or update this one, or change strategies altogether, this version
of the font will no longer have to be downloaded.

Additionally, the font won't be downloaded until the application is
actually built, which involves a bunch of other downloading (of Docker
images and the like), so it's a reasonable time to do it.
2022-01-24 23:16:14 -08:00
Mouse Reeve
ca0dbeb0ab Move list views into more files 2022-01-24 19:39:30 -08:00
Mouse Reeve
a1a84b28b0 Adds edit box 2022-01-24 13:56:18 -08:00
Mouse Reeve
8280386f0e Context for note block in list item 2022-01-24 13:45:52 -08:00
Mouse Reeve
5206d08dbb Adds demo display of comment in list entry 2022-01-24 13:37:51 -08:00
Mouse Reeve
d0a4c78d02 Limit length on list item note 2022-01-24 12:02:05 -08:00
Mouse Reeve
91f085c876
Merge pull request #1868 from bookwyrm-social/swedish-locale
Adds Swedish locale
2022-01-24 10:08:38 -08:00
Mouse Reeve
eeee62cd04 Adds Swedish to the app 2022-01-24 09:39:13 -08:00
Mouse Reeve
906456802a Adds Swedish locale files and updates all locales 2022-01-24 09:38:56 -08:00
Mouse Reeve
a651352b8b
Merge pull request #1866 from cincodenada/patch-3
Fix typo from models refactor
2022-01-24 07:25:19 -08:00
Joel Bradshaw
7373fb4132
Fix typo from models refactor
Looks like this got caught up when moving to importing `models`
instead of the individual models, and was throwing an error on
`./bw-dev initdb`
2022-01-23 23:41:22 -08:00
Mouse Reeve
191079a922 Python formatting 2022-01-22 19:01:42 -08:00
Mouse Reeve
e5c8500547 Updates cache buster 2022-01-22 17:05:31 -08:00
Mouse Reeve
3fc690e763 Calculate and translate unread status counts in view 2022-01-22 17:03:48 -08:00
Mouse Reeve
ec63ca3817
Merge branch 'main' into run-not-exec 2022-01-22 15:51:42 -08:00
Mouse Reeve
a74f907a61
Merge pull request #1864 from bookwyrm-social/fixes-initdb
Fixes option checking in initdb management command
2022-01-22 15:42:56 -08:00
Mouse Reeve
67c3091aa1 Fixes option checking in initdb management command 2022-01-22 15:09:30 -08:00
Mouse Reeve
b35efb6eab
Merge pull request #1857 from bookwyrm-social/about-page-superlatives
Fixes display controls for about page superlatives
2022-01-20 17:20:04 -08:00
Mouse Reeve
ce30f8a8f0
Merge pull request #1854 from bookwyrm-social/pending-users
Activate users in pending state when site registration mode changes
2022-01-20 17:02:28 -08:00
Mouse Reeve
a8776843bd Fixes display toggle for about page superlatives 2022-01-20 17:00:15 -08:00
Mouse Reeve
ca21238e60
Merge pull request #1856 from bookwyrm-social/rss-limit
Show only recent results in rss feed view
2022-01-20 16:46:14 -08:00
Mouse Reeve
7476964cca Show only recent results in rss feed view 2022-01-20 16:33:24 -08:00
Mouse Reeve
e2e5ed9aa3 Makes default language configurable 2022-01-20 16:04:42 -08:00
Mouse Reeve
148f9b6f5e Activate pending users when email confirmation is disabled 2022-01-20 15:58:00 -08:00
Mouse Reeve
874e2e0a9c Adds test for activating users on change to registration mode 2022-01-20 15:21:28 -08:00
Mouse Reeve
a0da5c75ff
Merge pull request #1853 from bookwyrm-social/author-page
Trying a new query to get author books
2022-01-20 15:19:11 -08:00
Mouse Reeve
4177654ccf
Merge pull request #1852 from bookwyrm-social/shelf-fixes
Shelf date on all books page
2022-01-20 15:14:21 -08:00
Mouse Reeve
d5ddaa874f Trying a new query to get author books 2022-01-20 15:07:39 -08:00
Mouse Reeve
afea857442 Uses max shelved date to get valid date for all books page 2022-01-20 14:28:30 -08:00
Mouse Reeve
28d675c5a0 Adds more shelf page tests 2022-01-20 14:25:24 -08:00
Mouse Reeve
d9175ce0b0 HTML validity on shelf page 2022-01-20 14:19:41 -08:00
Mouse Reeve
a8892d4dcc
Merge pull request #1851 from bookwyrm-social/update-locales
Updates locales
2022-01-20 13:55:38 -08:00
Mouse Reeve
a54fc08983 Updates locales 2022-01-20 13:43:59 -08:00
Mouse Reeve
db715cce2a
Merge pull request #1845 from bookwyrm-social/organizing-templatetags
Organizing templatetags
2022-01-18 14:51:13 -08:00
Mouse Reeve
8b8314f736 Fixes embed view 2022-01-18 14:27:19 -08:00
Mouse Reeve
93caa95855 Removes stray asssert line 2022-01-18 14:05:35 -08:00
Mouse Reeve
c888895327 Adds missing tag loaders 2022-01-18 14:04:55 -08:00
Mouse Reeve
55ae6d1f8d
Merge pull request #1844 from bookwyrm-social/review-html
Fixes review markup for mastodon serialization
2022-01-18 13:42:02 -08:00
Mouse Reeve
e47b5e788d Remove link form review title
html isn't supported in the name field I guess
2022-01-18 13:31:50 -08:00
Mouse Reeve
41c3eceb68 Updates tests 2022-01-18 13:19:04 -08:00
Mouse Reeve
3f487328e2 Adds more tests 2022-01-18 13:15:25 -08:00
Mouse Reeve
ffaeb3381a Updates tests 2022-01-18 12:53:35 -08:00
Mouse Reeve
ce0a49f64f Updates ratings and book display tests 2022-01-18 12:52:21 -08:00
Mouse Reeve
95c262c495 Renames group tags 2022-01-18 12:32:12 -08:00
Mouse Reeve
33c6e5aabe Moves remaining tags into new files 2022-01-18 12:28:59 -08:00
Mouse Reeve
3d63509e20 Updates snippets that use rating tags 2022-01-18 12:09:57 -08:00
Mouse Reeve
b25fa5a193 Adds tests 2022-01-18 12:07:42 -08:00
Mouse Reeve
6e6e2ab777 Moves rating tag to file 2022-01-18 12:02:38 -08:00
Mouse Reeve
4f4d2dc53e Adds tests 2022-01-18 12:02:27 -08:00
Mouse Reeve
8746409e6d Adds shelf tags file 2022-01-18 11:20:27 -08:00
Mouse Reeve
e3545517ec
Merge pull request #1837 from bookwyrm-social/author-page-caching
Author page caching
2022-01-18 11:02:49 -08:00
Mouse Reeve
1c096ecfc2 Fixes review markup for mastodon serialization 2022-01-18 10:57:52 -08:00
Mouse Reeve
8bbc4d3301 Cache checking if books are on shelve in shelve button snippet 2022-01-18 10:52:15 -08:00
Mouse Reeve
9e450f2d99
Merge pull request #1802 from cincodenada/configurable-logging
Make log level configurable, override default logging config
2022-01-18 07:39:43 -08:00
Mouse Reeve
d20db99501
Merge pull request #1838 from bookwyrm-social/create-readthrough-bug
Fixes bug in verifying readthrough dates
2022-01-18 06:57:34 -08:00
Mouse Reeve
f5de0dd3c9 Fixes bug in verifying readthrough dates 2022-01-17 19:46:48 -08:00
Mouse Reeve
a09c813f73 Python formatting 2022-01-17 19:04:20 -08:00
Joel Bradshaw
27a0b92de0 Fix include order 2022-01-17 16:12:16 -08:00
Joel Bradshaw
27acf668df Add the required bits for Django's logger
So, you can't define handlers piecewise, and if you redefine a logger,
you have to also include everything it uses, because your "new" logger
doesn't have a reference to the original logging config to get things
like mail_admins and require_debug_false.

require_debug_true isn't strictly necessary here, but it seemed strange
to just copy over one of them.
2022-01-17 15:56:24 -08:00
Joel Bradshaw
13a2c58b98 Use parameter-based formatting for debug 2022-01-17 15:14:01 -08:00
Mouse Reeve
02dd1e9443 Use False instead of None for test values 2022-01-17 12:45:32 -08:00
Mouse Reeve
1e4aee8276 Cache user-specific ratings 2022-01-17 12:17:24 -08:00
Mouse Reeve
4cc35ba25e Cache query for author's books 2022-01-17 12:05:11 -08:00
Mouse Reeve
63b21fe1c2
Merge pull request #1835 from bookwyrm-social/noreferrer
Uses both noopener and noreferrer on external links
2022-01-17 11:49:11 -08:00
Mouse Reeve
8e1352fb75 Updates locales 2022-01-17 11:27:06 -08:00
Mouse Reeve
32acccc350 Use both noopener and noreferrer 2022-01-17 11:25:41 -08:00
Mouse Reeve
8a0ea674ea
Merge pull request #1834 from bookwyrm-social/links-display
Improve link filetype and add availability field
2022-01-17 11:08:40 -08:00
Mouse Reeve
4c356cbeb4 Case insensitive suggestions 2022-01-17 10:52:16 -08:00
Mouse Reeve
a23e49c9f3 Fixes filetype field length 2022-01-17 10:48:42 -08:00
Mouse Reeve
2f924faa05 Adds tests 2022-01-17 10:47:49 -08:00
Mouse Reeve
cfcacb4797 Edit book availability 2022-01-17 10:00:12 -08:00
Mouse Reeve
1595bac9b5 Show availability in links panel 2022-01-17 09:26:00 -08:00
Mouse Reeve
39814a21f2 Set book availability 2022-01-17 09:22:40 -08:00
Mouse Reeve
7b1693a435 Larger file type field 2022-01-17 09:03:53 -08:00
Mouse Reeve
942092d6b1 Show link status more prominently on edit page 2022-01-17 08:54:52 -08:00
Mouse Reeve
d4cfe5b8f0 Fixes embedded links modal 2022-01-17 08:44:30 -08:00
Mouse Reeve
f769c42abe
Merge pull request #1833 from bookwyrm-social/links-admin-improvements
Links admin improvements
2022-01-17 08:36:48 -08:00
Mouse Reeve
6d7243b6cb
Merge pull request #1832 from bookwyrm-social/locale-updates
Updates locales
2022-01-17 08:23:29 -08:00
Mouse Reeve
da6e43a7eb Avoid two character wide urls on mobile 2022-01-17 08:22:55 -08:00
Mouse Reeve
e12372250a Mobile-friendly edit button on link domains 2022-01-17 08:17:36 -08:00
Mouse Reeve
b9fde85b49 Sort domains in admin view 2022-01-17 08:15:14 -08:00
Mouse Reeve
3c26e9ead1
Merge pull request #1830 from bookwyrm-social/bad-cache
Removes bad cache on content status reading buttons
2022-01-17 08:11:33 -08:00
Mouse Reeve
32a3570b5a Updates locales 2022-01-17 08:08:59 -08:00
Mouse Reeve
b060cf47f2 Fixes bad cache on content status reading buttons 2022-01-17 08:01:39 -08:00
Mouse Reeve
e218b73272
Merge pull request #1829 from bookwyrm-social/author-page
Fixes weird display of author page
2022-01-16 19:58:42 -08:00
Mouse Reeve
7dc7965b76 Fixes weird display of author page 2022-01-16 19:38:21 -08:00
Mouse Reeve
0c2537e27a
Merge pull request #1527 from bookwyrm-social/book-file-links
Book file links
2022-01-13 11:10:05 -08:00
Mouse Reeve
d95830037a Adds admin notice 2022-01-13 11:00:59 -08:00
Mouse Reeve
1c821263ab
Merge pull request #1824 from bookwyrm-social/locale-updates
Updates locales
2022-01-13 09:12:56 -08:00
Mouse Reeve
abd7c213ff
Merge pull request #1823 from bookwyrm-social/update-main
Adds update command to main for bw-dev
2022-01-13 09:07:38 -08:00
Mouse Reeve
a06fb777d7 Updates locales 2022-01-13 09:00:02 -08:00
Mouse Reeve
66c67a54e2
Merge pull request #1822 from bookwyrm-social/group-query
Fixes searching for users in group view, with test
2022-01-13 08:53:15 -08:00
Mouse Reeve
b76cb0a22f Adds update command to main for bw-dev 2022-01-13 08:52:22 -08:00
Mouse Reeve
0d12d82c12
Merge pull request #1818 from iamruinous/support-redis-db
add support for different redis db
2022-01-13 08:42:00 -08:00
Mouse Reeve
c7b2b303da Fixes searching for users in group view, with test 2022-01-13 08:38:54 -08:00
Jade Meskill
900937ee5f
use REDIS_x_DB_INDEX instead of REDIS_x_DB, add optional setting to example env file 2022-01-13 09:16:16 -07:00
Jade Meskill
5a3d108c62
update fomatting to pass automated checks 2022-01-12 22:46:51 -07:00
Mouse Reeve
fcd2a62e2a
Merge pull request #1819 from iamruinous/fix-email-domain
use correct environment variable for EMAIL_SENDER_DOMAIN
2022-01-12 21:38:07 -08:00
Jade Meskill
6490c1eded
use correct environment variable for EMAIL_SENDER_DOMAIN 2022-01-12 21:49:57 -07:00
Jade Meskill
3638e18844
add support for different redis db 2022-01-12 19:44:11 -07:00
Mouse Reeve
2fbbdbc06a Runs prettier 2022-01-12 17:19:34 -08:00
Mouse Reeve
e6355f76de Adds merge migration 2022-01-12 17:16:20 -08:00
Mouse Reeve
d74360a13f Merge branch 'main' into book-file-links 2022-01-12 17:14:27 -08:00
Mouse Reeve
a2fb1489b9 Merge branch 'main' into book-file-links 2022-01-12 17:11:29 -08:00
Mouse Reeve
d1183fd003 Python formatting 2022-01-12 17:11:24 -08:00
Mouse Reeve
7bb634b71f
Merge pull request #1699 from bookwyrm-social/autocomplete
Autocomplete script
2022-01-12 17:09:34 -08:00
Mouse Reeve
fc06f0cdd1 Avoid console error 2022-01-12 17:08:10 -08:00
Mouse Reeve
80efd58881 Javascript file in correct template 2022-01-12 17:06:36 -08:00
Mouse Reeve
34635b0c3f Select trie based on data attr 2022-01-12 17:02:30 -08:00
Mouse Reeve
99ec87c67c Merge branch 'book-file-links' into autocomplete 2022-01-12 16:51:59 -08:00
Mouse Reeve
262e641c79 Creates link template subdirectory 2022-01-12 16:50:52 -08:00
Mouse Reeve
5fcdc284ce Removes duplicate atomic block 2022-01-12 16:41:23 -08:00
Mouse Reeve
dedcbda2d8 Adds inbox test 2022-01-12 16:41:20 -08:00
Mouse Reeve
b2262a5f98
Merge pull request #1816 from bookwyrm-social/privacy-translation
Build-in translations to privacy choices dropdown
2022-01-12 16:15:03 -08:00
Mouse Reeve
1513c73d48
Merge pull request #1817 from bookwyrm-social/opensearch-site-name
Use site name as shortname for opensearch
2022-01-12 16:14:09 -08:00
Mouse Reeve
84575cef9a Use site name as shortname for opensearch 2022-01-12 15:29:40 -08:00
Mouse Reeve
8b2335c52c Build-in translations to privacy choices dropdwon 2022-01-12 15:26:13 -08:00
Mouse Reeve
899f9beb82
Merge pull request #1815 from bookwyrm-social/status-headers
Status headers
2022-01-12 11:35:26 -08:00
Mouse Reeve
c08b9e61c4 Fixes book link in table 2022-01-12 11:34:44 -08:00
Mouse Reeve
57a05e239b Python formatting 2022-01-12 11:17:30 -08:00
Mouse Reeve
24045685e1 Updates tests 2022-01-12 11:03:04 -08:00
Mouse Reeve
9c86132701 Adds missing bracket 2022-01-12 10:43:40 -08:00
Mouse Reeve
4a7013f104 Adds book path variable 2022-01-12 10:42:27 -08:00
Mouse Reeve
581e3d17e0 Fixes nested quotes 2022-01-12 10:41:48 -08:00
Mouse Reeve
7f23e8c112 Updates locales 2022-01-12 10:37:26 -08:00
Mouse Reeve
5da2ce6427 Include author in content status headers 2022-01-12 10:35:02 -08:00
Mouse Reeve
e452ec87d3 Link to book title in pure activitypub serialization of review 2022-01-12 10:15:26 -08:00
Mouse Reeve
4cf3f378ef Delete view 2022-01-12 10:08:49 -08:00
Mouse Reeve
ebc451fdd2 Edit links view 2022-01-12 09:59:46 -08:00
Mouse Reeve
2ca41a0b11 Renames add link view 2022-01-12 09:16:24 -08:00
Mouse Reeve
e6d9895854
Merge branch 'main' into book-file-links 2022-01-12 06:39:22 -08:00
Mouse Reeve
de0c50196e
Merge pull request #1812 from bookwyrm-social/modal-triggers
Use updated modal triggers on shelf page shelf selector
2022-01-11 13:19:14 -08:00
Mouse Reeve
e378e74901
Merge pull request #1811 from bookwyrm-social/cache-fix
Fixes active readthrough cache bug
2022-01-11 13:11:02 -08:00
Mouse Reeve
549d6e9b3b Use updated modal triggers on shelf page shelf selector 2022-01-11 13:10:25 -08:00
Mouse Reeve
6baab5d5a9 python formatting 2022-01-11 12:58:14 -08:00
Mouse Reeve
2fabad63e0
Merge pull request #1809 from bookwyrm-social/unread-notifications
Show unread notifications color
2022-01-11 12:55:18 -08:00
Mouse Reeve
26a089b3c9
Merge pull request #1810 from bookwyrm-social/shelf-breadcrumbs
Shelf breadcrumbs
2022-01-11 12:55:08 -08:00
Mouse Reeve
591bb955f8 Fixes active readthrough cache bug 2022-01-11 12:37:07 -08:00
Mouse Reeve
5fd0115216 Use translation snippet 2022-01-11 12:10:30 -08:00
Mouse Reeve
150756dbd0 Adds breadcrumbs to shelf page 2022-01-11 12:03:04 -08:00
Mouse Reeve
0abfc67c12
Merge pull request #1808 from bookwyrm-social/readthrough-form
Updates editing read-through flow
2022-01-11 12:01:21 -08:00
Mouse Reeve
f4b655f952 Makes form names unique in readthrough modal 2022-01-11 11:45:37 -08:00
Mouse Reeve
c12aa1ef79 Fixes test 2022-01-11 11:38:26 -08:00
Mouse Reeve
0d7801f6f4 Show unread notifications color 2022-01-11 11:04:56 -08:00
Mouse Reeve
9fdb75e2d3 Renames item layout file 2022-01-11 10:47:55 -08:00
Mouse Reeve
834eb95d9d Reformats readthrough view test 2022-01-11 10:43:17 -08:00
Mouse Reeve
0f9881365b Python formatting 2022-01-11 10:41:33 -08:00
Mouse Reeve
4ca90ca10f Renames class view 2022-01-11 10:40:32 -08:00
Mouse Reeve
68d943fb26 Preserve readthrough id in edit 2022-01-11 10:33:58 -08:00
Mouse Reeve
a412f87c64 Match wording to state 2022-01-11 10:29:11 -08:00
Mouse Reeve
7ccb02f635 Use new modal for edits 2022-01-11 10:27:10 -08:00
Mouse Reeve
cdaf0fe8e3 Show error message when start and finish date is invalid 2022-01-11 10:22:19 -08:00
Mouse Reeve
9521c477b2 Moves readthrough templates to dir 2022-01-11 09:58:28 -08:00
Mouse Reeve
0d2c6e63d1 Converts create readthrough to modal 2022-01-11 09:50:04 -08:00
Mouse Reeve
a47bd7a05b
Merge pull request #1807 from bookwyrm-social/ui-small-fixes
UI small fixes
2022-01-11 09:28:02 -08:00
Mouse Reeve
048460aec2 Don't show filters notice on paged feed 2022-01-11 09:12:30 -08:00
Mouse Reeve
4faf3cf09a Fixes button on search page 2022-01-11 09:12:04 -08:00
Mouse Reeve
de1bace8f3 Updates tests 2022-01-11 08:06:52 -08:00
Mouse Reeve
60761b19ba Run prettier 2022-01-10 16:55:30 -08:00
Mouse Reeve
4202498442 Fixes one option trie case 2022-01-10 16:53:30 -08:00
Mouse Reeve
f6d6285009 Updates trie function 2022-01-10 16:44:43 -08:00
Mouse Reeve
2746318152 Uses datalist for autocomplete suggestions 2022-01-10 15:47:40 -08:00
Mouse Reeve
380087da90 Merge branch 'book-file-links' into autocomplete 2022-01-10 15:32:20 -08:00
Mouse Reeve
dcf8a8dab9 Fixes settings tab highlighting 2022-01-10 15:27:33 -08:00
Mouse Reeve
c0b5e6ad78 Fixes linting errors 2022-01-10 15:00:37 -08:00
Mouse Reeve
aee7e1ae41 Fixes redirect on reports modal 2022-01-10 14:58:10 -08:00
Mouse Reeve
78dd5caf9f Allow users to report spam links 2022-01-10 14:55:10 -08:00
Mouse Reeve
651d468b13 Show who added the link in admin view 2022-01-10 13:33:22 -08:00
Mouse Reeve
34f375c53c Store user that added link 2022-01-10 13:27:01 -08:00
Mouse Reeve
6c78a7b6ef Add user attribution to links and domains 2022-01-10 13:20:31 -08:00
Mouse Reeve
93fead47ef Reformats init command and adds Standard EBooks 2022-01-10 13:13:28 -08:00
Mouse Reeve
dcf51020bc Removes initialization from migration
Just doesn't seem right
2022-01-10 13:05:08 -08:00
Mouse Reeve
8928e8da26 Corrects tests 2022-01-10 12:42:05 -08:00
Mouse Reeve
2880b311e1 HTML validity fix for summary tag 2022-01-10 12:30:24 -08:00
Mouse Reeve
eec1155bb8 Adds admin view tests 2022-01-10 12:29:28 -08:00
Mouse Reeve
62f481c859 Fixes urls 2022-01-10 12:21:36 -08:00
Mouse Reeve
d610115a5b Null state for links 2022-01-10 12:09:03 -08:00
Mouse Reeve
8ba3a4ab00 Adds link confirmation modal 2022-01-10 11:48:07 -08:00
Mouse Reeve
4ba375892a
Merge pull request #1793 from bookwyrm-social/more-caches
More caches
2022-01-10 11:25:26 -08:00
Mouse Reeve
4dfe9fd714 Support links with no name 2022-01-10 11:21:43 -08:00
Mouse Reeve
4820a2f982 Python formatting 2022-01-10 11:21:03 -08:00
Mouse Reeve
f0ae37c331 Block or approve domains 2022-01-10 11:19:20 -08:00
Mouse Reeve
6b0967df39 Show related books in links preview 2022-01-10 11:03:10 -08:00
Mouse Reeve
3f280af715 Functionality to edit name 2022-01-10 10:48:27 -08:00
Mouse Reeve
f580a51f24 Form to edit link domain display names 2022-01-10 10:39:09 -08:00
Mouse Reeve
32e3fdb438 Adds admin view 2022-01-10 10:12:28 -08:00
Joel Bradshaw
29ebfc456d Use run --rm instead of exec for initdb
This way we don't depend on the containers already being up and running.
2022-01-09 23:57:57 -08:00
Joel Bradshaw
5cf1d8a30a Make it black 2022-01-09 23:53:23 -08:00
Joel Bradshaw
085dd24a62 Simplify and explain our overrides
This should also fix the 500s-in-prod issue, yay
2022-01-09 23:49:14 -08:00
Joel Bradshaw
83851c2933 Add bookwyrm-specific logging 2022-01-09 23:49:14 -08:00
Joel Bradshaw
af3c84cd87 Add basic logging config 2022-01-09 23:49:14 -08:00
Mouse Reeve
0bfa15bb47 Adds id on static link edit view 2022-01-09 20:48:16 -08:00
Mouse Reeve
aa9864a21e Only show approved links 2022-01-09 20:30:23 -08:00
Mouse Reeve
70fe7e17af Removes name ap field 2022-01-09 14:25:22 -08:00
Mouse Reeve
63075a6fe9 Updates models 2022-01-09 14:21:13 -08:00
Mouse Reeve
bae01e1ea5 Updates modal 2022-01-09 14:20:52 -08:00
Mouse Reeve
bae355e8d2 Adds link domain table 2022-01-09 13:19:29 -08:00
Mouse Reeve
4931e5cad2 Merge branch 'main' into book-file-links 2022-01-09 13:15:58 -08:00
Mouse Reeve
0a182e8150 Caches query for landing page books 2022-01-09 13:04:41 -08:00
Mouse Reeve
e8c830750a No cache for suggested books 2022-01-09 13:00:02 -08:00
Mouse Reeve
6492ca2941
Merge pull request #1769 from joachimesque/thumbnail-generation-strategy
Change thumbnail generation strategy
2022-01-09 12:34:42 -08:00
Mouse Reeve
78c707bc58
Merge pull request #1801 from bookwyrm-social/fixes-compiled-locales
Fixes compiled locales
2022-01-09 12:21:18 -08:00
Mouse Reeve
556c9ea98f Adjusts cache get_or_set to work with tests 2022-01-09 12:16:01 -08:00
Mouse Reeve
593d1638f9 Updates tests env 2022-01-09 12:04:45 -08:00
Mouse Reeve
eee1d347d1 Fixes compiled locales 2022-01-09 11:21:06 -08:00
Mouse Reeve
f03c6c46d6
Merge pull request #1800 from bookwyrm-social/locale-updates
Updates locales
2022-01-09 11:11:39 -08:00
Mouse Reeve
00e8574d1f Typo fix 2022-01-09 11:01:55 -08:00
Mouse Reeve
296951f437 Updates locales 2022-01-09 10:50:53 -08:00
Mouse Reeve
ebf4c6127f
Merge pull request #1798 from joachimesque/annual-summary-fix-highest-link
Annual Summary: Fix link to book with highest page count
2022-01-09 10:08:13 -08:00
Mouse Reeve
dc7034cd61
Merge pull request #1797 from joachimesque/populate-list-streams-add-message
Add end message for populate_list_streams command
2022-01-09 10:07:01 -08:00
Joachim
278ce88b82 Annual Summary: Fix link to book with highest page count 2022-01-09 12:18:18 +01:00
Joachim
4c07c5e47e Add end message for populate_list_streams command 2022-01-09 12:11:52 +01:00
Joachim
734da71037 Remove backend setting 2022-01-09 10:36:06 +01:00
Mouse Reeve
3048311a5e
Merge pull request #1796 from bookwyrm-social/about-admins
Makes query to get admins unique
2022-01-08 18:54:59 -08:00
Mouse Reeve
599c79917e Makes query to get admins unique 2022-01-08 18:44:32 -08:00
Mouse Reeve
ad9d7bcd65
Merge pull request #1794 from bookwyrm-social/new-languages
Adds Italian and Norwegian locales
2022-01-08 18:42:23 -08:00
Mouse Reeve
79f6fb966e Updates migration 2022-01-08 17:07:51 -08:00
Mouse Reeve
16a58ae079 Merge branch 'main' into book-file-links 2022-01-08 16:58:37 -08:00
Mouse Reeve
c23b91da32 New strings 2022-01-08 16:56:34 -08:00
Mouse Reeve
ac1787ce6b Merge branch 'main' into new-languages 2022-01-08 16:54:31 -08:00
Mouse Reeve
82294909a8 Python formatting 2022-01-08 16:38:52 -08:00
Mouse Reeve
e1a617f742
Merge pull request #1613 from bookwyrm-social/list-not-loading
Use a redis cache to store lists for user
2022-01-08 13:38:20 -08:00
Mouse Reeve
a80cb4310e
Merge pull request #1771 from bookwyrm-social/about-page
Refactors about page
2022-01-08 13:28:23 -08:00
Mouse Reeve
c822048509 Invalidate template cache on relationship change 2022-01-08 13:04:01 -08:00
Mouse Reeve
f2f40cf3b9 Creates custom get_or_set function 2022-01-08 13:01:05 -08:00
Mouse Reeve
2cca9fab2d Cache user relationship for follow buttons 2022-01-08 12:33:13 -08:00
Mouse Reeve
26928252cd Use cache 2022-01-08 11:44:04 -08:00
Mouse Reeve
b6d04e9997
Merge pull request #1792 from reesporte/lang-setting
save language preferences with cookies that last
2022-01-08 11:27:58 -08:00
Mouse Reeve
bb4b724b1a Updates queries 2022-01-08 11:26:15 -08:00
Mouse Reeve
a4cb8f7e89
Merge pull request #1788 from bookwyrm-social/single-env-file
Moves to a single example .env file
2022-01-08 11:02:57 -08:00
reesporte
85691478f1 save language preferences with cookies that last
(as long as login ones do)
2022-01-08 12:56:57 -06:00
Joachim
705c4cd636 Update thumbnail_generation.py 2022-01-08 17:54:03 +01:00
Joachim
12ea1910b4 Add docstrings 2022-01-08 17:47:45 +01:00
Joachim
656e0b84eb Fix 2022-01-08 17:42:25 +01:00
Joachim
a54995eb9d Add new complete strategy 2022-01-08 17:41:44 +01:00
Mouse Reeve
02a963c4ef Adds locales to application 2022-01-08 07:38:14 -08:00
Mouse Reeve
cb858b66fe Adds Italian and Norwegian locales 2022-01-08 07:34:18 -08:00
Mouse Reeve
392dbfce01 Merge branch 'main' into about-page 2022-01-07 14:59:26 -08:00
Mouse Reeve
9609e130f2 Moves to a single example .env file
The prod and dev ones hae gotten so close that it seems unnecessary to
have two different ones.
2022-01-07 14:49:15 -08:00
Mouse Reeve
7d2a53fec9
Merge pull request #1784 from bookwyrm-social/npm-update
Updates NPM dependencies to resolve security alerts
2022-01-07 14:40:10 -08:00
Mouse Reeve
a9b88c0796 Use null to invalidate rules 2022-01-07 14:18:41 -08:00
Mouse Reeve
02feb0d594 Stylelint updates 2022-01-07 14:08:36 -08:00
Mouse Reeve
db3b4465f6 Updates NPM dependencies to resolve security alerts
Amazing how many npm dependencies you can have when you don't even use
npm in an app
2022-01-07 13:50:27 -08:00
Mouse Reeve
f43a9570e2 Updates test 2022-01-07 13:40:20 -08:00
Mouse Reeve
8a8ce0c0d4 Fixes deletion of lists 2022-01-07 13:30:11 -08:00
Mouse Reeve
0580b66c3b Fixes test 2022-01-07 10:34:45 -08:00
Mouse Reeve
7e1a4bc363 Ticks version number 2022-01-07 10:32:40 -08:00
Mouse Reeve
165fdc6d2d Merge branch 'main' into list-not-loading 2022-01-07 10:32:17 -08:00
Mouse Reeve
47c79afd75
Merge pull request #1770 from bookwyrm-social/email-config
Configure email sender from .env file
2022-01-07 10:23:50 -08:00
Mouse Reeve
5c7cc034d5
Merge pull request #1782 from bookwyrm-social/get-started-user-search
Fixes searching for users in get started view
2022-01-07 10:23:19 -08:00
Mouse Reeve
db1485abb3
Merge pull request #1781 from bookwyrm-social/dependabot/npm_and_yarn/postcss-8.2.13
Bump postcss from 8.2.10 to 8.2.13
2022-01-07 10:14:28 -08:00
Mouse Reeve
2ff9ba8bee
Merge pull request #1783 from bookwyrm-social/bad-caches
Removes caches that cause CSRF token failures
2022-01-07 10:14:17 -08:00
Mouse Reeve
e91947afbf Adds meaningful test mock 2022-01-07 10:06:11 -08:00
Mouse Reeve
c918edb622 Fixes searching for users in get started view 2022-01-07 09:56:29 -08:00
dependabot[bot]
21ce7f3721
Bump postcss from 8.2.10 to 8.2.13
Bumps [postcss](https://github.com/postcss/postcss) from 8.2.10 to 8.2.13.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.2.10...8.2.13)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-07 17:54:08 +00:00
Mouse Reeve
7415166718
Merge pull request #1776 from bookwyrm-social/dependabot/pip/celery-5.2.2
Bump celery from 4.4.2 to 5.2.2
2022-01-07 09:53:46 -08:00
Mouse Reeve
abcae9e6c4 Removes caches that cause CSRF token failures 2022-01-07 09:47:58 -08:00
Mouse Reeve
c89b8ee5db Updates flower 2022-01-07 09:45:21 -08:00
Mouse Reeve
1c74c0c0d9 Merge branch 'main' into dependabot/pip/celery-5.2.2 2022-01-07 08:38:05 -08:00
Mouse Reeve
f9d7512ffd
Merge pull request #1780 from bookwyrm-social/search-timeouts
Make search timeouts configurable
2022-01-07 08:12:30 -08:00
Mouse Reeve
b18c69e186 Make search timeouts configurable 2022-01-07 07:42:05 -08:00
Mouse Reeve
0ddecd7049
Merge pull request #1778 from hughrun/register-403
do not cache registration form
2022-01-06 18:56:23 -08:00
Mouse Reeve
a1e3ef1c79
Fixes pylint complaint 2022-01-06 18:47:14 -08:00
Hugh Rundle
e4be6a98e8
do not cache registration form
Fixes #1777

Caching the Landing view also caches the registration form, including the CSRF value.

This moves the caching into the recently reviewed books landing template which is presumably what we're trying to cache here, instead of caching the whole view.

NOTE: this fixes the problem with registration, I haven't done enough testing to be sure it actually still caches the recent reviews data.
2022-01-07 13:13:56 +11:00
dependabot[bot]
2d5ea3a99d
Bump celery from 4.4.2 to 5.2.2
Bumps [celery](https://github.com/celery/celery) from 4.4.2 to 5.2.2.
- [Release notes](https://github.com/celery/celery/releases)
- [Changelog](https://github.com/celery/celery/blob/master/Changelog.rst)
- [Commits](https://github.com/celery/celery/compare/4.4.2...v5.2.2)

---
updated-dependencies:
- dependency-name: celery
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-06 22:42:44 +00:00
Mouse Reeve
602574566b
Merge pull request #1775 from bookwyrm-social/order-suggestions
Sort suggestions by mutuals
2022-01-06 13:12:51 -08:00
Mouse Reeve
cc6c75c5ec
Merge pull request #1774 from hughrun/zero-annual
Minor grammar fix for annual review page
2022-01-06 13:05:33 -08:00
Mouse Reeve
deaa06d44c Sort suggestions by mutuals 2022-01-06 13:02:12 -08:00
Hugh Rundle
e2efd5fd5a
"any" is plural
English huh, what a weird language.
2022-01-07 07:50:36 +11:00
Mouse Reeve
00a14e89a0
Merge pull request #1772 from bookwyrm-social/cache-tweaks
Cache tweaks
2022-01-06 12:13:56 -08:00
Mouse Reeve
8722778ed0 Updates tests 2022-01-06 12:13:24 -08:00
Mouse Reeve
cf57891482 Python formatting 2022-01-06 11:50:51 -08:00
Mouse Reeve
cf6e101e55
Merge pull request #1773 from bookwyrm-social/load-generatednote-status-type
Loads subclass for generated note
2022-01-06 11:41:30 -08:00
Mouse Reeve
4d0fa2db4a Dummy cache for tests 2022-01-06 11:40:27 -08:00
Mouse Reeve
45393af843 Loads subclass for generated note
Fixes display weirdness in threads
2022-01-06 11:27:02 -08:00
Mouse Reeve
86b3789ffe Fixes display of filter inputs in chromium 2022-01-06 11:11:00 -08:00
Mouse Reeve
e416ef05e8 Fixes cache of status interact
The CSRF token was being cached which caused submits to fail
2022-01-06 11:07:22 -08:00
Mouse Reeve
32ac4111aa
Merge pull request #1768 from bookwyrm-social/shelf-button-cache
Cache queries in feed view
2022-01-06 10:42:31 -08:00
Mouse Reeve
b3bfaf0586 Use 6 month cache for items that don't really need to expire 2022-01-06 10:27:12 -08:00
Mouse Reeve
996d1fc571 Don't crash tests 2022-01-06 10:22:27 -08:00
Mouse Reeve
d9857839dc Add all superusers to admin group 2022-01-06 10:14:21 -08:00
Mouse Reeve
1d2b6f038a Fixes wording on want-to-read superlative 2022-01-06 10:01:20 -08:00
Mouse Reeve
ee1fd05430 Fixes book links 2022-01-06 09:58:46 -08:00
Mouse Reeve
ee301afa61 Adds tests for views 2022-01-06 09:55:35 -08:00
Mouse Reeve
0f09759662 Separate out landing and about views files 2022-01-06 09:51:38 -08:00
Mouse Reeve
b8c72d75e5 Python formatting 2022-01-06 09:48:36 -08:00
Mouse Reeve
461bfd0ce7 Link to books 2022-01-06 09:47:46 -08:00
Mouse Reeve
d690224559 Use weighted averages 2022-01-06 09:39:51 -08:00
Mouse Reeve
840746754d Fixes superlatives 2022-01-06 09:22:10 -08:00
Mouse Reeve
705f6d36a6 Adds admins copy 2022-01-06 09:09:00 -08:00
Mouse Reeve
4caa68200f Adds more info to the about page 2022-01-06 09:04:59 -08:00
Mouse Reeve
b855464396 Expands about pages 2022-01-05 21:42:41 -08:00
Mouse Reeve
99a5924ea8 Not bool 2022-01-05 17:36:52 -08:00
Mouse Reeve
2fed188862 Configure email sender from .env file 2022-01-05 17:35:42 -08:00
Mouse Reeve
6168ce91b3
Merge branch 'main' into list-not-loading 2022-01-05 16:33:05 -08:00
Mouse Reeve
69bd9246dd
Merge pull request #1767 from bookwyrm-social/suggested-users-query
Uses single query to get suggested users
2022-01-05 16:19:00 -08:00
Mouse Reeve
0f37e0ad42 Don't try to clear caches for nonexistant authors 2022-01-05 15:55:12 -08:00
Mouse Reeve
b0fef8f0e3 Cache landing page 2022-01-05 15:53:01 -08:00
Mouse Reeve
7df99afdc7 Cache status interact buttons 2022-01-05 14:54:51 -08:00
Mouse Reeve
0da0091237 Cache title author snippet 2022-01-05 14:33:10 -08:00
Mouse Reeve
4a43ad95ef Linting on suggested_users 2022-01-05 13:51:34 -08:00
Mouse Reeve
ad6d7d5eca Caches suggested books 2022-01-05 13:43:15 -08:00
Mouse Reeve
3cda27577f Removes status content cache 2022-01-05 13:01:53 -08:00
Mouse Reeve
6823d5f1b7 Cache follow button template snippet 2022-01-05 12:59:52 -08:00
Mouse Reeve
a5309e9973 Cache status contents 2022-01-05 10:22:25 -08:00
Mouse Reeve
d8dbf94c29 Fixes cache syntax 2022-01-05 10:16:49 -08:00
Mouse Reeve
2cad762646 Use in-memory cache for CI tests 2022-01-05 09:51:00 -08:00
Mouse Reeve
66456fc508 Adds test env var 2022-01-05 09:32:10 -08:00
Mouse Reeve
e6f7828361 Python formatting 2022-01-05 09:30:54 -08:00
Mouse Reeve
bebb2c167e Use redis with password in dev 2022-01-05 08:52:28 -08:00
Mouse Reeve
629140cad4 Adds redis cache backend 2022-01-05 08:27:31 -08:00
Joachim
f141777d52 Change thumbnail generation strategy 2022-01-05 11:54:49 +01:00
Mouse Reeve
b91649478b Fixes cache value 2022-01-04 18:07:30 -08:00
Mouse Reeve
cc4469e7e1 Python formatting 2022-01-04 18:05:26 -08:00
Mouse Reeve
5981575f0e Cache template snipped for shelve buttons 2022-01-04 17:59:35 -08:00
Mouse Reeve
c28fbbeb09 Uses single query to get suggested users 2022-01-04 16:33:19 -08:00
Mouse Reeve
1bd813c6f7
Merge pull request #1761 from bookwyrm-social/portuguese
Adds Portuguese locale
2022-01-04 14:45:07 -08:00
Mouse Reeve
96e8839d4b
Merge pull request #1690 from hughrun/group-list-button
add "Create list" form to group template
2022-01-04 14:39:12 -08:00
Mouse Reeve
557acd40ad Fixes locale names 2022-01-04 14:34:22 -08:00
Mouse Reeve
23e498879e Fixes account create tasks 2022-01-04 14:17:14 -08:00
Hugh Rundle
2153afe743 Merge branch 'main' into group-list-button
Hopefully fixes failing tests!
2022-01-05 08:47:01 +11:00
Mouse Reeve
3dd7847d7b Only remove non-public lists on unfollow 2022-01-04 13:46:21 -08:00
Mouse Reeve
77139385c1 Merge branch 'main' into list-not-loading 2022-01-04 13:36:06 -08:00
Mouse Reeve
e5c5dd8f98
Merge pull request #1736 from bookwyrm-social/new-modals-bright-futures
Switch old modals to new modals
2022-01-04 13:31:56 -08:00
Mouse Reeve
d8c682fb2b Adds Portuguese to the language list 2022-01-04 13:30:08 -08:00
Mouse Reeve
10792125ae Merge branch 'main' into portuguese 2022-01-04 13:28:19 -08:00
Mouse Reeve
160c758ce6 Adds and updates locale files 2022-01-04 13:23:43 -08:00
Mouse Reeve
afa713e667 Adds locale to bw-dev update command 2022-01-04 13:23:28 -08:00
Mouse Reeve
a5dc6b3d76
Merge pull request #1759 from bookwyrm-social/annual-goal-migration
Uses function to get current year for annual goal default
2022-01-04 13:03:53 -08:00
Mouse Reeve
10a51d9689 Changes how progress input fields are id'ed 2022-01-04 12:53:48 -08:00
Mouse Reeve
8a889e9a69
Merge branch 'main' into list-not-loading 2022-01-04 12:27:41 -08:00
Mouse Reeve
24faa45cc7 Merge branch 'main' into annual-goal-migration 2022-01-04 12:24:34 -08:00
Mouse Reeve
abb9686158
Merge pull request #1760 from bookwyrm-social/fragile-test
Updates fragile unit test causing nondeterministic failures
2022-01-04 12:23:30 -08:00
Mouse Reeve
cbc8ecb4b3 NotEqual, not False 2022-01-04 11:46:44 -08:00
Mouse Reeve
1ff653ddeb
Merge pull request #1749 from joachimesque/summary-goals
Display completed goal on Annual Summary page
2022-01-04 11:42:47 -08:00
Mouse Reeve
9dd2b88054 Updates fragile unit test causing nondeterministic failures 2022-01-04 11:35:12 -08:00
Mouse Reeve
aa1a7189ae Uses function to get current year for annual goal default 2022-01-04 11:02:59 -08:00
Mouse Reeve
cccd28cb74
Merge pull request #1726 from joachimesque/options-panels
Front-end: New look and behavior for Filters and Result panels
2022-01-03 09:23:12 -08:00
Hugh Rundle
d4acd89a28 Merge branch 'main' into group-list-button 2022-01-03 10:28:59 +11:00
Hugh Rundle
ea08b302c9
improve group page layout
- move 'Add list' button down to the group lists
- move member search box underneath members heading
- note about members being able to create lists is now under lists heading
2022-01-03 10:09:52 +11:00
Joachim
6e8a29aebf Update annual_summary.py 2022-01-02 17:52:49 +01:00
Mouse Reeve
0734e5cb62
Merge pull request #1755 from bookwyrm-social/locale-updates
Updates locales
2022-01-02 07:47:24 -08:00
Mouse Reeve
dcd1fec695 Updates locales 2022-01-02 07:38:37 -08:00
Mouse Reeve
8c265b1857
Merge pull request #1740 from bookwyrm-social/shelf-dupes
Removes duplicates from all books view
2022-01-02 07:28:50 -08:00
Mouse Reeve
5313b283dd Adds comment 2022-01-02 07:16:46 -08:00
Mouse Reeve
73d6dbab4c
Merge pull request #1752 from hughrun/shelf-selector-fix
only show own shelves in shelf_selector dropdown
2022-01-02 07:14:20 -08:00
Mouse Reeve
49ecd86afe Runs prettier 2022-01-02 07:01:11 -08:00
Mouse Reeve
f50294875f
Merge pull request #1748 from joachimesque/handle-modal-buttons-with-fallback
Handle modal component when already active at page load
2022-01-02 06:58:42 -08:00
Hugh Rundle
93d59c33ff
only show own shelves in shelf_selector dropdown 2022-01-02 13:09:40 +11:00
Hugh Rundle
38bd1f46d6
emblacken 2022-01-02 10:19:57 +11:00
Hugh Rundle
c73491b05c
Show add list button to group members 2022-01-02 10:06:59 +11:00
Hugh Rundle
045506d6e0
show group lists on group FindUsers page 2022-01-02 10:06:02 +11:00
Hugh Rundle
b1fa57d2ca
fix group form ids
Also adds the List form to the group FindUsers view
2022-01-02 09:08:04 +11:00
Mouse Reeve
da85df57b2
Merge pull request #1750 from bookwyrm-social/hide-summary-fix
Default to hidden state for local storage visibility toggle
2022-01-01 13:43:25 -08:00
Mouse Reeve
265fd1cb52 Default to hidden state for local storage visibility toggle 2022-01-01 13:09:24 -08:00
Hugh Rundle
8e17e20802
Merge branch 'bookwyrm-social:main' into group-list-button 2022-01-02 07:50:56 +11:00
Joachim
fd8423b73c Update annual_summary.py 2022-01-01 21:37:53 +01:00
Joachim
29b688b68d Update annual_summary.py 2022-01-01 21:32:30 +01:00
Joachim
864b731cfa remove testing line 2022-01-01 21:30:13 +01:00
Joachim
358aa142b2 Display completed goal on Annual Summary page 2022-01-01 21:28:14 +01:00
Joachim
e1642561ec Fix search panel validation error 2022-01-01 18:48:53 +01:00
Joachim
b7eb285f7b Handle modal when it is active on page load 2022-01-01 18:18:23 +01:00
Joachim
cc05e30605 Remove duplicate code 2022-01-01 18:17:11 +01:00
Mouse Reeve
cb3d224a5b
Merge pull request #1739 from bookwyrm-social/notification-link
Don't do fancy javascript clicks on the notification page
2022-01-01 08:41:00 -08:00
Mouse Reeve
653970054c
Merge pull request #1745 from bookwyrm-social/goal-status
Fixes display for goal statuses
2022-01-01 07:02:27 -08:00
Mouse Reeve
28fed2c6ae Fixes display for goal statuses 2022-01-01 06:52:13 -08:00
Mouse Reeve
3c1552d435
Merge pull request #1738 from bookwyrm-social/reading-modals
Refactors reading modals
2021-12-31 10:40:17 -08:00
Mouse Reeve
30bf84fe7b Adds aria-described-by to modal component 2021-12-31 10:39:18 -08:00
Mouse Reeve
31be6de665 Python formatting 2021-12-30 20:23:22 -08:00
Mouse Reeve
2cc9e3bbca Removes duplicates from all books view 2021-12-30 20:14:49 -08:00
Mouse Reeve
8d72169bbd Don't do fancy javascript clicks on the notification page 2021-12-30 19:48:47 -08:00
Mouse Reeve
2f4899dc1f Remove old modal, new modal is our best friend now 2021-12-30 19:19:55 -08:00
Mouse Reeve
48d3b4bf58 Merge branch 'new-modals-bright-futures' into reading-modals 2021-12-30 19:16:46 -08:00
Mouse Reeve
d4e24227df Updates shelve button menu options 2021-12-30 19:15:36 -08:00
Mouse Reeve
ed93eda18d Adds preventDefault to modal js 2021-12-30 19:09:03 -08:00
Mouse Reeve
8ad75084de Force state for active modal 2021-12-30 18:56:37 -08:00
Mouse Reeve
e3321c9bad Updates buttons to call modals in shelve buttons 2021-12-30 18:42:38 -08:00
Mouse Reeve
5f3a5c87b6 Update report modal 2021-12-30 18:37:49 -08:00
Mouse Reeve
a576b128c3 Updates reading modals 2021-12-30 18:06:33 -08:00
Mouse Reeve
65c719d2d4 Move readthrough delete modal into books dir 2021-12-30 17:49:41 -08:00
Mouse Reeve
7af4af278d Readthrough delete modal 2021-12-30 17:48:09 -08:00
Mouse Reeve
c6b5ecc418 Updates delete group modal 2021-12-30 17:29:06 -08:00
Mouse Reeve
57ce894667 Updates book sync modals 2021-12-30 14:19:31 -08:00
Mouse Reeve
472c003293 Merge branch 'main' into list-not-loading 2021-12-30 14:09:04 -08:00
Mouse Reeve
0031a63511 Updates add cover modal 2021-12-30 14:07:30 -08:00
Mouse Reeve
4400c62274 Adds sync modal for inventaire 2021-12-30 13:38:35 -08:00
Mouse Reeve
82ea04f247 Uses new modals for author sync 2021-12-30 13:37:07 -08:00
Mouse Reeve
d60684e08e
Merge pull request #1735 from bookwyrm-social/lists-markup
Cleans up html on list and list curate page
2021-12-30 13:33:37 -08:00
Mouse Reeve
c16312b068 Python formatting 2021-12-30 13:21:38 -08:00
Mouse Reeve
04476d253e Uses new modal component for delete list modal 2021-12-30 13:18:06 -08:00
Mouse Reeve
80f7c253de Improves list curate page test 2021-12-30 12:55:40 -08:00
Mouse Reeve
1e879f66ac Simplify decorators in list curate view 2021-12-30 12:45:47 -08:00
Mouse Reeve
ec0b1e8cc3 Switches position of list delete and save buttons 2021-12-30 12:38:36 -08:00
Mouse Reeve
821e579a39 Refactors list curate page 2021-12-30 12:34:21 -08:00
Mouse Reeve
b090490cd9 Revert test of add list on create command 2021-12-30 12:06:22 -08:00
Mouse Reeve
cc37d7404e Fixes calls to add lists 2021-12-30 11:58:27 -08:00
Mouse Reeve
4de406afe1 Some tests fixes 2021-12-30 11:07:04 -08:00
Mouse Reeve
975ef7d38e Merge branch 'main' into list-not-loading 2021-12-30 10:44:23 -08:00
Mouse Reeve
906e0c9c7c Renames function for loading lists 2021-12-30 10:40:26 -08:00
Mouse Reeve
f993195752
Merge pull request #1725 from joachimesque/book-page-cover-show-modal
Front-end: On book page, click on cover to show/add image
2021-12-30 09:29:43 -08:00
Mouse Reeve
3d808a0122
Merge pull request #1734 from joachimesque/summary-book-grid-fixes
Fix: Display a denser summary book grid and limit big books
2021-12-30 09:25:54 -08:00
Joachim
dabd1e919d Fix: Display a denser summary book grid and limit big books
Closes #1731
2021-12-30 12:01:28 +01:00
Joachim
cd89271724 Apply review suggestions 2021-12-30 10:43:23 +01:00
Mouse Reeve
9f6918767b Corrects documentation on sort order 2021-12-29 17:41:31 -08:00
Mouse Reeve
2640c26bb1 Fixes wording in comments 2021-12-29 17:39:14 -08:00
Mouse Reeve
1d1ef6589a
Merge pull request #1730 from bookwyrm-social/locales
Updates locales with new translations
2021-12-29 16:20:40 -08:00
Mouse Reeve
a9ff23ece0 Fixes nondeterministic test failure 2021-12-29 13:44:04 -08:00
Mouse Reeve
cefd0e4d5d
Merge pull request #1728 from joachimesque/summary-feed-panel-smol-fix
Front-end: Update Feed summary card style
2021-12-29 13:41:53 -08:00
Mouse Reeve
e1ab346418 Updates locales with new translations 2021-12-29 13:34:38 -08:00
Mouse Reeve
b43b3a26c7
Merge pull request #1729 from bookwyrm-social/templatetag-tests
Templatetag tests
2021-12-29 13:15:42 -08:00
Mouse Reeve
b1687f5cac Adds another test 2021-12-29 13:03:23 -08:00
Mouse Reeve
4b8daf6874
Merge branch 'main' into group-list-button 2021-12-29 12:52:24 -08:00
Joachim
ce679cec75 Update bookwyrm.css 2021-12-29 21:45:36 +01:00
Mouse Reeve
d89c7a3617
Merge pull request #1727 from bookwyrm-social/feed-template-tests
HTML validation fixes
2021-12-29 12:42:22 -08:00
Mouse Reeve
18213e2d24 Moves tests into separate files 2021-12-29 12:42:02 -08:00
Joachim
f204cff42b Fix filter panel validation error 2021-12-29 21:40:16 +01:00
Mouse Reeve
0ae6d5e708 Renames templatetags test file 2021-12-29 12:33:42 -08:00
Mouse Reeve
9e5707a9e1 Move templatetags test file into subdirectory 2021-12-29 12:31:42 -08:00
Mouse Reeve
7623168410 Fixes search html
And suppresses more warnings
2021-12-29 12:26:40 -08:00
Mouse Reeve
65e59e7b56 Validate search page html 2021-12-29 11:52:32 -08:00
Mouse Reeve
af63c9c187 Line breaks, why not 2021-12-29 11:52:14 -08:00
Mouse Reeve
0968802fd3 Adds alt tag to logo 2021-12-29 11:45:17 -08:00
Mouse Reeve
6075a88438 Validate html in get started views tests 2021-12-29 11:45:07 -08:00
Joachim
383f9fa228 Front-end: Update Feed summary card style
Now the header's background is contained by the border-radius
2021-12-29 20:41:11 +01:00
Mouse Reeve
e48d2c35ee Unqiue form names on list items 2021-12-29 11:38:53 -08:00
Mouse Reeve
3e550a13ad Unique names for shelve forms 2021-12-29 11:31:26 -08:00
Mouse Reeve
4e1b155c6c Encode characters in iframe copy text 2021-12-29 11:21:21 -08:00
Joachim
a001dabc52 Fix validation (︺︹︺) 2021-12-29 20:21:06 +01:00
Joachim
0c2997e562 Curlylint fixes 2021-12-29 20:16:53 +01:00
Mouse Reeve
8e89d02093 Fixes html form for editing lists 2021-12-29 11:11:09 -08:00
Joachim
c53b5c306f Lint fix 2021-12-29 20:03:07 +01:00
Joachim
4cb520f242 Front-end: New look and behavior for Filters and Result panels 2021-12-29 19:50:32 +01:00
Mouse Reeve
3770713e07 Validate html in discover page tests 2021-12-29 10:44:04 -08:00
Mouse Reeve
1e27b64af4 Valid dl html syntax on announcement page 2021-12-29 10:39:47 -08:00
Mouse Reeve
161532f8a8 Adds validate_html to announcement page tests 2021-12-29 10:37:21 -08:00
Mouse Reeve
9facaf404f Validates html in feed views 2021-12-29 10:20:54 -08:00
Mouse Reeve
0dcd7bee10
Merge pull request #1715 from bookwyrm-social/summary-queries
Simplifies query for earliest year
2021-12-29 10:17:52 -08:00
Mouse Reeve
41fb44a46a Python formatting 2021-12-29 10:07:27 -08:00
Mouse Reeve
f9e9dc55d5 Updates tests 2021-12-29 09:58:42 -08:00
Joachim
faa52503a3 Update bookwyrm.css 2021-12-29 18:57:45 +01:00
Joachim
3b0096caf0 Add button overlay 2021-12-29 18:55:02 +01:00
Mouse Reeve
6ca57ae314 Linter fixes 2021-12-29 09:43:06 -08:00
Mouse Reeve
7eb8d027c4
Merge pull request #1722 from cincodenada/no-more-fedireads-main
Remove last traces of fedireads, but in main
2021-12-29 09:32:43 -08:00
Joachim
6952ab0081 Solve markup validation issues 2021-12-29 17:10:44 +01:00
Joachim
e5f3e9cd2c fix curlylint issue 2021-12-29 17:00:40 +01:00
Joachim
3de2396cb8 Update cover_show_modal.html 2021-12-29 16:45:36 +01:00
Joachim
87ab665583 fix for editorConfig linting 2021-12-29 16:43:38 +01:00
Joachim
e5bca3873c Remove useless additoins 2021-12-29 16:41:14 +01:00
Joachim
f12ba8609f Front-end: On book page, click on cover to show/add image
Closes #1009
2021-12-29 16:40:19 +01:00
Mouse Reeve
0c0bfc046d
Merge pull request #1723 from bookwyrm-social/dependabot/pip/django-3.2.10
Bump django from 3.2.5 to 3.2.10
2021-12-28 17:06:37 -08:00
dependabot[bot]
49ee040241
Bump django from 3.2.5 to 3.2.10
Bumps [django](https://github.com/django/django) from 3.2.5 to 3.2.10.
- [Release notes](https://github.com/django/django/releases)
- [Commits](https://github.com/django/django/compare/3.2.5...3.2.10)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-29 00:54:20 +00:00
Joel Bradshaw
66df16eb78 Fix typo while we're here 2021-12-28 16:49:34 -08:00
Joel Bradshaw
9d1db3f67c Remove last traces of fedireads 2021-12-28 16:49:32 -08:00
Mouse Reeve
934a202738
Merge pull request #1683 from bookwyrm-social/prettier
Adds Prettier javascript formatter
2021-12-28 16:41:45 -08:00
Mouse Reeve
49e0f9437e Merge branch 'main' into prettier 2021-12-28 16:30:06 -08:00
Mouse Reeve
4b3d2e87a6
Merge pull request #1633 from joachimesque/tidy-header
Front-end: New modal component + header alignment
2021-12-28 16:24:27 -08:00
Mouse Reeve
c34c53b672
Merge pull request #1720 from bookwyrm-social/server-errors
Various fixes for server errors that popped up on bookwyrm.social
2021-12-28 16:12:30 -08:00
Mouse Reeve
5b75f3d310 Avoid clash with existing test data user 2021-12-28 16:02:48 -08:00
Mouse Reeve
6745cd73cc Deterministic ordering for OL import test 2021-12-28 15:53:35 -08:00
Mouse Reeve
a8ae427aeb Updates domain regex 2021-12-28 15:53:26 -08:00
Mouse Reeve
14a90e805a Test users with domains that contain dashes 2021-12-28 15:52:35 -08:00
Mouse Reeve
1a30546b99 Adds test for dm view with partner 2021-12-28 15:44:47 -08:00
Mouse Reeve
5b192d1b3d Fixes error when librarything csv is missing isbn 2021-12-28 15:27:35 -08:00
Mouse Reeve
a58d600030 Adds librarything line without isbn to test data 2021-12-28 15:22:02 -08:00
Mouse Reeve
21e0f4234e Don't try to create a json view of the all books page
It's a fake view, a liar
2021-12-28 15:04:25 -08:00
Mouse Reeve
3f8e309680 Adds test for json requests to all books view 2021-12-28 15:04:06 -08:00
Mouse Reeve
14601a0c31 Don't error out on invalid login POST
Thanks, log4j exploit scanners, for catching this one
2021-12-28 14:50:28 -08:00
Mouse Reeve
638ea166be More trailing slashes in urls 2021-12-28 14:41:45 -08:00
Mouse Reeve
f62cd5fd12 Makes embed key non-optional in urls 2021-12-28 14:40:11 -08:00
Mouse Reeve
0422421d60 Fixes bug in logged out group view 2021-12-28 14:33:30 -08:00
Mouse Reeve
8a3be920c6 Adds test for logged out view of group 2021-12-28 14:29:51 -08:00
Mouse Reeve
ec7c1e75fe
Merge pull request #1714 from joachimesque/handle-user-at-urls
Redirect /@<username> to /user/<username>
2021-12-28 13:19:46 -08:00
Mouse Reeve
c3ec25dbf8 Simplifies query for earliest year 2021-12-28 13:02:12 -08:00
Joachim
17cb936a16 Update test_user.py 2021-12-28 21:54:06 +01:00
Joachim
5284e7009d fix pylint remark 2021-12-28 21:51:45 +01:00
Joachim
cae4934b48 Apply review suggestion 2021-12-28 21:49:52 +01:00
Joachim
05142f4b73 Add test 2021-12-28 21:49:41 +01:00
Mouse Reeve
a06e1e37c9
Merge pull request #1712 from bookwyrm-social/plurals
Adds more plurals to summary translation
2021-12-28 12:44:44 -08:00
Joachim
ff3021d1f3 Redirect /@<username> to /user/<username> 2021-12-28 21:40:01 +01:00
Mouse Reeve
faafcbebd7 Fixes calls to counter 2021-12-28 12:26:57 -08:00
Mouse Reeve
f4f3659c6f Updates locales 2021-12-28 12:25:01 -08:00
Mouse Reeve
d974e251f1 Adds more plurals to summary translation 2021-12-28 12:05:32 -08:00
Mouse Reeve
4159776771
Merge pull request #1710 from joachimesque/summary-images-fixes
Summary images fixes
2021-12-28 12:00:38 -08:00
Joachim
b26d41cefc Update bookwyrm.css 2021-12-28 17:59:01 +01:00
Joachim
b6e90ce2b2 Fix grid on mobile 2021-12-28 17:58:10 +01:00
Joachim
9e0ebc3ec7 Fix hardcoded year in translation key 2021-12-28 17:40:33 +01:00
Joachim
b2f6c61bb6 Slightly better quality images 2021-12-28 17:40:13 +01:00
Mouse Reeve
daa3a1ee77
Merge pull request #1708 from bookwyrm-social/summary-mobile
Tweaks mobile view for annual summary
2021-12-28 07:25:44 -08:00
Mouse Reeve
38d4172e2c
Merge pull request #1707 from bookwyrm-social/locale_updates
Adds annual review translations for Galician and Spanish
2021-12-28 07:18:21 -08:00
Mouse Reeve
d67150fb7f Tweaks mobile view for annual summary 2021-12-28 07:16:33 -08:00
Mouse Reeve
86e8d36b25 Adds annual review translations for Galician and Spanish 2021-12-28 07:02:52 -08:00
Mouse Reeve
d0e44f1ee4
Merge pull request #1706 from joachimesque/summary-list-bugfixes
Fixes: Annual summary book list
2021-12-28 06:59:24 -08:00
Joachim
3a015062ec Reverse sorting order 2021-12-28 10:49:09 +01:00
Joachim
489c827673 fix sizes 2021-12-28 10:29:35 +01:00
Joachim
8fd0d5baf0 Fix images stretch 2021-12-28 10:18:40 +01:00
Mouse Reeve
0dde5d4a4b
Merge pull request #1705 from bookwyrm-social/annual-ids
Use readthroughs only to determine books read this year
2021-12-27 14:56:32 -08:00
Mouse Reeve
b35cc90be6
Merge pull request #1704 from bookwyrm-social/summary-strings
Adds translation strings for summary page
2021-12-27 14:51:30 -08:00
Mouse Reeve
b99ff9ef85 Removes unused import 2021-12-27 14:49:48 -08:00
Mouse Reeve
a064333a96 Use readthroughs only to determine books read this year 2021-12-27 14:45:11 -08:00
Mouse Reeve
66d5f16f82
Merge pull request #1703 from bookwyrm-social/hide-annual-summary
Hide annual summary
2021-12-27 14:32:53 -08:00
Mouse Reeve
90c321caae Adds translation strings for summary page
Plus locale updates
2021-12-27 14:27:37 -08:00
Mouse Reeve
e6b15f25eb Fixes variable name 2021-12-27 14:22:09 -08:00
Mouse Reeve
3cddd69274 Option to hide the annual summary card 2021-12-27 14:12:57 -08:00
Mouse Reeve
1be164425a Merge branch 'main' into prettier 2021-12-27 13:39:34 -08:00
Mouse Reeve
2345845560
Merge pull request #1692 from joachimesque/summary-review-sharing
Feature: Annual summary sharing
2021-12-27 13:37:59 -08:00
Mouse Reeve
ed3ae0940b
Merge pull request #1701 from bookwyrm-social/annual-summary-tweaks
Adds minor changes to null states for annual summary
2021-12-27 13:31:57 -08:00
Mouse Reeve
85486dcfad
Update bookwyrm.css 2021-12-27 13:29:47 -08:00
Mouse Reeve
5afd59f4d4
Merge branch 'main' into summary-review-sharing 2021-12-27 13:19:15 -08:00
Mouse Reeve
a96466bf35 Adds minor changes to null states for annual summary 2021-12-27 13:16:27 -08:00
Mouse Reeve
c85f881f97
Merge pull request #1691 from joachimesque/2021-in-the-books
Feature: Create annual summary page
2021-12-27 13:15:54 -08:00
Mouse Reeve
e1614a52ac
Merge pull request #1700 from bookwyrm-social/locales
Locale updates
2021-12-27 13:03:43 -08:00
Mouse Reeve
ae2d869fa9
Merge pull request #1695 from joachimesque/fix-text-right-on-shelf-modal
Fix: Fix modal alignment in Shelf page
2021-12-27 13:02:33 -08:00
Mouse Reeve
935cca2dd7
Merge pull request #1689 from joachimesque/details-fixes
Front-end: Fix Safari details display and enhance dropdown on mobile
2021-12-27 13:00:29 -08:00
Mouse Reeve
a148f0e2be
Merge pull request #1686 from cincodenada/sync-s3
Adds sync_media_to_s3 command
2021-12-27 12:48:25 -08:00
Mouse Reeve
38c132e251
Merge pull request #1684 from bookwyrm-social/remove-checkall
Removes check_all javascript that is no longer used
2021-12-27 12:47:21 -08:00
Mouse Reeve
119a030aab Locale updates 2021-12-27 12:44:22 -08:00
Mouse Reeve
76694bb891 Demo for file type 2021-12-27 12:42:24 -08:00
Mouse Reeve
3d07618b5f Styling for autocomplete box 2021-12-27 12:42:11 -08:00
Mouse Reeve
e2d1c987b5 Adds autocomplete scrip 2021-12-27 12:41:42 -08:00
Joachim
cc7f1ef73d Fix: Fix modal alignment in Shelf page 2021-12-22 20:03:13 +01:00
Joachim
5314681641 Update layout.html 2021-12-22 19:47:39 +01:00
Joachim
df7b40359a Add translation calls 2021-12-22 18:15:20 +01:00
Joachim
07f2d9a11c Update tests 2021-12-22 18:15:05 +01:00
Joachim
b03b6f6d6f Add docstring 2021-12-22 17:14:21 +01:00
Joachim
b9265bdd29 Update annual_summary.py 2021-12-22 17:10:47 +01:00
Joachim
04d51cde3f pylint 2021-12-22 17:09:12 +01:00
Joachim
d4b8aa51f6 lint styles 2021-12-22 16:55:02 +01:00
Joachim
13ee7e7a65 Use readthrough finish date instead of shelving date 2021-12-22 16:53:10 +01:00
Joachim
357eddf16e Limit page availability to earliest completed readthrough / shelving 2021-12-22 16:52:42 +01:00
Joachim
8de2bca2c5 Add + adjust text copy component 2021-12-22 15:13:42 +01:00
Joachim
45dd39d370 Add key creation/revocation 2021-12-22 15:12:56 +01:00
Joachim
af9c983145 Change voice for no read book 2021-12-22 15:11:55 +01:00
Joachim
1022e3e165 Add basic key verification and change voice in template 2021-12-22 15:11:05 +01:00
Joachim
24b0e086e7 Add summary_keys JSONField for the user 2021-12-22 14:57:26 +01:00
Joachim
ce9c6f1727 Color links in green 2021-12-22 14:54:36 +01:00
Joachim
13d668e49e Color links in green 2021-12-22 14:53:34 +01:00
Joachim
0da0a62660 Don't crash if there's no ratings 2021-12-22 11:18:47 +01:00
Joachim
6308625bab Don't crash if there's no ratings 2021-12-22 11:18:26 +01:00
Joachim
67092fd3e3 🤦 2021-12-22 10:27:59 +01:00
Joachim
ce8bb306a3 🤦 2021-12-21 17:35:57 +01:00
Joachim
73551f1602 Fix tests? 2021-12-21 17:24:44 +01:00
Joachim
66ee5ccacf Fix tests? 2021-12-21 17:24:15 +01:00
Joachim
8f0df388e6 Update test_annual_summary.py 2021-12-21 15:57:58 +01:00
Joachim
37abf9531d fix test 2021-12-21 15:55:51 +01:00
Joachim
c13e7479c3 Add tests 2021-12-21 14:44:21 +01:00
Joachim
b7545bf0dd Style fixes 2021-12-21 13:50:05 +01:00
Joachim
545fb9e4be disable no-self-use 2021-12-21 13:17:18 +01:00
Joachim
581e7f3e40 R0914 & R0201 2021-12-21 12:22:40 +01:00
Joachim
7e9c7ce9e3 Improve pylint 2021-12-21 12:12:32 +01:00
Joachim
d9bd7be1ec same 2021-12-21 12:06:57 +01:00
Joachim
7c9995a5e5 Fix EditorConfig linting 2021-12-21 12:02:57 +01:00
Joachim
da51711ddf black 2021-12-21 11:58:46 +01:00
Joachim
4d6c4d3ad2 Add rounding for averages 2021-12-21 11:54:20 +01:00
Joachim
c2c57db8e6 Fix for empty years 2021-12-21 11:52:33 +01:00
Joachim
1fd44aeb5c Style fixes 2021-12-21 11:43:45 +01:00
Joachim
ce6ca49620 Add link to current summary on home feed 2021-12-21 11:43:39 +01:00
Joachim
a8e8785106 Add previous/next year links 2021-12-21 11:43:09 +01:00
Joachim
a24afdb6bf Use aggregate queries 2021-12-21 10:21:30 +01:00
Joachim
b2f3f03197 Lint style 2021-12-20 23:40:53 +01:00
Joachim
8d64b2d55e Add serif styles 2021-12-20 23:38:18 +01:00
Joachim
c1459dbcf9 Feature: Create annual summary page 2021-12-20 23:37:45 +01:00
Hugh Rundle
1603df0817
add "Create list" form to group template 2021-12-19 14:19:35 +11:00
Joachim
89713ce685 same but for js 2021-12-17 20:53:06 +01:00
Joachim
b15e0e37fc same 2021-12-17 20:51:41 +01:00
Joachim
9a2a31028b fix linting issues 2021-12-17 20:50:04 +01:00
Joachim
355405daa3 Front-end: Fix Safari details display and enhance dropdown on mobile 2021-12-17 20:40:58 +01:00
Joachim
df8427921b Add alignment rule for button reset 2021-12-17 17:34:22 +01:00
Joachim
f88b511bbf Update bookwyrm.css 2021-12-17 17:32:44 +01:00
Joachim
ce0e2eb61a Handle navbar alignment thank to Bulma helper classes 2021-12-17 17:30:14 +01:00
Joachim
f300104c4d Add reset button style 2021-12-17 17:29:46 +01:00
Joachim
2544ea12c7 Revert changes on layout 2021-12-17 17:00:10 +01:00
Joel Bradshaw
faffbdce21 Fix spacing 2021-12-16 23:44:47 -08:00
Joel Bradshaw
37a7899f6f Consistently quote $@, check for argument
Also add $@ to a couple commands, and add a check for the argument to
the CORS command since it's required
2021-12-16 23:41:58 -08:00
Joel Bradshaw
8eb340945b Add sync_media_to_s3 command
This is useful if the copy gets aborted, or to sync over remnants
generated between the copy and the switchover to S3
2021-12-16 23:40:40 -08:00
Mouse Reeve
8bda0bc0dc Removes check_all javascript that is no longer used 2021-12-16 11:06:53 -08:00
Mouse Reeve
2b6c9d9d31 Runs prettier 2021-12-16 10:53:38 -08:00
Mouse Reeve
34a16667d8 Adds github workflow 2021-12-16 10:47:22 -08:00
Mouse Reeve
2fa1aa4cc7 Adds bw-dev command 2021-12-16 10:43:24 -08:00
Mouse Reeve
ea457eae58 Adds prettier package 2021-12-16 10:40:20 -08:00
Mouse Reeve
5d47f33972 Tick version number 2021-12-16 10:29:08 -08:00
Mouse Reeve
400417c79f Fixes form 2021-12-16 10:15:32 -08:00
Mouse Reeve
2f47284c77 Removes outdated code 2021-12-16 09:12:00 -08:00
Mouse Reeve
0629fce171 Fixes post test 2021-12-15 17:25:20 -08:00
Mouse Reeve
5c99f142f9 Serialize links for books 2021-12-15 17:12:53 -08:00
Mouse Reeve
86b294afd7 Re-structures link models 2021-12-15 16:23:21 -08:00
Mouse Reeve
af8cb51325 Adds view tests 2021-12-15 13:58:29 -08:00
Mouse Reeve
ed7d8e5501 Removed unused import 2021-12-15 13:39:20 -08:00
Mouse Reeve
322bb909fc Better mobile display 2021-12-15 13:35:10 -08:00
Mouse Reeve
d911e2c6db Cleans up sidebar html 2021-12-15 13:23:25 -08:00
Mouse Reeve
5ed5d5d222 Don't show cancel button in static mode 2021-12-15 13:21:08 -08:00
Mouse Reeve
c8e038cd4e Adds form errors 2021-12-15 13:20:05 -08:00
Mouse Reeve
dcf5694b66 Use class view 2021-12-15 13:15:51 -08:00
Mouse Reeve
cc3db31db9 Adds noscript fallback for links modal 2021-12-15 13:11:49 -08:00
Mouse Reeve
4f576b77a0 Use urlfield 2021-12-15 12:46:10 -08:00
Mouse Reeve
1d6b200172 Modal to add link 2021-12-15 12:40:25 -08:00
Mouse Reeve
40d1beee20 Adds links to activitypub spec 2021-12-15 10:56:49 -08:00
Mouse Reeve
c6bdc34499 Updates migration 2021-12-15 10:20:00 -08:00
Mouse Reeve
a4859668b8 Merge branch 'main' into book-file-links 2021-12-15 10:05:29 -08:00
Mouse Reeve
c3a32b3a54
Merge branch 'main' into tidy-header 2021-12-15 10:02:36 -08:00
Mouse Reeve
f7c6cb3598
Merge pull request #1677 from nycterent/fix/sample-config
removing quotes as they are interpreted as part of a value
2021-12-15 09:59:04 -08:00
Mouse Reeve
5e932711f9 Merge branch 'main' into list-not-loading 2021-12-15 09:56:33 -08:00
Mouse Reeve
f5b7fcd0c7
Merge pull request #1680 from bookwyrm-social/openlibrary-import
Support csv import from Openlibrary
2021-12-14 20:00:55 -08:00
Mouse Reeve
e6d500df6b Removes debugging print statements 2021-12-14 19:52:43 -08:00
Mouse Reeve
6ba5d53d38 trying item.last instead of going by list lookup 2021-12-14 19:46:35 -08:00
Mouse Reeve
69204a1c94 More print statements 2021-12-14 19:38:28 -08:00
Mouse Reeve
6af2182879 Test print statements 2021-12-14 19:20:29 -08:00
Mouse Reeve
8cb2e74c81 Uncomment test 2021-12-14 19:05:45 -08:00
Mouse Reeve
778027688a
Merge pull request #1681 from bookwyrm-social/locale-updates
Updates locales
2021-12-14 19:01:19 -08:00
Mouse Reeve
7ce1d8cd1a Updates locales 2021-12-14 18:53:53 -08:00
Mouse Reeve
86fcaad72c Comments out failing test 2021-12-14 18:47:17 -08:00
Mouse Reeve
3545085a7d Fixes tests 2021-12-14 14:19:27 -08:00
Mouse Reeve
09f5218f9c Fixes accept header 2021-12-14 13:47:09 -08:00
Mouse Reeve
a33b5b054f Retain source on retry jobs 2021-12-14 13:14:45 -08:00
Mouse Reeve
73ea44e532 Add openlibrary selector to list 2021-12-14 12:59:24 -08:00
Mouse Reeve
ba390dc3ad Safer user of "lower" 2021-12-14 12:50:53 -08:00
Mouse Reeve
bee3c86223 Lookup by openlibrary key 2021-12-14 12:49:00 -08:00
Mouse Reeve
4f1d4d9bc0 Adds openlibrary keys to data 2021-12-14 12:42:56 -08:00
Mouse Reeve
bb69c32a6c Adds support for openlibrary csv shelf name format 2021-12-14 11:58:56 -08:00
Mouse Reeve
79af354dfd Don't produce error is author is unset in import 2021-12-14 11:27:13 -08:00
Mouse Reeve
65ec626573 Don't trim stream if max length is unset 2021-12-14 11:11:05 -08:00
Mouse Reeve
0012f4464d Consider group membership for list cache 2021-12-14 11:07:36 -08:00
Mouse Reeve
3358e45086 Updates mocks on list stream tasks 2021-12-14 09:31:57 -08:00
Mouse Reeve
3d6266cca2 Merge branch 'main' into list-not-loading 2021-12-14 09:17:00 -08:00
Martynas Sklizmantas
6e0f322d12 removing quotes as they are interpreted as part of a value 2021-12-12 10:53:55 +02:00
Mouse Reeve
fec1827302
Merge pull request #1672 from bookwyrm-social/unused-view
Removes unused groups view
2021-12-10 15:56:44 -08:00
Mouse Reeve
288c396c49 Removes test line 2021-12-10 13:45:50 -08:00
Mouse Reeve
3fb9d140ed Fixes typo in test 2021-12-10 13:39:41 -08:00
Mouse Reeve
d28b22a361 Adds test for generated links in book model 2021-12-10 13:33:00 -08:00
Mouse Reeve
a3d5acc70c Model name in comment 2021-12-10 12:46:40 -08:00
Mouse Reeve
cfd0d0d56a Pylint changes for group model tests 2021-12-10 12:32:53 -08:00
Mouse Reeve
8d6059ae32 Fixes mocks on group model tests 2021-12-10 12:32:05 -08:00
Mouse Reeve
00fdca681f Fixes retry test 2021-12-10 12:16:33 -08:00
Mouse Reeve
5430e389d9 Adds group accept and reject tests 2021-12-10 12:10:58 -08:00
Mouse Reeve
73e09f8d18 Use transaction decorator on group accept 2021-12-10 12:03:18 -08:00
Mouse Reeve
08a8f37a0b Simpler error states for when model values aren't found 2021-12-10 12:02:57 -08:00
Mouse Reeve
3aebb54feb Adds remove member tests 2021-12-10 11:53:10 -08:00
Mouse Reeve
9f04919bec Remove unrelated tests changes
these will happen elsewhere
2021-12-10 11:44:38 -08:00
Mouse Reeve
d546d9dce9 Changes spacing on import method 2021-12-10 11:43:13 -08:00
Mouse Reeve
10c74d0619 Additional import tests 2021-12-10 11:41:54 -08:00
Mouse Reeve
7a547d9a1a Adds more groups tests 2021-12-10 11:21:11 -08:00
Mouse Reeve
b890e93533 Adds saved list view test 2021-12-10 09:55:50 -08:00
Mouse Reeve
f7c8a550cf Fixes references to populate lists task 2021-12-10 09:34:17 -08:00
Mouse Reeve
94250dab42 Mocks for list signals tests 2021-12-10 09:19:32 -08:00
Mouse Reeve
59e6b67bc8 Activitystreams mocks 2021-12-09 20:38:44 -08:00
Mouse Reeve
0c193b6ce1 ActivityStream mocks 2021-12-09 20:33:11 -08:00
Mouse Reeve
5e6b28bbc0 Prefs mocks 2021-12-09 20:30:53 -08:00
Mouse Reeve
acde30887d Importer tests 2021-12-09 20:12:06 -08:00
Mouse Reeve
936f045344 Adds resolve book view test 2021-12-09 19:36:12 -08:00
Mouse Reeve
d9d0919ad4 More mocks for more tests 2021-12-09 19:14:10 -08:00
Mouse Reeve
234d44b5c7 Adds delete test 2021-12-09 19:00:48 -08:00
Mouse Reeve
9c86bb1bc3 Removes invalid render 2021-12-09 18:54:15 -08:00
Mouse Reeve
23842f7501 Test for followers api view 2021-12-09 18:46:24 -08:00
Mouse Reeve
b57aa4c9d3 Fixes redirect 2021-12-09 18:42:09 -08:00
Mouse Reeve
cf275d0c59 Removes unused groups view 2021-12-09 18:38:05 -08:00
Mouse Reeve
074c2cfb95 Gets updates view to 100% test coverage 2021-12-09 18:16:34 -08:00
Mouse Reeve
2d63bfb791 Updates views tests 2021-12-09 18:02:59 -08:00
Mouse Reeve
93dbe2daa0 Updates inbox tests 2021-12-09 15:02:53 -08:00
Mouse Reeve
7a89552892 Updates test_* tests 2021-12-09 13:02:23 -08:00
Mouse Reeve
eb4a399472 Updates models tests 2021-12-09 12:43:09 -08:00
Mouse Reeve
fe56402b69
Merge pull request #1670 from bookwyrm-social/locale-updates
Locale updates
2021-12-09 11:22:27 -08:00
Mouse Reeve
e9c58295f3 Merge branch 'main' into list-not-loading 2021-12-09 11:10:26 -08:00
Mouse Reeve
ee0485a8d5 Locale updates 2021-12-09 11:07:22 -08:00
Mouse Reeve
6e61e4d52c
Merge pull request #1578 from bookwyrm-social/improve-compatibility
Improve federation compability with Hubzilla and Zap
2021-12-09 11:06:04 -08:00
Mouse Reeve
2ffddeaa1f
Merge pull request #1647 from joachimesque/list-embed
List embed
2021-12-09 10:53:16 -08:00
Joachim
5b09035690 Update i18n messages 2021-12-08 16:42:49 +01:00
Joachim
5b8c1bde89 Merge branch 'main' into list-embed 2021-12-08 16:40:15 +01:00
Joachim
793ce4d33b Remove query in view response 2021-12-08 16:39:43 +01:00
Mouse Reeve
7e7af792ca
Merge pull request #1667 from bookwyrm-social/new-copy
Adds strings for load data feature
2021-12-07 14:33:26 -08:00
Mouse Reeve
14452dcccf Adds strings for load data feature
Plus, updated locales
2021-12-07 14:20:24 -08:00
Mouse Reeve
142616b996
Merge pull request #1660 from bookwyrm-social/update-from-remote
Button to manually load remote data for editions and authors
2021-12-07 14:11:06 -08:00
Mouse Reeve
4248c23c49 Test loading ISNI from openlibrary 2021-12-07 13:58:23 -08:00
Mouse Reeve
6ee1a628b0 inventaire remote id test 2021-12-07 13:53:25 -08:00
Mouse Reeve
b6071da3fc Connector tests 2021-12-07 13:48:22 -08:00
Mouse Reeve
31883a9f7c Linting fixes 2021-12-07 13:08:25 -08:00
Mouse Reeve
cf26f48d5c Adds view tests 2021-12-07 13:05:31 -08:00
Mouse Reeve
e500f53125 Sync button for books 2021-12-07 12:47:33 -08:00
Mouse Reeve
4973e0a010 Adds confirm modal for loading data 2021-12-07 12:32:17 -08:00
Mouse Reeve
7dbb9b4b26 Cleans up styling on author page
Better mobile display, trim long text blocks
2021-12-07 11:33:44 -08:00
Mouse Reeve
85ab679b68
Merge pull request #1663 from bookwyrm-social/locale-updates
Loads new translation strings and adds remote follow text
2021-12-07 10:17:02 -08:00
Mouse Reeve
c178c4de80 Loads new translation strings and adds remote follow text 2021-12-07 09:39:46 -08:00
Mouse Reeve
857bc6adae
Merge pull request #1635 from hughrun/remote-follow
Remote follow
2021-12-06 14:36:21 -08:00
Mouse Reeve
8680fde2b8
Merge pull request #1661 from bookwyrm-social/revert-1656
Revert "Fixes alignment of search bpx and login form"
2021-12-06 13:37:25 -08:00
Hugh Rundle
caf1d4163b
simplify translation blocks 2021-12-07 08:36:57 +11:00
Mouse Reeve
c9216fe14e Revert "Fixes alignment of search bpx and login form"
This reverts commit 2797386608.
2021-12-06 13:27:57 -08:00
Hugh Rundle
5847bc1924
handle type errors 2021-12-06 18:18:12 +11:00
Hugh Rundle
c3f24316a0
lint 2021-12-06 17:02:47 +11:00
Hugh Rundle
6d894d71ec
stop pylint contradicting itself 2021-12-06 16:59:51 +11:00
Hugh Rundle
4ade580732
pylint called my code useless how rude 2021-12-06 16:47:04 +11:00
Hugh Rundle
c817ea0ff9
improve error handling 2021-12-06 16:40:18 +11:00
Hugh Rundle
5bbd6faa8b
tidy templates 2021-12-06 16:26:16 +11:00
Hugh Rundle
027520d923
add remote follow tests 2021-12-06 16:26:02 +11:00
Hugh Rundle
685e0a172d
make code WET again
moving url discovery borked general webfinger tests for some reason IDK why.
2021-12-06 10:45:39 +11:00
Hugh Rundle
781fe69470
more descriptive remote follow errors
- distinguish between invalid username, user not found, and remote follow not supported
- make helpers DRYer
2021-12-06 09:29:51 +11:00
Mouse Reeve
02313f40b8 Adds update from inventaire link for books 2021-12-05 13:48:05 -08:00
Mouse Reeve
071da7d4fb Handle various link generation needs 2021-12-05 13:38:15 -08:00
Mouse Reeve
4085714764 Update openlibrary author with ISNI 2021-12-05 13:26:22 -08:00
Mouse Reeve
d7e4e6aa1e Adds openlibrary update for book 2021-12-05 13:02:42 -08:00
Mouse Reeve
113eda33e9 Adds update views 2021-12-05 12:47:43 -08:00
Mouse Reeve
b824841cb3 Adds update logic to connectors 2021-12-05 12:47:27 -08:00
Mouse Reeve
2d875b5575 Add link properties for remotes 2021-12-05 12:29:54 -08:00
Mouse Reeve
099b516321
Merge pull request #1659 from bookwyrm-social/edit-author-isni
Add isni to edit author form
2021-12-05 11:22:17 -08:00
Mouse Reeve
68a489dbe0 Add isni to edit author form 2021-12-05 11:02:36 -08:00
Mouse Reeve
8383bc20f5
Merge pull request #1640 from NonSparkly/patch-1
Comment out trailing block ending in production nginx config template
2021-12-05 10:33:33 -08:00
Mouse Reeve
9b0b771a40
Merge pull request #1658 from bookwyrm-social/isni-check
More thoroughly checking if title is set to avoid error
2021-12-05 10:16:10 -08:00
Mouse Reeve
89c23c3e0c More thoroughly checking if title is set to avoid error 2021-12-05 09:07:17 -08:00
Hugh Rundle
c77edab79c
minor functionality fixes 2021-12-05 18:09:51 +11:00
Mouse Reeve
660b2e48e7
Merge pull request #1649 from bookwyrm-social/detail-menus
Use html details instead of javascript menus
2021-12-04 17:03:36 -08:00
Mouse Reeve
977d09bc06
Merge pull request #1656 from bookwyrm-social/top-bar-alignment
Fixes alignment of search box and login form
2021-12-04 16:55:06 -08:00
Mouse Reeve
2797386608 Fixes alignment of search bpx and login form 2021-12-04 16:41:07 -08:00
Mouse Reeve
08255508a3
Merge pull request #1654 from bookwyrm-social/locale-updates
Locale updates
2021-12-04 15:13:35 -08:00
Mouse Reeve
2fd8f1887f
Merge pull request #1655 from bookwyrm-social/display-fixes
Display fixes
2021-12-04 15:13:22 -08:00
Mouse Reeve
4b5a0d4a03 Fix display of long words in list titles 2021-12-04 14:51:18 -08:00
Mouse Reeve
591fd1e803 Stop is-small class from propogating to modal buttons 2021-12-04 14:47:17 -08:00
Mouse Reeve
e19fe3321b Javascript cache buster 2021-12-04 14:47:06 -08:00
Mouse Reeve
525ed16016 Updates locale files with new translations 2021-12-04 14:40:38 -08:00
Mouse Reeve
f9c78c79c8 Removes inoperative translation string 2021-12-04 14:40:25 -08:00
Mouse Reeve
17b25c0a87
Merge pull request #1652 from bookwyrm-social/saved-flag
Display "saved!" indicator in status form
2021-12-04 13:57:03 -08:00
Mouse Reeve
597d537461 Display "saved!" indicator in status form 2021-12-04 13:43:01 -08:00
Mouse Reeve
ba34e11fb0 Fixes auto-closing menu 2021-12-04 12:11:29 -08:00
Mouse Reeve
7050013144 Close menus when the rest of the page is clicked
Ce-authored-by: Joachim <joachim.robert@protonmail.com>
2021-12-04 11:51:57 -08:00
Mouse Reeve
f98fe0348a Fixes merge error 2021-12-04 11:45:02 -08:00
Mouse Reeve
5e919ab07f
Merge pull request #1650 from joachimesque/fix-preview-image-wrap
Fix preview image text wrap length
2021-12-04 11:44:06 -08:00
Mouse Reeve
403382e4b4
Merge branch 'main' into detail-menus 2021-12-04 11:30:49 -08:00
Mouse Reeve
18f7863eac
Merge pull request #1651 from bookwyrm-social/feed-settings-style
Creates consistent styling for details element
2021-12-04 11:29:20 -08:00
Mouse Reeve
56609bbc2b Css linting 2021-12-04 11:18:41 -08:00
Joachim
5b690532fa Add an AttributeError exception for CI tests 2021-12-04 19:59:45 +01:00
Mouse Reeve
c813ce1144 Creates consistent styling for details element 2021-12-04 10:41:42 -08:00
Joachim
5e9e7db935 Fix preview image text wrap length
Closes #1634
2021-12-04 19:08:55 +01:00
Mouse Reeve
b6106691ef Force dropdown menus to always visible 2021-12-04 09:57:45 -08:00
Mouse Reeve
5b27952b34 Use html details instead of javascript menus 2021-12-04 09:48:55 -08:00
Mouse Reeve
2ae8cdaa88
Merge pull request #1648 from bookwyrm-social/completions
Adds bash completion script for bw-dev
2021-12-04 09:39:05 -08:00
Mouse Reeve
4e47c19901 Adds line breaks 2021-12-04 09:15:23 -08:00
Mouse Reeve
ba04c3382b Adds autocomplete file for bw-dev 2021-12-04 09:12:04 -08:00
Joachim
a1f76fa208 Update messages 2021-12-04 17:47:31 +01:00
Joachim
8a84bd3490 Apply suggestions from python lint 2021-12-04 17:33:28 +01:00
Joachim
0801c66878 Add tests 2021-12-04 17:29:22 +01:00
Mouse Reeve
14ba04d393 Add local copy of nginx conf to gitignore 2021-12-04 08:28:47 -08:00
Mouse Reeve
41fbfb627e
Merge pull request #1638 from joachimesque/font-end-accessibility-improvements
Add `aria-describedby` to field help/error messages
2021-12-04 08:23:09 -08:00
Joachim
57502c1f3c Fix js following review 2021-12-04 16:31:38 +01:00
Joachim
407d471065 Change footer link 2021-12-04 16:18:23 +01:00
Joachim
5ffe465a7a Better style for embedded cards 2021-12-04 16:18:11 +01:00
Joachim
78a0092f92 Translate home page on main layout 2021-12-04 16:17:51 +01:00
Joachim
b2a274ba41 Add JS code for copy text component 2021-12-04 16:17:33 +01:00
Joachim
306ea962c4 Add embed URL component to list layout 2021-12-04 16:17:21 +01:00
Joachim
1b9291616b Add EmbedList view template 2021-12-04 16:08:47 +01:00
Joachim
2c7c3fd1c9 Create a new layout for embedded content 2021-12-04 16:08:15 +01:00
Joachim
8ee09a2284 Add url to reach the view 2021-12-04 16:07:38 +01:00
Joachim
d22167e105 Add EmbedList view with an X-Frame-Options exemption 2021-12-04 16:07:21 +01:00
Joachim
3bd28afe93 Add unique embed_key to List model 2021-12-04 16:06:07 +01:00
Mouse Reeve
749c902070
Merge pull request #1645 from bookwyrm-social/status-previews
Use book preview card for social media on status page
2021-12-03 12:14:07 -08:00
Mouse Reeve
c0ac838ed8
Merge branch 'main' into font-end-accessibility-improvements 2021-12-03 10:08:47 -08:00
Mouse Reeve
f6dfe3530a Use book preview card for social media on status page 2021-12-03 09:58:14 -08:00
Mouse Reeve
9ee248033d
Merge pull request #1639 from hughrun/shelfnames
add translation strings
2021-12-02 12:45:41 -08:00
Mouse Reeve
cb2a890c3b
Merge pull request #1630 from joachimesque/add-feed-filters
Add feed filters
2021-12-02 12:44:26 -08:00
Mouse Reeve
da7f44791f
Merge branch 'main' into shelfnames 2021-12-02 12:25:19 -08:00
Mouse Reeve
4b55ffe99e
Merge branch 'main' into remote-follow 2021-12-02 12:16:56 -08:00
Mouse Reeve
7eb3de6247
Merge branch 'main' into tidy-header 2021-12-02 12:16:05 -08:00
Mouse Reeve
ed28d5f945
Merge branch 'main' into add-feed-filters 2021-12-02 12:14:54 -08:00
Mouse Reeve
baca5e50e7
Merge pull request #1608 from hughrun/move-shelves
refactor shelf activity on book page
2021-12-02 12:06:07 -08:00
Mouse Reeve
b4f1a7a020
Merge pull request #1642 from bookwyrm-social/locale-updates
Updates locales
2021-12-02 11:03:01 -08:00
Mouse Reeve
26f28f7642
Merge pull request #1481 from bibliotechy/1203-better-ui-for-adding-authors
Improve UI for adding authors to books
2021-12-02 10:47:40 -08:00
Mouse Reeve
0794f1a286 Updates locales 2021-12-02 10:28:13 -08:00
Hugh Rundle
2ec6e56698
blocktrans for reading goal 2021-12-02 07:28:35 +11:00
Olof Pettersson
5f10ccd9c7
Comment out trailing block ending
For people installing an instance with only the reverse proxy server, the hidden trailing `}` at the end of the second server block is quite hard to catch and it took me a good while to figure it out. Having the entire server commented out makes the whole process more understandable in my opinion.
2021-12-01 14:18:28 +01:00
Hugh Rundle
8e6619294f
oclc server sure is slow 2021-12-01 21:02:25 +11:00
Hugh Rundle
2602ae42b0
add translation strings
- add logic when default shelves used
- add trans strings in a few spots they were missing
2021-12-01 20:07:52 +11: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
9be1a8f455
keep close button simple 2021-12-01 07:45:30 +11:00
Hugh Rundle
461c35f416
fix buttons 2021-11-30 21:02:39 +11:00
Hugh Rundle
080fa72c84
ostatus template fixes
- remove unnecessary links
- remove footer
- remove unnecessary JS scripts
- make block title and block heading empty
2021-11-30 21:01:07 +11:00
Hugh Rundle
7848ff7927
fix translation strings 2021-11-30 20:46:41 +11:00
Hugh Rundle
fbb6368caf
undo footer component 2021-11-30 20:21:41 +11:00
Hugh Rundle
4ee234258a
remove OG meta in ostatus template
It's just a temporary popup so would be weird to share and just gunks things up.

Co-authored-by: Joachim <joachim.robert@protonmail.com>
2021-11-30 12:47:04 +11:00
Hugh Rundle
386371baa3
improve a11y on notifications
Also change close link to a button.

Co-authored-by: Joachim <joachim.robert@protonmail.com>
2021-11-30 12:42:52 +11:00
Joachim
4d93545d88 Lint forms 2021-11-29 23:31:05 +01:00
Joachim
43072a357f Password reset form 2021-11-29 23:30:23 +01:00
Joachim
80535a3b0c Login form 2021-11-29 23:30:14 +01:00
Joachim
3cf9660df3 Login form 2021-11-29 23:29:56 +01:00
Joachim
3eb4dfdc9b Get started user form 2021-11-29 23:29:36 +01:00
Joachim
63d31b8623 Edit book form 2021-11-29 23:29:22 +01:00
Joachim
659d13d0a6 Announcement form 2021-11-29 23:28:51 +01:00
Joachim
a6760cabc8 Email domain form 2021-11-29 23:28:29 +01:00
Joachim
5d0c6bdde2 Edit instance form 2021-11-29 23:27:25 +01:00
Joachim
0a621550b8 IP address form 2021-11-29 23:27:04 +01:00
Joachim
a154597de1 Delete user form 2021-11-29 23:26:53 +01:00
Joachim
08b4c538e6 User moderation actions 2021-11-29 23:26:43 +01:00
Joachim
c2873c601f Register form 2021-11-29 23:26:25 +01:00
Joachim
adb0d356a8 Update site.html 2021-11-29 22:39:44 +01:00
Joachim
28f0882ba6 Handle Author form errors 2021-11-29 22:39:01 +01:00
Joachim
dd0114c644 Include errors display snippet 2021-11-29 22:33:03 +01:00
Hugh Rundle
1636dfd308
fix footer indentation 2021-11-29 20:42:16 +11:00
Hugh Rundle
1d90ca6fa6
keep footer DRY
Pulls footer and scripts after it into a separate component template.
This allows ostatus/template to use the footer without having to use
layout without repeating the same code.
2021-11-29 20:35:26 +11:00
Hugh Rundle
1211fda7ff
beautiful code quality, pylint will be pleased 2021-11-29 19:53:13 +11:00
Hugh Rundle
9a3ec4362b
code cleanup 2021-11-29 19:45:52 +11:00
Hugh Rundle
f5d9a204eb
clean up ostatus templates 2021-11-29 19:37:56 +11:00
Hugh Rundle
3d73ea92e8
handle user blocks properly 2021-11-29 18:08:25 +11:00
Hugh Rundle
7b65edf10b
improve and bugfix remote follow templates 2021-11-29 15:33:26 +11:00
Hugh Rundle
587b0194fc
bugfix remote follows 2021-11-29 15:33:18 +11:00
Joachim
84b5c2da4e Documentation 2021-11-28 22:10:15 +01:00
Hugh Rundle
4a9713b812
fix template for remote follower error 2021-11-29 08:03:01 +11:00
Joachim
85c688b147 Update forms.py 2021-11-28 22:01:49 +01:00
Hugh Rundle
c7242b6022
add popup warning 2021-11-29 07:56:31 +11:00
Hugh Rundle
46f3294431
fix remote follow template 2021-11-29 07:56:09 +11:00
Joachim
403e282d88 Add aria-describedby to field help/error messages 2021-11-28 21:52:28 +01:00
Joachim
9ec4ad6b31 Apply review suggestion 2021-11-28 21:46:32 +01:00
Joachim
bf5cb898ef Apply review suggestion 2021-11-28 21:45:35 +01:00
Hugh Rundle
feaf0d5e52
handle username errors in remote follow form 2021-11-29 07:11:57 +11:00
Joachim
3816b0aa57 Better JS 2021-11-28 18:34:54 +01:00
Mouse Reeve
1fed22b27e
Merge pull request #1636 from bookwyrm-social/missing-covers
Fixes checking if image fields are already set
2021-11-28 09:34:49 -08:00
Joachim
a688c73b79 Fix stylelint rule 2021-11-28 18:28:49 +01:00
Joachim
c924f578e5 Fix linting errors 2021-11-28 18:26:01 +01:00
Mouse Reeve
3f09b4bc8a More tests 2021-11-28 09:23:13 -08:00
Mouse Reeve
3a7f070a79 Typo fix 2021-11-28 08:50:29 -08:00
Mouse Reeve
a7ee8fea24 Adds test for setting model image field 2021-11-28 08:49:54 -08:00
Mouse Reeve
7b89014e7b Updates image fields tests 2021-11-28 08:24:00 -08:00
Mouse Reeve
54cef421e2 Fixes checking if image fields are already set 2021-11-28 07:57:27 -08:00
Hugh Rundle
6abf5d6910
add submit button to remote follow form 2021-11-28 21:48:03 +11:00
Hugh Rundle
e9bb2a04a4
code cleanup 2021-11-28 21:38:28 +11:00
Hugh Rundle
f828f36cc5
show popup for remote follow 2021-11-28 21:16:57 +11:00
Hugh Rundle
6e7d23c1ae
add remote follow button 2021-11-28 20:09:29 +11:00
Hugh Rundle
2e428e6ea1
add remote follow templates 2021-11-28 20:08:54 +11:00
Hugh Rundle
e275b98183
ostatus remote follow views 2021-11-28 16:56:21 +11:00
Hugh Rundle
610114b4eb
rearrange ostatus templates 2021-11-28 16:54:25 +11:00
Hugh Rundle
d05e100421
update ostatus templates 2021-11-28 13:28:58 +11:00
Hugh Rundle
f7c8f121b9
add remote follow ostatus templates 2021-11-28 12:43:29 +11:00
Joachim
89bbf005c3 Add an accessibility helper
This will display a default outline specifically for keyboard users (and some inputs)
2021-11-27 19:19:09 +01:00
Joachim
4ed4278826 Tidy header for non-authenticated visitors
with the help of a login modal
2021-11-27 19:18:20 +01:00
Hugh Rundle
9d52e3cf27
add ostatus subscribe to webfinger links 2021-11-27 18:32:50 +11:00
Hugh Rundle
1a37903583
remove unnecessary function call arg 2021-11-26 17:39:35 +11:00
Hugh Rundle
a5efc798f8
clean up old vars 2021-11-26 17:30:27 +11:00
Hugh Rundle
951eb43aa6
bypass ajax for shelf_selector statuses 2021-11-26 17:16:26 +11:00
Hugh Rundle
5b67226571
forceReload prevents ajax submission
...instead of weird hacky workarounds forcing refreshes later.
2021-11-25 19:12:03 +11:00
Hugh Rundle
b91915d316
change shelf var for shelf_selector in book view 2021-11-25 08:20:34 +11:00
Hugh Rundle
c704c7eb8f
remove from any shelf in all books shelf view
- fixes removing book from 'all books' shelf erroring
- remove from any shelf item is on when in 'all books'
2021-11-25 07:38:08 +11:00
Joachim
7d24568dcd Update test_updates.py 2021-11-24 20:54:53 +01:00
Joachim
5f81be74cb Add test 2021-11-24 20:52:30 +01:00
Joachim
0001d6e92a PyLint 2021-11-24 19:04:14 +01:00
Joachim
8712b2fdab ESLint 2021-11-24 19:02:07 +01:00
Joachim
db5e7a886a Handle count of notifications banner 2021-11-24 19:00:30 +01:00
Joachim
2ad37a22dd Move stream filter to helpers 2021-11-24 13:37:09 +01:00
Joachim
40e4591a24 Apply review suggestions 2021-11-24 11:59:45 +01:00
Mouse Reeve
ad6c860951
Merge pull request #1627 from joachimesque/fix-preview-image-url
Don't change the preview image URL on update
2021-11-23 15:01:15 -08:00
Mouse Reeve
a24fb5cd11
Merge pull request #1581 from hughrun/isni-poc
Query ISNI database when adding authors
2021-11-23 14:30:49 -08:00
Mouse Reeve
73abd2d342
Merge pull request #1631 from bookwyrm-social/locale
Updates for Spanish, Galician, French, Lithuanian locales
2021-11-23 14:19:04 -08:00
Mouse Reeve
8752fec37f Updates for Spanish, Galician, French, Lithuanian locales 2021-11-23 12:38:02 -08:00
Joachim
7bdfacb688 Add translation keys 2021-11-22 19:25:49 +01:00
Joachim
63e284dc41 Forgive me pylint 2021-11-22 18:59:46 +01:00
Joachim
47cfc2f157 Hardcode form 2021-11-22 18:52:57 +01: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
Hugh Rundle
09c5a3861b
prefer English language sources for ISNI titles 2021-11-22 12:15:06 +11:00
Joachim
0b46db49a3 Fix pylint 2021-11-22 00:46:24 +01:00
Joachim
bc7de410b7 Add migration 2021-11-22 00:33:08 +01:00
Joachim
a0093a8a2e Add status type filters 2021-11-22 00:25:47 +01:00
Chad Nelson
6be9ac4f70 Abstract JS for multivalue form fields 2021-11-21 17:32:48 -05:00
Hugh Rundle
fd3ed7fb8c
fix author is now class object not dict 2021-11-22 09:25:31 +11:00
Hugh Rundle
8691023fa9
display link to isni in author page when other identifiers missing 2021-11-22 09:24:05 +11:00
Hugh Rundle
a218fa21ea Merge branch 'main' into isni-poc 2021-11-22 08:53:58 +11: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
e2836d468d
don't use author name as deduplication field 2021-11-22 08:47:12 +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
Joachim
ad6aaa6bc8 Update preview_images.py 2021-11-20 17:15:58 +01:00
Joachim
7d0a7ab766 Bump django-imagekit to remove deprecation warning 2021-11-20 17:12:54 +01:00
Joachim
f26a41bd10 Prevent empty file name 2021-11-20 17:10:29 +01:00
Joachim
d74df047c5 Clean up file before saving 2021-11-20 16:59:05 +01:00
Joachim
40264e372d Update preview_images.py 2021-11-20 16:26:02 +01:00
Joachim
37508d2583 Update preview_images.py 2021-11-20 16:23:50 +01:00
Hugh Rundle
e247e96832
remove incorrect comment 2021-11-20 19:34:37 +11:00
Hugh Rundle
a3270551f9
code cleanup 2021-11-20 19:19:51 +11:00
Hugh Rundle
b406a03533
don't persist form state in firefox
Fixes shelves not being disabled in dropdowns.
See https://stackoverflow.com/questions/5985839/bug-with-firefox-disabled-attribute-of-input-not-resetting-when-refreshing
2021-11-20 19:04:51 +11:00
Hugh Rundle
4b6f5c9f51
remove out of date comment 2021-11-20 19:03:57 +11:00
Hugh Rundle
b273123708
code style 2021-11-20 16:06:16 +11:00
Hugh Rundle
12810d8e34
don't try to update non-existent readthroughs 2021-11-20 16:03:46 +11:00
Hugh Rundle
af9768a2e3
force page reload when adding status from move button 2021-11-20 14:59:59 +11:00
Hugh Rundle
41862e854c
move from reading to editable shelf with logic that actually works 2021-11-20 13:57:37 +11:00
Hugh Rundle
c6a2de3bbc
pass readthrough id to shelf_selector
- allows user to move book from a shelf to the 'Read' shelf using the move button.
2021-11-20 10:29:17 +11:00
Hugh Rundle
373cc2c762
active_shelf should always be a reading status shelf 2021-11-20 09:58:34 +11:00
Hugh Rundle
a082121930
fix shelves not being unshelved if any shelf is read-status 2021-11-20 08:55:43 +11:00
Hugh Rundle
6951b52365
disallow moving to shelf already used 2021-11-20 08:18:43 +11:00
Hugh Rundle
9ffe4d340e
trigger reading status modals from move button
- unhide reading status shelves
- trigger modals when moving to a read status shelf
- force page refresh when using move button
2021-11-20 08:06:13 +11:00
Mouse Reeve
8a6f78cfff
Merge pull request #1624 from bookwyrm-social/locale-updates
Full coverage in Galician locale!
2021-11-19 09:44:22 -08:00
Mouse Reeve
7ac3d5da7c Full coverage in Galician locale! 2021-11-19 09:34:43 -08:00
Mouse Reeve
da39d91b68
Merge pull request #1622 from bookwyrm-social/email-reports
Include admin and moderator in reporting email
2021-11-18 15:19:33 -08:00
Mouse Reeve
417f09690f Include admin and moderator in reporting email 2021-11-18 15:08:00 -08:00
Mouse Reeve
f4ad1dbbdf
Merge pull request #1620 from bookwyrm-social/email-reports
Email admins when a moderation report is created
2021-11-18 15:02:39 -08:00
Mouse Reeve
21c90ac99e Use groups not permissions 2021-11-18 14:51:00 -08:00
Mouse Reeve
3787a31c67 Updates image helpers on site 2021-11-18 14:39:22 -08:00
Mouse Reeve
253225cf43
Merge pull request #1621 from bookwyrm-social/locale-update
Updates locales
2021-11-18 14:36:46 -08:00
Mouse Reeve
235167f06c Updates locales 2021-11-18 14:03:19 -08:00
Mouse Reeve
41dd915d7f Email templates 2021-11-17 20:22:00 -08:00
Mouse Reeve
8cf6eb1c13
Merge pull request #1619 from bookwyrm-social/galician-locale
Adds Galician locale
2021-11-17 10:19:10 -08:00
Mouse Reeve
9662143518 Updates english locale file 2021-11-17 10:03:48 -08:00
Mouse Reeve
9961a08c93 Adds Galician locale 2021-11-17 10:02:39 -08:00
Mouse Reeve
e6ffc48b17
Merge pull request #1618 from bookwyrm-social/locale-updates
Adds translations for french and lithuanian lcoales
2021-11-17 10:02:05 -08:00
Mouse Reeve
058184a81b Adds translations for french and lithuanian lcoales 2021-11-17 09:51:15 -08:00
Mouse Reeve
b206aae32b Tasks tests 2021-11-17 09:47:24 -08:00
Mouse Reeve
3bf1121fa6 Signals tests 2021-11-17 09:38:02 -08:00
Mouse Reeve
157d891681 Adds tests files 2021-11-17 09:10:28 -08:00
Mouse Reeve
f255b5f21d
Merge pull request #1617 from bookwyrm-social/nodeinfo
Fixes logic on nodeinfo page
2021-11-16 16:55:57 -08:00
Mouse Reeve
e3fec5885a Fixes logic on nodeinfo page 2021-11-16 16:20:29 -08:00
Mouse Reeve
4cb572f4c7 Updates management tests 2021-11-16 11:25:59 -08:00
Mouse Reeve
903aaaf4c4 Adds management and bw-dev commands 2021-11-16 10:41:08 -08:00
Mouse Reeve
d0e431cff5
Merge pull request #1580 from bookwyrm-social/inventaire-connector-tests
Adds more tests for the inventaire connector
2021-11-16 10:25:36 -08:00
Mouse Reeve
6dd7eebd98 Fixes tests 2021-11-16 10:16:28 -08:00
Mouse Reeve
50ca16a46f Merge branch 'main' into inventaire-connector-tests 2021-11-16 09:59:50 -08:00
Mouse Reeve
a463e22bbe
Merge pull request #1615 from bookwyrm-social/locales-update
A command to update locales and updated locales
2021-11-16 09:41:17 -08:00
Mouse Reeve
a26302683f List command in echo 2021-11-16 09:31:57 -08:00
Mouse Reeve
a1830ac701 Adds updates locales 2021-11-16 09:30:11 -08:00
Mouse Reeve
77f29a621f Adds command to pull locale updates 2021-11-16 09:29:58 -08:00
Mouse Reeve
1d28c7e73d Load lists from redis cache 2021-11-16 09:21:12 -08:00
Hugh Rundle
8658e36ca8
code formatting 2021-11-16 20:40:22 +11:00
Hugh Rundle
03c59f2431
improve security on isni url 2021-11-16 20:37:37 +11:00
Hugh Rundle
9ca18d9cd4
isni utils cleanup
Utilises the requests module's built in functionality to pass params as a dict
which is url encoded by requests.
2021-11-16 20:35:47 +11:00
Hugh Rundle
ec39346e67
check shelf.editable instead of custom filter 2021-11-16 19:26:49 +11:00
Mouse Reeve
2968145627
Merge pull request #1614 from bookwyrm-social/outbox-error
Safer call to get preview image or books
2021-11-15 13:47:00 -08:00
Mouse Reeve
f22ae23574 Safer call to get preview image or books 2021-11-15 13:34:02 -08:00
Mouse Reeve
fc520fdbdc Adds quick first pass on lists stream manager 2021-11-15 13:09:17 -08:00
Mouse Reeve
58f63280fd
Merge pull request #1612 from bookwyrm-social/lithuanian-space
Preserve spaces between links
2021-11-15 12:11:36 -08:00
Mouse Reeve
87e2b72056
Merge pull request #1611 from bookwyrm-social/follow-list-order
Sort followers/following lists by if you follow the user
2021-11-15 11:48:49 -08:00
Mouse Reeve
5e5cb26290 Preserve spaces between links 2021-11-15 11:47:39 -08:00
Mouse Reeve
bcfe13bb4e Sort followers/following lists by if you follow the user 2021-11-15 11:28:43 -08:00
Mouse Reeve
054a85b0dd
Merge pull request #1610 from bookwyrm-social/lithuanian
Adds Lithuanian locale
2021-11-15 10:38:36 -08:00
Mouse Reeve
7d66013b52 Adds Lithuanian to the user options 2021-11-15 10:26:00 -08:00
Mouse Reeve
9050350113 Adds lithuanian locale 2021-11-15 10:19:13 -08:00
Mouse Reeve
afbc742f47
Merge pull request #1600 from bookwyrm-social/import-field-names
Refactors import process
2021-11-15 09:59:54 -08:00
Mouse Reeve
30afe42b3a Removes extra space in progress bar 2021-11-15 09:41:05 -08:00
Mouse Reeve
83e468a4f8 Fixes "indeterminate" state of progress indicator on screen reader 2021-11-15 09:34:36 -08:00
Mouse Reeve
77ee1147d5 Adds return_first tests to book_search 2021-11-15 09:03:00 -08:00
Hugh Rundle
eab2ec0ffd
code cleanup in is_shelf_type template tag 2021-11-15 21:19:16 +11:00
Hugh Rundle
168a2488e2
refactor shelf activity on book page
- disallow moving from custom shelf to a reading status shelf with shelf_selector
- always use shelve_button for moving books from a reading status shelf
- redesign shelf information as a list of boxes
2021-11-15 20:59:22 +11:00
Mouse Reeve
8612cf654d Invalid href 2021-11-14 11:31:47 -08:00
Mouse Reeve
14e2960d06 Update legacy jobs 2021-11-14 10:58:46 -08:00
Mouse Reeve
9f6796bbf5 Safer request for normalized data 2021-11-14 10:29:12 -08:00
Mouse Reeve
31f3351854 Fixes bug comparing dates to nonetype 2021-11-14 10:22:26 -08:00
Mouse Reeve
8cede05d32 Retry hanging items 2021-11-14 10:20:14 -08:00
Mouse Reeve
f92863ad3e Notify when import completes 2021-11-14 09:56:23 -08:00
Mouse Reeve
47b98ad0d9 Track completed items on job 2021-11-14 09:04:12 -08:00
Mouse Reeve
9e673834dc Check for duplicates 2021-11-14 08:35:16 -08:00
Mouse Reeve
6cca3f9772 Updates test data 2021-11-14 07:57:13 -08:00
Mouse Reeve
2748e0a824 Check for existing reviews/ratings on import items 2021-11-14 07:50:19 -08:00
Mouse Reeve
bdc3f6828b Python formatting 2021-11-14 07:11:48 -08:00
Mouse Reeve
66ad8c3b25 Updates locale 2021-11-14 07:11:33 -08:00
Mouse Reeve
c614f638fd Merge branch 'import-field-names' of github.com:bookwyrm-social/bookwyrm into import-field-names 2021-11-14 07:06:48 -08:00
Mouse Reeve
c50e791965
Merge pull request #1604 from bookwyrm-social/save-reviews
Associate imported review with import items
2021-11-14 07:02:40 -08:00
Mouse Reeve
403c0dc3a3
Merge pull request #1605 from hughrun/author-form
Don't delete non-form data when editing authors
2021-11-14 06:50:55 -08:00
Hugh Rundle
3357953a53
whoops forgot inventaire_id 2021-11-14 21:26:23 +11:00
Hugh Rundle
8495cf8a45
don't delete non-form data when editing authors
fixes #1584

This is a temporary fix. As Mouse has suggested, ultimately it would be good to re-import data from one or more of the linked data sources if there is anything missing.
2021-11-14 21:21:37 +11:00
Mouse Reeve
32d0d8d027 Expand librarything csv processing tests 2021-11-13 13:04:54 -08:00
Mouse Reeve
7f06ee3844 Fixes getting isbn for librarything imports 2021-11-13 12:46:27 -08:00
Mouse Reeve
fb91c33682 Fixes isbn assignment for goodreads 2021-11-13 12:24:16 -08:00
Mouse Reeve
a9622942cd Test correctly adding goodreads isbns 2021-11-13 12:11:07 -08:00
Mouse Reeve
8b7720c8b8 Use "reject" instead of "delete" on review page 2021-11-13 11:54:28 -08:00
Mouse Reeve
712d8ecfb4 Don't show empty stars when there's no review 2021-11-13 11:52:08 -08:00
Mouse Reeve
1e46de4c9d Associate imported review with import item 2021-11-13 11:44:05 -08:00
Mouse Reeve
1e2dca402b Adds null value to breadcrumb links 2021-11-13 11:40:19 -08:00
Mouse Reeve
644d969330 Fixes importer tests 2021-11-13 11:22:07 -08:00
Mouse Reeve
4dae851da0 Adds breadcrumbs 2021-11-13 11:18:10 -08:00
Mouse Reeve
e77eea9c81 Adds tests for import manual review 2021-11-13 10:52:11 -08:00
Mouse Reeve
c3156a1de5 Fixes import path in test 2021-11-13 10:22:28 -08:00
Mouse Reeve
628f104b13 Separates out imports views tests 2021-11-13 10:16:25 -08:00
Mouse Reeve
232e051dcb Fixes import job creates in tests 2021-11-13 10:16:05 -08:00
Mouse Reeve
3bdda973bc Creates subdirectory for import views tests 2021-11-13 09:52:09 -08:00
Mouse Reeve
d3f23b4a0a Updates calls in tests 2021-11-13 09:50:56 -08:00
Mouse Reeve
659d0f19eb Improves import table ui
adds table container, plays with display a bit
2021-11-13 09:43:52 -08:00
Mouse Reeve
60fb1ac2e6 More flexible templates 2021-11-13 09:34:10 -08:00
Mouse Reeve
acc32d579e Preview review in import preview 2021-11-13 09:22:35 -08:00
Mouse Reeve
c245ad09bb Make sure book is in the right format 2021-11-13 09:07:50 -08:00
Mouse Reeve
08f4ad6cd4 Fixes call to import task 2021-11-13 09:02:42 -08:00
Mouse Reeve
40fff02eec Approve or delete import guesses 2021-11-12 17:10:47 -08:00
Mouse Reeve
221cde9be4 Adds manual review view 2021-11-12 16:24:45 -08:00
Mouse Reeve
9bff27e61f Separate import classes into files 2021-11-12 15:50:33 -08:00
Mouse Reeve
be26e8363a Create import directory 2021-11-12 15:43:15 -08:00
Mouse Reeve
5558ed810e Show manual review flag 2021-11-12 15:40:07 -08:00
Mouse Reeve
6a5a598345 Raise errors when import items fail
This should make is way easier to debug
2021-11-12 15:17:01 -08:00
Mouse Reeve
b784dcdb46 Removes uninformative test 2021-11-12 15:07:26 -08:00
Mouse Reeve
1d0f6d5243 Python formatting 2021-11-12 15:06:23 -08:00
Mouse Reeve
6161f60695 Use normalized data in table 2021-11-12 14:54:20 -08:00
Mouse Reeve
61eaf51310 Fixes html validity 2021-11-12 14:49:24 -08:00
Mouse Reeve
e09c02017c Fixes title/author search handling 2021-11-12 14:46:39 -08:00
Mouse Reeve
60c777ed49 Updates tests 2021-11-12 14:41:25 -08:00
Mouse Reeve
d8197cdcfa Indicate retry on status page 2021-11-12 14:38:41 -08:00
Mouse Reeve
a65f07e0bf Adds retry page 2021-11-12 14:36:28 -08:00
Mouse Reeve
2a84c0a370 title author search already working correctly with return first 2021-11-12 13:59:54 -08:00
Mouse Reeve
80c1954aa3 Fixes first_search_result behavior 2021-11-12 13:48:31 -08:00
Mouse Reeve
1e8269b6c9 Refactors import status view 2021-11-12 13:10:52 -08:00
Mouse Reeve
e211ece346
Merge pull request #1602 from bookwyrm-social/locale-updates
Updates existing locales
2021-11-12 11:25:26 -08:00
Mouse Reeve
843e9a7b32 Updates existing locales 2021-11-12 11:03:47 -08:00
Mouse Reeve
309d289a65 A few more mocks 2021-11-12 10:49:49 -08:00
Mouse Reeve
cad5a128ac Fixes call to add_status signal 2021-11-12 10:19:13 -08:00
Mouse Reeve
e6a251fdad Updates mocks across tests 2021-11-12 10:07:38 -08:00
Mouse Reeve
f71ef286b6 Updates mocks 2021-11-12 08:55:47 -08:00
Mouse Reeve
3190ef4346 Deprioritize adding old statuses to timelines 2021-11-11 19:19:23 -08:00
Mouse Reeve
9fee860b00 Adds enum for queue names 2021-11-11 19:10:22 -08:00
Mouse Reeve
6aa57d4d34 Set queue for broadcast task 2021-11-11 19:00:01 -08:00
Mouse Reeve
c33d791974 adds tests for new task system 2021-11-11 15:17:32 -08:00
Mouse Reeve
908c9dc689 Use many small tasks instead of one big task 2021-11-11 14:42:29 -08:00
Mouse Reeve
f0ce236ffc Removes unused code 2021-11-11 14:28:49 -08:00
Mouse Reeve
be94818a10 Fixes views tests 2021-11-11 14:27:29 -08:00
Mouse Reeve
915c41f59f Merge branch 'main' into import-field-names 2021-11-11 14:08:16 -08:00
Mouse Reeve
50ab4e8248 Updates model tests 2021-11-11 14:08:00 -08:00
Mouse Reeve
c37472b484
Merge pull request #1599 from bookwyrm-social/remove-serialize-image-helper
Remove serialize image helper
2021-11-11 13:53:17 -08:00
Mouse Reeve
5130053249
Merge pull request #1601 from bookwyrm-social/import-view
Cleans up html in import view
2021-11-11 13:53:07 -08:00
Mouse Reeve
ffcaef0559 Python formatting 2021-11-11 13:39:58 -08:00
Mouse Reeve
8c4e8361f2 Fixes tests 2021-11-11 13:35:56 -08:00
Mouse Reeve
c744faf393 Fixes dictionary list html validity 2021-11-11 13:00:34 -08:00
Mouse Reeve
d807774c2d Fixes label for privacy field 2021-11-11 12:53:48 -08:00
Mouse Reeve
efcf7824dd iUpdates storygraph tests 2021-11-11 12:39:12 -08:00
Mouse Reeve
5967834805 Adds migration 2021-11-11 12:29:51 -08:00
Mouse Reeve
f3bcced0a0 Adds shelf mappings 2021-11-11 12:29:38 -08:00
Mouse Reeve
147dd95e8d Removes unused import 2021-11-11 11:59:15 -08:00
Mouse Reeve
a95e031140 Validate html in unit tests 2021-11-11 11:33:12 -08:00
Mouse Reeve
4d574a3536 Process dates in librarything import 2021-11-11 09:54:36 -08:00
Mouse Reeve
20baf9385d Updates goodreads tests 2021-11-11 09:22:44 -08:00
Mouse Reeve
4ccd9fc633 Use generalized mappings to handle import 2021-11-10 16:49:54 -08:00
Mouse Reeve
81450ac2d5
Merge pull request #1597 from bookwyrm-social/import-fixes
Don't broadcast imported reviews outside bookwyrm
2021-11-10 12:32:51 -08:00
Mouse Reeve
0736c7e160 Uses general names for fields in parsed csvs 2021-11-10 11:10:09 -08:00
Mouse Reeve
717da918cf Use social media preview images 2021-11-10 10:59:21 -08:00
Mouse Reeve
d61595abb9 Clearer syntax 2021-11-10 10:50:05 -08:00
Mouse Reeve
cf477a03ae Corrects broadcast flow for objects 2021-11-10 10:39:51 -08:00
Mouse Reeve
7e784fa705 Removes used import 2021-11-10 10:35:37 -08:00
Mouse Reeve
9815e9e100 Python formatting 2021-11-10 10:30:18 -08:00
Mouse Reeve
4f5d23e785 Replace image_serialzier helper with built-in serializers 2021-11-10 10:28:43 -08:00
Mouse Reeve
d204e8dbb8
Merge pull request #1247 from joachimesque/image-absolute-url-getter
Add get_absolute_url to ImageField
2021-11-10 10:27:29 -08:00
Mouse Reeve
957d2b2872
Merge pull request #1598 from hughrun/discover
Fix reading actions and book links in Discover
2021-11-10 10:02:23 -08:00
Mouse Reeve
97a71f5e39 Cleans up software check syntax 2021-11-10 09:55:56 -08:00
Mouse Reeve
1b9d08414f Adds storygraph tests 2021-11-10 09:55:52 -08:00
Mouse Reeve
aeef472ee1 Fixes flow in checking software for broadcast 2021-11-10 09:33:00 -08:00
Mouse Reeve
20c6a3ea1c Creates generic importer test file
And removes some tests that duplicate the generic tests
2021-11-10 09:32:53 -08:00
Hugh Rundle
eb62474b97
fix broken book links in Discover 2021-11-10 22:04:19 +11:00
Hugh Rundle
3f6b0608b2
Show user and book names for reading actions in Discover
fixes #1596

This uses the same technique as #1572 to ensure read statuses from GeneratedNotes are translated.
2021-11-10 21:37:16 +11:00
Mouse Reeve
e19c4620ce Don't broadcast imported reviews outside bookwyrm 2021-11-08 12:00:08 -08:00
Mouse Reeve
3af1ca693b
Merge pull request #1592 from nycterent/misc/small-default-template-fixes
Misc/small default template fixes
2021-11-08 11:33:26 -08:00
Mouse Reeve
c6db7ffcbe
Merge pull request #1593 from bookwyrm-social/bw-dev-updates
bw-dev updates
2021-11-08 11:33:02 -08:00
Mouse Reeve
3f5fe83950 Renames run web with service ports command 2021-11-07 06:21:13 -08:00
Mouse Reeve
c2f44a9f1e Removed outdated add_locales command from doc 2021-11-07 06:19:38 -08:00
Mouse Reeve
b2dea343af Removes outdated test command 2021-11-07 06:17:04 -08:00
Mouse Reeve
23549c7fdb Removes unused rundb command 2021-11-07 06:13:44 -08:00
nycterent
67d830e327 fixed typo for the domain placeholder for easier substitution 2021-11-07 16:07:21 +02:00
nycterent
1dec882dba removed quotes from the host - fixes connecting to smtp server 2021-11-07 16:06:20 +02:00
Mouse Reeve
582d2e6d0d
Merge pull request #1589 from hughrun/shelf-names
match page title to active shelf
2021-11-07 05:41:40 -08:00
Hugh Rundle
dfe92a27c0
use shelf name if not default shelf
(instead of shelf.identifier)
2021-11-06 11:10:58 +11:00
Hugh Rundle
d8098357e6
match page title to active shelf
resolves #1586
2021-11-06 10:53:41 +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
b593b9c9d3 Display link to isni record on author page 2021-11-01 11:45:47 +11:00
Hugh Rundle
630f508ee4 code cleanup 2021-11-01 11:39:37 +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
30a959dfce make pylint happy 2021-11-01 10:20:19 +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
45158a1c03 improve isni search logic
- skip ISNIs that aren't persons
- don't look for text values in non-existent nameTitle elements
2021-10-30 09:24:42 +11:00
Hugh Rundle
87ed6f8380 code formatting 2021-10-29 21:14:32 +11:00
Hugh Rundle
d87e1b1567 fix encoding
The OCLC server claims that the xml payload is encoded as latin1 (ISO-8859-1).
This causes Requests to incorrectly encode things as latin1, when actually everything is (thank goodness) UTF-8.
We can fix it by just telling Requests that it is really UTF-8

With thanks to Tex Texin, creator of http://i18nqa.com/debug/utf8-debug.html
2021-10-29 21:00:35 +11:00
Hugh Rundle
f2e4865adf check isni sources when editing book authors 2021-10-29 16:13:05 +11:00
Hugh Rundle
625cfac76f isni author lookup utility 2021-10-29 16:12:31 +11:00
Mouse Reeve
d3e4c7e8d9 Removes change to boolean logic 2021-10-27 10:40:37 -07:00
Mouse Reeve
07446fa7d2 Adds more tests for the inventaire connector 2021-10-27 10:03:09 -07:00
Joachim
56fd147c88 Update test_status_model.py 2021-10-27 19:00:09 +02:00
Joachim
b956b79bd0 Add full URL generation to image_serializer 2021-10-27 18:56:37 +02:00
Joachim
35bd4a4071 Apply review suggestion 2021-10-27 18:13:47 +02:00
Mouse Reeve
8ba875af4a Improve federation compability with Hubzilla and Zap
Co-authored-by: hubzilla <redmatrix@users.noreply.github.com>
Fixes #1564
2021-10-26 14:41:06 -07:00
Mouse Reeve
6ba605cbd0
Merge pull request #1577 from hughrun/sort-recent
sort shelves by latest shelved date
2021-10-26 14:31:57 -07:00
Mouse Reeve
0e023fd9c9
Merge pull request #1572 from hughrun/trans-updates
translate all read statuses
2021-10-26 14:28:49 -07:00
Hugh Rundle
f4573996e6 black wants double quotes 2021-10-26 21:01:45 +11:00
Hugh Rundle
097da148be sort shelves by latest shelved date
Display the latest 2 books to be shelved in each shelf, when in the homepage feed view.
fixes #1576
2021-10-26 20:17:53 +11:00
Mouse Reeve
98cf322eb1
Merge pull request #1573 from bookwyrm-social/author-page-fix
Fixes duplicate books in author page when there are multiple authors
2021-10-25 11:32:32 -07:00
Mouse Reeve
24bf3f408c Fixes duplicate books in author page when there are mulitple authors 2021-10-25 11:06:54 -07:00
Hugh Rundle
c5d530c0c4 translate all read statuses
This fixes #1566 - "Already translated strings sometimes show up untranslated in UI"

- add generatednote status header template
- include the relevant template (to-read/reading/read) based on the status.content
- remove GeneratedNote block from note status header template

This is probably not the most correct way of resolving the problem, but it's simple and it works.
2021-10-25 15:30:48 +11:00
Mouse Reeve
f2b11c6ad1
Merge pull request #1565 from bookwyrm-social/translation-whitespace
Translation whitespace
2021-10-24 10:55:11 -07:00
Mouse Reeve
7502158e58 Builds latest changes 2021-10-24 07:10:20 -07:00
Mouse Reeve
9a07c11b19 Fixes group quotes and button whitespace 2021-10-24 06:43:31 -07:00
Mouse Reeve
0f9c363b00 Updates locale file for quotes fix 2021-10-23 08:13:07 -07:00
Mouse Reeve
d80a28e128 Consistent quotes around group names in notifications 2021-10-23 08:00:45 -07:00
Mouse Reeve
353ccc1d7d Updates references locale 2021-10-23 07:11:38 -07:00
Mouse Reeve
1e6390a405 Fixes whitespace in translation strings 2021-10-23 06:59:06 -07:00
Mouse Reeve
b4a4f91002
Merge pull request #1563 from bookwyrm-social/locale-updates
Updates locales
2021-10-22 11:23:40 -07:00
Mouse Reeve
37ff68adb1 Updates with new translation strings 2021-10-22 10:48:22 -07:00
Mouse Reeve
230c6f6798 Updates locales 2021-10-22 10:46:56 -07:00
Mouse Reeve
ac749d94b2
Merge pull request #1562 from bookwyrm-social/suggested-users-tests
Adds a few more tests to the suggested users module
2021-10-22 10:39:11 -07:00
Mouse Reeve
c59abdc89a
Merge pull request #1561 from hughrun/group-privacy
Fix Group privacy
2021-10-22 10:38:43 -07:00
Mouse Reeve
f39ff96a64 Adds a few more tests to the suggested users module 2021-10-22 10:25:33 -07:00
Hugh Rundle
bdb6e4c911 fix template indenting
whoops
2021-10-22 21:15:48 +11:00
Hugh Rundle
1d791d950f add migration for updated notification types 2021-10-22 20:30:25 +11:00
Hugh Rundle
bcbff4f002 Merge branch 'main' into group-privacy 2021-10-22 20:28:31 +11:00
Hugh Rundle
6bc86f189f notify group members of group changes
Send a notification to all group members when group name, description, or privacy are changed.
2021-10-22 20:23:45 +11:00
Hugh Rundle
c9deda8fdd remove superfluous field 2021-10-22 20:21:55 +11:00
Hugh Rundle
80edc1e95e remove trailing spaces 2021-10-22 20:16:48 +11:00
Hugh Rundle
bd20c9ce2c remove followers group visibility test
Also updates description of group.followers_filter() override
2021-10-22 18:42:18 +11:00
Hugh Rundle
19c7e43f50 remove followers privacy option from group form 2021-10-22 18:40:55 +11:00
Mouse Reeve
c366f57a8d
Merge pull request #1557 from bookwyrm-social/author-page
Author page pagination
2021-10-21 08:02:50 -07:00
Mouse Reeve
278a9de673 Removes duplicate assertions in author view test 2021-10-20 18:29:00 -07:00
Mouse Reeve
72dc21e82a Adds tests and fixes unset ordering warnings 2021-10-20 18:27:19 -07:00
Mouse Reeve
d706b26ac9 Python formatting 2021-10-20 18:11:31 -07:00
Mouse Reeve
14682ed8c6 Prefect related data in author view 2021-10-20 18:04:29 -07:00
Mouse Reeve
de93beca84 Adds shelve buttons to books on author page 2021-10-20 17:51:42 -07:00
Mouse Reeve
3eb3225d2c Adds pagination to the template 2021-10-20 17:42:19 -07:00
Mouse Reeve
89a385da0a Paginate books on author page 2021-10-20 17:40:23 -07:00
Mouse Reeve
9d4e0851a0
Merge branch 'main' into image-absolute-url-getter 2021-10-20 15:12:06 -07:00
Mouse Reeve
74b697d844
Merge pull request #1555 from bookwyrm-social/shelf-views
Shelf views
2021-10-20 14:56:46 -07:00
Mouse Reeve
f65a54eb4a Python formatting 2021-10-20 14:34:42 -07:00
Mouse Reeve
5c2d6e6510 Separate out test files and add more tests 2021-10-20 14:30:11 -07:00
Mouse Reeve
3d92afdf28 Moves shelf tests into subdirectory 2021-10-20 14:16:13 -07:00
Mouse Reeve
1bb23a8edf Adds more tests of shelf views 2021-10-20 14:15:05 -07:00
Mouse Reeve
b64a616ff9 Fixes mock in test 2021-10-20 13:56:55 -07:00
Mouse Reeve
87deac17f9 Make import link a link not a button 2021-10-20 13:31:18 -07:00
Mouse Reeve
d86ffc47a7 Fixes incorrect method comment 2021-10-20 13:16:38 -07:00
Mouse Reeve
6a2f962f8d Split shelf view into multiple files 2021-10-20 13:15:43 -07:00
Mouse Reeve
baba2e2057 Move shelf views into directory 2021-10-20 13:09:28 -07:00
Mouse Reeve
f8bdf3a533
Merge pull request #1552 from bookwyrm-social/german-locale-updates
Updates German locale
2021-10-20 10:40:57 -07:00
Mouse Reeve
9080cf1a6d Updates German locale 2021-10-20 10:22:15 -07:00
Mouse Reeve
a27a55b40a
Merge pull request #1490 from hughrun/bookwyrm-groups
Bookwyrm groups
2021-10-17 07:54:59 -07:00
Hugh Rundle
ca47f836d1 adjust Group test mocks 2021-10-17 07:21:47 +11:00
Mouse Reeve
2b18e4d235
Merge pull request #1545 from bookwyrm-social/locale_updates
Updates for Portuguese and Simplified Chinese locales
2021-10-16 12:39:04 -07:00
Hugh Rundle
9116af1b3f add makemigrations merge file 2021-10-17 06:33:11 +11:00
Mouse Reeve
5c29d64666 Updates for Portuguese and Simplified Chinese locales 2021-10-16 12:24:39 -07:00
Hugh Rundle
6e5c0cc4c3 Merge branch 'main' into bookwyrm-groups
There are database migrations in main ahead of this branch so they need to be merged in to the branch before we can merge back into main.
2021-10-17 06:22:04 +11:00
Mouse Reeve
b215316080
Merge pull request #1544 from bookwyrm-social/landing-views
Landing views
2021-10-16 12:17:26 -07:00
Mouse Reeve
8bdedc9304 Catches some stray unvalidated html in landing tests 2021-10-16 12:07:16 -07:00
Mouse Reeve
c852405e42 Moves invite tests 2021-10-16 12:01:24 -07:00
Mouse Reeve
5b22cf8c46 Updates mocks for new view locations 2021-10-16 12:00:06 -07:00
Mouse Reeve
d735d03b59 Moves tests into subdirectory 2021-10-16 12:00:03 -07:00
Mouse Reeve
290039ac66 Moves landing views into directory 2021-10-16 11:45:55 -07:00
Mouse Reeve
86824ff1cb Fixes path to invite page in admin view 2021-10-16 11:32:51 -07:00
Mouse Reeve
63163ca0ff Python formatting 2021-10-16 11:23:45 -07:00
Mouse Reeve
4a695ce612 Update environs to fix zillions of warnings 2021-10-16 11:17:34 -07:00
Mouse Reeve
851a8f6958 More registration tests 2021-10-16 11:15:57 -07:00
Mouse Reeve
ad26e65109 Fixes clashing identifier and attr with no quotes 2021-10-16 11:15:38 -07:00
Mouse Reeve
3118cdfbb6 Adds another register test 2021-10-16 10:56:22 -07:00
Mouse Reeve
7ec573bf50 Fixes duplicate form ids in login form 2021-10-16 10:55:51 -07:00
Mouse Reeve
5e9cc5eec5 Validate remaining templates 2021-10-16 10:46:05 -07:00
Mouse Reeve
ea268449fa Python formatting 2021-10-16 10:38:45 -07:00
Mouse Reeve
68cbea60a9 Updates registration tests with html validation 2021-10-16 10:34:41 -07:00
Mouse Reeve
dce0c85602 Fixes clashing input ids on reset password form 2021-10-16 10:28:38 -07:00
Mouse Reeve
bec56180f0 Fixes label on layout login form 2021-10-16 10:20:06 -07:00
Mouse Reeve
974c05dedb Adds more password view tests 2021-10-16 10:14:53 -07:00
Mouse Reeve
b56147d70c Use validate html in landing views tests 2021-10-16 10:09:25 -07:00
Mouse Reeve
8cb91acb93 Move logged out templates into a directory 2021-10-16 10:00:31 -07:00
Mouse Reeve
5558216917
Merge pull request #1542 from bookwyrm-social/cancel-button
A cancel button that leads nowhere
2021-10-16 07:21:39 -07:00
Mouse Reeve
17eebfb916
Merge pull request #1537 from bookwyrm-social/locale-improvements
Locale improvements
2021-10-16 07:13:56 -07:00
Mouse Reeve
94bce7fd83 Use javascript back button on create book page 2021-10-16 07:11:12 -07:00
Mouse Reeve
584e0a54af Adds test to catch invalid link 2021-10-16 07:06:49 -07:00
Hugh Rundle
8192d6ad10 code indenting fix 2021-10-16 18:00:55 +11:00
Hugh Rundle
0cd8ece474 code formatting 2021-10-16 17:45:39 +11:00
Hugh Rundle
a476b52f86 database migrations for groups 2021-10-16 17:45:21 +11:00
Hugh Rundle
2a31bf2f0c delete groups
Whoops, forgot to add this functionality earlier.

- allow owner to delete a group
- change all group lists to closed curation with group=False when group deleted
2021-10-16 17:35:36 +11:00
Hugh Rundle
85784f07d2 groups templates improvements
- require confirmation before removing a member
- require confirmation before removing self
- make button text less verbose
- use more standardised formatting for group editing form
- improve button colours
- add missing trans tags
- reload group page when removing member
2021-10-16 16:43:09 +11:00
Hugh Rundle
1736419538 (hopefully) fix group tests 2021-10-16 16:42:08 +11:00
Hugh Rundle
91534aff82 group view fixes
- fix form details not appearing in group member search view
- fix query term appearing in main search box when searching for new members
- direct request user back to the group rather than the user when adding a user to a group
2021-10-16 16:39:50 +11:00
Hugh Rundle
afd00cc67a improve group removal flow
Use .save() twice, but with broadcast=False on the second update. This is more efficient than doing a query and update() and avoids the duplicate AP broadcast.
2021-10-16 16:38:02 +11:00
Hugh Rundle
6f13c0d808 formatting fix 2021-10-16 16:09:03 +11:00
Mouse Reeve
3b817adf97 Updates locales with edit page change 2021-10-15 15:04:19 -07:00
Mouse Reeve
fe00032da5 Merge branch 'main' into locale-improvements 2021-10-15 15:02:44 -07:00
Mouse Reeve
53e49baa20
Merge pull request #1538 from bookwyrm-social/author-page
Author page validation
2021-10-15 15:02:22 -07:00
Mouse Reeve
2945a88a1d
Merge pull request #1539 from bookwyrm-social/edit-tweaks
Edit tweaks
2021-10-15 14:56:16 -07:00
Mouse Reeve
0e30d1f856 Show status header on edit page 2021-10-15 14:45:26 -07:00
Mouse Reeve
896885bffd Don't show progress field on status update comments
Also retitle the view
2021-10-15 14:43:02 -07:00
Mouse Reeve
a9daa4670e Retain reading status on comments 2021-10-15 14:41:14 -07:00
Mouse Reeve
1e7b56cdb0 Don't show last edited by link if it's not set 2021-10-15 14:26:16 -07:00
Mouse Reeve
931f78d7c2 Validate author page html 2021-10-15 14:26:07 -07:00
Hugh Rundle
e261bfdb6a fix local filter for suggested users 2021-10-16 08:20:12 +11:00
Hugh Rundle
864d8cea2b clean up templates 2021-10-16 08:18:55 +11:00
Hugh Rundle
97ea61dd7e efficiency improvement to remove_from_group 2021-10-16 08:17:42 +11:00
Mouse Reeve
9e7b73a884 Compiles locales 2021-10-15 14:13:59 -07:00
Mouse Reeve
4178d1f7f6 Adds context to translation strings on discover page 2021-10-15 14:10:34 -07:00
Mouse Reeve
3621224074 Properly localize book format 2021-10-15 13:59:07 -07:00
Mouse Reeve
dede101d17 Capitalize html and markdown 2021-10-15 13:58:59 -07:00
Mouse Reeve
032dedabb4 Goodreads capitalization standardization 2021-10-15 13:50:05 -07:00
Mouse Reeve
7f75cd329a Use instance name instead of the word "instance" where possible
trying to use less jargon
2021-10-15 13:42:32 -07:00
Mouse Reeve
eac1ed3484
Merge pull request #1534 from bookwyrm-social/followers-display
Fixes privacy filters for followers-only replies
2021-10-15 13:38:42 -07:00
Mouse Reeve
145a31045a Use "like" consistently (instead of mixing in "favorite") 2021-10-15 13:36:48 -07:00
Mouse Reeve
c6caa5a3f4 Fixes privacy display 2021-10-15 13:26:02 -07:00
Mouse Reeve
66a2b4c7c7 Tests for status raise_visible_to_user function 2021-10-15 13:25:47 -07:00
Hugh Rundle
2f38af4faa Revert "clean up List db queries"
This reverts commit 41f27a4a66.

I forgot that update() can only be done on a query result, not on an object, so we will need to go back to querying in order to update rather than saving.
2021-10-16 06:59:07 +11:00
Mouse Reeve
1072381b7d Fixes followers filter for non-status objs 2021-10-15 11:09:46 -07:00
Mouse Reeve
72a8f34a8f
Merge pull request #1536 from bookwyrm-social/markdown
Edit posts in original markdown syntax
2021-10-15 10:48:21 -07:00
Mouse Reeve
bd0e4abd56 Uses correct model field for raw values 2021-10-15 10:36:46 -07:00
Mouse Reeve
61a0b50b91 Test raw version is saved 2021-10-15 10:10:38 -07:00
Mouse Reeve
e8f5678867 More test names 2021-10-15 10:10:25 -07:00
Mouse Reeve
60b910172d Update migration 2021-10-15 10:09:34 -07:00
Mouse Reeve
b9e6824360 Imrpove test names 2021-10-15 10:07:29 -07:00
Mouse Reeve
117e6a08b2 Merge branch 'main' into markdown 2021-10-15 10:06:34 -07:00
Mouse Reeve
1e41458a44
Merge pull request #1535 from bookwyrm-social/edit-posts
Edit posts
2021-10-15 10:04:17 -07:00
Mouse Reeve
9ac5384d68 Fixes test and css linter 2021-10-15 09:54:14 -07:00
Mouse Reeve
b84152d84b tick version number 2021-10-15 09:42:21 -07:00
Mouse Reeve
2f40394c0a Updates edited display 2021-10-15 09:41:29 -07:00
Mouse Reeve
1b1e557800 Updates app to use date instead of boolean 2021-10-15 09:08:10 -07:00
Mouse Reeve
b11b810ec9 Use edit date to track is status has been updated 2021-10-15 08:56:07 -07:00
Mouse Reeve
20cca69f06 Test update status via inbox 2021-10-15 08:52:32 -07:00
Mouse Reeve
4002df04fc Send update activity on edit 2021-10-15 08:15:48 -07:00
Hugh Rundle
1634c8774e remove useless field in Notifications model 2021-10-15 17:59:39 +11:00
Hugh Rundle
41f27a4a66 clean up List db queries
- don't unnecessarily query DB in List views
- use more efficient query in remove_from_group List class method
2021-10-15 17:56:23 +11:00
Mouse Reeve
50db0bd012 Hide reply panel in no interact mode 2021-10-14 20:29:45 -07:00
Mouse Reeve
0dba071126 Fixes editing replies 2021-10-14 19:14:47 -07:00
Mouse Reeve
e43cade6cc Test edit view 2021-10-14 19:13:02 -07:00
Mouse Reeve
af567ba05e Edit posts in original markdown syntax 2021-10-14 18:34:26 -07:00
Mouse Reeve
01911d3b23 Update and indicate edit status 2021-10-14 17:33:45 -07:00
Mouse Reeve
175df2181c Adds edited field to status model 2021-10-14 17:33:04 -07:00
Mouse Reeve
2d1052766d Fixes undefined variable error 2021-10-14 17:32:38 -07:00
Mouse Reeve
f5e52d6a11 Save updated statuses 2021-10-14 17:23:54 -07:00
Mouse Reeve
066f14ca84 Save edited statuses 2021-10-14 17:13:54 -07:00
Mouse Reeve
8a08d789cb Removes delete and redraft tests 2021-10-14 17:13:15 -07:00
Mouse Reeve
92535a5481 Python formatting 2021-10-14 16:57:58 -07:00
Mouse Reeve
df27614937 Don't use localstorage cache for edits 2021-10-14 16:53:46 -07:00
Mouse Reeve
e149a14e73 Use href instead of POST form to edit status 2021-10-14 16:53:42 -07:00
Mouse Reeve
7488f8da96 Creates edit status endpoint 2021-10-14 16:30:27 -07:00
Mouse Reeve
cc650e235b Fixes privacy filters for followers-only replies 2021-10-14 16:26:28 -07:00
Mouse Reeve
599818dc43
Merge pull request #1533 from bookwyrm-social/fixes-display-identifiers
Fixes book identifiers not displaying
2021-10-14 16:25:50 -07:00
Mouse Reeve
b9251b4dc7 Fixes book identifiers not displaying 2021-10-14 16:11:33 -07:00
Mouse Reeve
1f6f543847 Use url templatetag to load posting urls 2021-10-14 15:56:34 -07:00
Mouse Reeve
d5b247b905 Merge branch 'main' into edit-posts 2021-10-14 15:49:08 -07:00
Mouse Reeve
c1287f800e
Merge pull request #1529 from scientia-ac-labore/add_sort_books
Add sorting to shelf. Use table-sort-header
2021-10-14 15:46:08 -07:00
Faiazov Dmitrii
1abbc67483 Make requested changes.
Signed-off-by: Faiazov Dmitrii <jjsolutions0110@gmail.com>
2021-10-14 13:39:15 +03:00
Mouse Reeve
803ad3c911 Removes delete and redraft view 2021-10-13 13:12:56 -07:00
Mouse Reeve
5b25811034
Merge pull request #1531 from bookwyrm-social/german-updates
Adds additional German translations
2021-10-13 12:46:44 -07:00
Mouse Reeve
48d3ef1f3c
Merge pull request #1530 from bookwyrm-social/portuguese-update
Updates to Portuguese locale
2021-10-13 12:34:38 -07:00
Mouse Reeve
94fcd3c8a1 Adds additional German translations 2021-10-13 12:31:54 -07:00
Mouse Reeve
de09d73016 Updates to Portuguese locale 2021-10-13 12:22:27 -07:00
Faiazov Dmitrii
ce16f36fe8 Add sorting to shelf. Use table-sort-header
existing template.

Signed-off-by: Faiazov Dmitrii <jjsolutions0110@gmail.com>
2021-10-13 21:25:40 +03:00
Mouse Reeve
e340e7360d
Merge pull request #1526 from bookwyrm-social/spanish-locale
Updates Spanish locale
2021-10-11 12:34:43 -07:00
Mouse Reeve
2882f96c08 Adds compiled spanish file 2021-10-11 12:19:38 -07:00
Mouse Reeve
4384098292 Updates Spanish locale 2021-10-11 12:17:39 -07:00
Mouse Reeve
2ad547a90b
Merge pull request #1525 from bookwyrm-social/unused-locales
Remove locales without translations
2021-10-11 10:34:53 -07:00
Mouse Reeve
e958bd7680 Remove locales without translations 2021-10-11 10:21:42 -07:00
Mouse Reeve
551a8c459f
Merge pull request #1524 from bookwyrm-social/portuguese
Portuguese locale
2021-10-11 10:19:28 -07:00
Mouse Reeve
81e0115551 Up to date locale 2021-10-11 10:10:37 -07:00
Mouse Reeve
58ba1ddf87 Typo fix 2021-10-11 10:07:02 -07:00
Mouse Reeve
48b84afbde Python formatting 2021-10-11 09:37:25 -07:00
Mouse Reeve
18cec21a37 Compiles locales 2021-10-11 09:25:11 -07:00
Mouse Reeve
69110497ae Adds Brazilian Portuguese locale 2021-10-11 09:23:28 -07:00
Hugh Rundle
5d7f77021b dammit eslint 2021-10-10 14:02:55 +11:00
Hugh Rundle
3d74b10c5f eslinting 2021-10-10 13:55:18 +11:00
Hugh Rundle
726217577f linting 2021-10-10 13:18:16 +11:00
Hugh Rundle
14d3158871 add database migrations for Groups 2021-10-10 12:33:51 +11:00
Hugh Rundle
2a78c1221c style cleanup
Even tests must be formatted to please Black...
2021-10-10 12:33:11 +11:00
Hugh Rundle
8ae20928bb add tests for groups 2021-10-10 12:06:54 +11:00
Hugh Rundle
18735bdd42 use update() to remove orphaned groups on list edit
Using add() broadcasts the database change, which is unnecessary potentially broadcast AP messages twice.
2021-10-10 12:04:03 +11:00
Hugh Rundle
d6a5794ac3 do not load list edit form if viewer not authenticated 2021-10-10 12:02:27 +11:00
Hugh Rundle
83f46b6cda remove print() statement
Whoops accidentally left this behind from manual troubleshooting
2021-10-10 12:01:21 +11:00
Hugh Rundle
252ff0d689 emblacken files
Wouldn't it be great if I just remembered to run Black before every commit?
2021-10-09 22:15:24 +11:00
Hugh Rundle
b3cc9e5b75 remove user and their lists from group when group.user blocks them
Lists are changed to closed curation with no group.
2021-10-09 22:13:12 +11:00
Hugh Rundle
9940abfd81 refactor removing user from group
This is in preparation for removing a user and their lists when the group owner blocks them.
Remove the user via models.group
Remove the lists via models.list
2021-10-09 22:11:46 +11:00
Hugh Rundle
1bf5758e01 overide filters for groups and group lists
- use more sensible query for displaying groups on user page
- privacy_filter now allows group members to see followers_only and private lists and groups they would otherwise not see
2021-10-09 16:11:11 +11:00
Hugh Rundle
714a369246 only show list edit form to list.user 2021-10-09 16:10:00 +11:00
Mouse Reeve
d7f8a7b99e
Merge pull request #1518 from bookwyrm-social/french-locale
Updates for French locale
2021-10-08 11:32:43 -07:00
Mouse Reeve
1702cbf76d Compiled locale 2021-10-08 11:21:09 -07:00
Mouse Reeve
aeafb54d8d Updates for French locale 2021-10-08 10:40:02 -07:00
Hugh Rundle
056150d583 CASCADE group.user
Delete groups when group.user is deleted.
2021-10-08 21:21:19 +11:00
Hugh Rundle
39e002ee13 Merge remote-tracking branch 'origin/bookwyrm-groups' into bookwyrm-groups
Merge changes from main project into local branch
2021-10-08 18:53:59 +11:00
Hugh Rundle
5a4026cda3 group views tests 2021-10-08 18:47:03 +11:00
Hugh Rundle
05bde27944 remove commented out code 2021-10-08 18:46:30 +11:00
Hugh Rundle
48fc85c761 adjust commenting on js file 2021-10-08 18:45:28 +11:00
Mouse Reeve
cef46a1827 Adds migration 2021-10-07 17:30:42 -07:00
Mouse Reeve
4ba3234f6c
Merge branch 'main' into bookwyrm-groups 2021-10-07 17:27:11 -07:00
Mouse Reeve
37e03e8993 Merge branch 'main' into book-file-links 2021-10-07 15:27:16 -07:00
Hugh Rundle
3003b103e4 add group views tests
TODO: the POST test needs to test that the group was actually updated.
2021-10-08 08:38:00 +11:00
Mouse Reeve
73a8f89bee
Merge branch 'main' into bookwyrm-groups 2021-10-06 11:37:38 -07:00
Mouse Reeve
15105bda4f Remove follow suggestion on request 2021-10-06 06:48:44 -07:00
Hugh Rundle
ec7d0db843 linting fixes 2021-10-05 21:48:59 +11:00
Hugh Rundle
f8e0de1ea9 run black for clean code
Godammit Hugh remember to do this before pushing new code.
2021-10-05 21:32:48 +11:00
Hugh Rundle
b3dc81dea0 update tests 2021-10-05 21:29:46 +11:00
Hugh Rundle
6fde19e9b1 lint fixes 2021-10-05 21:29:33 +11:00
Hugh Rundle
cdf7775e05 add test for Group views 2021-10-05 21:06:09 +11:00
Hugh Rundle
fe87e815e6 database migrations for Groups 2021-10-05 20:41:48 +11:00
Hugh Rundle
b1bb43d143 lint Group views file 2021-10-05 18:04:47 +11:00
Hugh Rundle
cc8db1c353 linting fixes
- remove unused imports
- add class docstrings
2021-10-05 09:05:20 +11:00
Hugh Rundle
484e9ed959 fix user Groups view pagination function 2021-10-05 08:14:52 +11:00
Hugh Rundle
90d92edd75 disable pylint on NotificationType now being "too long" 2021-10-05 08:10:23 +11:00
Hugh Rundle
78f5003407 lint raise_visible_to_user
Don't return True unnecessarily
2021-10-05 08:09:24 +11:00
Hugh Rundle
da53bad0f5 make Black happy 2021-10-04 22:22:00 +11:00
Hugh Rundle
3a90311129 update indenting for linter 2021-10-04 22:20:02 +11:00
Hugh Rundle
05969c5311 improve group creation hint
- use help class
- hopefully make the linter happy
2021-10-04 22:18:51 +11:00
Hugh Rundle
57b2c83c64 disable pylint suppression
I don't know what this does so I removed it - maybe I'll find out!
2021-10-04 21:34:54 +11:00
Hugh Rundle
dafda649f1 run Black on changed code 2021-10-04 21:31:28 +11:00
Hugh Rundle
782512b2ce replace get_group_suggestions
- adds **filters argument to get_suggestions()
- passes local=True arg to get_suggestions() for group member suggestions
- removes get_group_suggestions()

Thanks to Mouse for the suggestion to keep the codebase DRY!
2021-10-04 21:25:38 +11:00
Hugh Rundle
2b96b3365c Merge branch 'main' into bookwyrm-groups 2021-10-04 21:10:15 +11:00
Hugh Rundle
0d5c20bcde remove_from_group button updates
- enable blocked users to be removed
- make "remove" button more subtle
2021-10-03 13:57:21 +11:00
Hugh Rundle
9d8e978686 sort group members in UserGroups view 2021-10-03 13:45:41 +11:00
Hugh Rundle
c04659984f fix raise_not_editable for group lists 2021-10-03 13:45:19 +11:00
Hugh Rundle
603a9dc25c fix group members not being able to delete items on group lists 2021-10-03 12:22:03 +11:00
Hugh Rundle
7db2af89dd use group.local_path instead of harcoded url 2021-10-03 12:03:37 +11:00
Hugh Rundle
1ad8d87434 use raise_visible_to_user in group model
instead of if visible_to_user
2021-10-03 12:02:57 +11:00
Hugh Rundle
f13223b8ca add notifications for groups
Moved into new structure after merge.
2021-10-03 11:46:51 +11:00
Hugh Rundle
77ac8e0c04 add group membership to raise_not_deletable for lists 2021-10-03 11:45:53 +11:00
Hugh Rundle
602664b8d7 Merge branch 'main' into groups-merge-test
Big merge of a couple of weeks' work from the main project back into this branch. :ohno:
2021-10-03 10:49:38 +11:00
Hugh Rundle
f39887cf7f groups should appear before lists on user pages 2021-10-03 10:07:47 +11:00
Hugh Rundle
1c5789f283 remove group-curated lists when user leaves group 2021-10-03 09:16:19 +11:00
Hugh Rundle
a179de33bc fix incorrect wording on group selection
select a group, not a list!
2021-10-03 09:07:42 +11:00
Hugh Rundle
4ea99d1763 don't assign a group when creating non-group curated lists
same as updating a list but for if a user changes their mind about curation when initially creating a list.
2021-10-03 09:06:06 +11:00
Hugh Rundle
680e547c8b add button for non-owner members to leave group 2021-10-02 21:24:26 +10:00
Hugh Rundle
eed9d44cfd fix visible_to_user for groups user is a member of 2021-10-02 20:52:19 +10:00
Hugh Rundle
72e00f75c9 send notification when other group members add books to group lists 2021-10-02 20:14:53 +10:00
Hugh Rundle
3a954ca6ae improve responsive layout for groups 2021-10-02 20:05:19 +10:00
Hugh Rundle
29f18ee123 only suggest local users as potential group members 2021-10-02 19:35:57 +10:00
Hugh Rundle
2c399fe1aa fix suggested members all appearing in a column 2021-10-02 19:35:08 +10:00
Hugh Rundle
8708d71f4b group members can see lists
- fix visible_to_user for group objects (like lists)
- temporarily disable privacy_filter on group lists
2021-10-02 18:31:56 +10:00
Hugh Rundle
8496f24032 fix filters for group members to see and edit group lists 2021-10-02 18:09:15 +10:00
Hugh Rundle
832a9b9890 fix group local_path
as per Lists, we need to override get_remote_id to remove the user from the URL
2021-10-02 16:54:44 +10:00
Hugh Rundle
52a083a907 revert name change for Group, GroupMember
these were named as BookwyrmGroup and BookwyrmGroupMember due to a misunderstanding about related_name and a dodgy development environment. This naming makes more sense.
2021-10-02 16:52:34 +10:00
Hugh Rundle
21e6ed7388 complete group notifications
- notify group members when a new member accepts an invitation
- notify all group members when a member leaves or is removed
- notify ex-member when they are removed
2021-10-02 15:48:55 +10:00
Hugh Rundle
f82af6382f make message about group members more generic 2021-10-02 15:48:34 +10:00
Hugh Rundle
70e0128052 non-owners can't add users to groups
- hide add-user pages from non-owners
- hide user searchbox from non-owners
- fix find-user searchbox being in wrong place where no results
2021-10-02 14:41:23 +10:00
Hugh Rundle
5237e88aba remove user button for groups 2021-10-02 13:48:53 +10:00
Hugh Rundle
0984972b05 group membership invitations
- fix display of group information on user and group pages
- send, receive, accept and reject invitations
2021-10-02 12:30:48 +10:00
Hugh Rundle
89dea44614 accepting membership fixes
- don't delete the invitation twice
- send membership information properly to notification
2021-10-02 12:29:01 +10:00
Hugh Rundle
9290655116 fix urls for group invitations 2021-10-02 12:13:34 +10:00
Hugh Rundle
80fb37b55c add has_groups tag for use on user page 2021-10-02 12:12:59 +10:00
Hugh Rundle
0f3be40957 fix group references in templates
Let's do this the sensible way huh, by using backwards references to memberships etc

Also adds filters for is_member and is_invited so we don't have to do weird things in group Views
2021-10-02 10:47:42 +10:00
Hugh Rundle
2f42161dda disambiguate groups and prep for group invitations
- rename Group to BookwyrmGroup
- create group memberships and invitations
- adjust all model name references accordingly
2021-10-02 10:10:37 +10:00
Hugh Rundle
66494e7788 fix reverse reference to user bookwyrm_groups 2021-09-28 18:53:11 +10:00
Hugh Rundle
fb823189a0 don't allow non-local users to join groups (yet)
Groups are not compatible with ActivityPub because I don't know what I'm doing.

NOTE: this is super hacky, fix ASAP
2021-09-27 21:48:40 +10:00
Hugh Rundle
e15eef16c5 improve new group member adding
The add-members page now looks almost identical to the group
page and is clearer.
2021-09-27 21:21:00 +10:00
Hugh Rundle
1a02af1450 allow members to see groups and their lists
- add additional logic to visible_to_user, for groups and their objects
- cleans up some queries in Group view

NOTE: I can't work out how to make group lists only visible
to users who should be able to see them, on user group listings.
They still can't access the actual group, but can see it on
user pages. This is potentialy problematic.
2021-09-27 20:24:25 +10:00
Hugh Rundle
df5a5f94a1 fix local_path for groups 2021-09-27 19:27:39 +10:00
Hugh Rundle
c87712c995 allow group members to add items to group lists directly
NOTE: this will be the case regardless of privacy settings of the list
2021-09-27 18:41:29 +10:00
Hugh Rundle
81e5ff5b76 show groups on member pages if allowed
- display groups on user pages when not the logged in user
- restrict visibility of groups on user pages and group pages themselves according to privacy settings
2021-09-27 17:51:18 +10:00
Hugh Rundle
277c033fda show star if this user is the creator/manager of the group 2021-09-27 17:50:38 +10:00
Hugh Rundle
e5ca377cd3 clean up stray code mess 2021-09-27 16:50:51 +10:00
Hugh Rundle
e38d7b63f3 make groups actually editable 2021-09-27 16:49:56 +10:00
Hugh Rundle
493ed14f34 better group creation form logic and placement 2021-09-27 16:39:12 +10:00
Hugh Rundle
0ccd54b05a better urls and views for group creation and editing 2021-09-27 15:38:05 +10:00
Hugh Rundle
f3181690a2 change group owner from 'manager' to 'user'
This will allow privacy management to use existing code.
Some template updates also are for rationalising how
groups are created and edited.
2021-09-27 15:36:41 +10:00
Hugh Rundle
2874e52309 rationalise group creation and prep for group privacy 2021-09-27 15:34:14 +10:00
Hugh Rundle
762202c4b0 fix UI for group curated list editing
When creating or editing a list, the group selection dropdown will only appear if the user selects "group" as the curation option (or it is already selected).

- fix typo in bookwyrm.js comments
- add data-hides trigger for hiding elements after they have been unhidden, where simple toggles are not the right approach
2021-09-27 11:03:41 +10:00
Hugh Rundle
0e2095bc5e refer to group in group lists created_text 2021-09-26 20:52:44 +10:00
Hugh Rundle
5fccb991a7 remove list from group when changing curation
Allows 'group' to be blank when saving a list.
Removes the 'group' field when saving a list with curation other than 'group' - this stops the list "sticking" to a group after it is changed from group curation to something else.
2021-09-26 18:28:16 +10:00
Hugh Rundle
8bfc71db6e create group curated lists 2021-09-26 15:56:52 +10:00
Hugh Rundle
f3a3ba5f01 pass group value to list views and vice-versa 2021-09-26 15:56:02 +10:00
Hugh Rundle
b921d666cf add group field to ListForm 2021-09-26 15:55:16 +10:00
Hugh Rundle
686198472d update group and list models
- remove GroupList model
- add a group foreign key value  to List model
- remove reference to lists in Group model
2021-09-26 15:50:15 +10:00
Hugh Rundle
ec0720514e don't allow non-manager to add and remove group members 2021-09-25 20:25:30 +10:00
Hugh Rundle
035fc5209d better logic for identifying group manager 2021-09-25 20:23:59 +10:00
Hugh Rundle
62a5ed7a9e identify group manager 2021-09-25 19:53:06 +10:00
Hugh Rundle
b645d75303 add and remove users from groups 2021-09-25 17:34:44 +10:00
Hugh Rundle
e800106be4 smaller cards for group members
- this will also enable members to be removed easily by managers in a future commit.
2021-09-25 11:37:08 +10:00
Hugh Rundle
8d17f888ea improve naming of templates and urls for groups 2021-09-25 11:36:35 +10:00
Hugh Rundle
7c0deabcb2 update urls and group view for searching users to add to group 2021-09-25 11:14:04 +10:00
Hugh Rundle
cbe172df3d find users for groups
- search for users to add to a group
- display suggested users on search results screen

TODO: actaully enable users to be added!
TODO: groups/suggested_users probably could be replaced with some logic in snippets/suggested_users.html
2021-09-25 11:11:58 +10:00
Hugh Rundle
8c326ec52f user groups listing template
- creates groups/user_groups template for listing a user's groups on their user page
2021-09-25 11:10:06 +10:00
Hugh Rundle
273ad9a466 add create_group to __init__.py
you probably want this otherwise nothing previously added for group creation will work :-)
2021-09-25 10:55:32 +10:00
Hugh Rundle
d4fcf88cf5 add list cards to groups page
- add list cards to groups page based on lists page
- add sort to members on group page
2021-09-24 21:57:01 +10:00
Hugh Rundle
86a60d58e5 add user cards to group pages 2021-09-24 21:24:06 +10:00
Hugh Rundle
264d9b2f3c add group page template 2021-09-24 20:35:51 +10:00
Hugh Rundle
9b6d2a9d88 add group page 2021-09-24 20:34:11 +10:00
Hugh Rundle
f32a2cc4d0 group creation form can now be submitted!
Whoops
2021-09-24 15:04:52 +10:00
Hugh Rundle
4e93b09067 create group form
adds a group creation form to user dashboard
2021-09-24 14:12:36 +10:00
Hugh Rundle
e07a25e288 add groups urls 2021-09-24 07:52:40 +10:00
Hugh Rundle
99b533510a add group templates 2021-09-24 07:51:51 +10:00
Hugh Rundle
71b1c6117c update templates for groups 2021-09-24 07:50:57 +10:00
Hugh Rundle
b74cd37096 add models for groups 2021-09-24 07:49:54 +10:00
Hugh Rundle
3e3c90ec03 add views for groups 2021-09-24 07:49:25 +10:00
Joachim
c1673ef717 Update fields.py 2021-08-04 19:25:19 +02:00
Joachim
0db3512eb3 Revert previous commit 2021-08-04 19:21:56 +02:00
Joachim
ee39e8c036 Fix R0201: Method could be a function (no-self-use) 2021-08-04 19:16:24 +02:00
Joachim
c6f8236b07 Fix tests 2021-08-04 19:11:57 +02:00
Joachim
bc7710a4a7 Update Status Model Test 2021-08-04 18:18:18 +02:00
Joachim
60e805ac2b Fix tests 2021-08-04 17:39:46 +02:00
Joachim
7a716db48a lint 2021-08-04 16:56:07 +02:00
Joachim
b8b491bbf2 Add get_absolute_url to ImageField 2021-08-04 16:55:12 +02:00
803 changed files with 34920 additions and 125806 deletions

View file

@ -1,75 +0,0 @@
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY="7(2w1sedok=aznpq)ta1mc4i%4h=xx@hxwx*o57ctsuml0x%fr"
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG=true
USE_HTTPS=false
DOMAIN=your.domain.here
#EMAIL=your@email.here
# Used for deciding which editions to prefer
DEFAULT_LANGUAGE="English"
## Leave unset to allow all hosts
# ALLOWED_HOSTS="localhost,127.0.0.1,[::1]"
MEDIA_ROOT=images/
PGPORT=5432
POSTGRES_PASSWORD=securedbypassword123
POSTGRES_USER=fedireads
POSTGRES_DB=fedireads
POSTGRES_HOST=db
# Redis activity stream manager
MAX_STREAM_LENGTH=200
REDIS_ACTIVITY_HOST=redis_activity
REDIS_ACTIVITY_PORT=6379
#REDIS_ACTIVITY_PASSWORD=redispassword345
# Redis as celery broker
REDIS_BROKER_PORT=6379
#REDIS_BROKER_PASSWORD=redispassword123
FLOWER_PORT=8888
#FLOWER_USER=mouse
#FLOWER_PASSWORD=changeme
EMAIL_HOST="smtp.mailgun.org"
EMAIL_PORT=587
EMAIL_HOST_USER=mail@your.domain.here
EMAIL_HOST_PASSWORD=emailpassword123
EMAIL_USE_TLS=true
EMAIL_USE_SSL=false
# Thumbnails Generation
ENABLE_THUMBNAIL_GENERATION=false
# S3 configuration
USE_S3=false
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
# Commented are example values if you use a non-AWS, S3-compatible service
# AWS S3 should work with only AWS_STORAGE_BUCKET_NAME and AWS_S3_REGION_NAME
# non-AWS S3-compatible services will need AWS_STORAGE_BUCKET_NAME,
# along with both AWS_S3_CUSTOM_DOMAIN and AWS_S3_ENDPOINT_URL
# AWS_STORAGE_BUCKET_NAME= # "example-bucket-name"
# AWS_S3_CUSTOM_DOMAIN=None # "example-bucket-name.s3.fr-par.scw.cloud"
# AWS_S3_REGION_NAME=None # "fr-par"
# AWS_S3_ENDPOINT_URL=None # "https://s3.fr-par.scw.cloud"
# Preview image generation can be computing and storage intensive
# ENABLE_PREVIEW_IMAGES=True
# Specify RGB tuple or RGB hex strings,
# or use_dominant_color_light / use_dominant_color_dark
PREVIEW_BG_COLOR=use_dominant_color_light
# Change to #FFF if you use use_dominant_color_dark
PREVIEW_TEXT_COLOR="#363636"
PREVIEW_IMG_WIDTH=1200
PREVIEW_IMG_HEIGHT=630
PREVIEW_DEFAULT_COVER_COLOR="#002549"

View file

@ -8,6 +8,8 @@ USE_HTTPS=true
DOMAIN=your.domain.here
EMAIL=your@email.here
# Instance defualt language (see options at bookwyrm/settings.py "LANGUAGES"
LANGUAGE_CODE="en-us"
# Used for deciding which editions to prefer
DEFAULT_LANGUAGE="English"
@ -16,6 +18,7 @@ DEFAULT_LANGUAGE="English"
MEDIA_ROOT=images/
# Database configuration
PGPORT=5432
POSTGRES_PASSWORD=securedbypassword123
POSTGRES_USER=fedireads
@ -27,21 +30,34 @@ MAX_STREAM_LENGTH=200
REDIS_ACTIVITY_HOST=redis_activity
REDIS_ACTIVITY_PORT=6379
REDIS_ACTIVITY_PASSWORD=redispassword345
# Optional, use a different redis database (defaults to 0)
# REDIS_ACTIVITY_DB_INDEX=0
# Redis as celery broker
REDIS_BROKER_PORT=6379
REDIS_BROKER_PASSWORD=redispassword123
# Optional, use a different redis database (defaults to 0)
# REDIS_BROKER_DB_INDEX=0
# Monitoring for celery
FLOWER_PORT=8888
FLOWER_USER=mouse
FLOWER_USER=admin
FLOWER_PASSWORD=changeme
EMAIL_HOST="smtp.mailgun.org"
# Email config
EMAIL_HOST=smtp.mailgun.org
EMAIL_PORT=587
EMAIL_HOST_USER=mail@your.domain.here
EMAIL_HOST_PASSWORD=emailpassword123
EMAIL_USE_TLS=true
EMAIL_USE_SSL=false
EMAIL_SENDER_NAME=admin
# defaults to DOMAIN
EMAIL_SENDER_DOMAIN=
# Query timeouts
SEARCH_TIMEOUT=15
QUERY_TIMEOUT=5
# Thumbnails Generation
ENABLE_THUMBNAIL_GENERATION=false
@ -69,7 +85,26 @@ AWS_SECRET_ACCESS_KEY=
# or use_dominant_color_light / use_dominant_color_dark
PREVIEW_BG_COLOR=use_dominant_color_light
# Change to #FFF if you use use_dominant_color_dark
PREVIEW_TEXT_COLOR="#363636"
PREVIEW_TEXT_COLOR=#363636
PREVIEW_IMG_WIDTH=1200
PREVIEW_IMG_HEIGHT=630
PREVIEW_DEFAULT_COVER_COLOR="#002549"
PREVIEW_DEFAULT_COVER_COLOR=#002549
# Below are example keys if you want to enable automatically
# sending telemetry to an OTLP-compatible service. Many of
# the main monitoring apps have OLTP collectors, including
# NewRelic, DataDog, and Honeycomb.io - consult their
# documentation for setup instructions, and what exactly to
# put below!
#
# Service name is an arbitrary tag that is attached to any
# data sent, used to distinguish different sources. Useful
# for sending prod and dev metrics to the same place and
# keeping them separate, for instance!
# API endpoint for your provider
OTEL_EXPORTER_OTLP_ENDPOINT=
# Any headers required, usually authentication info
OTEL_EXPORTER_OTLP_HEADERS=
# Service name to identify your app
OTEL_SERVICE_NAME=

View file

@ -46,6 +46,8 @@ jobs:
POSTGRES_HOST: 127.0.0.1
CELERY_BROKER: ""
REDIS_BROKER_PORT: 6379
REDIS_BROKER_PASSWORD: beep
USE_DUMMY_CACHE: true
FLOWER_PORT: 8888
EMAIL_HOST: "smtp.mailgun.org"
EMAIL_PORT: 587

View file

@ -1,5 +1,5 @@
# @url https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: Lint Frontend
name: Lint Frontend (run `./bw-dev stylelint` to fix css errors)
on:
push:
@ -8,7 +8,7 @@ on:
- '.github/workflows/**'
- 'static/**'
- '.eslintrc'
- '.stylelintrc'
- '.stylelintrc.js'
pull_request:
branches: [ main, ci, frontend ]
@ -22,17 +22,16 @@ jobs:
- uses: actions/checkout@v2
- name: Install modules
run: yarn
run: npm install stylelint stylelint-config-recommended stylelint-config-standard stylelint-order eslint
# See .stylelintignore for files that are not linted.
- name: Run stylelint
run: >
yarn stylelint bookwyrm/static/**/*.css \
--report-needless-disables \
--report-invalid-scope-disables
npx stylelint bookwyrm/static/css/*.scss bookwyrm/static/css/bookwyrm/**/*.scss \
--config dev-tools/.stylelintrc.js
# See .eslintignore for files that are not linted.
- name: Run ESLint
run: >
yarn eslint bookwyrm/static \
npx eslint bookwyrm/static \
--ext .js,.jsx,.ts,.tsx

View file

@ -1,21 +0,0 @@
# @url https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: Lint project globally
on:
push:
branches: [ main, ci ]
pull_request:
branches: [ main, ci ]
jobs:
lint:
name: Lint with EditorConfig.
runs-on: ubuntu-20.04
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: EditorConfig
uses: greut/eclint-action@v0

23
.github/workflows/prettier.yaml vendored Normal file
View file

@ -0,0 +1,23 @@
# @url https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: JavaScript Prettier (run ./bw-dev prettier to fix)
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
lint:
name: Lint with Prettier
runs-on: ubuntu-20.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it.
- uses: actions/checkout@v2
- name: Install modules
run: npm install prettier
- name: Run Prettier
run: npx prettier --check bookwyrm/static/js/*.js

View file

@ -21,8 +21,7 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pylint
- name: Analysing the code with pylint
run: |
pylint bookwyrm/ --ignore=migrations,tests --disable=E1101,E1135,E1136,R0903,R0901,R0902,W0707,W0511,W0406,R0401,R0801
pylint bookwyrm/

8
.gitignore vendored
View file

@ -4,6 +4,7 @@
*.swp
**/__pycache__
.local
/nginx/nginx.conf
# VSCode
/.vscode
@ -15,6 +16,9 @@
# BookWyrm
.env
/images/
bookwyrm/static/css/bookwyrm.css
bookwyrm/static/css/themes/
!bookwyrm/static/css/themes/bookwyrm-*.scss
# Testing
.coverage
@ -23,7 +27,9 @@
.idea
#Node tools
/node_modules/
node_modules/
package-lock.json
yarn.lock
#nginx
nginx/default.conf

1
.prettierignore Normal file
View file

@ -0,0 +1 @@
**/vendor/*

6
.pylintrc Normal file
View file

@ -0,0 +1,6 @@
[MAIN]
ignore=migrations
load-plugins=pylint.extensions.no_self_use
[MESSAGES CONTROL]
disable=E1101,E1135,E1136,R0903,R0901,R0902,W0707,W0511,W0406,R0401,R0801,C3001

View file

@ -1,17 +0,0 @@
/* global module */
module.exports = {
"extends": "stylelint-config-standard",
"plugins": [
"stylelint-order"
],
"rules": {
"order/order": [
"custom-properties",
"declarations"
],
"indentation": 4
}
};

View file

@ -6,6 +6,7 @@ RUN mkdir /app /app/static /app/images
WORKDIR /app
RUN apt-get update && apt-get install -y gettext libgettextpo-dev tidy && apt-get clean
COPY requirements.txt /app/
RUN pip install -r requirements.txt --no-cache-dir
RUN apt-get update && apt-get install -y gettext libgettextpo-dev tidy && apt-get clean

View file

@ -9,21 +9,18 @@ Social reading and reviewing, decentralized with ActivityPub
- [What it is and isn't](#what-it-is-and-isnt)
- [The role of federation](#the-role-of-federation)
- [Features](#features)
- [Book data](#book-data)
- [Set up Bookwyrm](#set-up-bookwyrm)
- [Set up BookWyrm](#set-up-bookwyrm)
## Joining BookWyrm
BookWyrm is still a young piece of software, and isn't at the level of stability and feature-richness that you'd find in a production-ready application. But it does what it says on the box! If you'd like to join an instance, you can check out the [instances](https://docs.joinbookwyrm.com/instances.html) list.
You can request an invite by entering your email address at https://bookwyrm.social.
If you'd like to join an instance, you can check out the [instances](https://joinbookwyrm.com/instances/) list.
## Contributing
See [contributing](https://docs.joinbookwyrm.com/how-to-contribute.html) for code, translation or monetary contributions.
See [contributing](https://docs.joinbookwyrm.com/contributing.html) for code, translation or monetary contributions.
## About BookWyrm
### What it is and isn't
BookWyrm is a platform for social reading! You can use it to track what you're reading, review books, and follow your friends. It isn't primarily meant for cataloguing or as a data-source for books, but it does do both of those things to some degree.
BookWyrm is a platform for social reading. You can use it to track what you're reading, review books, and follow your friends. It isn't primarily meant for cataloguing or as a data-source for books, but it does do both of those things to some degree.
### The role of federation
BookWyrm is built on [ActivityPub](http://activitypub.rocks/). With ActivityPub, it inter-operates with different instances of BookWyrm, and other ActivityPub compliant services, like Mastodon. This means you can run an instance for your book club, and still follow your friend who posts on a server devoted to 20th century Russian speculative fiction. It also means that your friend on mastodon can read and comment on a book review that you post on your BookWyrm instance.
@ -78,8 +75,5 @@ Deployment
- [Nginx](https://nginx.org/en/) HTTP server
## Book data
The application is set up to share book and author data between instances, and get book data from arbitrary outside sources. Right now, the only connector is to OpenLibrary, but other connectors could be written.
## Set up Bookwyrm
The [documentation website](https://docs.joinbookwyrm.com/) has instruction on how to set up Bookwyrm in a [developer environment](https://docs.joinbookwyrm.com/developer-environment.html) or [production](https://docs.joinbookwyrm.com/installing-in-production.html).
## Set up BookWyrm
The [documentation website](https://docs.joinbookwyrm.com/) has instruction on how to set up BookWyrm in a [developer environment](https://docs.joinbookwyrm.com/install-dev.html) or [production](https://docs.joinbookwyrm.com/install-prod.html).

View file

@ -1,6 +1,7 @@
""" basics for an activitypub serializer """
from dataclasses import dataclass, fields, MISSING
from json import JSONEncoder
import logging
from django.apps import apps
from django.db import IntegrityError, transaction
@ -8,6 +9,8 @@ from django.db import IntegrityError, transaction
from bookwyrm.connectors import ConnectorException, get_data
from bookwyrm.tasks import app
logger = logging.getLogger(__name__)
class ActivitySerializerError(ValueError):
"""routine problems serializing activitypub json"""
@ -20,22 +23,6 @@ class ActivityEncoder(JSONEncoder):
return o.__dict__
@dataclass
class Link:
"""for tagging a book in a status"""
href: str
name: str
type: str = "Link"
@dataclass
class Mention(Link):
"""a subtype of Link for mentioning an actor"""
type: str = "Mention"
@dataclass
# pylint: disable=invalid-name
class Signature:
@ -55,12 +42,12 @@ def naive_parse(activity_objects, activity_json, serializer=None):
activity_json["type"] = "PublicKey"
activity_type = activity_json.get("type")
if activity_type in ["Question", "Article"]:
return None
try:
serializer = activity_objects[activity_type]
except KeyError as err:
# we know this exists and that we can't handle it
if activity_type in ["Question"]:
return None
raise ActivitySerializerError(err)
return serializer(activity_objects=activity_objects, **activity_json)
@ -81,7 +68,7 @@ class ActivityObject:
try:
value = kwargs[field.name]
if value in (None, MISSING, {}):
raise KeyError()
raise KeyError("Missing required field", field.name)
try:
is_subclass = issubclass(field.type, ActivityObject)
except TypeError:
@ -198,8 +185,9 @@ class ActivityObject:
)
return instance
def serialize(self):
def serialize(self, **kwargs):
"""convert to dictionary with context attr"""
omit = kwargs.get("omit", ())
data = self.__dict__.copy()
# recursively serialize
for (k, v) in data.items():
@ -208,8 +196,9 @@ class ActivityObject:
data[k] = v.serialize()
except TypeError:
pass
data = {k: v for (k, v) in data.items() if v is not None}
data["@context"] = "https://www.w3.org/ns/activitystreams"
data = {k: v for (k, v) in data.items() if v is not None and k not in omit}
if "@context" not in omit:
data["@context"] = "https://www.w3.org/ns/activitystreams"
return data
@ -222,35 +211,32 @@ def set_related_field(
model = apps.get_model(f"bookwyrm.{model_name}", require_ready=True)
origin_model = apps.get_model(f"bookwyrm.{origin_model_name}", require_ready=True)
with transaction.atomic():
if isinstance(data, str):
existing = model.find_existing_by_remote_id(data)
if existing:
data = existing.to_activity()
else:
data = get_data(data)
activity = model.activity_serializer(**data)
if isinstance(data, str):
existing = model.find_existing_by_remote_id(data)
if existing:
data = existing.to_activity()
else:
data = get_data(data)
activity = model.activity_serializer(**data)
# this must exist because it's the object that triggered this function
instance = origin_model.find_existing_by_remote_id(related_remote_id)
if not instance:
raise ValueError(f"Invalid related remote id: {related_remote_id}")
# this must exist because it's the object that triggered this function
instance = origin_model.find_existing_by_remote_id(related_remote_id)
if not instance:
raise ValueError(f"Invalid related remote id: {related_remote_id}")
# set the origin's remote id on the activity so it will be there when
# the model instance is created
# edition.parentWork = instance, for example
model_field = getattr(model, related_field_name)
if hasattr(model_field, "activitypub_field"):
setattr(
activity, getattr(model_field, "activitypub_field"), instance.remote_id
)
item = activity.to_model()
# set the origin's remote id on the activity so it will be there when
# the model instance is created
# edition.parentWork = instance, for example
model_field = getattr(model, related_field_name)
if hasattr(model_field, "activitypub_field"):
setattr(activity, getattr(model_field, "activitypub_field"), instance.remote_id)
item = activity.to_model(model=model)
# if the related field isn't serialized (attachments on Status), then
# we have to set it post-creation
if not hasattr(model_field, "activitypub_field"):
setattr(item, related_field_name, instance)
item.save()
# if the related field isn't serialized (attachments on Status), then
# we have to set it post-creation
if not hasattr(model_field, "activitypub_field"):
setattr(item, related_field_name, instance)
item.save()
def get_model_from_type(activity_type):
@ -285,9 +271,9 @@ def resolve_remote_id(
try:
data = get_data(remote_id)
except ConnectorException:
raise ActivitySerializerError(
f"Could not connect to host for remote_id: {remote_id}"
)
logger.exception("Could not connect to host for remote_id: %s", remote_id)
return None
# determine the model implicitly, if not provided
# or if it's a model with subclasses like Status, check again
if not model or hasattr(model.objects, "select_subclasses"):
@ -304,3 +290,28 @@ def resolve_remote_id(
# if we're refreshing, "result" will be set and we'll update it
return item.to_model(model=model, instance=result, save=save)
@dataclass(init=False)
class Link(ActivityObject):
"""for tagging a book in a status"""
href: str
name: str = None
mediaType: str = None
id: str = None
attributedTo: str = None
availability: str = None
type: str = "Link"
def serialize(self, **kwargs):
"""remove fields"""
omit = ("id", "type", "@context")
return super().serialize(omit=omit)
@dataclass(init=False)
class Mention(Link):
"""a subtype of Link for mentioning an actor"""
type: str = "Mention"

View file

@ -16,7 +16,12 @@ class BookData(ActivityObject):
librarythingKey: str = None
goodreadsKey: str = None
bnfId: str = None
viaf: str = None
wikidata: str = None
asin: str = None
lastEditedBy: str = None
links: List[str] = field(default_factory=lambda: [])
fileLinks: List[str] = field(default_factory=lambda: [])
# pylint: disable=invalid-name
@ -25,8 +30,8 @@ class Book(BookData):
"""serializes an edition or work, abstract"""
title: str
sortTitle: str = ""
subtitle: str = ""
sortTitle: str = None
subtitle: str = None
description: str = ""
languages: List[str] = field(default_factory=lambda: [])
series: str = ""
@ -51,7 +56,6 @@ class Edition(Book):
isbn10: str = ""
isbn13: str = ""
oclcNumber: str = ""
asin: str = ""
pages: int = None
physicalFormat: str = ""
physicalFormatDetail: str = ""

View file

@ -35,6 +35,7 @@ class Note(ActivityObject):
tag: List[Link] = field(default_factory=lambda: [])
attachment: List[Document] = field(default_factory=lambda: [])
sensitive: bool = False
updated: str = None
type: str = "Note"

View file

@ -15,6 +15,11 @@ class PublicKey(ActivityObject):
publicKeyPem: str
type: str = "PublicKey"
def serialize(self, **kwargs):
"""remove fields"""
omit = ("type", "@context")
return super().serialize(omit=omit)
# pylint: disable=invalid-name
@dataclass(init=False)
@ -34,4 +39,5 @@ class Person(ActivityObject):
bookwyrmUser: bool = False
manuallyApprovesFollowers: str = False
discoverable: str = False
hideFollows: str = False
type: str = "Person"

View file

@ -38,7 +38,7 @@ class Create(Verb):
class Delete(Verb):
"""Create activity"""
to: List[str]
to: List[str] = field(default_factory=lambda: [])
cc: List[str] = field(default_factory=lambda: [])
type: str = "Delete"
@ -69,8 +69,9 @@ class Update(Verb):
def action(self):
"""update a model instance from the dataclass"""
if self.object:
self.object.to_model(allow_create=False)
if not self.object:
return
self.object.to_model(allow_create=False)
@dataclass(init=False)
@ -136,8 +137,8 @@ class Accept(Verb):
type: str = "Accept"
def action(self):
"""find and remove the activity object"""
obj = self.object.to_model(save=False, allow_create=False)
"""accept a request"""
obj = self.object.to_model(save=False, allow_create=True)
obj.accept()
@ -149,7 +150,7 @@ class Reject(Verb):
type: str = "Reject"
def action(self):
"""find and remove the activity object"""
"""reject a follow request"""
obj = self.object.to_model(save=False, allow_create=False)
obj.reject()

View file

@ -7,7 +7,7 @@ from django.utils import timezone
from bookwyrm import models
from bookwyrm.redis_store import RedisStore, r
from bookwyrm.tasks import app
from bookwyrm.tasks import app, LOW, MEDIUM, HIGH
class ActivityStream(RedisStore):
@ -22,6 +22,11 @@ class ActivityStream(RedisStore):
stream_id = self.stream_id(user)
return f"{stream_id}-unread"
def unread_by_status_type_id(self, user):
"""the redis key for this user's unread count for this stream"""
stream_id = self.stream_id(user)
return f"{stream_id}-unread-by-type"
def get_rank(self, obj): # pylint: disable=no-self-use
"""statuses are sorted by date published"""
return obj.published_date.timestamp()
@ -35,6 +40,10 @@ class ActivityStream(RedisStore):
for user in self.get_audience(status):
# add to the unread status count
pipeline.incr(self.unread_id(user))
# add to the unread status count for status type
pipeline.hincrby(
self.unread_by_status_type_id(user), get_status_type(status), 1
)
# and go!
pipeline.execute()
@ -55,6 +64,7 @@ class ActivityStream(RedisStore):
"""load the statuses to be displayed"""
# clear unreads for this feed
r.set(self.unread_id(user), 0)
r.delete(self.unread_by_status_type_id(user))
statuses = self.get_store(self.stream_id(user))
return (
@ -75,6 +85,14 @@ class ActivityStream(RedisStore):
"""get the unread status count for this user's feed"""
return int(r.get(self.unread_id(user)) or 0)
def get_unread_count_by_status_type(self, user):
"""get the unread status count for this user's feed's status types"""
status_types = r.hgetall(self.unread_by_status_type_id(user))
return {
str(key.decode("utf-8")): int(value) or 0
for key, value in status_types.items()
}
def populate_streams(self, user):
"""go from zero to a timeline"""
self.populate_store(self.stream_id(user))
@ -277,7 +295,19 @@ def add_status_on_create(sender, instance, created, *args, **kwargs):
def add_status_on_create_command(sender, instance, created):
"""runs this code only after the database commit completes"""
add_status_task.delay(instance.id, increment_unread=created)
priority = HIGH
# check if this is an old status, de-prioritize if so
# (this will happen if federation is very slow, or, more expectedly, on csv import)
if instance.published_date < timezone.now() - timedelta(
days=1
) or instance.created_date < instance.published_date - timedelta(days=1):
priority = LOW
add_status_task.apply_async(
args=(instance.id,),
kwargs={"increment_unread": created},
queue=priority,
)
if sender == models.Boost:
handle_boost_task.delay(instance.id)
@ -368,9 +398,15 @@ def populate_streams_on_account_create(sender, instance, created, *args, **kwarg
"""build a user's feeds when they join"""
if not created or not instance.local:
return
transaction.on_commit(
lambda: populate_streams_on_account_create_command(instance.id)
)
def populate_streams_on_account_create_command(instance_id):
"""wait for the transaction to complete"""
for stream in streams:
populate_stream_task.delay(stream, instance.id)
populate_stream_task.delay(stream, instance_id)
@receiver(signals.pre_save, sender=models.ShelfBook)
@ -409,7 +445,7 @@ def remove_statuses_on_unshelve(sender, instance, *args, **kwargs):
# ---- TASKS
@app.task(queue="low_priority")
@app.task(queue=LOW)
def add_book_statuses_task(user_id, book_id):
"""add statuses related to a book on shelve"""
user = models.User.objects.get(id=user_id)
@ -417,7 +453,7 @@ def add_book_statuses_task(user_id, book_id):
BooksStream().add_book_statuses(user, book)
@app.task(queue="low_priority")
@app.task(queue=LOW)
def remove_book_statuses_task(user_id, book_id):
"""remove statuses about a book from a user's books feed"""
user = models.User.objects.get(id=user_id)
@ -425,7 +461,7 @@ def remove_book_statuses_task(user_id, book_id):
BooksStream().remove_book_statuses(user, book)
@app.task(queue="medium_priority")
@app.task(queue=MEDIUM)
def populate_stream_task(stream, user_id):
"""background task for populating an empty activitystream"""
user = models.User.objects.get(id=user_id)
@ -433,7 +469,7 @@ def populate_stream_task(stream, user_id):
stream.populate_streams(user)
@app.task(queue="medium_priority")
@app.task(queue=MEDIUM)
def remove_status_task(status_ids):
"""remove a status from any stream it might be in"""
# this can take an id or a list of ids
@ -446,10 +482,10 @@ def remove_status_task(status_ids):
stream.remove_object_from_related_stores(status)
@app.task(queue="high_priority")
@app.task(queue=HIGH)
def add_status_task(status_id, increment_unread=False):
"""add a status to any stream it should be in"""
status = models.Status.objects.get(id=status_id)
status = models.Status.objects.select_subclasses().get(id=status_id)
# we don't want to tick the unread count for csv import statuses, idk how better
# to check than just to see if the states is more than a few days old
if status.created_date < timezone.now() - timedelta(days=2):
@ -458,7 +494,7 @@ def add_status_task(status_id, increment_unread=False):
stream.add_status(status, increment_unread=increment_unread)
@app.task(queue="medium_priority")
@app.task(queue=MEDIUM)
def remove_user_statuses_task(viewer_id, user_id, stream_list=None):
"""remove all statuses by a user from a viewer's stream"""
stream_list = [streams[s] for s in stream_list] if stream_list else streams.values()
@ -468,7 +504,7 @@ def remove_user_statuses_task(viewer_id, user_id, stream_list=None):
stream.remove_user_statuses(viewer, user)
@app.task(queue="medium_priority")
@app.task(queue=MEDIUM)
def add_user_statuses_task(viewer_id, user_id, stream_list=None):
"""add all statuses by a user to a viewer's stream"""
stream_list = [streams[s] for s in stream_list] if stream_list else streams.values()
@ -478,7 +514,7 @@ def add_user_statuses_task(viewer_id, user_id, stream_list=None):
stream.add_user_statuses(viewer, user)
@app.task(queue="medium_priority")
@app.task(queue=MEDIUM)
def handle_boost_task(boost_id):
"""remove the original post and other, earlier boosts"""
instance = models.Status.objects.get(id=boost_id)
@ -496,3 +532,20 @@ def handle_boost_task(boost_id):
stream.remove_object_from_related_stores(boosted, stores=audience)
for status in old_versions:
stream.remove_object_from_related_stores(status, stores=audience)
def get_status_type(status):
"""return status type even for boosted statuses"""
status_type = status.status_type.lower()
# Check if current status is a boost
if hasattr(status, "boost"):
# Act in accordance of your findings
if hasattr(status.boost.boosted_status, "review"):
status_type = "review"
if hasattr(status.boost.boosted_status, "comment"):
status_type = "comment"
if hasattr(status.boost.boosted_status, "quotation"):
status_type = "quotation"
return status_type

54
bookwyrm/apps.py Normal file
View file

@ -0,0 +1,54 @@
"""Do further startup configuration and initialization"""
import os
import urllib
import logging
from django.apps import AppConfig
from bookwyrm import settings
logger = logging.getLogger(__name__)
def download_file(url, destination):
"""Downloads a file to the given path"""
try:
# Ensure our destination directory exists
os.makedirs(os.path.dirname(destination))
with urllib.request.urlopen(url) as stream:
with open(destination, "b+w") as outfile:
outfile.write(stream.read())
except (urllib.error.HTTPError, urllib.error.URLError):
logger.info("Failed to download file %s", url)
except OSError:
logger.info("Couldn't open font file %s for writing", destination)
except: # pylint: disable=bare-except
logger.info("Unknown error in file download")
class BookwyrmConfig(AppConfig):
"""Handles additional configuration"""
name = "bookwyrm"
verbose_name = "BookWyrm"
# pylint: disable=no-self-use
def ready(self):
"""set up OTLP and preview image files, if desired"""
if settings.OTEL_EXPORTER_OTLP_ENDPOINT:
# pylint: disable=import-outside-toplevel
from bookwyrm.telemetry import open_telemetry
open_telemetry.instrumentDjango()
if settings.ENABLE_PREVIEW_IMAGES and settings.FONTS:
# Download any fonts that we don't have yet
logger.debug("Downloading fonts..")
for name, config in settings.FONTS.items():
font_path = os.path.join(
settings.FONT_DIR, config["directory"], config["filename"]
)
if "url" in config and not os.path.exists(font_path):
logger.info("Just a sec, downloading %s", name)
download_file(config["url"], font_path)

View file

@ -82,6 +82,8 @@ def search_identifiers(query, *filters, return_first=False):
*filters, reduce(operator.or_, (Q(**f) for f in or_filters))
).distinct()
if results.count() <= 1:
if return_first:
return results.first()
return results
# when there are multiple editions of the same work, pick the default.
@ -124,6 +126,7 @@ def search_title_author(query, min_confidence, *filters, return_first=False):
result = default
else:
result = editions.first()
if return_first:
return result
list_results.append(result)
@ -145,8 +148,8 @@ class SearchResult:
def __repr__(self):
# pylint: disable=consider-using-f-string
return "<SearchResult key={!r} title={!r} author={!r}>".format(
self.key, self.title, self.author
return "<SearchResult key={!r} title={!r} author={!r} confidence={!r}>".format(
self.key, self.title, self.author, self.confidence
)
def json(self):

View file

@ -1,13 +1,16 @@
""" functionality outline for a book data connector """
from abc import ABC, abstractmethod
import imghdr
import logging
import re
from django.core.files.base import ContentFile
from django.db import transaction
import requests
from requests.exceptions import RequestException
from bookwyrm import activitypub, models, settings
from .connector_manager import load_more_data, ConnectorException
from .connector_manager import load_more_data, ConnectorException, raise_not_valid_url
from .format_mappings import format_mappings
@ -35,61 +38,34 @@ class AbstractMinimalConnector(ABC):
for field in self_fields:
setattr(self, field, getattr(info, field))
def search(self, query, min_confidence=None, timeout=5):
"""free text search"""
params = {}
if min_confidence:
params["min_confidence"] = min_confidence
def get_search_url(self, query):
"""format the query url"""
# Check if the query resembles an ISBN
if maybe_isbn(query) and self.isbn_search_url and self.isbn_search_url != "":
return f"{self.isbn_search_url}{query}"
data = self.get_search_data(
f"{self.search_url}{query}",
params=params,
timeout=timeout,
)
results = []
# NOTE: previously, we tried searching isbn and if that produces no results,
# searched as free text. This, instead, only searches isbn if it's isbn-y
return f"{self.search_url}{query}"
for doc in self.parse_search_data(data)[:10]:
results.append(self.format_search_result(doc))
return results
def isbn_search(self, query):
"""isbn search"""
params = {}
data = self.get_search_data(
f"{self.isbn_search_url}{query}",
params=params,
)
results = []
# this shouldn't be returning mutliple results, but just in case
for doc in self.parse_isbn_search_data(data)[:10]:
results.append(self.format_isbn_search_result(doc))
return results
def get_search_data(self, remote_id, **kwargs): # pylint: disable=no-self-use
"""this allows connectors to override the default behavior"""
return get_data(remote_id, **kwargs)
def process_search_response(self, query, data, min_confidence):
"""Format the search results based on the formt of the query"""
if maybe_isbn(query):
return list(self.parse_isbn_search_data(data))[:10]
return list(self.parse_search_data(data, min_confidence))[:10]
@abstractmethod
def get_or_create_book(self, remote_id):
"""pull up a book record by whatever means possible"""
@abstractmethod
def parse_search_data(self, data):
def parse_search_data(self, data, min_confidence):
"""turn the result json from a search into a list"""
@abstractmethod
def format_search_result(self, search_result):
"""create a SearchResult obj from json"""
@abstractmethod
def parse_isbn_search_data(self, data):
"""turn the result json from a search into a list"""
@abstractmethod
def format_isbn_search_result(self, search_result):
"""create a SearchResult obj from json"""
class AbstractConnector(AbstractMinimalConnector):
"""generic book data connector"""
@ -111,7 +87,7 @@ class AbstractConnector(AbstractMinimalConnector):
return existing.default_edition
return existing
# load the json
# load the json data from the remote data source
data = self.get_book_data(remote_id)
if self.is_work_data(data):
try:
@ -126,7 +102,7 @@ class AbstractConnector(AbstractMinimalConnector):
try:
work_data = self.get_work_from_edition_data(data)
except (KeyError, ConnectorException) as err:
logger.exception(err)
logger.info(err)
work_data = data
if not work_data or not edition_data:
@ -150,27 +126,37 @@ class AbstractConnector(AbstractMinimalConnector):
"""this allows connectors to override the default behavior"""
return get_data(remote_id)
def create_edition_from_data(self, work, edition_data):
def create_edition_from_data(self, work, edition_data, instance=None):
"""if we already have the work, we're ready"""
mapped_data = dict_from_mappings(edition_data, self.book_mappings)
mapped_data["work"] = work.remote_id
edition_activity = activitypub.Edition(**mapped_data)
edition = edition_activity.to_model(model=models.Edition, overwrite=False)
edition.connector = self.connector
edition.save()
edition = edition_activity.to_model(
model=models.Edition, overwrite=False, instance=instance
)
# if we're updating an existing instance, we don't need to load authors
if instance:
return edition
if not edition.connector:
edition.connector = self.connector
edition.save(broadcast=False, update_fields=["connector"])
for author in self.get_authors_from_data(edition_data):
edition.authors.add(author)
# use the authors from the work if none are found for the edition
if not edition.authors.exists() and work.authors.exists():
edition.authors.set(work.authors.all())
return edition
def get_or_create_author(self, remote_id):
def get_or_create_author(self, remote_id, instance=None):
"""load that author"""
existing = models.Author.find_existing_by_remote_id(remote_id)
if existing:
return existing
if not instance:
existing = models.Author.find_existing_by_remote_id(remote_id)
if existing:
return existing
data = self.get_book_data(remote_id)
@ -181,7 +167,24 @@ class AbstractConnector(AbstractMinimalConnector):
return None
# this will dedupe
return activity.to_model(model=models.Author, overwrite=False)
return activity.to_model(
model=models.Author, overwrite=False, instance=instance
)
def get_remote_id_from_model(self, obj):
"""given the data stored, how can we look this up"""
return getattr(obj, getattr(self, "generated_remote_link_field"))
def update_author_from_remote(self, obj):
"""load the remote data from this connector and add it to an existing author"""
remote_id = self.get_remote_id_from_model(obj)
return self.get_or_create_author(remote_id, instance=obj)
def update_book_from_remote(self, obj):
"""load the remote data from this connector and add it to an existing book"""
remote_id = self.get_remote_id_from_model(obj)
data = self.get_book_data(remote_id)
return self.create_edition_from_data(obj.parent_work, data, instance=obj)
@abstractmethod
def is_work_data(self, data):
@ -220,36 +223,38 @@ def dict_from_mappings(data, mappings):
def get_data(url, params=None, timeout=10):
"""wrapper for request.get"""
# check if the url is blocked
if models.FederatedServer.is_blocked(url):
raise ConnectorException(f"Attempting to load data from blocked url: {url}")
raise_not_valid_url(url)
try:
resp = requests.get(
url,
params=params,
headers={
"Accept": "application/json; charset=utf-8",
headers={ # pylint: disable=line-too-long
"Accept": (
'application/json, application/activity+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams"; charset=utf-8'
),
"User-Agent": settings.USER_AGENT,
},
timeout=timeout,
)
except RequestException as err:
logger.exception(err)
raise ConnectorException()
logger.info(err)
raise ConnectorException(err)
if not resp.ok:
raise ConnectorException()
try:
data = resp.json()
except ValueError as err:
logger.exception(err)
raise ConnectorException()
logger.info(err)
raise ConnectorException(err)
return data
def get_image(url, timeout=10):
"""wrapper for requesting an image"""
raise_not_valid_url(url)
try:
resp = requests.get(
url,
@ -259,11 +264,19 @@ def get_image(url, timeout=10):
timeout=timeout,
)
except RequestException as err:
logger.exception(err)
return None
logger.info(err)
return None, None
if not resp.ok:
return None
return resp
return None, None
image_content = ContentFile(resp.content)
extension = imghdr.what(None, image_content.read())
if not extension:
logger.info("File requested was not an image: %s", url)
return None, None
return image_content, extension
class Mapping:
@ -307,3 +320,9 @@ def unique_physical_format(format_text):
# try a direct match, so saving this would be redundant
return None
return format_text
def maybe_isbn(query):
"""check if a query looks like an isbn"""
isbn = re.sub(r"[\W_]", "", query) # removes filler characters
return len(isbn) in [10, 13] # ISBN10 or ISBN13

View file

@ -10,15 +10,12 @@ class Connector(AbstractMinimalConnector):
def get_or_create_book(self, remote_id):
return activitypub.resolve_remote_id(remote_id, model=models.Edition)
def parse_search_data(self, data):
return data
def format_search_result(self, search_result):
search_result["connector"] = self
return SearchResult(**search_result)
def parse_search_data(self, data, min_confidence):
for search_result in data:
search_result["connector"] = self
yield SearchResult(**search_result)
def parse_isbn_search_data(self, data):
return data
def format_isbn_search_result(self, search_result):
return self.format_search_result(search_result)
for search_result in data:
search_result["connector"] = self
yield SearchResult(**search_result)

View file

@ -1,16 +1,18 @@
""" interface with whatever connectors the app has """
from datetime import datetime
import asyncio
import importlib
import ipaddress
import logging
import re
from urllib.parse import urlparse
import aiohttp
from django.dispatch import receiver
from django.db.models import signals
from requests import HTTPError
from bookwyrm import book_search, models
from bookwyrm.settings import SEARCH_TIMEOUT, USER_AGENT
from bookwyrm.tasks import app
logger = logging.getLogger(__name__)
@ -20,54 +22,85 @@ class ConnectorException(HTTPError):
"""when the connector can't do what was asked"""
async def get_results(session, url, min_confidence, query, connector):
"""try this specific connector"""
# pylint: disable=line-too-long
headers = {
"Accept": (
'application/json, application/activity+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams"; charset=utf-8'
),
"User-Agent": USER_AGENT,
}
params = {"min_confidence": min_confidence}
try:
async with session.get(url, headers=headers, params=params) as response:
if not response.ok:
logger.info("Unable to connect to %s: %s", url, response.reason)
return
try:
raw_data = await response.json()
except aiohttp.client_exceptions.ContentTypeError as err:
logger.exception(err)
return
return {
"connector": connector,
"results": connector.process_search_response(
query, raw_data, min_confidence
),
}
except asyncio.TimeoutError:
logger.info("Connection timed out for url: %s", url)
except aiohttp.ClientError as err:
logger.exception(err)
async def async_connector_search(query, items, min_confidence):
"""Try a number of requests simultaneously"""
timeout = aiohttp.ClientTimeout(total=SEARCH_TIMEOUT)
async with aiohttp.ClientSession(timeout=timeout) as session:
tasks = []
for url, connector in items:
tasks.append(
asyncio.ensure_future(
get_results(session, url, min_confidence, query, connector)
)
)
results = await asyncio.gather(*tasks)
return results
def search(query, min_confidence=0.1, return_first=False):
"""find books based on arbitary keywords"""
if not query:
return []
results = []
# Have we got a ISBN ?
isbn = re.sub(r"[\W_]", "", query)
maybe_isbn = len(isbn) in [10, 13] # ISBN10 or ISBN13
timeout = 15
start_time = datetime.now()
items = []
for connector in get_connectors():
result_set = None
if maybe_isbn and connector.isbn_search_url and connector.isbn_search_url != "":
# Search on ISBN
try:
result_set = connector.isbn_search(isbn)
except Exception as err: # pylint: disable=broad-except
logger.exception(err)
# if this fails, we can still try regular search
# get the search url from the connector before sending
url = connector.get_search_url(query)
try:
raise_not_valid_url(url)
except ConnectorException:
# if this URL is invalid we should skip it and move on
logger.info("Request denied to blocked domain: %s", url)
continue
items.append((url, connector))
# if no isbn search results, we fallback to generic search
if not result_set:
try:
result_set = connector.search(query, min_confidence=min_confidence)
except Exception as err: # pylint: disable=broad-except
# we don't want *any* error to crash the whole search page
logger.exception(err)
continue
if return_first and result_set:
# if we found anything, return it
return result_set[0]
if result_set:
results.append(
{
"connector": connector,
"results": result_set,
}
)
if (datetime.now() - start_time).seconds >= timeout:
break
# load as many results as we can
results = asyncio.run(async_connector_search(query, items, min_confidence))
results = [r for r in results if r]
if return_first:
return None
# find the best result from all the responses and return that
all_results = [r for con in results for r in con["results"]]
all_results = sorted(all_results, key=lambda r: r.confidence, reverse=True)
return all_results[0] if all_results else None
# failed requests will return None, so filter those out
return results
@ -133,3 +166,20 @@ def create_connector(sender, instance, created, *args, **kwargs):
"""create a connector to an external bookwyrm server"""
if instance.application_type == "bookwyrm":
get_or_create_connector(f"https://{instance.server_name}")
def raise_not_valid_url(url):
"""do some basic reality checks on the url"""
parsed = urlparse(url)
if not parsed.scheme in ["http", "https"]:
raise ConnectorException("Invalid scheme: ", url)
try:
ipaddress.ip_address(parsed.netloc)
raise ConnectorException("Provided url is an IP address: ", url)
except ValueError:
# it's not an IP address, which is good
pass
if models.FederatedServer.is_blocked(url):
raise ConnectorException(f"Attempting to load data from blocked url: {url}")

View file

@ -11,6 +11,8 @@ from .connector_manager import ConnectorException
class Connector(AbstractConnector):
"""instantiate a connector for inventaire"""
generated_remote_link_field = "inventaire_id"
def __init__(self, identifier):
super().__init__(identifier)
@ -67,7 +69,7 @@ class Connector(AbstractConnector):
extracted = list(data.get("entities").values())
try:
data = extracted[0]
except KeyError:
except (KeyError, IndexError):
raise ConnectorException("Invalid book data")
# flatten the data so that images, uri, and claims are on the same level
return {
@ -75,59 +77,49 @@ class Connector(AbstractConnector):
**{k: data.get(k) for k in ["uri", "image", "labels", "sitelinks", "type"]},
}
def search(self, query, min_confidence=None): # pylint: disable=arguments-differ
"""overrides default search function with confidence ranking"""
results = super().search(query)
if min_confidence:
# filter the search results after the fact
return [r for r in results if r.confidence >= min_confidence]
return results
def parse_search_data(self, data):
return data.get("results")
def format_search_result(self, search_result):
images = search_result.get("image")
cover = f"{self.covers_url}/img/entities/{images[0]}" if images else None
# a deeply messy translation of inventaire's scores
confidence = float(search_result.get("_score", 0.1))
confidence = 0.1 if confidence < 150 else 0.999
return SearchResult(
title=search_result.get("label"),
key=self.get_remote_id(search_result.get("uri")),
author=search_result.get("description"),
view_link=f"{self.base_url}/entity/{search_result.get('uri')}",
cover=cover,
confidence=confidence,
connector=self,
)
def parse_search_data(self, data, min_confidence):
for search_result in data.get("results", []):
images = search_result.get("image")
cover = f"{self.covers_url}/img/entities/{images[0]}" if images else None
# a deeply messy translation of inventaire's scores
confidence = float(search_result.get("_score", 0.1))
confidence = 0.1 if confidence < 150 else 0.999
if confidence < min_confidence:
continue
yield SearchResult(
title=search_result.get("label"),
key=self.get_remote_id(search_result.get("uri")),
author=search_result.get("description"),
view_link=f"{self.base_url}/entity/{search_result.get('uri')}",
cover=cover,
confidence=confidence,
connector=self,
)
def parse_isbn_search_data(self, data):
"""got some daaaata"""
results = data.get("entities")
if not results:
return []
return list(results.values())
def format_isbn_search_result(self, search_result):
"""totally different format than a regular search result"""
title = search_result.get("claims", {}).get("wdt:P1476", [])
if not title:
return None
return SearchResult(
title=title[0],
key=self.get_remote_id(search_result.get("uri")),
author=search_result.get("description"),
view_link=f"{self.base_url}/entity/{search_result.get('uri')}",
cover=self.get_cover_url(search_result.get("image")),
connector=self,
)
return
for search_result in list(results.values()):
title = search_result.get("claims", {}).get("wdt:P1476", [])
if not title:
continue
yield SearchResult(
title=title[0],
key=self.get_remote_id(search_result.get("uri")),
author=search_result.get("description"),
view_link=f"{self.base_url}/entity/{search_result.get('uri')}",
cover=self.get_cover_url(search_result.get("image")),
connector=self,
)
def is_work_data(self, data):
return data.get("type") == "work"
def load_edition_data(self, work_uri):
"""get a list of editions for a work"""
# pylint: disable=line-too-long
url = f"{self.books_url}?action=reverse-claims&property=wdt:P629&value={work_uri}&sort=true"
return get_data(url)
@ -209,6 +201,11 @@ class Connector(AbstractConnector):
return ""
return data.get("extract")
def get_remote_id_from_model(self, obj):
"""use get_remote_id to figure out the link from a model obj"""
remote_id_value = obj.inventaire_id
return self.get_remote_id(remote_id_value)
def get_language_code(options, code="en"):
"""when there are a bunch of translation but we need a single field"""

View file

@ -12,6 +12,8 @@ from .openlibrary_languages import languages
class Connector(AbstractConnector):
"""instantiate a connector for OL"""
generated_remote_link_field = "openlibrary_link"
def __init__(self, identifier):
super().__init__(identifier)
@ -66,6 +68,30 @@ class Connector(AbstractConnector):
Mapping("born", remote_field="birth_date"),
Mapping("died", remote_field="death_date"),
Mapping("bio", formatter=get_description),
Mapping(
"isni",
remote_field="remote_ids",
formatter=lambda b: get_dict_field(b, "isni"),
),
Mapping(
"asin",
remote_field="remote_ids",
formatter=lambda b: get_dict_field(b, "amazon"),
),
Mapping(
"viaf",
remote_field="remote_ids",
formatter=lambda b: get_dict_field(b, "viaf"),
),
Mapping(
"wikidata",
remote_field="remote_ids",
formatter=lambda b: get_dict_field(b, "wikidata"),
),
Mapping(
"wikipedia_link", remote_field="links", formatter=get_wikipedia_link
),
Mapping("inventaire_id", remote_field="links", formatter=get_inventaire_id),
]
def get_book_data(self, remote_id):
@ -126,39 +152,41 @@ class Connector(AbstractConnector):
image_name = f"{cover_id}-{size}.jpg"
return f"{self.covers_url}/b/id/{image_name}"
def parse_search_data(self, data):
return data.get("docs")
def parse_search_data(self, data, min_confidence):
for idx, search_result in enumerate(data.get("docs")):
# build the remote id from the openlibrary key
key = self.books_url + search_result["key"]
author = search_result.get("author_name") or ["Unknown"]
cover_blob = search_result.get("cover_i")
cover = self.get_cover_url([cover_blob], size="M") if cover_blob else None
def format_search_result(self, search_result):
# build the remote id from the openlibrary key
key = self.books_url + search_result["key"]
author = search_result.get("author_name") or ["Unknown"]
cover_blob = search_result.get("cover_i")
cover = self.get_cover_url([cover_blob], size="M") if cover_blob else None
return SearchResult(
title=search_result.get("title"),
key=key,
author=", ".join(author),
connector=self,
year=search_result.get("first_publish_year"),
cover=cover,
)
# OL doesn't provide confidence, but it does sort by an internal ranking, so
# this confidence value is relative to the list position
confidence = 1 / (idx + 1)
yield SearchResult(
title=search_result.get("title"),
key=key,
author=", ".join(author),
connector=self,
year=search_result.get("first_publish_year"),
cover=cover,
confidence=confidence,
)
def parse_isbn_search_data(self, data):
return list(data.values())
def format_isbn_search_result(self, search_result):
# build the remote id from the openlibrary key
key = self.books_url + search_result["key"]
authors = search_result.get("authors") or [{"name": "Unknown"}]
author_names = [author.get("name") for author in authors]
return SearchResult(
title=search_result.get("title"),
key=key,
author=", ".join(author_names),
connector=self,
year=search_result.get("publish_date"),
)
for search_result in list(data.values()):
# build the remote id from the openlibrary key
key = self.books_url + search_result["key"]
authors = search_result.get("authors") or [{"name": "Unknown"}]
author_names = [author.get("name") for author in authors]
yield SearchResult(
title=search_result.get("title"),
key=key,
author=", ".join(author_names),
connector=self,
year=search_result.get("publish_date"),
)
def load_edition_data(self, olkey):
"""query openlibrary for editions of a work"""
@ -224,6 +252,40 @@ def get_languages(language_blob):
return langs
def get_dict_field(blob, field_name):
"""extract the isni from the remote id data for the author"""
if not blob or not isinstance(blob, dict):
return None
return blob.get(field_name)
def get_wikipedia_link(links):
"""extract wikipedia links"""
if not isinstance(links, list):
return None
for link in links:
if not isinstance(link, dict):
continue
if link.get("title") == "wikipedia":
return link.get("url")
return None
def get_inventaire_id(links):
"""extract and format inventaire ids"""
if not isinstance(links, list):
return None
for link in links:
if not isinstance(link, dict):
continue
if link.get("title") == "inventaire.io":
iv_link = link.get("url")
return iv_link.split("/")[-1]
return None
def pick_default_edition(options):
"""favor physical copies with covers in english"""
if not options:

View file

@ -8,8 +8,20 @@ def site_settings(request): # pylint: disable=unused-argument
if not request.is_secure():
request_protocol = "http://"
site = models.SiteSettings.objects.get()
theme = "css/themes/bookwyrm-light.scss"
if (
hasattr(request, "user")
and request.user.is_authenticated
and request.user.theme
):
theme = request.user.theme.path
elif site.default_theme:
theme = site.default_theme.path
return {
"site": models.SiteSettings.objects.get(),
"site": site,
"site_theme": theme,
"active_announcements": models.Announcement.active_announcements(),
"thumbnail_generation_enabled": settings.ENABLE_THUMBNAIL_GENERATION,
"media_full_url": settings.MEDIA_FULL_URL,

View file

@ -10,14 +10,9 @@ from bookwyrm.settings import DOMAIN
def email_data():
"""fields every email needs"""
site = models.SiteSettings.objects.get()
if site.logo_small:
logo_path = f"/images/{site.logo_small.url}"
else:
logo_path = "/static/images/logo-small.png"
return {
"site_name": site.name,
"logo": logo_path,
"logo": site.logo_small_url,
"domain": DOMAIN,
"user": None,
}
@ -46,6 +41,20 @@ def password_reset_email(reset_code):
send_email.delay(reset_code.user.email, *format_email("password_reset", data))
def moderation_report_email(report):
"""a report was created"""
data = email_data()
data["reporter"] = report.reporter.localname or report.reporter.username
data["reportee"] = report.user.localname or report.user.username
data["report_link"] = report.remote_id
for admin in models.User.objects.filter(
groups__name__in=["admin", "moderator"]
).distinct():
data["user"] = admin.display_name
send_email.delay(admin.email, *format_email("moderation_report", data))
def format_email(email_name, data):
"""render the email templates"""
subject = get_template(f"email/{email_name}/subject.html").render(data).strip()
@ -62,7 +71,7 @@ def format_email(email_name, data):
def send_email(recipient, subject, html_content, text_content):
"""use a task to send the email"""
email = EmailMultiAlternatives(
subject, text_content, settings.DEFAULT_FROM_EMAIL, [recipient]
subject, text_content, settings.EMAIL_SENDER, [recipient]
)
email.attach_alternative(html_content, "text/html")
email.send()

View file

@ -1,337 +0,0 @@
""" using django model forms """
import datetime
from collections import defaultdict
from django import forms
from django.forms import ModelForm, PasswordInput, widgets, ChoiceField
from django.forms.widgets import Textarea
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from bookwyrm import models
class CustomForm(ModelForm):
"""add css classes to the forms"""
def __init__(self, *args, **kwargs):
css_classes = defaultdict(lambda: "")
css_classes["text"] = "input"
css_classes["password"] = "input"
css_classes["email"] = "input"
css_classes["number"] = "input"
css_classes["checkbox"] = "checkbox"
css_classes["textarea"] = "textarea"
# pylint: disable=super-with-arguments
super(CustomForm, self).__init__(*args, **kwargs)
for visible in self.visible_fields():
if hasattr(visible.field.widget, "input_type"):
input_type = visible.field.widget.input_type
if isinstance(visible.field.widget, Textarea):
input_type = "textarea"
visible.field.widget.attrs["rows"] = 5
visible.field.widget.attrs["class"] = css_classes[input_type]
# pylint: disable=missing-class-docstring
class LoginForm(CustomForm):
class Meta:
model = models.User
fields = ["localname", "password"]
help_texts = {f: None for f in fields}
widgets = {
"password": PasswordInput(),
}
class RegisterForm(CustomForm):
class Meta:
model = models.User
fields = ["localname", "email", "password"]
help_texts = {f: None for f in fields}
widgets = {"password": PasswordInput()}
class RatingForm(CustomForm):
class Meta:
model = models.ReviewRating
fields = ["user", "book", "rating", "privacy"]
class ReviewForm(CustomForm):
class Meta:
model = models.Review
fields = [
"user",
"book",
"name",
"content",
"rating",
"content_warning",
"sensitive",
"privacy",
]
class CommentForm(CustomForm):
class Meta:
model = models.Comment
fields = [
"user",
"book",
"content",
"content_warning",
"sensitive",
"privacy",
"progress",
"progress_mode",
"reading_status",
]
class QuotationForm(CustomForm):
class Meta:
model = models.Quotation
fields = [
"user",
"book",
"quote",
"content",
"content_warning",
"sensitive",
"privacy",
"position",
"position_mode",
]
class ReplyForm(CustomForm):
class Meta:
model = models.Status
fields = [
"user",
"content",
"content_warning",
"sensitive",
"reply_parent",
"privacy",
]
class StatusForm(CustomForm):
class Meta:
model = models.Status
fields = ["user", "content", "content_warning", "sensitive", "privacy"]
class DirectForm(CustomForm):
class Meta:
model = models.Status
fields = ["user", "content", "content_warning", "sensitive", "privacy"]
class EditUserForm(CustomForm):
class Meta:
model = models.User
fields = [
"avatar",
"name",
"email",
"summary",
"show_goal",
"show_suggested_users",
"manually_approves_followers",
"default_post_privacy",
"discoverable",
"preferred_timezone",
"preferred_language",
]
help_texts = {f: None for f in fields}
class LimitedEditUserForm(CustomForm):
class Meta:
model = models.User
fields = [
"avatar",
"name",
"summary",
"manually_approves_followers",
"discoverable",
]
help_texts = {f: None for f in fields}
class DeleteUserForm(CustomForm):
class Meta:
model = models.User
fields = ["password"]
class UserGroupForm(CustomForm):
class Meta:
model = models.User
fields = ["groups"]
class CoverForm(CustomForm):
class Meta:
model = models.Book
fields = ["cover"]
help_texts = {f: None for f in fields}
class EditionForm(CustomForm):
class Meta:
model = models.Edition
exclude = [
"remote_id",
"origin_id",
"created_date",
"updated_date",
"edition_rank",
"authors",
"parent_work",
"shelves",
"connector",
"search_vector",
]
class AuthorForm(CustomForm):
class Meta:
model = models.Author
exclude = [
"remote_id",
"origin_id",
"created_date",
"updated_date",
"search_vector",
]
class ImportForm(forms.Form):
csv_file = forms.FileField()
class ExpiryWidget(widgets.Select):
def value_from_datadict(self, data, files, name):
"""human-readable exiration time buckets"""
selected_string = super().value_from_datadict(data, files, name)
if selected_string == "day":
interval = datetime.timedelta(days=1)
elif selected_string == "week":
interval = datetime.timedelta(days=7)
elif selected_string == "month":
interval = datetime.timedelta(days=31) # Close enough?
elif selected_string == "forever":
return None
else:
return selected_string # This will raise
return timezone.now() + interval
class InviteRequestForm(CustomForm):
def clean(self):
"""make sure the email isn't in use by a registered user"""
cleaned_data = super().clean()
email = cleaned_data.get("email")
if email and models.User.objects.filter(email=email).exists():
self.add_error("email", _("A user with this email already exists."))
class Meta:
model = models.InviteRequest
fields = ["email"]
class CreateInviteForm(CustomForm):
class Meta:
model = models.SiteInvite
exclude = ["code", "user", "times_used", "invitees"]
widgets = {
"expiry": ExpiryWidget(
choices=[
("day", _("One Day")),
("week", _("One Week")),
("month", _("One Month")),
("forever", _("Does Not Expire")),
]
),
"use_limit": widgets.Select(
choices=[(i, _(f"{i} uses")) for i in [1, 5, 10, 25, 50, 100]]
+ [(None, _("Unlimited"))]
),
}
class ShelfForm(CustomForm):
class Meta:
model = models.Shelf
fields = ["user", "name", "privacy", "description"]
class GoalForm(CustomForm):
class Meta:
model = models.AnnualGoal
fields = ["user", "year", "goal", "privacy"]
class SiteForm(CustomForm):
class Meta:
model = models.SiteSettings
exclude = []
class AnnouncementForm(CustomForm):
class Meta:
model = models.Announcement
exclude = ["remote_id"]
class ListForm(CustomForm):
class Meta:
model = models.List
fields = ["user", "name", "description", "curation", "privacy"]
class ReportForm(CustomForm):
class Meta:
model = models.Report
fields = ["user", "reporter", "statuses", "note"]
class EmailBlocklistForm(CustomForm):
class Meta:
model = models.EmailBlocklist
fields = ["domain"]
class IPBlocklistForm(CustomForm):
class Meta:
model = models.IPBlocklist
fields = ["address"]
class ServerForm(CustomForm):
class Meta:
model = models.FederatedServer
exclude = ["remote_id"]
class SortListForm(forms.Form):
sort_by = ChoiceField(
choices=(
("order", _("List Order")),
("title", _("Book Title")),
("rating", _("Rating")),
),
label=_("Sort By"),
)
direction = ChoiceField(
choices=(
("ascending", _("Ascending")),
("descending", _("Descending")),
),
)

View file

@ -0,0 +1,12 @@
""" make forms available to the app """
# site admin
from .admin import *
from .author import *
from .books import *
from .edit_user import *
from .forms import *
from .groups import *
from .landing import *
from .links import *
from .lists import *
from .status import *

141
bookwyrm/forms/admin.py Normal file
View file

@ -0,0 +1,141 @@
""" using django model forms """
import datetime
from django import forms
from django.forms import widgets
from django.utils import timezone
from django.utils.translation import gettext_lazy as _
from django_celery_beat.models import IntervalSchedule
from bookwyrm import models
from .custom_form import CustomForm
# pylint: disable=missing-class-docstring
class ExpiryWidget(widgets.Select):
def value_from_datadict(self, data, files, name):
"""human-readable exiration time buckets"""
selected_string = super().value_from_datadict(data, files, name)
if selected_string == "day":
interval = datetime.timedelta(days=1)
elif selected_string == "week":
interval = datetime.timedelta(days=7)
elif selected_string == "month":
interval = datetime.timedelta(days=31) # Close enough?
elif selected_string == "forever":
return None
else:
return selected_string # This will raise
return timezone.now() + interval
class CreateInviteForm(CustomForm):
class Meta:
model = models.SiteInvite
exclude = ["code", "user", "times_used", "invitees"]
widgets = {
"expiry": ExpiryWidget(
choices=[
("day", _("One Day")),
("week", _("One Week")),
("month", _("One Month")),
("forever", _("Does Not Expire")),
]
),
"use_limit": widgets.Select(
choices=[(i, _(f"{i} uses")) for i in [1, 5, 10, 25, 50, 100]]
+ [(None, _("Unlimited"))]
),
}
class SiteForm(CustomForm):
class Meta:
model = models.SiteSettings
exclude = ["admin_code", "install_mode"]
widgets = {
"instance_short_description": forms.TextInput(
attrs={"aria-describedby": "desc_instance_short_description"}
),
"require_confirm_email": forms.CheckboxInput(
attrs={"aria-describedby": "desc_require_confirm_email"}
),
"invite_request_text": forms.Textarea(
attrs={"aria-describedby": "desc_invite_request_text"}
),
}
class ThemeForm(CustomForm):
class Meta:
model = models.Theme
fields = ["name", "path"]
widgets = {
"name": forms.TextInput(attrs={"aria-describedby": "desc_name"}),
"path": forms.TextInput(
attrs={
"aria-describedby": "desc_path",
"placeholder": "css/themes/theme-name.scss",
}
),
}
class AnnouncementForm(CustomForm):
class Meta:
model = models.Announcement
exclude = ["remote_id"]
widgets = {
"preview": forms.TextInput(attrs={"aria-describedby": "desc_preview"}),
"content": forms.Textarea(attrs={"aria-describedby": "desc_content"}),
"event_date": forms.SelectDateWidget(
attrs={"aria-describedby": "desc_event_date"}
),
"start_date": forms.SelectDateWidget(
attrs={"aria-describedby": "desc_start_date"}
),
"end_date": forms.SelectDateWidget(
attrs={"aria-describedby": "desc_end_date"}
),
"active": forms.CheckboxInput(attrs={"aria-describedby": "desc_active"}),
}
class EmailBlocklistForm(CustomForm):
class Meta:
model = models.EmailBlocklist
fields = ["domain"]
widgets = {
"avatar": forms.TextInput(attrs={"aria-describedby": "desc_domain"}),
}
class IPBlocklistForm(CustomForm):
class Meta:
model = models.IPBlocklist
fields = ["address"]
class ServerForm(CustomForm):
class Meta:
model = models.FederatedServer
exclude = ["remote_id"]
class AutoModRuleForm(CustomForm):
class Meta:
model = models.AutoMod
fields = ["string_match", "flag_users", "flag_statuses", "created_by"]
class IntervalScheduleForm(CustomForm):
class Meta:
model = IntervalSchedule
fields = ["every", "period"]
widgets = {
"every": forms.NumberInput(attrs={"aria-describedby": "desc_every"}),
"period": forms.Select(attrs={"aria-describedby": "desc_period"}),
}

47
bookwyrm/forms/author.py Normal file
View file

@ -0,0 +1,47 @@
""" using django model forms """
from django import forms
from bookwyrm import models
from .custom_form import CustomForm
# pylint: disable=missing-class-docstring
class AuthorForm(CustomForm):
class Meta:
model = models.Author
fields = [
"last_edited_by",
"name",
"aliases",
"bio",
"wikipedia_link",
"born",
"died",
"openlibrary_key",
"inventaire_id",
"librarything_key",
"goodreads_key",
"isni",
]
widgets = {
"name": forms.TextInput(attrs={"aria-describedby": "desc_name"}),
"aliases": forms.TextInput(attrs={"aria-describedby": "desc_aliases"}),
"bio": forms.Textarea(attrs={"aria-describedby": "desc_bio"}),
"wikipedia_link": forms.TextInput(
attrs={"aria-describedby": "desc_wikipedia_link"}
),
"born": forms.SelectDateWidget(attrs={"aria-describedby": "desc_born"}),
"died": forms.SelectDateWidget(attrs={"aria-describedby": "desc_died"}),
"oepnlibrary_key": forms.TextInput(
attrs={"aria-describedby": "desc_oepnlibrary_key"}
),
"inventaire_id": forms.TextInput(
attrs={"aria-describedby": "desc_inventaire_id"}
),
"librarything_key": forms.TextInput(
attrs={"aria-describedby": "desc_librarything_key"}
),
"goodreads_key": forms.TextInput(
attrs={"aria-describedby": "desc_goodreads_key"}
),
}

104
bookwyrm/forms/books.py Normal file
View file

@ -0,0 +1,104 @@
""" using django model forms """
from django import forms
from bookwyrm import models
from bookwyrm.models.fields import ClearableFileInputWithWarning
from .custom_form import CustomForm
from .widgets import ArrayWidget, SelectDateWidget, Select
# pylint: disable=missing-class-docstring
class CoverForm(CustomForm):
class Meta:
model = models.Book
fields = ["cover"]
help_texts = {f: None for f in fields}
class EditionForm(CustomForm):
class Meta:
model = models.Edition
exclude = [
"remote_id",
"origin_id",
"created_date",
"updated_date",
"edition_rank",
"authors",
"parent_work",
"shelves",
"connector",
"search_vector",
"links",
"file_links",
]
widgets = {
"title": forms.TextInput(attrs={"aria-describedby": "desc_title"}),
"subtitle": forms.TextInput(attrs={"aria-describedby": "desc_subtitle"}),
"description": forms.Textarea(
attrs={"aria-describedby": "desc_description"}
),
"series": forms.TextInput(attrs={"aria-describedby": "desc_series"}),
"series_number": forms.TextInput(
attrs={"aria-describedby": "desc_series_number"}
),
"subjects": ArrayWidget(),
"languages": forms.TextInput(
attrs={"aria-describedby": "desc_languages_help desc_languages"}
),
"publishers": forms.TextInput(
attrs={"aria-describedby": "desc_publishers_help desc_publishers"}
),
"first_published_date": SelectDateWidget(
attrs={"aria-describedby": "desc_first_published_date"}
),
"published_date": SelectDateWidget(
attrs={"aria-describedby": "desc_published_date"}
),
"cover": ClearableFileInputWithWarning(
attrs={"aria-describedby": "desc_cover"}
),
"physical_format": Select(
attrs={"aria-describedby": "desc_physical_format"}
),
"physical_format_detail": forms.TextInput(
attrs={"aria-describedby": "desc_physical_format_detail"}
),
"pages": forms.NumberInput(attrs={"aria-describedby": "desc_pages"}),
"isbn_13": forms.TextInput(attrs={"aria-describedby": "desc_isbn_13"}),
"isbn_10": forms.TextInput(attrs={"aria-describedby": "desc_isbn_10"}),
"openlibrary_key": forms.TextInput(
attrs={"aria-describedby": "desc_openlibrary_key"}
),
"inventaire_id": forms.TextInput(
attrs={"aria-describedby": "desc_inventaire_id"}
),
"oclc_number": forms.TextInput(
attrs={"aria-describedby": "desc_oclc_number"}
),
"ASIN": forms.TextInput(attrs={"aria-describedby": "desc_ASIN"}),
}
class EditionFromWorkForm(CustomForm):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# make all fields hidden
for visible in self.visible_fields():
visible.field.widget = forms.HiddenInput()
class Meta:
model = models.Work
fields = [
"title",
"subtitle",
"authors",
"description",
"languages",
"series",
"series_number",
"subjects",
"subject_places",
"cover",
"first_published_date",
]

View file

@ -0,0 +1,26 @@
""" Overrides django's default form class """
from collections import defaultdict
from django.forms import ModelForm
from django.forms.widgets import Textarea
class CustomForm(ModelForm):
"""add css classes to the forms"""
def __init__(self, *args, **kwargs):
css_classes = defaultdict(lambda: "")
css_classes["text"] = "input"
css_classes["password"] = "input"
css_classes["email"] = "input"
css_classes["number"] = "input"
css_classes["checkbox"] = "checkbox"
css_classes["textarea"] = "textarea"
# pylint: disable=super-with-arguments
super(CustomForm, self).__init__(*args, **kwargs)
for visible in self.visible_fields():
if hasattr(visible.field.widget, "input_type"):
input_type = visible.field.widget.input_type
if isinstance(visible.field.widget, Textarea):
input_type = "textarea"
visible.field.widget.attrs["rows"] = 5
visible.field.widget.attrs["class"] = css_classes[input_type]

View file

@ -0,0 +1,68 @@
""" using django model forms """
from django import forms
from bookwyrm import models
from bookwyrm.models.fields import ClearableFileInputWithWarning
from .custom_form import CustomForm
# pylint: disable=missing-class-docstring
class EditUserForm(CustomForm):
class Meta:
model = models.User
fields = [
"avatar",
"name",
"email",
"summary",
"show_goal",
"show_suggested_users",
"manually_approves_followers",
"default_post_privacy",
"discoverable",
"hide_follows",
"preferred_timezone",
"preferred_language",
"theme",
]
help_texts = {f: None for f in fields}
widgets = {
"avatar": ClearableFileInputWithWarning(
attrs={"aria-describedby": "desc_avatar"}
),
"name": forms.TextInput(attrs={"aria-describedby": "desc_name"}),
"summary": forms.Textarea(attrs={"aria-describedby": "desc_summary"}),
"email": forms.EmailInput(attrs={"aria-describedby": "desc_email"}),
"discoverable": forms.CheckboxInput(
attrs={"aria-describedby": "desc_discoverable"}
),
}
class LimitedEditUserForm(CustomForm):
class Meta:
model = models.User
fields = [
"avatar",
"name",
"summary",
"manually_approves_followers",
"discoverable",
]
help_texts = {f: None for f in fields}
widgets = {
"avatar": ClearableFileInputWithWarning(
attrs={"aria-describedby": "desc_avatar"}
),
"name": forms.TextInput(attrs={"aria-describedby": "desc_name"}),
"summary": forms.Textarea(attrs={"aria-describedby": "desc_summary"}),
"discoverable": forms.CheckboxInput(
attrs={"aria-describedby": "desc_discoverable"}
),
}
class DeleteUserForm(CustomForm):
class Meta:
model = models.User
fields = ["password"]

64
bookwyrm/forms/forms.py Normal file
View file

@ -0,0 +1,64 @@
""" using django model forms """
from django import forms
from django.forms import widgets
from django.utils.translation import gettext_lazy as _
from bookwyrm import models
from bookwyrm.models.user import FeedFilterChoices
from .custom_form import CustomForm
# pylint: disable=missing-class-docstring
class FeedStatusTypesForm(CustomForm):
class Meta:
model = models.User
fields = ["feed_status_types"]
help_texts = {f: None for f in fields}
widgets = {
"feed_status_types": widgets.CheckboxSelectMultiple(
choices=FeedFilterChoices,
),
}
class ImportForm(forms.Form):
csv_file = forms.FileField()
class ShelfForm(CustomForm):
class Meta:
model = models.Shelf
fields = ["user", "name", "privacy", "description"]
class GoalForm(CustomForm):
class Meta:
model = models.AnnualGoal
fields = ["user", "year", "goal", "privacy"]
class ReportForm(CustomForm):
class Meta:
model = models.Report
fields = ["user", "reporter", "status", "links", "note"]
class ReadThroughForm(CustomForm):
def clean(self):
"""don't let readthroughs end before they start"""
cleaned_data = super().clean()
start_date = cleaned_data.get("start_date")
finish_date = cleaned_data.get("finish_date")
if start_date and finish_date and start_date > finish_date:
self.add_error(
"finish_date", _("Reading finish date cannot be before start date.")
)
stopped_date = cleaned_data.get("stopped_date")
if start_date and stopped_date and start_date > stopped_date:
self.add_error(
"stopped_date", _("Reading stopped date cannot be before start date.")
)
class Meta:
model = models.ReadThrough
fields = ["user", "book", "start_date", "finish_date", "stopped_date"]

16
bookwyrm/forms/groups.py Normal file
View file

@ -0,0 +1,16 @@
""" using django model forms """
from bookwyrm import models
from .custom_form import CustomForm
# pylint: disable=missing-class-docstring
class UserGroupForm(CustomForm):
class Meta:
model = models.User
fields = ["groups"]
class GroupForm(CustomForm):
class Meta:
model = models.Group
fields = ["user", "privacy", "name", "description"]

45
bookwyrm/forms/landing.py Normal file
View file

@ -0,0 +1,45 @@
""" Forms for the landing pages """
from django.forms import PasswordInput
from django.utils.translation import gettext_lazy as _
from bookwyrm import models
from .custom_form import CustomForm
# pylint: disable=missing-class-docstring
class LoginForm(CustomForm):
class Meta:
model = models.User
fields = ["localname", "password"]
help_texts = {f: None for f in fields}
widgets = {
"password": PasswordInput(),
}
class RegisterForm(CustomForm):
class Meta:
model = models.User
fields = ["localname", "email", "password"]
help_texts = {f: None for f in fields}
widgets = {"password": PasswordInput()}
def clean(self):
"""Check if the username is taken"""
cleaned_data = super().clean()
localname = cleaned_data.get("localname").strip()
if models.User.objects.filter(localname=localname).first():
self.add_error("localname", _("User with this username already exists"))
class InviteRequestForm(CustomForm):
def clean(self):
"""make sure the email isn't in use by a registered user"""
cleaned_data = super().clean()
email = cleaned_data.get("email")
if email and models.User.objects.filter(email=email).exists():
self.add_error("email", _("A user with this email already exists."))
class Meta:
model = models.InviteRequest
fields = ["email", "answer"]

48
bookwyrm/forms/links.py Normal file
View file

@ -0,0 +1,48 @@
""" using django model forms """
from urllib.parse import urlparse
from django.utils.translation import gettext_lazy as _
from bookwyrm import models
from .custom_form import CustomForm
# pylint: disable=missing-class-docstring
class LinkDomainForm(CustomForm):
class Meta:
model = models.LinkDomain
fields = ["name"]
class FileLinkForm(CustomForm):
class Meta:
model = models.FileLink
fields = ["url", "filetype", "availability", "book", "added_by"]
def clean(self):
"""make sure the domain isn't blocked or pending"""
cleaned_data = super().clean()
url = cleaned_data.get("url")
filetype = cleaned_data.get("filetype")
book = cleaned_data.get("book")
domain = urlparse(url).netloc
if models.LinkDomain.objects.filter(domain=domain).exists():
status = models.LinkDomain.objects.get(domain=domain).status
if status == "blocked":
# pylint: disable=line-too-long
self.add_error(
"url",
_(
"This domain is blocked. Please contact your administrator if you think this is an error."
),
)
elif models.FileLink.objects.filter(
url=url, book=book, filetype=filetype
).exists():
# pylint: disable=line-too-long
self.add_error(
"url",
_(
"This link with file type has already been added for this book. If it is not visible, the domain is still pending."
),
)

37
bookwyrm/forms/lists.py Normal file
View file

@ -0,0 +1,37 @@
""" using django model forms """
from django import forms
from django.forms import ChoiceField
from django.utils.translation import gettext_lazy as _
from bookwyrm import models
from .custom_form import CustomForm
# pylint: disable=missing-class-docstring
class ListForm(CustomForm):
class Meta:
model = models.List
fields = ["user", "name", "description", "curation", "privacy", "group"]
class ListItemForm(CustomForm):
class Meta:
model = models.ListItem
fields = ["user", "book", "book_list", "notes"]
class SortListForm(forms.Form):
sort_by = ChoiceField(
choices=(
("order", _("List Order")),
("title", _("Book Title")),
("rating", _("Rating")),
),
label=_("Sort By"),
)
direction = ChoiceField(
choices=(
("ascending", _("Ascending")),
("descending", _("Descending")),
),
)

82
bookwyrm/forms/status.py Normal file
View file

@ -0,0 +1,82 @@
""" using django model forms """
from bookwyrm import models
from .custom_form import CustomForm
# pylint: disable=missing-class-docstring
class RatingForm(CustomForm):
class Meta:
model = models.ReviewRating
fields = ["user", "book", "rating", "privacy"]
class ReviewForm(CustomForm):
class Meta:
model = models.Review
fields = [
"user",
"book",
"name",
"content",
"rating",
"content_warning",
"sensitive",
"privacy",
]
class CommentForm(CustomForm):
class Meta:
model = models.Comment
fields = [
"user",
"book",
"content",
"content_warning",
"sensitive",
"privacy",
"progress",
"progress_mode",
"reading_status",
]
class QuotationForm(CustomForm):
class Meta:
model = models.Quotation
fields = [
"user",
"book",
"quote",
"content",
"content_warning",
"sensitive",
"privacy",
"position",
"position_mode",
]
class ReplyForm(CustomForm):
class Meta:
model = models.Status
fields = [
"user",
"content",
"content_warning",
"sensitive",
"reply_parent",
"privacy",
]
class StatusForm(CustomForm):
class Meta:
model = models.Status
fields = ["user", "content", "content_warning", "sensitive", "privacy"]
class DirectForm(CustomForm):
class Meta:
model = models.Status
fields = ["user", "content", "content_warning", "sensitive", "privacy"]

70
bookwyrm/forms/widgets.py Normal file
View file

@ -0,0 +1,70 @@
""" using django model forms """
from django import forms
class ArrayWidget(forms.widgets.TextInput):
"""Inputs for postgres array fields"""
# pylint: disable=unused-argument
# pylint: disable=no-self-use
def value_from_datadict(self, data, files, name):
"""get all values for this name"""
return [i for i in data.getlist(name) if i]
class Select(forms.Select):
"""custom template for select widget"""
template_name = "widgets/select.html"
class SelectDateWidget(forms.SelectDateWidget):
"""
A widget that splits date input into two <select> boxes and a numerical year.
"""
template_name = "widgets/addon_multiwidget.html"
select_widget = Select
def get_context(self, name, value, attrs):
"""sets individual widgets"""
context = super().get_context(name, value, attrs)
date_context = {}
year_name = self.year_field % name
date_context["year"] = forms.NumberInput().get_context(
name=year_name,
value=context["widget"]["value"]["year"],
attrs={
**context["widget"]["attrs"],
"id": f"id_{year_name}",
"class": "input",
},
)
month_choices = list(self.months.items())
if not self.is_required:
month_choices.insert(0, self.month_none_value)
month_name = self.month_field % name
date_context["month"] = self.select_widget(
attrs, choices=month_choices
).get_context(
name=month_name,
value=context["widget"]["value"]["month"],
attrs={**context["widget"]["attrs"], "id": f"id_{month_name}"},
)
day_choices = [(i, i) for i in range(1, 32)]
if not self.is_required:
day_choices.insert(0, self.day_none_value)
day_name = self.day_field % name
date_context["day"] = self.select_widget(
attrs,
choices=day_choices,
).get_context(
name=day_name,
value=context["widget"]["value"]["day"],
attrs={**context["widget"]["attrs"], "id": f"id_{day_name}"},
)
subwidgets = []
for field in self._parse_date_fmt():
subwidgets.append(date_context[field]["widget"])
context["widget"]["subwidgets"] = subwidgets
return context

View file

@ -1,6 +1,8 @@
""" import classes """
from .importer import Importer
from .calibre_import import CalibreImporter
from .goodreads_import import GoodreadsImporter
from .librarything_import import LibrarythingImporter
from .openlibrary_import import OpenLibraryImporter
from .storygraph_import import StorygraphImporter

View file

@ -0,0 +1,28 @@
""" handle reading a csv from calibre """
from bookwyrm.models import Shelf
from . import Importer
class CalibreImporter(Importer):
"""csv downloads from Calibre"""
service = "Calibre"
def __init__(self, *args, **kwargs):
# Add timestamp to row_mappings_guesses for date_added to avoid
# integrity error
row_mappings_guesses = []
for field, mapping in self.row_mappings_guesses:
if field in ("date_added",):
row_mappings_guesses.append((field, mapping + ["timestamp"]))
else:
row_mappings_guesses.append((field, mapping))
self.row_mappings_guesses = row_mappings_guesses
super().__init__(*args, **kwargs)
def get_shelf(self, normalized_row):
# Calibre export does not indicate which shelf to use. Go with a default one for now
return Shelf.TO_READ

View file

@ -3,14 +3,7 @@ from . import Importer
class GoodreadsImporter(Importer):
"""GoodReads is the default importer, thus Importer follows its structure.
"""Goodreads is the default importer, thus Importer follows its structure.
For a more complete example of overriding see librarything_import.py"""
service = "GoodReads"
def parse_fields(self, entry):
"""handle the specific fields in goodreads csvs"""
entry.update({"import_source": self.service})
# add missing 'Date Started' field
entry.update({"Date Started": None})
return entry
service = "Goodreads"

View file

@ -1,4 +1,4 @@
""" handle reading a csv from an external service, defaults are from GoodReads """
""" handle reading a csv from an external service, defaults are from Goodreads """
import csv
import logging
@ -7,7 +7,7 @@ from django.utils.translation import gettext_lazy as _
from bookwyrm import models
from bookwyrm.models import ImportJob, ImportItem
from bookwyrm.tasks import app
from bookwyrm.tasks import app, LOW
logger = logging.getLogger(__name__)
@ -15,33 +15,93 @@ logger = logging.getLogger(__name__)
class Importer:
"""Generic class for csv data import from an outside service"""
service = "Unknown"
service = "Import"
delimiter = ","
encoding = "UTF-8"
mandatory_fields = ["Title", "Author"]
# these are from Goodreads
row_mappings_guesses = [
("id", ["id", "book id"]),
("title", ["title"]),
("authors", ["author", "authors", "primary author"]),
("isbn_10", ["isbn10", "isbn"]),
("isbn_13", ["isbn13", "isbn", "isbns"]),
("shelf", ["shelf", "exclusive shelf", "read status", "bookshelf"]),
("review_name", ["review name"]),
("review_body", ["my review", "review"]),
("rating", ["my rating", "rating", "star rating"]),
("date_added", ["date added", "entry date", "added"]),
("date_started", ["date started", "started"]),
("date_finished", ["date finished", "last date read", "date read", "finished"]),
]
date_fields = ["date_added", "date_started", "date_finished"]
shelf_mapping_guesses = {
"to-read": ["to-read", "want to read"],
"read": ["read", "already read"],
"reading": ["currently-reading", "reading", "currently reading"],
}
def create_job(self, user, csv_file, include_reviews, privacy):
"""check over a csv and creates a database entry for the job"""
csv_reader = csv.DictReader(csv_file, delimiter=self.delimiter)
rows = enumerate(list(csv_reader))
job = ImportJob.objects.create(
user=user, include_reviews=include_reviews, privacy=privacy
user=user,
include_reviews=include_reviews,
privacy=privacy,
mappings=self.create_row_mappings(csv_reader.fieldnames),
source=self.service,
)
for index, entry in enumerate(
list(csv.DictReader(csv_file, delimiter=self.delimiter))
):
if not all(x in entry for x in self.mandatory_fields):
raise ValueError("Author and title must be in data.")
entry = self.parse_fields(entry)
self.save_item(job, index, entry)
for index, entry in rows:
self.create_item(job, index, entry)
return job
def save_item(self, job, index, data): # pylint: disable=no-self-use
"""creates and saves an import item"""
ImportItem(job=job, index=index, data=data).save()
def update_legacy_job(self, job):
"""patch up a job that was in the old format"""
items = job.items
headers = list(items.first().data.keys())
job.mappings = self.create_row_mappings(headers)
job.updated_date = timezone.now()
job.save()
def parse_fields(self, entry):
"""updates csv data with additional info"""
entry.update({"import_source": self.service})
return entry
for item in items.all():
normalized = self.normalize_row(item.data, job.mappings)
normalized["shelf"] = self.get_shelf(normalized)
item.normalized_data = normalized
item.save()
def create_row_mappings(self, headers):
"""guess what the headers mean"""
mappings = {}
for (key, guesses) in self.row_mappings_guesses:
value = [h for h in headers if h.lower() in guesses]
value = value[0] if len(value) else None
if value:
headers.remove(value)
mappings[key] = value
return mappings
def create_item(self, job, index, data):
"""creates and saves an import item"""
normalized = self.normalize_row(data, job.mappings)
normalized["shelf"] = self.get_shelf(normalized)
ImportItem(job=job, index=index, data=data, normalized_data=normalized).save()
def get_shelf(self, normalized_row):
"""determine which shelf to use"""
shelf_name = normalized_row.get("shelf")
if not shelf_name:
return None
shelf_name = shelf_name.lower()
shelf = [
s for (s, gs) in self.shelf_mapping_guesses.items() if shelf_name in gs
]
return shelf[0] if shelf else None
def normalize_row(self, entry, mappings): # pylint: disable=no-self-use
"""use the dataclass to create the formatted row of data"""
return {k: entry.get(v) for k, v in mappings.items()}
def create_retry_job(self, user, original_job, items):
"""retry items that didn't import"""
@ -49,55 +109,66 @@ class Importer:
user=user,
include_reviews=original_job.include_reviews,
privacy=original_job.privacy,
source=original_job.source,
# TODO: allow users to adjust mappings
mappings=original_job.mappings,
retry=True,
)
for item in items:
self.save_item(job, item.index, item.data)
# this will re-normalize the raw data
self.create_item(job, item.index, item.data)
return job
def start_import(self, job):
def start_import(self, job): # pylint: disable=no-self-use
"""initalizes a csv import job"""
result = import_data.delay(self.service, job.id)
result = start_import_task.delay(job.id)
job.task_id = result.id
job.save()
@app.task(queue="low_priority")
def import_data(source, job_id):
"""does the actual lookup work in a celery task"""
def start_import_task(job_id):
"""trigger the child tasks for each row"""
job = ImportJob.objects.get(id=job_id)
# these are sub-tasks so that one big task doesn't use up all the memory in celery
for item in job.items.values_list("id", flat=True).all():
import_item_task.delay(item)
@app.task(queue="low_priority")
def import_item_task(item_id):
"""resolve a row into a book"""
item = models.ImportItem.objects.get(id=item_id)
try:
for item in job.items.all():
try:
item.resolve()
except Exception as err: # pylint: disable=broad-except
logger.exception(err)
item.fail_reason = _("Error loading book")
item.save()
continue
item.resolve()
except Exception as err: # pylint: disable=broad-except
item.fail_reason = _("Error loading book")
item.save()
item.update_job()
raise err
if item.book or item.book_guess:
item.save()
if item.book:
# shelves book and handles reviews
handle_imported_book(item)
else:
item.fail_reason = _("Could not find a match for book")
if item.book:
# shelves book and handles reviews
handle_imported_book(
source, job.user, item, job.include_reviews, job.privacy
)
else:
item.fail_reason = _("Could not find a match for book")
item.save()
finally:
job.complete = True
job.save()
item.save()
item.update_job()
def handle_imported_book(source, user, item, include_reviews, privacy):
def handle_imported_book(item):
"""process a csv and then post about it"""
job = item.job
user = job.user
if isinstance(item.book, models.Work):
item.book = item.book.default_edition
if not item.book:
item.fail_reason = _("Error loading book")
item.save()
return
if not isinstance(item.book, models.Edition):
item.book = item.book.edition
existing_shelf = models.ShelfBook.objects.filter(book=item.book, user=user).exists()
@ -105,9 +176,9 @@ def handle_imported_book(source, user, item, include_reviews, privacy):
if item.shelf and not existing_shelf:
desired_shelf = models.Shelf.objects.get(identifier=item.shelf, user=user)
shelved_date = item.date_added or timezone.now()
models.ShelfBook.objects.create(
models.ShelfBook(
book=item.book, shelf=desired_shelf, user=user, shelved_date=shelved_date
)
).save(priority=LOW)
for read in item.reads:
# check for an existing readthrough with the same dates
@ -122,35 +193,52 @@ def handle_imported_book(source, user, item, include_reviews, privacy):
read.user = user
read.save()
if include_reviews and (item.rating or item.review):
if job.include_reviews and (item.rating or item.review) and not item.linked_review:
# we don't know the publication date of the review,
# but "now" is a bad guess
published_date_guess = item.date_read or item.date_added
if item.review:
# pylint: disable=consider-using-f-string
review_title = (
"Review of {!r} on {!r}".format(
item.book.title,
source,
)
if item.review
else ""
review_title = "Review of {!r} on {!r}".format(
item.book.title,
job.source,
)
models.Review.objects.create(
review = models.Review.objects.filter(
user=user,
book=item.book,
name=review_title,
content=item.review,
rating=item.rating,
published_date=published_date_guess,
privacy=privacy,
)
).first()
if not review:
review = models.Review(
user=user,
book=item.book,
name=review_title,
content=item.review,
rating=item.rating,
published_date=published_date_guess,
privacy=job.privacy,
)
review.save(software="bookwyrm", priority=LOW)
else:
# just a rating
models.ReviewRating.objects.create(
review = models.ReviewRating.objects.filter(
user=user,
book=item.book,
rating=item.rating,
published_date=published_date_guess,
privacy=privacy,
)
rating=item.rating,
).first()
if not review:
review = models.ReviewRating(
user=user,
book=item.book,
rating=item.rating,
published_date=published_date_guess,
privacy=job.privacy,
)
review.save(software="bookwyrm", priority=LOW)
# only broadcast this review to other bookwyrm instances
item.linked_review = review
item.save()

View file

@ -1,6 +1,7 @@
""" handle reading a csv from librarything """
""" handle reading a tsv from librarything """
import re
import math
from bookwyrm.models import Shelf
from . import Importer
@ -11,32 +12,19 @@ class LibrarythingImporter(Importer):
service = "LibraryThing"
delimiter = "\t"
encoding = "ISO-8859-1"
# mandatory_fields : fields matching the book title and author
mandatory_fields = ["Title", "Primary Author"]
def parse_fields(self, entry):
"""custom parsing for librarything"""
data = {}
data["import_source"] = self.service
data["Book Id"] = entry["Book Id"]
data["Title"] = entry["Title"]
data["Author"] = entry["Primary Author"]
data["ISBN13"] = entry["ISBN"]
data["My Review"] = entry["Review"]
if entry["Rating"]:
data["My Rating"] = math.ceil(float(entry["Rating"]))
else:
data["My Rating"] = ""
data["Date Added"] = re.sub(r"\[|\]", "", entry["Entry Date"])
data["Date Started"] = re.sub(r"\[|\]", "", entry["Date Started"])
data["Date Read"] = re.sub(r"\[|\]", "", entry["Date Read"])
def normalize_row(self, entry, mappings): # pylint: disable=no-self-use
"""use the dataclass to create the formatted row of data"""
remove_brackets = lambda v: re.sub(r"\[|\]", "", v) if v else None
normalized = {k: remove_brackets(entry.get(v)) for k, v in mappings.items()}
isbn_13 = normalized.get("isbn_13")
isbn_13 = isbn_13.split(", ") if isbn_13 else []
normalized["isbn_13"] = isbn_13[1] if len(isbn_13) > 0 else None
return normalized
data["Exclusive Shelf"] = None
if data["Date Read"]:
data["Exclusive Shelf"] = "read"
elif data["Date Started"]:
data["Exclusive Shelf"] = "reading"
else:
data["Exclusive Shelf"] = "to-read"
return data
def get_shelf(self, normalized_row):
if normalized_row["date_finished"]:
return Shelf.READ_FINISHED
if normalized_row["date_started"]:
return Shelf.READING
return Shelf.TO_READ

View file

@ -0,0 +1,13 @@
""" handle reading a csv from openlibrary"""
from . import Importer
class OpenLibraryImporter(Importer):
"""csv downloads from OpenLibrary"""
service = "OpenLibrary"
def __init__(self, *args, **kwargs):
self.row_mappings_guesses.append(("openlibrary_key", ["edition id"]))
self.row_mappings_guesses.append(("openlibrary_work_key", ["work id"]))
super().__init__(*args, **kwargs)

View file

@ -1,34 +1,8 @@
""" handle reading a csv from librarything """
import re
import math
""" handle reading a csv from storygraph"""
from . import Importer
class StorygraphImporter(Importer):
"""csv downloads from librarything"""
"""csv downloads from Storygraph"""
service = "Storygraph"
# mandatory_fields : fields matching the book title and author
mandatory_fields = ["Title"]
def parse_fields(self, entry):
"""custom parsing for storygraph"""
data = {}
data["import_source"] = self.service
data["Title"] = entry["Title"]
data["Author"] = entry["Authors"] if "Authors" in entry else entry["Author"]
data["ISBN13"] = entry["ISBN"]
data["My Review"] = entry["Review"]
if entry["Star Rating"]:
data["My Rating"] = math.ceil(float(entry["Star Rating"]))
else:
data["My Rating"] = ""
data["Date Added"] = re.sub(r"[/]", "-", entry["Date Added"])
data["Date Read"] = re.sub(r"[/]", "-", entry["Last Date Read"])
data["Exclusive Shelf"] = (
{"read": "read", "currently-reading": "reading", "to-read": "to-read"}
).get(entry["Read Status"], None)
return data

251
bookwyrm/lists_stream.py Normal file
View file

@ -0,0 +1,251 @@
""" access the list streams stored in redis """
from django.dispatch import receiver
from django.db import transaction
from django.db.models import signals, Count, Q
from bookwyrm import models
from bookwyrm.redis_store import RedisStore
from bookwyrm.tasks import app, MEDIUM, HIGH
class ListsStream(RedisStore):
"""all the lists you can see"""
def stream_id(self, user): # pylint: disable=no-self-use
"""the redis key for this user's instance of this stream"""
if isinstance(user, int):
# allows the function to take an int or an obj
return f"{user}-lists"
return f"{user.id}-lists"
def get_rank(self, obj): # pylint: disable=no-self-use
"""lists are sorted by updated date"""
return obj.updated_date.timestamp()
def add_list(self, book_list):
"""add a list to users' feeds"""
# the pipeline contains all the add-to-stream activities
self.add_object_to_related_stores(book_list)
def add_user_lists(self, viewer, user):
"""add a user's lists to another user's feed"""
# only add the lists that the viewer should be able to see
lists = models.List.privacy_filter(viewer).filter(user=user)
self.bulk_add_objects_to_store(lists, self.stream_id(viewer))
def remove_user_lists(self, viewer, user, exclude_privacy=None):
"""remove a user's list from another user's feed"""
# remove all so that followers only lists are removed
lists = user.list_set
if exclude_privacy:
lists = lists.exclude(privacy=exclude_privacy)
self.bulk_remove_objects_from_store(lists.all(), self.stream_id(viewer))
def get_list_stream(self, user):
"""load the lists to be displayed"""
lists = self.get_store(self.stream_id(user))
return (
models.List.objects.filter(id__in=lists)
.annotate(item_count=Count("listitem", filter=Q(listitem__approved=True)))
# hide lists with no approved books
.filter(item_count__gt=0)
.select_related("user")
.prefetch_related("listitem_set")
.order_by("-updated_date")
.distinct()
)
def populate_lists(self, user):
"""go from zero to a timeline"""
self.populate_store(self.stream_id(user))
def get_audience(self, book_list): # pylint: disable=no-self-use
"""given a list, what users should see it"""
# everybody who could plausibly see this list
audience = models.User.objects.filter(
is_active=True,
local=True, # we only create feeds for users of this instance
).exclude( # not blocked
Q(id__in=book_list.user.blocks.all()) | Q(blocks=book_list.user)
)
group = book_list.group
# only visible to the poster and mentioned users
if book_list.privacy == "direct":
if group:
audience = audience.filter(
Q(id=book_list.user.id) # if the user is the post's author
| ~Q(groups=group.memberships) # if the user is in the group
)
else:
audience = audience.filter(
Q(id=book_list.user.id) # if the user is the post's author
)
# only visible to the poster's followers and tagged users
elif book_list.privacy == "followers":
if group:
audience = audience.filter(
Q(id=book_list.user.id) # if the user is the list's owner
| Q(following=book_list.user) # if the user is following the pwmer
# if a user is in the group
| Q(memberships__group__id=book_list.group.id)
)
else:
audience = audience.filter(
Q(id=book_list.user.id) # if the user is the list's owner
| Q(following=book_list.user) # if the user is following the pwmer
)
return audience.distinct()
def get_stores_for_object(self, obj):
return [self.stream_id(u) for u in self.get_audience(obj)]
def get_lists_for_user(self, user): # pylint: disable=no-self-use
"""given a user, what lists should they see on this stream"""
return models.List.privacy_filter(
user,
privacy_levels=["public", "followers"],
)
def get_objects_for_store(self, store):
user = models.User.objects.get(id=store.split("-")[0])
return self.get_lists_for_user(user)
@receiver(signals.post_save, sender=models.List)
# pylint: disable=unused-argument
def add_list_on_create(sender, instance, created, *args, **kwargs):
"""add newly created lists streamsstreams"""
if not created:
return
# when creating new things, gotta wait on the transaction
transaction.on_commit(lambda: add_list_on_create_command(instance.id))
@receiver(signals.post_delete, sender=models.List)
# pylint: disable=unused-argument
def remove_list_on_delete(sender, instance, *args, **kwargs):
"""remove deleted lists to streams"""
remove_list_task.delay(instance.id)
def add_list_on_create_command(instance_id):
"""runs this code only after the database commit completes"""
add_list_task.delay(instance_id)
@receiver(signals.post_save, sender=models.UserFollows)
# pylint: disable=unused-argument
def add_lists_on_follow(sender, instance, created, *args, **kwargs):
"""add a newly followed user's lists to feeds"""
if not created or not instance.user_subject.local:
return
add_user_lists_task.delay(instance.user_subject.id, instance.user_object.id)
@receiver(signals.post_delete, sender=models.UserFollows)
# pylint: disable=unused-argument
def remove_lists_on_unfollow(sender, instance, *args, **kwargs):
"""remove lists from a feed on unfollow"""
if not instance.user_subject.local:
return
# remove all but public lists
remove_user_lists_task.delay(
instance.user_subject.id, instance.user_object.id, exclude_privacy="public"
)
@receiver(signals.post_save, sender=models.UserBlocks)
# pylint: disable=unused-argument
def remove_lists_on_block(sender, instance, *args, **kwargs):
"""remove lists from all feeds on block"""
# blocks apply ot all feeds
if instance.user_subject.local:
remove_user_lists_task.delay(instance.user_subject.id, instance.user_object.id)
# and in both directions
if instance.user_object.local:
remove_user_lists_task.delay(instance.user_object.id, instance.user_subject.id)
@receiver(signals.post_delete, sender=models.UserBlocks)
# pylint: disable=unused-argument
def add_lists_on_unblock(sender, instance, *args, **kwargs):
"""add lists back to all feeds on unblock"""
# make sure there isn't a block in the other direction
if models.UserBlocks.objects.filter(
user_subject=instance.user_object,
user_object=instance.user_subject,
).exists():
return
# add lists back to streams with lists from anyone
if instance.user_subject.local:
add_user_lists_task.delay(
instance.user_subject.id,
instance.user_object.id,
)
# add lists back to streams with lists from anyone
if instance.user_object.local:
add_user_lists_task.delay(
instance.user_object.id,
instance.user_subject.id,
)
@receiver(signals.post_save, sender=models.User)
# pylint: disable=unused-argument
def populate_lists_on_account_create(sender, instance, created, *args, **kwargs):
"""build a user's feeds when they join"""
if not created or not instance.local:
return
transaction.on_commit(lambda: add_list_on_account_create_command(instance.id))
def add_list_on_account_create_command(user_id):
"""wait for the transaction to complete"""
populate_lists_task.delay(user_id)
# ---- TASKS
@app.task(queue=MEDIUM)
def populate_lists_task(user_id):
"""background task for populating an empty list stream"""
user = models.User.objects.get(id=user_id)
ListsStream().populate_lists(user)
@app.task(queue=MEDIUM)
def remove_list_task(list_id):
"""remove a list from any stream it might be in"""
stores = models.User.objects.filter(local=True, is_active=True).values_list(
"id", flat=True
)
# delete for every store
stores = [ListsStream().stream_id(idx) for idx in stores]
ListsStream().remove_object_from_related_stores(list_id, stores=stores)
@app.task(queue=HIGH)
def add_list_task(list_id):
"""add a list to any stream it should be in"""
book_list = models.List.objects.get(id=list_id)
ListsStream().add_list(book_list)
@app.task(queue=MEDIUM)
def remove_user_lists_task(viewer_id, user_id, exclude_privacy=None):
"""remove all lists by a user from a viewer's stream"""
viewer = models.User.objects.get(id=viewer_id)
user = models.User.objects.get(id=user_id)
ListsStream().remove_user_lists(viewer, user, exclude_privacy=exclude_privacy)
@app.task(queue=MEDIUM)
def add_user_lists_task(viewer_id, user_id):
"""add all lists by a user to a viewer's stream"""
viewer = models.User.objects.get(id=viewer_id)
user = models.User.objects.get(id=user_id)
ListsStream().add_user_lists(viewer, user)

View file

@ -0,0 +1,23 @@
""" Get your admin code to allow install """
from django.core.management.base import BaseCommand
from bookwyrm import models
def get_admin_code():
"""get that code"""
return models.SiteSettings.objects.get().admin_code
class Command(BaseCommand):
"""command-line options"""
help = "Gets admin code for configuring BookWyrm"
# pylint: disable=unused-argument
def handle(self, *args, **options):
"""execute init"""
self.stdout.write("*******************************************")
self.stdout.write("Use this code to create your admin account:")
self.stdout.write(get_admin_code())
self.stdout.write("*******************************************")

View file

@ -5,7 +5,10 @@ import redis
from bookwyrm import settings
r = redis.Redis(
host=settings.REDIS_ACTIVITY_HOST, port=settings.REDIS_ACTIVITY_PORT, db=0
host=settings.REDIS_ACTIVITY_HOST,
port=settings.REDIS_ACTIVITY_PORT,
password=settings.REDIS_ACTIVITY_PASSWORD,
db=settings.REDIS_ACTIVITY_DB_INDEX,
)

View file

@ -10,7 +10,9 @@ class Command(BaseCommand):
help = "Generate preview images"
# pylint: disable=no-self-use
def add_arguments(self, parser):
"""options for how the command is run"""
parser.add_argument(
"--all",
"-a",
@ -38,6 +40,7 @@ class Command(BaseCommand):
preview_images.generate_site_preview_image_task.delay()
self.stdout.write(" OK 🖼")
# pylint: disable=consider-using-f-string
if options["all"]:
# Users
users = models.User.objects.filter(
@ -53,12 +56,17 @@ class Command(BaseCommand):
self.stdout.write(" OK 🖼")
# Books
books = models.Book.objects.select_subclasses().filter()
self.stdout.write(
" → Book preview images ({}): ".format(len(books)), ending=""
book_ids = (
models.Book.objects.select_subclasses()
.filter()
.values_list("id", flat=True)
)
for book in books:
preview_images.generate_edition_preview_image_task.delay(book.id)
self.stdout.write(
" → Book preview images ({}): ".format(len(book_ids)), ending=""
)
for book_id in book_ids:
preview_images.generate_edition_preview_image_task.delay(book_id)
self.stdout.write(".", ending="")
self.stdout.write(" OK 🖼")

View file

@ -3,7 +3,7 @@ from django.core.management.base import BaseCommand
from django.contrib.auth.models import Group, Permission
from django.contrib.contenttypes.models import ContentType
from bookwyrm.models import Connector, FederatedServer, SiteSettings, User
from bookwyrm import models
def init_groups():
@ -19,9 +19,7 @@ def init_permissions():
{
"codename": "edit_instance_settings",
"name": "change the instance info",
"groups": [
"admin",
],
"groups": ["admin"],
},
{
"codename": "set_user_group",
@ -55,7 +53,7 @@ def init_permissions():
},
]
content_type = ContentType.objects.get_for_model(User)
content_type = ContentType.objects.get_for_model(models.User)
for permission in permissions:
permission_obj = Permission.objects.create(
codename=permission["codename"],
@ -66,15 +64,12 @@ def init_permissions():
for group_name in permission["groups"]:
Group.objects.get(name=group_name).permissions.add(permission_obj)
# while the groups and permissions shouldn't be changed because the code
# depends on them, what permissions go with what groups should be editable
def init_connectors():
"""access book data sources"""
Connector.objects.create(
models.Connector.objects.create(
identifier="bookwyrm.social",
name="BookWyrm dot Social",
name="Bookwyrm.social",
connector_file="bookwyrm_connector",
base_url="https://bookwyrm.social",
books_url="https://bookwyrm.social/book",
@ -84,7 +79,8 @@ def init_connectors():
priority=2,
)
Connector.objects.create(
# pylint: disable=line-too-long
models.Connector.objects.create(
identifier="inventaire.io",
name="Inventaire",
connector_file="inventaire",
@ -93,10 +89,10 @@ def init_connectors():
covers_url="https://inventaire.io",
search_url="https://inventaire.io/api/search?types=works&types=works&search=",
isbn_search_url="https://inventaire.io/api/entities?action=by-uris&uris=isbn%3A",
priority=3,
priority=1,
)
Connector.objects.create(
models.Connector.objects.create(
identifier="openlibrary.org",
name="OpenLibrary",
connector_file="openlibrary",
@ -105,34 +101,71 @@ def init_connectors():
covers_url="https://covers.openlibrary.org",
search_url="https://openlibrary.org/search?q=",
isbn_search_url="https://openlibrary.org/api/books?jscmd=data&format=json&bibkeys=ISBN:",
priority=3,
priority=1,
)
def init_federated_servers():
"""big no to nazis"""
built_in_blocks = ["gab.ai", "gab.com"]
for server in built_in_blocks:
FederatedServer.objects.create(
server_name=server,
status="blocked",
)
def init_settings():
"""info about the instance"""
SiteSettings.objects.create(
models.SiteSettings.objects.create(
support_link="https://www.patreon.com/bookwyrm",
support_title="Patreon",
install_mode=True,
)
def init_link_domains():
"""safe book links"""
domains = [
("standardebooks.org", "Standard EBooks"),
("www.gutenberg.org", "Project Gutenberg"),
("archive.org", "Internet Archive"),
("openlibrary.org", "Open Library"),
("theanarchistlibrary.org", "The Anarchist Library"),
]
for domain, name in domains:
models.LinkDomain.objects.create(
domain=domain,
name=name,
status="approved",
)
# pylint: disable=no-self-use
# pylint: disable=unused-argument
class Command(BaseCommand):
"""command-line options"""
help = "Initializes the database with starter data"
def add_arguments(self, parser):
"""specify which function to run"""
parser.add_argument(
"--limit",
default=None,
help="Limit init to specific table",
)
def handle(self, *args, **options):
init_groups()
init_permissions()
init_connectors()
init_federated_servers()
init_settings()
"""execute init"""
limit = options.get("limit")
tables = [
"group",
"permission",
"connector",
"settings",
"linkdomain",
]
if limit and limit not in tables:
raise Exception("Invalid table limit:", limit)
if not limit or limit == "group":
init_groups()
if not limit or limit == "permission":
init_permissions()
if not limit or limit == "connector":
init_connectors()
if not limit or limit == "settings":
init_settings()
if not limit or limit == "linkdomain":
init_link_domains()

View file

@ -0,0 +1,54 @@
""" Get your admin code to allow install """
from django.core.management.base import BaseCommand
from bookwyrm import models
from bookwyrm.settings import VERSION
# pylint: disable=no-self-use
class Command(BaseCommand):
"""command-line options"""
help = "What version is this?"
def add_arguments(self, parser):
"""specify which function to run"""
parser.add_argument(
"--current",
action="store_true",
help="Version stored in database",
)
parser.add_argument(
"--target",
action="store_true",
help="Version stored in settings",
)
parser.add_argument(
"--update",
action="store_true",
help="Update database version",
)
# pylint: disable=unused-argument
def handle(self, *args, **options):
"""execute init"""
site = models.SiteSettings.objects.get()
current = site.version or "0.0.1"
target = VERSION
if options.get("current"):
print(current)
return
if options.get("target"):
print(target)
return
if options.get("update"):
site.version = target
site.save()
return
if current != target:
print(f"{current}/{target}")
else:
print(current)

View file

@ -0,0 +1,28 @@
""" Re-create list streams """
from django.core.management.base import BaseCommand
from bookwyrm import lists_stream, models
def populate_lists_streams():
"""build all the lists streams for all the users"""
print("Populating lists streams")
users = models.User.objects.filter(
local=True,
is_active=True,
).order_by("-last_active_date")
print("This may take a long time! Please be patient.")
for user in users:
print(".", end="")
lists_stream.populate_lists_task.delay(user.id)
print("\nAll done, thank you for your patience!")
class Command(BaseCommand):
"""start all over with lists streams"""
help = "Populate list streams for all users"
# pylint: disable=no-self-use,unused-argument
def handle(self, *args, **options):
"""run feed builder"""
populate_lists_streams()

View file

@ -1,18 +1,20 @@
""" Re-create user streams """
from django.core.management.base import BaseCommand
from bookwyrm import activitystreams, models
from bookwyrm import activitystreams, lists_stream, models
def populate_streams(stream=None):
"""build all the streams for all the users"""
streams = [stream] if stream else activitystreams.streams.keys()
print("Populations streams", streams)
print("Populating streams", streams)
users = models.User.objects.filter(
local=True,
is_active=True,
).order_by("-last_active_date")
print("This may take a long time! Please be patient.")
for user in users:
print(".", end="")
lists_stream.populate_lists_task.delay(user.id)
for stream_key in streams:
print(".", end="")
activitystreams.populate_stream_task.delay(stream_key, user.id)

View file

@ -0,0 +1,31 @@
# Generated by Django 3.2.5 on 2021-10-11 16:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0106_user_preferred_language"),
]
operations = [
migrations.AlterField(
model_name="user",
name="preferred_language",
field=models.CharField(
blank=True,
choices=[
("en-us", "English"),
("de-de", "Deutsch (German)"),
("es", "Español (Spanish)"),
("fr-fr", "Français (French)"),
("pt-br", "Português - Brasil (Brazilian Portugues)"),
("zh-hans", "简体中文 (Simplified Chinese)"),
("zh-hant", "繁體中文 (Traditional Chinese)"),
],
max_length=255,
null=True,
),
),
]

View file

@ -0,0 +1,871 @@
# Generated by Django 3.2.5 on 2021-10-16 06:39
import bookwyrm.models.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0106_user_preferred_language"),
]
operations = [
migrations.CreateModel(
name="Group",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("created_date", models.DateTimeField(auto_now_add=True)),
("updated_date", models.DateTimeField(auto_now=True)),
(
"remote_id",
bookwyrm.models.fields.RemoteIdField(
max_length=255,
null=True,
validators=[bookwyrm.models.fields.validate_remote_id],
),
),
("name", bookwyrm.models.fields.CharField(max_length=100)),
(
"description",
bookwyrm.models.fields.TextField(blank=True, null=True),
),
(
"privacy",
bookwyrm.models.fields.PrivacyField(
choices=[
("public", "Public"),
("unlisted", "Unlisted"),
("followers", "Followers"),
("direct", "Direct"),
],
default="public",
max_length=255,
),
),
],
options={
"abstract": False,
},
),
migrations.CreateModel(
name="GroupMember",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("created_date", models.DateTimeField(auto_now_add=True)),
("updated_date", models.DateTimeField(auto_now=True)),
],
),
migrations.CreateModel(
name="GroupMemberInvitation",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("created_date", models.DateTimeField(auto_now_add=True)),
],
),
migrations.RemoveConstraint(
model_name="notification",
name="notification_type_valid",
),
migrations.AlterField(
model_name="list",
name="curation",
field=bookwyrm.models.fields.CharField(
choices=[
("closed", "Closed"),
("open", "Open"),
("curated", "Curated"),
("group", "Group"),
],
default="closed",
max_length=255,
),
),
migrations.AlterField(
model_name="notification",
name="notification_type",
field=models.CharField(
choices=[
("FAVORITE", "Favorite"),
("REPLY", "Reply"),
("MENTION", "Mention"),
("TAG", "Tag"),
("FOLLOW", "Follow"),
("FOLLOW_REQUEST", "Follow Request"),
("BOOST", "Boost"),
("IMPORT", "Import"),
("ADD", "Add"),
("REPORT", "Report"),
("INVITE", "Invite"),
("ACCEPT", "Accept"),
("JOIN", "Join"),
("LEAVE", "Leave"),
("REMOVE", "Remove"),
],
max_length=255,
),
),
migrations.AlterField(
model_name="user",
name="preferred_language",
field=models.CharField(
blank=True,
choices=[
("en-us", "English"),
("de-de", "Deutsch (German)"),
("es", "Español (Spanish)"),
("fr-fr", "Français (French)"),
("zh-hans", "简体中文 (Simplified Chinese)"),
("zh-hant", "繁體中文 (Traditional Chinese)"),
],
max_length=255,
null=True,
),
),
migrations.AlterField(
model_name="user",
name="preferred_timezone",
field=models.CharField(
choices=[
("Africa/Abidjan", "Africa/Abidjan"),
("Africa/Accra", "Africa/Accra"),
("Africa/Addis_Ababa", "Africa/Addis_Ababa"),
("Africa/Algiers", "Africa/Algiers"),
("Africa/Asmara", "Africa/Asmara"),
("Africa/Asmera", "Africa/Asmera"),
("Africa/Bamako", "Africa/Bamako"),
("Africa/Bangui", "Africa/Bangui"),
("Africa/Banjul", "Africa/Banjul"),
("Africa/Bissau", "Africa/Bissau"),
("Africa/Blantyre", "Africa/Blantyre"),
("Africa/Brazzaville", "Africa/Brazzaville"),
("Africa/Bujumbura", "Africa/Bujumbura"),
("Africa/Cairo", "Africa/Cairo"),
("Africa/Casablanca", "Africa/Casablanca"),
("Africa/Ceuta", "Africa/Ceuta"),
("Africa/Conakry", "Africa/Conakry"),
("Africa/Dakar", "Africa/Dakar"),
("Africa/Dar_es_Salaam", "Africa/Dar_es_Salaam"),
("Africa/Djibouti", "Africa/Djibouti"),
("Africa/Douala", "Africa/Douala"),
("Africa/El_Aaiun", "Africa/El_Aaiun"),
("Africa/Freetown", "Africa/Freetown"),
("Africa/Gaborone", "Africa/Gaborone"),
("Africa/Harare", "Africa/Harare"),
("Africa/Johannesburg", "Africa/Johannesburg"),
("Africa/Juba", "Africa/Juba"),
("Africa/Kampala", "Africa/Kampala"),
("Africa/Khartoum", "Africa/Khartoum"),
("Africa/Kigali", "Africa/Kigali"),
("Africa/Kinshasa", "Africa/Kinshasa"),
("Africa/Lagos", "Africa/Lagos"),
("Africa/Libreville", "Africa/Libreville"),
("Africa/Lome", "Africa/Lome"),
("Africa/Luanda", "Africa/Luanda"),
("Africa/Lubumbashi", "Africa/Lubumbashi"),
("Africa/Lusaka", "Africa/Lusaka"),
("Africa/Malabo", "Africa/Malabo"),
("Africa/Maputo", "Africa/Maputo"),
("Africa/Maseru", "Africa/Maseru"),
("Africa/Mbabane", "Africa/Mbabane"),
("Africa/Mogadishu", "Africa/Mogadishu"),
("Africa/Monrovia", "Africa/Monrovia"),
("Africa/Nairobi", "Africa/Nairobi"),
("Africa/Ndjamena", "Africa/Ndjamena"),
("Africa/Niamey", "Africa/Niamey"),
("Africa/Nouakchott", "Africa/Nouakchott"),
("Africa/Ouagadougou", "Africa/Ouagadougou"),
("Africa/Porto-Novo", "Africa/Porto-Novo"),
("Africa/Sao_Tome", "Africa/Sao_Tome"),
("Africa/Timbuktu", "Africa/Timbuktu"),
("Africa/Tripoli", "Africa/Tripoli"),
("Africa/Tunis", "Africa/Tunis"),
("Africa/Windhoek", "Africa/Windhoek"),
("America/Adak", "America/Adak"),
("America/Anchorage", "America/Anchorage"),
("America/Anguilla", "America/Anguilla"),
("America/Antigua", "America/Antigua"),
("America/Araguaina", "America/Araguaina"),
(
"America/Argentina/Buenos_Aires",
"America/Argentina/Buenos_Aires",
),
("America/Argentina/Catamarca", "America/Argentina/Catamarca"),
(
"America/Argentina/ComodRivadavia",
"America/Argentina/ComodRivadavia",
),
("America/Argentina/Cordoba", "America/Argentina/Cordoba"),
("America/Argentina/Jujuy", "America/Argentina/Jujuy"),
("America/Argentina/La_Rioja", "America/Argentina/La_Rioja"),
("America/Argentina/Mendoza", "America/Argentina/Mendoza"),
(
"America/Argentina/Rio_Gallegos",
"America/Argentina/Rio_Gallegos",
),
("America/Argentina/Salta", "America/Argentina/Salta"),
("America/Argentina/San_Juan", "America/Argentina/San_Juan"),
("America/Argentina/San_Luis", "America/Argentina/San_Luis"),
("America/Argentina/Tucuman", "America/Argentina/Tucuman"),
("America/Argentina/Ushuaia", "America/Argentina/Ushuaia"),
("America/Aruba", "America/Aruba"),
("America/Asuncion", "America/Asuncion"),
("America/Atikokan", "America/Atikokan"),
("America/Atka", "America/Atka"),
("America/Bahia", "America/Bahia"),
("America/Bahia_Banderas", "America/Bahia_Banderas"),
("America/Barbados", "America/Barbados"),
("America/Belem", "America/Belem"),
("America/Belize", "America/Belize"),
("America/Blanc-Sablon", "America/Blanc-Sablon"),
("America/Boa_Vista", "America/Boa_Vista"),
("America/Bogota", "America/Bogota"),
("America/Boise", "America/Boise"),
("America/Buenos_Aires", "America/Buenos_Aires"),
("America/Cambridge_Bay", "America/Cambridge_Bay"),
("America/Campo_Grande", "America/Campo_Grande"),
("America/Cancun", "America/Cancun"),
("America/Caracas", "America/Caracas"),
("America/Catamarca", "America/Catamarca"),
("America/Cayenne", "America/Cayenne"),
("America/Cayman", "America/Cayman"),
("America/Chicago", "America/Chicago"),
("America/Chihuahua", "America/Chihuahua"),
("America/Coral_Harbour", "America/Coral_Harbour"),
("America/Cordoba", "America/Cordoba"),
("America/Costa_Rica", "America/Costa_Rica"),
("America/Creston", "America/Creston"),
("America/Cuiaba", "America/Cuiaba"),
("America/Curacao", "America/Curacao"),
("America/Danmarkshavn", "America/Danmarkshavn"),
("America/Dawson", "America/Dawson"),
("America/Dawson_Creek", "America/Dawson_Creek"),
("America/Denver", "America/Denver"),
("America/Detroit", "America/Detroit"),
("America/Dominica", "America/Dominica"),
("America/Edmonton", "America/Edmonton"),
("America/Eirunepe", "America/Eirunepe"),
("America/El_Salvador", "America/El_Salvador"),
("America/Ensenada", "America/Ensenada"),
("America/Fort_Nelson", "America/Fort_Nelson"),
("America/Fort_Wayne", "America/Fort_Wayne"),
("America/Fortaleza", "America/Fortaleza"),
("America/Glace_Bay", "America/Glace_Bay"),
("America/Godthab", "America/Godthab"),
("America/Goose_Bay", "America/Goose_Bay"),
("America/Grand_Turk", "America/Grand_Turk"),
("America/Grenada", "America/Grenada"),
("America/Guadeloupe", "America/Guadeloupe"),
("America/Guatemala", "America/Guatemala"),
("America/Guayaquil", "America/Guayaquil"),
("America/Guyana", "America/Guyana"),
("America/Halifax", "America/Halifax"),
("America/Havana", "America/Havana"),
("America/Hermosillo", "America/Hermosillo"),
("America/Indiana/Indianapolis", "America/Indiana/Indianapolis"),
("America/Indiana/Knox", "America/Indiana/Knox"),
("America/Indiana/Marengo", "America/Indiana/Marengo"),
("America/Indiana/Petersburg", "America/Indiana/Petersburg"),
("America/Indiana/Tell_City", "America/Indiana/Tell_City"),
("America/Indiana/Vevay", "America/Indiana/Vevay"),
("America/Indiana/Vincennes", "America/Indiana/Vincennes"),
("America/Indiana/Winamac", "America/Indiana/Winamac"),
("America/Indianapolis", "America/Indianapolis"),
("America/Inuvik", "America/Inuvik"),
("America/Iqaluit", "America/Iqaluit"),
("America/Jamaica", "America/Jamaica"),
("America/Jujuy", "America/Jujuy"),
("America/Juneau", "America/Juneau"),
("America/Kentucky/Louisville", "America/Kentucky/Louisville"),
("America/Kentucky/Monticello", "America/Kentucky/Monticello"),
("America/Knox_IN", "America/Knox_IN"),
("America/Kralendijk", "America/Kralendijk"),
("America/La_Paz", "America/La_Paz"),
("America/Lima", "America/Lima"),
("America/Los_Angeles", "America/Los_Angeles"),
("America/Louisville", "America/Louisville"),
("America/Lower_Princes", "America/Lower_Princes"),
("America/Maceio", "America/Maceio"),
("America/Managua", "America/Managua"),
("America/Manaus", "America/Manaus"),
("America/Marigot", "America/Marigot"),
("America/Martinique", "America/Martinique"),
("America/Matamoros", "America/Matamoros"),
("America/Mazatlan", "America/Mazatlan"),
("America/Mendoza", "America/Mendoza"),
("America/Menominee", "America/Menominee"),
("America/Merida", "America/Merida"),
("America/Metlakatla", "America/Metlakatla"),
("America/Mexico_City", "America/Mexico_City"),
("America/Miquelon", "America/Miquelon"),
("America/Moncton", "America/Moncton"),
("America/Monterrey", "America/Monterrey"),
("America/Montevideo", "America/Montevideo"),
("America/Montreal", "America/Montreal"),
("America/Montserrat", "America/Montserrat"),
("America/Nassau", "America/Nassau"),
("America/New_York", "America/New_York"),
("America/Nipigon", "America/Nipigon"),
("America/Nome", "America/Nome"),
("America/Noronha", "America/Noronha"),
("America/North_Dakota/Beulah", "America/North_Dakota/Beulah"),
("America/North_Dakota/Center", "America/North_Dakota/Center"),
(
"America/North_Dakota/New_Salem",
"America/North_Dakota/New_Salem",
),
("America/Nuuk", "America/Nuuk"),
("America/Ojinaga", "America/Ojinaga"),
("America/Panama", "America/Panama"),
("America/Pangnirtung", "America/Pangnirtung"),
("America/Paramaribo", "America/Paramaribo"),
("America/Phoenix", "America/Phoenix"),
("America/Port-au-Prince", "America/Port-au-Prince"),
("America/Port_of_Spain", "America/Port_of_Spain"),
("America/Porto_Acre", "America/Porto_Acre"),
("America/Porto_Velho", "America/Porto_Velho"),
("America/Puerto_Rico", "America/Puerto_Rico"),
("America/Punta_Arenas", "America/Punta_Arenas"),
("America/Rainy_River", "America/Rainy_River"),
("America/Rankin_Inlet", "America/Rankin_Inlet"),
("America/Recife", "America/Recife"),
("America/Regina", "America/Regina"),
("America/Resolute", "America/Resolute"),
("America/Rio_Branco", "America/Rio_Branco"),
("America/Rosario", "America/Rosario"),
("America/Santa_Isabel", "America/Santa_Isabel"),
("America/Santarem", "America/Santarem"),
("America/Santiago", "America/Santiago"),
("America/Santo_Domingo", "America/Santo_Domingo"),
("America/Sao_Paulo", "America/Sao_Paulo"),
("America/Scoresbysund", "America/Scoresbysund"),
("America/Shiprock", "America/Shiprock"),
("America/Sitka", "America/Sitka"),
("America/St_Barthelemy", "America/St_Barthelemy"),
("America/St_Johns", "America/St_Johns"),
("America/St_Kitts", "America/St_Kitts"),
("America/St_Lucia", "America/St_Lucia"),
("America/St_Thomas", "America/St_Thomas"),
("America/St_Vincent", "America/St_Vincent"),
("America/Swift_Current", "America/Swift_Current"),
("America/Tegucigalpa", "America/Tegucigalpa"),
("America/Thule", "America/Thule"),
("America/Thunder_Bay", "America/Thunder_Bay"),
("America/Tijuana", "America/Tijuana"),
("America/Toronto", "America/Toronto"),
("America/Tortola", "America/Tortola"),
("America/Vancouver", "America/Vancouver"),
("America/Virgin", "America/Virgin"),
("America/Whitehorse", "America/Whitehorse"),
("America/Winnipeg", "America/Winnipeg"),
("America/Yakutat", "America/Yakutat"),
("America/Yellowknife", "America/Yellowknife"),
("Antarctica/Casey", "Antarctica/Casey"),
("Antarctica/Davis", "Antarctica/Davis"),
("Antarctica/DumontDUrville", "Antarctica/DumontDUrville"),
("Antarctica/Macquarie", "Antarctica/Macquarie"),
("Antarctica/Mawson", "Antarctica/Mawson"),
("Antarctica/McMurdo", "Antarctica/McMurdo"),
("Antarctica/Palmer", "Antarctica/Palmer"),
("Antarctica/Rothera", "Antarctica/Rothera"),
("Antarctica/South_Pole", "Antarctica/South_Pole"),
("Antarctica/Syowa", "Antarctica/Syowa"),
("Antarctica/Troll", "Antarctica/Troll"),
("Antarctica/Vostok", "Antarctica/Vostok"),
("Arctic/Longyearbyen", "Arctic/Longyearbyen"),
("Asia/Aden", "Asia/Aden"),
("Asia/Almaty", "Asia/Almaty"),
("Asia/Amman", "Asia/Amman"),
("Asia/Anadyr", "Asia/Anadyr"),
("Asia/Aqtau", "Asia/Aqtau"),
("Asia/Aqtobe", "Asia/Aqtobe"),
("Asia/Ashgabat", "Asia/Ashgabat"),
("Asia/Ashkhabad", "Asia/Ashkhabad"),
("Asia/Atyrau", "Asia/Atyrau"),
("Asia/Baghdad", "Asia/Baghdad"),
("Asia/Bahrain", "Asia/Bahrain"),
("Asia/Baku", "Asia/Baku"),
("Asia/Bangkok", "Asia/Bangkok"),
("Asia/Barnaul", "Asia/Barnaul"),
("Asia/Beirut", "Asia/Beirut"),
("Asia/Bishkek", "Asia/Bishkek"),
("Asia/Brunei", "Asia/Brunei"),
("Asia/Calcutta", "Asia/Calcutta"),
("Asia/Chita", "Asia/Chita"),
("Asia/Choibalsan", "Asia/Choibalsan"),
("Asia/Chongqing", "Asia/Chongqing"),
("Asia/Chungking", "Asia/Chungking"),
("Asia/Colombo", "Asia/Colombo"),
("Asia/Dacca", "Asia/Dacca"),
("Asia/Damascus", "Asia/Damascus"),
("Asia/Dhaka", "Asia/Dhaka"),
("Asia/Dili", "Asia/Dili"),
("Asia/Dubai", "Asia/Dubai"),
("Asia/Dushanbe", "Asia/Dushanbe"),
("Asia/Famagusta", "Asia/Famagusta"),
("Asia/Gaza", "Asia/Gaza"),
("Asia/Harbin", "Asia/Harbin"),
("Asia/Hebron", "Asia/Hebron"),
("Asia/Ho_Chi_Minh", "Asia/Ho_Chi_Minh"),
("Asia/Hong_Kong", "Asia/Hong_Kong"),
("Asia/Hovd", "Asia/Hovd"),
("Asia/Irkutsk", "Asia/Irkutsk"),
("Asia/Istanbul", "Asia/Istanbul"),
("Asia/Jakarta", "Asia/Jakarta"),
("Asia/Jayapura", "Asia/Jayapura"),
("Asia/Jerusalem", "Asia/Jerusalem"),
("Asia/Kabul", "Asia/Kabul"),
("Asia/Kamchatka", "Asia/Kamchatka"),
("Asia/Karachi", "Asia/Karachi"),
("Asia/Kashgar", "Asia/Kashgar"),
("Asia/Kathmandu", "Asia/Kathmandu"),
("Asia/Katmandu", "Asia/Katmandu"),
("Asia/Khandyga", "Asia/Khandyga"),
("Asia/Kolkata", "Asia/Kolkata"),
("Asia/Krasnoyarsk", "Asia/Krasnoyarsk"),
("Asia/Kuala_Lumpur", "Asia/Kuala_Lumpur"),
("Asia/Kuching", "Asia/Kuching"),
("Asia/Kuwait", "Asia/Kuwait"),
("Asia/Macao", "Asia/Macao"),
("Asia/Macau", "Asia/Macau"),
("Asia/Magadan", "Asia/Magadan"),
("Asia/Makassar", "Asia/Makassar"),
("Asia/Manila", "Asia/Manila"),
("Asia/Muscat", "Asia/Muscat"),
("Asia/Nicosia", "Asia/Nicosia"),
("Asia/Novokuznetsk", "Asia/Novokuznetsk"),
("Asia/Novosibirsk", "Asia/Novosibirsk"),
("Asia/Omsk", "Asia/Omsk"),
("Asia/Oral", "Asia/Oral"),
("Asia/Phnom_Penh", "Asia/Phnom_Penh"),
("Asia/Pontianak", "Asia/Pontianak"),
("Asia/Pyongyang", "Asia/Pyongyang"),
("Asia/Qatar", "Asia/Qatar"),
("Asia/Qostanay", "Asia/Qostanay"),
("Asia/Qyzylorda", "Asia/Qyzylorda"),
("Asia/Rangoon", "Asia/Rangoon"),
("Asia/Riyadh", "Asia/Riyadh"),
("Asia/Saigon", "Asia/Saigon"),
("Asia/Sakhalin", "Asia/Sakhalin"),
("Asia/Samarkand", "Asia/Samarkand"),
("Asia/Seoul", "Asia/Seoul"),
("Asia/Shanghai", "Asia/Shanghai"),
("Asia/Singapore", "Asia/Singapore"),
("Asia/Srednekolymsk", "Asia/Srednekolymsk"),
("Asia/Taipei", "Asia/Taipei"),
("Asia/Tashkent", "Asia/Tashkent"),
("Asia/Tbilisi", "Asia/Tbilisi"),
("Asia/Tehran", "Asia/Tehran"),
("Asia/Tel_Aviv", "Asia/Tel_Aviv"),
("Asia/Thimbu", "Asia/Thimbu"),
("Asia/Thimphu", "Asia/Thimphu"),
("Asia/Tokyo", "Asia/Tokyo"),
("Asia/Tomsk", "Asia/Tomsk"),
("Asia/Ujung_Pandang", "Asia/Ujung_Pandang"),
("Asia/Ulaanbaatar", "Asia/Ulaanbaatar"),
("Asia/Ulan_Bator", "Asia/Ulan_Bator"),
("Asia/Urumqi", "Asia/Urumqi"),
("Asia/Ust-Nera", "Asia/Ust-Nera"),
("Asia/Vientiane", "Asia/Vientiane"),
("Asia/Vladivostok", "Asia/Vladivostok"),
("Asia/Yakutsk", "Asia/Yakutsk"),
("Asia/Yangon", "Asia/Yangon"),
("Asia/Yekaterinburg", "Asia/Yekaterinburg"),
("Asia/Yerevan", "Asia/Yerevan"),
("Atlantic/Azores", "Atlantic/Azores"),
("Atlantic/Bermuda", "Atlantic/Bermuda"),
("Atlantic/Canary", "Atlantic/Canary"),
("Atlantic/Cape_Verde", "Atlantic/Cape_Verde"),
("Atlantic/Faeroe", "Atlantic/Faeroe"),
("Atlantic/Faroe", "Atlantic/Faroe"),
("Atlantic/Jan_Mayen", "Atlantic/Jan_Mayen"),
("Atlantic/Madeira", "Atlantic/Madeira"),
("Atlantic/Reykjavik", "Atlantic/Reykjavik"),
("Atlantic/South_Georgia", "Atlantic/South_Georgia"),
("Atlantic/St_Helena", "Atlantic/St_Helena"),
("Atlantic/Stanley", "Atlantic/Stanley"),
("Australia/ACT", "Australia/ACT"),
("Australia/Adelaide", "Australia/Adelaide"),
("Australia/Brisbane", "Australia/Brisbane"),
("Australia/Broken_Hill", "Australia/Broken_Hill"),
("Australia/Canberra", "Australia/Canberra"),
("Australia/Currie", "Australia/Currie"),
("Australia/Darwin", "Australia/Darwin"),
("Australia/Eucla", "Australia/Eucla"),
("Australia/Hobart", "Australia/Hobart"),
("Australia/LHI", "Australia/LHI"),
("Australia/Lindeman", "Australia/Lindeman"),
("Australia/Lord_Howe", "Australia/Lord_Howe"),
("Australia/Melbourne", "Australia/Melbourne"),
("Australia/NSW", "Australia/NSW"),
("Australia/North", "Australia/North"),
("Australia/Perth", "Australia/Perth"),
("Australia/Queensland", "Australia/Queensland"),
("Australia/South", "Australia/South"),
("Australia/Sydney", "Australia/Sydney"),
("Australia/Tasmania", "Australia/Tasmania"),
("Australia/Victoria", "Australia/Victoria"),
("Australia/West", "Australia/West"),
("Australia/Yancowinna", "Australia/Yancowinna"),
("Brazil/Acre", "Brazil/Acre"),
("Brazil/DeNoronha", "Brazil/DeNoronha"),
("Brazil/East", "Brazil/East"),
("Brazil/West", "Brazil/West"),
("CET", "CET"),
("CST6CDT", "CST6CDT"),
("Canada/Atlantic", "Canada/Atlantic"),
("Canada/Central", "Canada/Central"),
("Canada/Eastern", "Canada/Eastern"),
("Canada/Mountain", "Canada/Mountain"),
("Canada/Newfoundland", "Canada/Newfoundland"),
("Canada/Pacific", "Canada/Pacific"),
("Canada/Saskatchewan", "Canada/Saskatchewan"),
("Canada/Yukon", "Canada/Yukon"),
("Chile/Continental", "Chile/Continental"),
("Chile/EasterIsland", "Chile/EasterIsland"),
("Cuba", "Cuba"),
("EET", "EET"),
("EST", "EST"),
("EST5EDT", "EST5EDT"),
("Egypt", "Egypt"),
("Eire", "Eire"),
("Etc/GMT", "Etc/GMT"),
("Etc/GMT+0", "Etc/GMT+0"),
("Etc/GMT+1", "Etc/GMT+1"),
("Etc/GMT+10", "Etc/GMT+10"),
("Etc/GMT+11", "Etc/GMT+11"),
("Etc/GMT+12", "Etc/GMT+12"),
("Etc/GMT+2", "Etc/GMT+2"),
("Etc/GMT+3", "Etc/GMT+3"),
("Etc/GMT+4", "Etc/GMT+4"),
("Etc/GMT+5", "Etc/GMT+5"),
("Etc/GMT+6", "Etc/GMT+6"),
("Etc/GMT+7", "Etc/GMT+7"),
("Etc/GMT+8", "Etc/GMT+8"),
("Etc/GMT+9", "Etc/GMT+9"),
("Etc/GMT-0", "Etc/GMT-0"),
("Etc/GMT-1", "Etc/GMT-1"),
("Etc/GMT-10", "Etc/GMT-10"),
("Etc/GMT-11", "Etc/GMT-11"),
("Etc/GMT-12", "Etc/GMT-12"),
("Etc/GMT-13", "Etc/GMT-13"),
("Etc/GMT-14", "Etc/GMT-14"),
("Etc/GMT-2", "Etc/GMT-2"),
("Etc/GMT-3", "Etc/GMT-3"),
("Etc/GMT-4", "Etc/GMT-4"),
("Etc/GMT-5", "Etc/GMT-5"),
("Etc/GMT-6", "Etc/GMT-6"),
("Etc/GMT-7", "Etc/GMT-7"),
("Etc/GMT-8", "Etc/GMT-8"),
("Etc/GMT-9", "Etc/GMT-9"),
("Etc/GMT0", "Etc/GMT0"),
("Etc/Greenwich", "Etc/Greenwich"),
("Etc/UCT", "Etc/UCT"),
("Etc/UTC", "Etc/UTC"),
("Etc/Universal", "Etc/Universal"),
("Etc/Zulu", "Etc/Zulu"),
("Europe/Amsterdam", "Europe/Amsterdam"),
("Europe/Andorra", "Europe/Andorra"),
("Europe/Astrakhan", "Europe/Astrakhan"),
("Europe/Athens", "Europe/Athens"),
("Europe/Belfast", "Europe/Belfast"),
("Europe/Belgrade", "Europe/Belgrade"),
("Europe/Berlin", "Europe/Berlin"),
("Europe/Bratislava", "Europe/Bratislava"),
("Europe/Brussels", "Europe/Brussels"),
("Europe/Bucharest", "Europe/Bucharest"),
("Europe/Budapest", "Europe/Budapest"),
("Europe/Busingen", "Europe/Busingen"),
("Europe/Chisinau", "Europe/Chisinau"),
("Europe/Copenhagen", "Europe/Copenhagen"),
("Europe/Dublin", "Europe/Dublin"),
("Europe/Gibraltar", "Europe/Gibraltar"),
("Europe/Guernsey", "Europe/Guernsey"),
("Europe/Helsinki", "Europe/Helsinki"),
("Europe/Isle_of_Man", "Europe/Isle_of_Man"),
("Europe/Istanbul", "Europe/Istanbul"),
("Europe/Jersey", "Europe/Jersey"),
("Europe/Kaliningrad", "Europe/Kaliningrad"),
("Europe/Kiev", "Europe/Kiev"),
("Europe/Kirov", "Europe/Kirov"),
("Europe/Lisbon", "Europe/Lisbon"),
("Europe/Ljubljana", "Europe/Ljubljana"),
("Europe/London", "Europe/London"),
("Europe/Luxembourg", "Europe/Luxembourg"),
("Europe/Madrid", "Europe/Madrid"),
("Europe/Malta", "Europe/Malta"),
("Europe/Mariehamn", "Europe/Mariehamn"),
("Europe/Minsk", "Europe/Minsk"),
("Europe/Monaco", "Europe/Monaco"),
("Europe/Moscow", "Europe/Moscow"),
("Europe/Nicosia", "Europe/Nicosia"),
("Europe/Oslo", "Europe/Oslo"),
("Europe/Paris", "Europe/Paris"),
("Europe/Podgorica", "Europe/Podgorica"),
("Europe/Prague", "Europe/Prague"),
("Europe/Riga", "Europe/Riga"),
("Europe/Rome", "Europe/Rome"),
("Europe/Samara", "Europe/Samara"),
("Europe/San_Marino", "Europe/San_Marino"),
("Europe/Sarajevo", "Europe/Sarajevo"),
("Europe/Saratov", "Europe/Saratov"),
("Europe/Simferopol", "Europe/Simferopol"),
("Europe/Skopje", "Europe/Skopje"),
("Europe/Sofia", "Europe/Sofia"),
("Europe/Stockholm", "Europe/Stockholm"),
("Europe/Tallinn", "Europe/Tallinn"),
("Europe/Tirane", "Europe/Tirane"),
("Europe/Tiraspol", "Europe/Tiraspol"),
("Europe/Ulyanovsk", "Europe/Ulyanovsk"),
("Europe/Uzhgorod", "Europe/Uzhgorod"),
("Europe/Vaduz", "Europe/Vaduz"),
("Europe/Vatican", "Europe/Vatican"),
("Europe/Vienna", "Europe/Vienna"),
("Europe/Vilnius", "Europe/Vilnius"),
("Europe/Volgograd", "Europe/Volgograd"),
("Europe/Warsaw", "Europe/Warsaw"),
("Europe/Zagreb", "Europe/Zagreb"),
("Europe/Zaporozhye", "Europe/Zaporozhye"),
("Europe/Zurich", "Europe/Zurich"),
("GB", "GB"),
("GB-Eire", "GB-Eire"),
("GMT", "GMT"),
("GMT+0", "GMT+0"),
("GMT-0", "GMT-0"),
("GMT0", "GMT0"),
("Greenwich", "Greenwich"),
("HST", "HST"),
("Hongkong", "Hongkong"),
("Iceland", "Iceland"),
("Indian/Antananarivo", "Indian/Antananarivo"),
("Indian/Chagos", "Indian/Chagos"),
("Indian/Christmas", "Indian/Christmas"),
("Indian/Cocos", "Indian/Cocos"),
("Indian/Comoro", "Indian/Comoro"),
("Indian/Kerguelen", "Indian/Kerguelen"),
("Indian/Mahe", "Indian/Mahe"),
("Indian/Maldives", "Indian/Maldives"),
("Indian/Mauritius", "Indian/Mauritius"),
("Indian/Mayotte", "Indian/Mayotte"),
("Indian/Reunion", "Indian/Reunion"),
("Iran", "Iran"),
("Israel", "Israel"),
("Jamaica", "Jamaica"),
("Japan", "Japan"),
("Kwajalein", "Kwajalein"),
("Libya", "Libya"),
("MET", "MET"),
("MST", "MST"),
("MST7MDT", "MST7MDT"),
("Mexico/BajaNorte", "Mexico/BajaNorte"),
("Mexico/BajaSur", "Mexico/BajaSur"),
("Mexico/General", "Mexico/General"),
("NZ", "NZ"),
("NZ-CHAT", "NZ-CHAT"),
("Navajo", "Navajo"),
("PRC", "PRC"),
("PST8PDT", "PST8PDT"),
("Pacific/Apia", "Pacific/Apia"),
("Pacific/Auckland", "Pacific/Auckland"),
("Pacific/Bougainville", "Pacific/Bougainville"),
("Pacific/Chatham", "Pacific/Chatham"),
("Pacific/Chuuk", "Pacific/Chuuk"),
("Pacific/Easter", "Pacific/Easter"),
("Pacific/Efate", "Pacific/Efate"),
("Pacific/Enderbury", "Pacific/Enderbury"),
("Pacific/Fakaofo", "Pacific/Fakaofo"),
("Pacific/Fiji", "Pacific/Fiji"),
("Pacific/Funafuti", "Pacific/Funafuti"),
("Pacific/Galapagos", "Pacific/Galapagos"),
("Pacific/Gambier", "Pacific/Gambier"),
("Pacific/Guadalcanal", "Pacific/Guadalcanal"),
("Pacific/Guam", "Pacific/Guam"),
("Pacific/Honolulu", "Pacific/Honolulu"),
("Pacific/Johnston", "Pacific/Johnston"),
("Pacific/Kanton", "Pacific/Kanton"),
("Pacific/Kiritimati", "Pacific/Kiritimati"),
("Pacific/Kosrae", "Pacific/Kosrae"),
("Pacific/Kwajalein", "Pacific/Kwajalein"),
("Pacific/Majuro", "Pacific/Majuro"),
("Pacific/Marquesas", "Pacific/Marquesas"),
("Pacific/Midway", "Pacific/Midway"),
("Pacific/Nauru", "Pacific/Nauru"),
("Pacific/Niue", "Pacific/Niue"),
("Pacific/Norfolk", "Pacific/Norfolk"),
("Pacific/Noumea", "Pacific/Noumea"),
("Pacific/Pago_Pago", "Pacific/Pago_Pago"),
("Pacific/Palau", "Pacific/Palau"),
("Pacific/Pitcairn", "Pacific/Pitcairn"),
("Pacific/Pohnpei", "Pacific/Pohnpei"),
("Pacific/Ponape", "Pacific/Ponape"),
("Pacific/Port_Moresby", "Pacific/Port_Moresby"),
("Pacific/Rarotonga", "Pacific/Rarotonga"),
("Pacific/Saipan", "Pacific/Saipan"),
("Pacific/Samoa", "Pacific/Samoa"),
("Pacific/Tahiti", "Pacific/Tahiti"),
("Pacific/Tarawa", "Pacific/Tarawa"),
("Pacific/Tongatapu", "Pacific/Tongatapu"),
("Pacific/Truk", "Pacific/Truk"),
("Pacific/Wake", "Pacific/Wake"),
("Pacific/Wallis", "Pacific/Wallis"),
("Pacific/Yap", "Pacific/Yap"),
("Poland", "Poland"),
("Portugal", "Portugal"),
("ROC", "ROC"),
("ROK", "ROK"),
("Singapore", "Singapore"),
("Turkey", "Turkey"),
("UCT", "UCT"),
("US/Alaska", "US/Alaska"),
("US/Aleutian", "US/Aleutian"),
("US/Arizona", "US/Arizona"),
("US/Central", "US/Central"),
("US/East-Indiana", "US/East-Indiana"),
("US/Eastern", "US/Eastern"),
("US/Hawaii", "US/Hawaii"),
("US/Indiana-Starke", "US/Indiana-Starke"),
("US/Michigan", "US/Michigan"),
("US/Mountain", "US/Mountain"),
("US/Pacific", "US/Pacific"),
("US/Samoa", "US/Samoa"),
("UTC", "UTC"),
("Universal", "Universal"),
("W-SU", "W-SU"),
("WET", "WET"),
("Zulu", "Zulu"),
],
default="UTC",
max_length=255,
),
),
migrations.AddConstraint(
model_name="notification",
constraint=models.CheckConstraint(
check=models.Q(
(
"notification_type__in",
[
"FAVORITE",
"REPLY",
"MENTION",
"TAG",
"FOLLOW",
"FOLLOW_REQUEST",
"BOOST",
"IMPORT",
"ADD",
"REPORT",
"INVITE",
"ACCEPT",
"JOIN",
"LEAVE",
"REMOVE",
],
)
),
name="notification_type_valid",
),
),
migrations.AddField(
model_name="groupmemberinvitation",
name="group",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="user_invitations",
to="bookwyrm.group",
),
),
migrations.AddField(
model_name="groupmemberinvitation",
name="user",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="group_invitations",
to=settings.AUTH_USER_MODEL,
),
),
migrations.AddField(
model_name="groupmember",
name="group",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="memberships",
to="bookwyrm.group",
),
),
migrations.AddField(
model_name="groupmember",
name="user",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="memberships",
to=settings.AUTH_USER_MODEL,
),
),
migrations.AddField(
model_name="group",
name="user",
field=bookwyrm.models.fields.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL
),
),
migrations.AddField(
model_name="list",
name="group",
field=models.ForeignKey(
blank=True,
default=None,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="bookwyrm.group",
),
),
migrations.AddField(
model_name="notification",
name="related_group",
field=models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="notifications",
to="bookwyrm.group",
),
),
migrations.AddConstraint(
model_name="groupmemberinvitation",
constraint=models.UniqueConstraint(
fields=("group", "user"), name="unique_invitation"
),
),
migrations.AddConstraint(
model_name="groupmember",
constraint=models.UniqueConstraint(
fields=("group", "user"), name="unique_membership"
),
),
]

View file

@ -0,0 +1,31 @@
# Generated by Django 3.2.5 on 2021-10-11 17:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0107_alter_user_preferred_language"),
]
operations = [
migrations.AlterField(
model_name="user",
name="preferred_language",
field=models.CharField(
blank=True,
choices=[
("en-us", "English"),
("de-de", "Deutsch (German)"),
("es-es", "Español (Spanish)"),
("fr-fr", "Français (French)"),
("pt-br", "Português - Brasil (Brazilian Portuguese)"),
("zh-hans", "简体中文 (Simplified Chinese)"),
("zh-hant", "繁體中文 (Traditional Chinese)"),
],
max_length=255,
null=True,
),
),
]

View file

@ -0,0 +1,19 @@
# Generated by Django 3.2.5 on 2021-10-15 15:54
import bookwyrm.models.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0108_alter_user_preferred_language"),
]
operations = [
migrations.AddField(
model_name="status",
name="edited_date",
field=bookwyrm.models.fields.DateTimeField(blank=True, null=True),
),
]

View file

@ -0,0 +1,23 @@
# Generated by Django 3.2.5 on 2021-10-15 17:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0109_status_edited_date"),
]
operations = [
migrations.AddField(
model_name="quotation",
name="raw_quote",
field=models.TextField(blank=True, null=True),
),
migrations.AddField(
model_name="status",
name="raw_content",
field=models.TextField(blank=True, null=True),
),
]

View file

@ -0,0 +1,13 @@
# Generated by Django 3.2.5 on 2021-10-16 19:30
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0107_auto_20211016_0639"),
("bookwyrm", "0110_auto_20211015_1734"),
]
operations = []

View file

@ -0,0 +1,93 @@
# Generated by Django 3.2.5 on 2021-10-22 08:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0111_merge_0107_auto_20211016_0639_0110_auto_20211015_1734"),
]
operations = [
migrations.RemoveConstraint(
model_name="notification",
name="notification_type_valid",
),
migrations.AlterField(
model_name="notification",
name="notification_type",
field=models.CharField(
choices=[
("FAVORITE", "Favorite"),
("REPLY", "Reply"),
("MENTION", "Mention"),
("TAG", "Tag"),
("FOLLOW", "Follow"),
("FOLLOW_REQUEST", "Follow Request"),
("BOOST", "Boost"),
("IMPORT", "Import"),
("ADD", "Add"),
("REPORT", "Report"),
("INVITE", "Invite"),
("ACCEPT", "Accept"),
("JOIN", "Join"),
("LEAVE", "Leave"),
("REMOVE", "Remove"),
("GROUP_PRIVACY", "Group Privacy"),
("GROUP_NAME", "Group Name"),
("GROUP_DESCRIPTION", "Group Description"),
],
max_length=255,
),
),
migrations.AlterField(
model_name="user",
name="preferred_language",
field=models.CharField(
blank=True,
choices=[
("en-us", "English"),
("de-de", "Deutsch (German)"),
("es-es", "Español (Spanish)"),
("fr-fr", "Français (French)"),
("pt-br", "Português - Brasil (Brazilian Portuguese)"),
("zh-hans", "简体中文 (Simplified Chinese)"),
("zh-hant", "繁體中文 (Traditional Chinese)"),
],
max_length=255,
null=True,
),
),
migrations.AddConstraint(
model_name="notification",
constraint=models.CheckConstraint(
check=models.Q(
(
"notification_type__in",
[
"FAVORITE",
"REPLY",
"MENTION",
"TAG",
"FOLLOW",
"FOLLOW_REQUEST",
"BOOST",
"IMPORT",
"ADD",
"REPORT",
"INVITE",
"ACCEPT",
"JOIN",
"LEAVE",
"REMOVE",
"GROUP_PRIVACY",
"GROUP_NAME",
"GROUP_DESCRIPTION",
],
)
),
name="notification_type_valid",
),
),
]

View file

@ -0,0 +1,25 @@
# Generated by Django 3.2.5 on 2021-11-10 21:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0112_auto_20211022_0844"),
]
operations = [
migrations.AddField(
model_name="importitem",
name="normalized_data",
field=models.JSONField(default={}),
preserve_default=False,
),
migrations.AddField(
model_name="importjob",
name="mappings",
field=models.JSONField(default={}),
preserve_default=False,
),
]

View file

@ -0,0 +1,19 @@
# Generated by Django 3.2.5 on 2021-11-13 00:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0113_auto_20211110_2104"),
]
operations = [
migrations.AddField(
model_name="importjob",
name="source",
field=models.CharField(default="Import", max_length=100),
preserve_default=False,
),
]

View file

@ -0,0 +1,24 @@
# Generated by Django 3.2.5 on 2021-11-13 19:35
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0114_importjob_source"),
]
operations = [
migrations.AddField(
model_name="importitem",
name="linked_review",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="bookwyrm.review",
),
),
]

View file

@ -0,0 +1,23 @@
# Generated by Django 3.2.5 on 2021-11-14 17:34
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0115_importitem_linked_review"),
]
operations = [
migrations.RemoveField(
model_name="importjob",
name="task_id",
),
migrations.AddField(
model_name="importjob",
name="updated_date",
field=models.DateTimeField(default=django.utils.timezone.now),
),
]

View file

@ -0,0 +1,32 @@
# Generated by Django 3.2.5 on 2021-11-15 18:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0116_auto_20211114_1734"),
]
operations = [
migrations.AlterField(
model_name="user",
name="preferred_language",
field=models.CharField(
blank=True,
choices=[
("en-us", "English"),
("de-de", "Deutsch (German)"),
("es-es", "Español (Spanish)"),
("fr-fr", "Français (French)"),
("lt-lt", "lietuvių (Lithuanian)"),
("pt-br", "Português - Brasil (Brazilian Portuguese)"),
("zh-hans", "简体中文 (Simplified Chinese)"),
("zh-hant", "繁體中文 (Traditional Chinese)"),
],
max_length=255,
null=True,
),
),
]

View file

@ -0,0 +1,33 @@
# Generated by Django 3.2.5 on 2021-11-17 18:01
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0117_alter_user_preferred_language"),
]
operations = [
migrations.AlterField(
model_name="user",
name="preferred_language",
field=models.CharField(
blank=True,
choices=[
("en-us", "English"),
("de-de", "Deutsch (German)"),
("es-es", "Español (Spanish)"),
("gl-es", "Galego (Galician)"),
("fr-fr", "Français (French)"),
("lt-lt", "Lietuvių (Lithuanian)"),
("pt-br", "Português - Brasil (Brazilian Portuguese)"),
("zh-hans", "简体中文 (Simplified Chinese)"),
("zh-hant", "繁體中文 (Traditional Chinese)"),
],
max_length=255,
null=True,
),
),
]

View file

@ -0,0 +1,32 @@
# Generated by Django 3.2.5 on 2021-11-24 10:15
import bookwyrm.models.user
import django.contrib.postgres.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0118_alter_user_preferred_language"),
]
operations = [
migrations.AddField(
model_name="user",
name="feed_status_types",
field=django.contrib.postgres.fields.ArrayField(
base_field=models.CharField(
choices=[
("review", "Reviews"),
("comment", "Comments"),
("quotation", "Quotations"),
("everything", "Everything else"),
],
max_length=10,
),
default=bookwyrm.models.user.get_feed_filter_choices,
size=8,
),
),
]

View file

@ -0,0 +1,29 @@
# Generated by Django 3.2.5 on 2021-12-04 10:55
from django.db import migrations, models
import uuid
def gen_uuid(apps, schema_editor):
"""sets an unique UUID for embed_key"""
book_lists = apps.get_model("bookwyrm", "List")
db_alias = schema_editor.connection.alias
for book_list in book_lists.objects.using(db_alias).all():
book_list.embed_key = uuid.uuid4()
book_list.save(broadcast=False)
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0119_user_feed_status_types"),
]
operations = [
migrations.AddField(
model_name="list",
name="embed_key",
field=models.UUIDField(editable=False, null=True, unique=True),
),
migrations.RunPython(gen_uuid, reverse_code=migrations.RunPython.noop),
]

View file

@ -0,0 +1,18 @@
# Generated by Django 3.2.5 on 2021-12-22 11:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0120_list_embed_key"),
]
operations = [
migrations.AddField(
model_name="user",
name="summary_keys",
field=models.JSONField(null=True),
),
]

View file

@ -0,0 +1,19 @@
# Generated by Django 3.2.5 on 2022-01-04 18:59
import bookwyrm.models.user
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0121_user_summary_keys"),
]
operations = [
migrations.AlterField(
model_name="annualgoal",
name="year",
field=models.IntegerField(default=bookwyrm.models.user.get_current_year),
),
]

View file

@ -0,0 +1,34 @@
# Generated by Django 3.2.5 on 2022-01-04 22:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0122_alter_annualgoal_year"),
]
operations = [
migrations.AlterField(
model_name="user",
name="preferred_language",
field=models.CharField(
blank=True,
choices=[
("en-us", "English"),
("de-de", "Deutsch (German)"),
("es-es", "Español (Spanish)"),
("gl-es", "Galego (Galician)"),
("fr-fr", "Français (French)"),
("lt-lt", "Lietuvių (Lithuanian)"),
("pt-br", "Português do Brasil (Brazilian Portuguese)"),
("pt-pt", "Português Europeu (European Portuguese)"),
("zh-hans", "简体中文 (Simplified Chinese)"),
("zh-hant", "繁體中文 (Traditional Chinese)"),
],
max_length=255,
null=True,
),
),
]

View file

@ -0,0 +1,33 @@
# Generated by Django 3.2.10 on 2022-01-06 17:59
from django.contrib.auth.models import AbstractUser
from django.db import migrations
def get_admins(apps, schema_editor):
"""add any superusers to the "admin" group"""
db_alias = schema_editor.connection.alias
groups = apps.get_model("auth", "Group")
try:
group = groups.objects.using(db_alias).get(name="admin")
except groups.DoesNotExist:
# for tests
return
users = apps.get_model("bookwyrm", "User")
admins = users.objects.using(db_alias).filter(is_superuser=True)
for admin in admins:
admin.groups.add(group)
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0123_alter_user_preferred_language"),
]
operations = [
migrations.RunPython(get_admins, reverse_code=migrations.RunPython.noop),
]

View file

@ -0,0 +1,36 @@
# Generated by Django 3.2.10 on 2022-01-09 01:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0124_auto_20220106_1759"),
]
operations = [
migrations.AlterField(
model_name="user",
name="preferred_language",
field=models.CharField(
blank=True,
choices=[
("en-us", "English"),
("de-de", "Deutsch (German)"),
("es-es", "Español (Spanish)"),
("gl-es", "Galego (Galician)"),
("it-it", "Italiano (Italian)"),
("fr-fr", "Français (French)"),
("lt-lt", "Lietuvių (Lithuanian)"),
("no-no", "Norsk (Norwegian)"),
("pt-br", "Português do Brasil (Brazilian Portuguese)"),
("pt-pt", "Português Europeu (European Portuguese)"),
("zh-hans", "简体中文 (Simplified Chinese)"),
("zh-hant", "繁體中文 (Traditional Chinese)"),
],
max_length=255,
null=True,
),
),
]

View file

@ -0,0 +1,55 @@
# Generated by Django 3.2.10 on 2022-01-12 23:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0125_alter_user_preferred_language"),
]
operations = [
migrations.AlterField(
model_name="annualgoal",
name="privacy",
field=models.CharField(
choices=[
("public", "Public"),
("unlisted", "Unlisted"),
("followers", "Followers"),
("direct", "Private"),
],
default="public",
max_length=255,
),
),
migrations.AlterField(
model_name="importjob",
name="privacy",
field=models.CharField(
choices=[
("public", "Public"),
("unlisted", "Unlisted"),
("followers", "Followers"),
("direct", "Private"),
],
default="public",
max_length=255,
),
),
migrations.AlterField(
model_name="user",
name="default_post_privacy",
field=models.CharField(
choices=[
("public", "Public"),
("unlisted", "Unlisted"),
("followers", "Followers"),
("direct", "Private"),
],
default="public",
max_length=255,
),
),
]

View file

@ -0,0 +1,144 @@
# Generated by Django 3.2.10 on 2022-01-10 21:20
import bookwyrm.models.activitypub_mixin
import bookwyrm.models.fields
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0125_alter_user_preferred_language"),
]
operations = [
migrations.CreateModel(
name="LinkDomain",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("created_date", models.DateTimeField(auto_now_add=True)),
("updated_date", models.DateTimeField(auto_now=True)),
(
"remote_id",
bookwyrm.models.fields.RemoteIdField(
max_length=255,
null=True,
validators=[bookwyrm.models.fields.validate_remote_id],
),
),
("domain", models.CharField(max_length=255, unique=True)),
(
"status",
models.CharField(
choices=[
("approved", "Approved"),
("blocked", "Blocked"),
("pending", "Pending"),
],
default="pending",
max_length=50,
),
),
("name", models.CharField(max_length=100)),
(
"reported_by",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to=settings.AUTH_USER_MODEL,
),
),
],
options={
"abstract": False,
},
),
migrations.CreateModel(
name="Link",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("created_date", models.DateTimeField(auto_now_add=True)),
("updated_date", models.DateTimeField(auto_now=True)),
(
"remote_id",
bookwyrm.models.fields.RemoteIdField(
max_length=255,
null=True,
validators=[bookwyrm.models.fields.validate_remote_id],
),
),
("url", bookwyrm.models.fields.URLField(max_length=255)),
(
"added_by",
bookwyrm.models.fields.ForeignKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to=settings.AUTH_USER_MODEL,
),
),
(
"domain",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="links",
to="bookwyrm.linkdomain",
),
),
],
options={
"abstract": False,
},
bases=(bookwyrm.models.activitypub_mixin.ActivitypubMixin, models.Model),
),
migrations.CreateModel(
name="FileLink",
fields=[
(
"link_ptr",
models.OneToOneField(
auto_created=True,
on_delete=django.db.models.deletion.CASCADE,
parent_link=True,
primary_key=True,
serialize=False,
to="bookwyrm.link",
),
),
("filetype", bookwyrm.models.fields.CharField(max_length=5)),
(
"book",
models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.CASCADE,
related_name="file_links",
to="bookwyrm.book",
),
),
],
options={
"abstract": False,
},
bases=("bookwyrm.link",),
),
]

View file

@ -0,0 +1,22 @@
# Generated by Django 3.2.10 on 2022-01-10 22:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0126_filelink_link_linkdomain"),
]
operations = [
migrations.RemoveConstraint(
model_name="report",
name="self_report",
),
migrations.AddField(
model_name="report",
name="links",
field=models.ManyToManyField(blank=True, to="bookwyrm.Link"),
),
]

View file

@ -0,0 +1,13 @@
# Generated by Django 3.2.10 on 2022-01-13 01:14
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0126_auto_20220112_2315"),
("bookwyrm", "0127_auto_20220110_2211"),
]
operations = []

View file

@ -0,0 +1,32 @@
# Generated by Django 3.2.10 on 2022-01-17 17:16
import bookwyrm.models.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0128_merge_0126_auto_20220112_2315_0127_auto_20220110_2211"),
]
operations = [
migrations.AddField(
model_name="filelink",
name="availability",
field=bookwyrm.models.fields.CharField(
choices=[
("free", "Free"),
("purchase", "Purchasable"),
("loan", "Available for loan"),
],
default="free",
max_length=100,
),
),
migrations.AlterField(
model_name="filelink",
name="filetype",
field=bookwyrm.models.fields.CharField(max_length=50),
),
]

View file

@ -0,0 +1,21 @@
# Generated by Django 3.2.10 on 2022-01-24 20:01
import bookwyrm.models.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0129_auto_20220117_1716"),
]
operations = [
migrations.AlterField(
model_name="listitem",
name="notes",
field=bookwyrm.models.fields.TextField(
blank=True, max_length=300, null=True
),
),
]

View file

@ -0,0 +1,37 @@
# Generated by Django 3.2.10 on 2022-01-24 17:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0129_auto_20220117_1716"),
]
operations = [
migrations.AlterField(
model_name="user",
name="preferred_language",
field=models.CharField(
blank=True,
choices=[
("en-us", "English"),
("de-de", "Deutsch (German)"),
("es-es", "Español (Spanish)"),
("gl-es", "Galego (Galician)"),
("it-it", "Italiano (Italian)"),
("fr-fr", "Français (French)"),
("lt-lt", "Lietuvių (Lithuanian)"),
("no-no", "Norsk (Norwegian)"),
("pt-br", "Português do Brasil (Brazilian Portuguese)"),
("pt-pt", "Português Europeu (European Portuguese)"),
("sv-se", "Swedish (Svenska)"),
("zh-hans", "简体中文 (Simplified Chinese)"),
("zh-hant", "繁體中文 (Traditional Chinese)"),
],
max_length=255,
null=True,
),
),
]

View file

@ -0,0 +1,13 @@
# Generated by Django 3.2.10 on 2022-01-25 16:44
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0130_alter_listitem_notes"),
("bookwyrm", "0130_alter_user_preferred_language"),
]
operations = []

View file

@ -0,0 +1,37 @@
# Generated by Django 3.2.10 on 2022-02-02 20:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0131_merge_20220125_1644"),
]
operations = [
migrations.AlterField(
model_name="user",
name="preferred_language",
field=models.CharField(
blank=True,
choices=[
("en-us", "English"),
("de-de", "Deutsch (German)"),
("es-es", "Español (Spanish)"),
("gl-es", "Galego (Galician)"),
("it-it", "Italiano (Italian)"),
("fr-fr", "Français (French)"),
("lt-lt", "Lietuvių (Lithuanian)"),
("no-no", "Norsk (Norwegian)"),
("pt-br", "Português do Brasil (Brazilian Portuguese)"),
("pt-pt", "Português Europeu (European Portuguese)"),
("sv-se", "Svenska (Swedish)"),
("zh-hans", "简体中文 (Simplified Chinese)"),
("zh-hant", "繁體中文 (Traditional Chinese)"),
],
max_length=255,
null=True,
),
),
]

View file

@ -0,0 +1,21 @@
# Generated by Django 3.2.11 on 2022-02-04 20:06
import bookwyrm.models.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0132_alter_user_preferred_language"),
]
operations = [
migrations.AlterField(
model_name="listitem",
name="notes",
field=bookwyrm.models.fields.HtmlField(
blank=True, max_length=300, null=True
),
),
]

View file

@ -0,0 +1,29 @@
# Generated by Django 3.2.11 on 2022-02-11 18:59
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0133_alter_listitem_notes"),
]
operations = [
migrations.AddField(
model_name="announcement",
name="display_type",
field=models.CharField(
choices=[
("white-ter", "None"),
("primary-light", "Primary"),
("success-light", "Success"),
("link-light", "Link"),
("warning-light", "Warning"),
("danger-light", "Danger"),
],
default="white-ter",
max_length=20,
),
),
]

View file

@ -0,0 +1,58 @@
# Generated by Django 3.2.12 on 2022-02-17 16:24
import bookwyrm.models.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0134_announcement_display_type"),
]
operations = [
migrations.RenameField(
model_name="author",
old_name="viaf_id",
new_name="viaf",
),
migrations.RemoveField(
model_name="edition",
name="asin",
),
migrations.AddField(
model_name="author",
name="asin",
field=bookwyrm.models.fields.CharField(
blank=True, max_length=255, null=True
),
),
migrations.AddField(
model_name="author",
name="wikidata",
field=bookwyrm.models.fields.CharField(
blank=True, max_length=255, null=True
),
),
migrations.AddField(
model_name="book",
name="asin",
field=bookwyrm.models.fields.CharField(
blank=True, max_length=255, null=True
),
),
migrations.AddField(
model_name="book",
name="viaf",
field=bookwyrm.models.fields.CharField(
blank=True, max_length=255, null=True
),
),
migrations.AddField(
model_name="book",
name="wikidata",
field=bookwyrm.models.fields.CharField(
blank=True, max_length=255, null=True
),
),
]

View file

@ -0,0 +1,24 @@
# Generated by Django 3.2.12 on 2022-02-17 17:08
from django.db import migrations, models
import uuid
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0135_auto_20220217_1624"),
]
operations = [
migrations.AddField(
model_name="sitesettings",
name="admin_code",
field=models.CharField(default=uuid.uuid4, max_length=50),
),
migrations.AddField(
model_name="sitesettings",
name="install_mode",
field=models.BooleanField(default=False),
),
]

View file

@ -0,0 +1,18 @@
# Generated by Django 3.2.12 on 2022-02-17 19:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0136_auto_20220217_1708"),
]
operations = [
migrations.AlterField(
model_name="sitesettings",
name="allow_registration",
field=models.BooleanField(default=False),
),
]

View file

@ -0,0 +1,39 @@
# Generated by Django 3.2.12 on 2022-02-24 18:59
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0137_alter_sitesettings_allow_registration"),
]
operations = [
migrations.CreateModel(
name="AutoMod",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("string_match", models.CharField(max_length=200, unique=True)),
("flag_users", models.BooleanField(default=True)),
("flag_statuses", models.BooleanField(default=True)),
(
"created_by",
models.ForeignKey(
on_delete=django.db.models.deletion.PROTECT,
to=settings.AUTH_USER_MODEL,
),
),
],
),
]

View file

@ -0,0 +1,45 @@
# Generated by Django 3.2.12 on 2022-02-24 20:41
from django.db import migrations, models
import django.db.models.deletion
def set_report_statuses(apps, schema_editor):
"""copy over status fields"""
db_alias = schema_editor.connection.alias
report_model = apps.get_model("bookwyrm", "Report")
reports = report_model.objects.using(db_alias).filter(statuses__isnull=False)
for report in reports:
report.status = report.statuses.first()
report.save()
def set_reverse(apps, schema_editor):
"""copy over status fields"""
db_alias = schema_editor.connection.alias
report_model = apps.get_model("bookwyrm", "Report")
reports = report_model.objects.using(db_alias).filter(status__isnull=False)
for report in reports:
report.statuses.set(report.status)
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0138_automod"),
]
operations = [
migrations.AddField(
model_name="report",
name="status",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.PROTECT,
related_name="reports",
to="bookwyrm.status",
),
),
migrations.RunPython(set_report_statuses, reverse_code=set_reverse),
]

View file

@ -0,0 +1,17 @@
# Generated by Django 3.2.12 on 2022-02-24 20:43
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0139_report_status"),
]
operations = [
migrations.RemoveField(
model_name="report",
name="statuses",
),
]

View file

@ -0,0 +1,24 @@
# Generated by Django 3.2.12 on 2022-02-24 20:50
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0140_remove_report_statuses"),
]
operations = [
migrations.AlterField(
model_name="report",
name="status",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.PROTECT,
to="bookwyrm.status",
),
),
]

View file

@ -0,0 +1,68 @@
# Generated by Django 3.2.12 on 2022-02-27 17:52
from django.db import migrations, models
import django.db.models.deletion
def add_default_themes(apps, schema_editor):
"""add light and dark themes"""
db_alias = schema_editor.connection.alias
theme_model = apps.get_model("bookwyrm", "Theme")
theme_model.objects.using(db_alias).create(
name="BookWyrm Light",
path="css/themes/bookwyrm-light.scss",
)
theme_model.objects.using(db_alias).create(
name="BookWyrm Dark",
path="css/themes/bookwyrm-dark.scss",
)
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0141_alter_report_status"),
]
operations = [
migrations.CreateModel(
name="Theme",
fields=[
(
"id",
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("created_date", models.DateTimeField(auto_now_add=True)),
("name", models.CharField(max_length=50, unique=True)),
("path", models.CharField(max_length=50, unique=True)),
],
),
migrations.AddField(
model_name="sitesettings",
name="default_theme",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="bookwyrm.theme",
),
),
migrations.AddField(
model_name="user",
name="theme",
field=models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="bookwyrm.theme",
),
),
migrations.RunPython(
add_default_themes, reverse_code=migrations.RunPython.noop
),
]

View file

@ -0,0 +1,19 @@
# Generated by Django 3.2.12 on 2022-02-28 19:44
import bookwyrm.models.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0141_alter_report_status"),
]
operations = [
migrations.AddField(
model_name="user",
name="hide_follows",
field=bookwyrm.models.fields.BooleanField(default=False),
),
]

View file

@ -0,0 +1,13 @@
# Generated by Django 3.2.12 on 2022-02-28 21:28
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0142_auto_20220227_1752"),
("bookwyrm", "0142_user_hide_follows"),
]
operations = []

View file

@ -0,0 +1,39 @@
# Generated by Django 3.2.12 on 2022-03-01 18:46
from django.db import migrations, models
def remove_white(apps, schema_editor):
"""don't hardcode white announcements"""
db_alias = schema_editor.connection.alias
announcement_model = apps.get_model("bookwyrm", "Announcement")
announcement_model.objects.using(db_alias).filter(display_type="white-ter").update(
display_type=None
)
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0143_merge_0142_auto_20220227_1752_0142_user_hide_follows"),
]
operations = [
migrations.AlterField(
model_name="announcement",
name="display_type",
field=models.CharField(
blank=True,
choices=[
("primary-light", "Primary"),
("success-light", "Success"),
("link-light", "Link"),
("warning-light", "Warning"),
("danger-light", "Danger"),
],
max_length=20,
null=True,
),
),
migrations.RunPython(remove_white, reverse_code=migrations.RunPython.noop),
]

View file

@ -0,0 +1,18 @@
# Generated by Django 3.2.12 on 2022-03-16 18:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0144_alter_announcement_display_type"),
]
operations = [
migrations.AddField(
model_name="sitesettings",
name="version",
field=models.CharField(blank=True, max_length=10, null=True),
),
]

Some files were not shown because too many files have changed in this diff Show more