diff --git a/.env.example b/.env.example index 4c457f625..dd7bec4f2 100644 --- a/.env.example +++ b/.env.example @@ -61,7 +61,7 @@ SEARCH_TIMEOUT=5 QUERY_TIMEOUT=5 # Thumbnails Generation -ENABLE_THUMBNAIL_GENERATION=false +ENABLE_THUMBNAIL_GENERATION=true # S3 configuration USE_S3=false diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml index 7258b6087..95a0ebfb0 100644 --- a/.github/workflows/black.yml +++ b/.github/workflows/black.yml @@ -10,6 +10,6 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - - uses: psf/black@21.4b2 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + - uses: psf/black@22.12.0 diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index d35f90eb5..68bb05d7e 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -36,11 +36,11 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v1 + uses: github/codeql-action/init@v2 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -51,7 +51,7 @@ jobs: # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v1 + uses: github/codeql-action/autobuild@v2 # ℹī¸ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -65,4 +65,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v1 + uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/curlylint.yaml b/.github/workflows/curlylint.yaml index 593a42837..8d5c6b4f7 100644 --- a/.github/workflows/curlylint.yaml +++ b/.github/workflows/curlylint.yaml @@ -10,7 +10,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install curlylint run: pip install curlylint diff --git a/.github/workflows/django-tests.yml b/.github/workflows/django-tests.yml index 4335a4605..da11fe09e 100644 --- a/.github/workflows/django-tests.yml +++ b/.github/workflows/django-tests.yml @@ -23,9 +23,9 @@ jobs: ports: - 5432:5432 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.9 - name: Install Dependencies diff --git a/.github/workflows/lint-frontend.yaml b/.github/workflows/lint-frontend.yaml index c97ee02ad..0d0559e40 100644 --- a/.github/workflows/lint-frontend.yaml +++ b/.github/workflows/lint-frontend.yaml @@ -19,7 +19,7 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it. - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install modules run: npm install stylelint stylelint-config-recommended stylelint-config-standard stylelint-order eslint diff --git a/.github/workflows/prettier.yaml b/.github/workflows/prettier.yaml index c4a031dba..a081e1a7a 100644 --- a/.github/workflows/prettier.yaml +++ b/.github/workflows/prettier.yaml @@ -14,7 +14,7 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it. - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install modules run: npm install prettier diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index a3117f7cb..3811c97d3 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -12,9 +12,9 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python 3.9 - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: 3.9 - name: Install Dependencies diff --git a/bookwyrm/activitypub/book.py b/bookwyrm/activitypub/book.py index 745aa3aab..d3aca4471 100644 --- a/bookwyrm/activitypub/book.py +++ b/bookwyrm/activitypub/book.py @@ -92,3 +92,4 @@ class Author(BookData): bio: str = "" wikipediaLink: str = "" type: str = "Author" + website: str = "" diff --git a/bookwyrm/forms/author.py b/bookwyrm/forms/author.py index a7811180f..37dba629f 100644 --- a/bookwyrm/forms/author.py +++ b/bookwyrm/forms/author.py @@ -15,6 +15,7 @@ class AuthorForm(CustomForm): "aliases", "bio", "wikipedia_link", + "website", "born", "died", "openlibrary_key", @@ -31,6 +32,7 @@ class AuthorForm(CustomForm): "wikipedia_link": forms.TextInput( attrs={"aria-describedby": "desc_wikipedia_link"} ), + "website": forms.TextInput(attrs={"aria-describedby": "desc_website"}), "born": forms.SelectDateWidget(attrs={"aria-describedby": "desc_born"}), "died": forms.SelectDateWidget(attrs={"aria-describedby": "desc_died"}), "oepnlibrary_key": forms.TextInput( diff --git a/bookwyrm/migrations/0173_auto_20221228_1436.py b/bookwyrm/migrations/0173_auto_20221228_1436.py new file mode 100644 index 000000000..1f6e1d87e --- /dev/null +++ b/bookwyrm/migrations/0173_auto_20221228_1436.py @@ -0,0 +1,33 @@ +# Generated by Django 3.2.16 on 2022-12-28 14:36 + +import bookwyrm.models.fields +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("bookwyrm", "0172_alter_user_preferred_language"), + ] + + operations = [ + migrations.AddField( + model_name="author", + name="website", + field=bookwyrm.models.fields.CharField( + blank=True, max_length=255, null=True + ), + ), + migrations.AlterField( + model_name="author", + name="isfdb", + field=bookwyrm.models.fields.CharField(blank=True, max_length=6, null=True), + ), + migrations.AlterField( + model_name="author", + name="isni", + field=bookwyrm.models.fields.CharField( + blank=True, max_length=19, null=True + ), + ), + ] diff --git a/bookwyrm/models/author.py b/bookwyrm/models/author.py index b1d0510c9..78381a65e 100644 --- a/bookwyrm/models/author.py +++ b/bookwyrm/models/author.py @@ -17,12 +17,15 @@ class Author(BookDataModel): max_length=255, blank=True, null=True, deduplication_field=True ) isni = fields.CharField( - max_length=255, blank=True, null=True, deduplication_field=True + max_length=19, blank=True, null=True, deduplication_field=True ) gutenberg_id = fields.CharField( max_length=255, blank=True, null=True, deduplication_field=True ) isfdb = fields.CharField( + max_length=6, blank=True, null=True, deduplication_field=True + ) + website = fields.CharField( max_length=255, blank=True, null=True, deduplication_field=True ) # idk probably other keys would be useful here? diff --git a/bookwyrm/models/book.py b/bookwyrm/models/book.py index a5be51a29..c44d47dd9 100644 --- a/bookwyrm/models/book.py +++ b/bookwyrm/models/book.py @@ -58,7 +58,7 @@ class BookDataModel(ObjectMixin, BookWyrmModel): max_length=255, blank=True, null=True, deduplication_field=True ) isfdb = fields.CharField( - max_length=255, blank=True, null=True, deduplication_field=True + max_length=6, blank=True, null=True, deduplication_field=True ) search_vector = SearchVectorField(null=True) diff --git a/bookwyrm/templates/author/author.html b/bookwyrm/templates/author/author.html index ade654568..62947eec0 100644 --- a/bookwyrm/templates/author/author.html +++ b/bookwyrm/templates/author/author.html @@ -28,7 +28,7 @@ {% firstof author.aliases author.born author.died as details %} - {% firstof author.wikipedia_link author.openlibrary_key author.inventaire_id author.isni author.isfdb as links %} + {% firstof author.wikipedia_link author.website author.openlibrary_key author.inventaire_id author.isni author.isfdb as links %} {% if details or links %}
{% if details %} @@ -73,6 +73,14 @@
{% endif %} + {% if author.website %} +
+ + {% trans "Website" %} + +
+ {% endif %} + {% if author.isni %}
diff --git a/bookwyrm/templates/author/edit_author.html b/bookwyrm/templates/author/edit_author.html index 1916df6be..9ea932bf6 100644 --- a/bookwyrm/templates/author/edit_author.html +++ b/bookwyrm/templates/author/edit_author.html @@ -57,6 +57,10 @@ {% include 'snippets/form_errors.html' with errors_list=form.wikipedia_link.errors id="desc_wikipedia_link" %} +

{{ form.website }}

+ + {% include 'snippets/form_errors.html' with errors_list=form.website.errors id="desc_website" %} +
diff --git a/bookwyrm/templates/snippets/form_rate_stars.html b/bookwyrm/templates/snippets/form_rate_stars.html index 71499b700..8cc405abb 100644 --- a/bookwyrm/templates/snippets/form_rate_stars.html +++ b/bookwyrm/templates/snippets/form_rate_stars.html @@ -37,7 +37,7 @@ type="radio" name="rating" value="{{ forloop.counter0 }}.5" - {% if default_rating > 0 and default_rating >= forloop.counter0 %}checked{% endif %} + {% if default_rating > 0 and default_rating > forloop.counter0 %}checked{% endif %} /> {{ book_title }}" {% csrf_token %} - + {% endblock %} {% block reading-dates %} diff --git a/bookwyrm/templates/snippets/reading_modals/start_reading_modal.html b/bookwyrm/templates/snippets/reading_modals/start_reading_modal.html index 861f118f9..d8331a281 100644 --- a/bookwyrm/templates/snippets/reading_modals/start_reading_modal.html +++ b/bookwyrm/templates/snippets/reading_modals/start_reading_modal.html @@ -10,9 +10,9 @@ Start "{{ book_title }}" {% block modal-form-open %}
+{% csrf_token %} -{% csrf_token %} {% endblock %} {% block reading-dates %} diff --git a/bookwyrm/templates/snippets/reading_modals/want_to_read_modal.html b/bookwyrm/templates/snippets/reading_modals/want_to_read_modal.html index d6bc4d70a..80d67f79e 100644 --- a/bookwyrm/templates/snippets/reading_modals/want_to_read_modal.html +++ b/bookwyrm/templates/snippets/reading_modals/want_to_read_modal.html @@ -10,9 +10,9 @@ Want to Read "{{ book_title }}" {% block modal-form-open %} +{% csrf_token %} -{% csrf_token %} {% endblock %} {% block form %} diff --git a/bookwyrm/templates/snippets/shelf_selector.html b/bookwyrm/templates/snippets/shelf_selector.html index feea50d7b..902a66196 100644 --- a/bookwyrm/templates/snippets/shelf_selector.html +++ b/bookwyrm/templates/snippets/shelf_selector.html @@ -22,7 +22,6 @@ -