From dbd5a02617a19f501a6494e6f5179a73bee3f069 Mon Sep 17 00:00:00 2001 From: Vivianne Langdon Date: Wed, 16 Mar 2022 23:56:19 -0700 Subject: [PATCH 01/41] specify npm prefix and stylelint configs and adjust ignores --- bw-dev | 18 ++++++++++-------- dev-tools/.stylelintignore | 1 + dev-tools/.stylelintrc.js | 2 +- dev-tools/Dockerfile | 7 ++++--- dev-tools/package.json | 1 + docker-compose.yml | 1 + 6 files changed, 18 insertions(+), 12 deletions(-) diff --git a/bw-dev b/bw-dev index b610758fe..6b1d52255 100755 --- a/bw-dev +++ b/bw-dev @@ -139,19 +139,21 @@ case "$CMD" in docker-compose run --rm dev-tools black celerywyrm bookwyrm ;; prettier) - docker-compose run --rm dev-tools npx prettier --write bookwyrm/static/js/*.js + docker-compose run --rm dev-tools npm exec --prefix=dev-tools/ -- prettier \ + --write bookwyrm/static/js/*.js ;; stylelint) - docker-compose run --rm dev-tools npx stylelint \ - bookwyrm/static/css/bookwyrm.scss bookwyrm/static/css/bookwyrm/**/*.scss --fix \ - --config dev-tools/.stylelintrc.js + docker-compose run --rm dev-tools npm exec --prefix=dev-tools/ -- stylelint \ + --fix --config=dev-tools/.stylelintrc.js --ignore-path=dev-tools/.stylelintignore \ + bookwyrm/static/css ;; formatters) docker-compose run --rm dev-tools black celerywyrm bookwyrm - docker-compose run --rm dev-tools npx prettier --write bookwyrm/static/js/*.js - docker-compose run --rm dev-tools npx stylelint \ - bookwyrm/static/css/bookwyrm.scss bookwyrm/static/css/bookwyrm/**/*.scss --fix \ - --config dev-tools/.stylelintrc.js + docker-compose run --rm dev-tools npm exec --prefix=dev-tools/ -- prettier \ + --write bookwyrm/static/js/*.js + docker-compose run --rm dev-tools npm exec --prefix=dev-tools/ -- stylelint \ + --fix --config=dev-tools/.stylelintrc.js --ignore-path=dev-tools/.stylelintignore \ + bookwyrm/static/css ;; compilescss) runweb python manage.py compilescss diff --git a/dev-tools/.stylelintignore b/dev-tools/.stylelintignore index b2cd33f89..441f5eb72 100644 --- a/dev-tools/.stylelintignore +++ b/dev-tools/.stylelintignore @@ -1 +1,2 @@ **/vendor/** +**/fonts/** diff --git a/dev-tools/.stylelintrc.js b/dev-tools/.stylelintrc.js index 7ab51b9b3..ba9c50e96 100644 --- a/dev-tools/.stylelintrc.js +++ b/dev-tools/.stylelintrc.js @@ -1,7 +1,7 @@ /* global module */ module.exports = { - "extends": "stylelint-config-standard", + "extends": "stylelint-config-standard-scss", "plugins": [ "stylelint-order" diff --git a/dev-tools/Dockerfile b/dev-tools/Dockerfile index c207a60d0..9e3ddc324 100644 --- a/dev-tools/Dockerfile +++ b/dev-tools/Dockerfile @@ -2,13 +2,14 @@ FROM python:3.9 ENV PYTHONUNBUFFERED 1 -RUN mkdir /app -WORKDIR /app +WORKDIR /app/dev-tools -COPY package.json requirements.txt .stylelintrc.js .stylelintignore /app/ +COPY package.json requirements.txt .stylelintrc.js .stylelintignore /app/dev-tools/ RUN pip install -r requirements.txt RUN apt-get update && apt-get install -y curl RUN curl -sL https://deb.nodesource.com/setup_17.x | bash - RUN apt-get install -y nodejs && apt-get clean RUN npm install . + +WORKDIR /app diff --git a/dev-tools/package.json b/dev-tools/package.json index 3fbc940cb..f7b996b77 100644 --- a/dev-tools/package.json +++ b/dev-tools/package.json @@ -11,6 +11,7 @@ "stylelint-config-recommended": "^7.0.0", "stylelint-config-standard": "^25.0.0", "stylelint-order": "^5.0.0", + "stylelint-config-standard-scss": "^3.0.0", "watch": "^0.13.0" }, "dependencies": { diff --git a/docker-compose.yml b/docker-compose.yml index e45cae0d1..f8e0e3ad7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -101,6 +101,7 @@ services: build: dev-tools env_file: .env volumes: + - /app/dev-tools/ - .:/app volumes: pgdata: From 6f27b5fd2e49836dcaafe34ef8ef50b5320320e0 Mon Sep 17 00:00:00 2001 From: Vivianne Langdon Date: Wed, 16 Mar 2022 23:56:34 -0700 Subject: [PATCH 02/41] auto-fixes from running this --- bookwyrm/static/css/bookwyrm.scss | 1 - bookwyrm/static/css/bookwyrm/_all.scss | 6 ------ bookwyrm/static/css/themes/bookwyrm-dark.scss | 3 +-- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/bookwyrm/static/css/bookwyrm.scss b/bookwyrm/static/css/bookwyrm.scss index 437795457..c44bf990c 100644 --- a/bookwyrm/static/css/bookwyrm.scss +++ b/bookwyrm/static/css/bookwyrm.scss @@ -1,4 +1,3 @@ @charset "utf-8"; - @import "vendor/bulma/bulma.sass"; @import "bookwyrm/all.scss"; diff --git a/bookwyrm/static/css/bookwyrm/_all.scss b/bookwyrm/static/css/bookwyrm/_all.scss index 6002785f7..bdc34784b 100644 --- a/bookwyrm/static/css/bookwyrm/_all.scss +++ b/bookwyrm/static/css/bookwyrm/_all.scss @@ -16,9 +16,7 @@ @import "components/status"; @import "components/tabs"; @import "components/toggle"; - @import "overrides/bulma_overrides"; - @import "utilities/a11y"; @import "utilities/alignments"; @import "utilities/colors"; @@ -77,7 +75,6 @@ button::-moz-focus-inner { /** Utilities not covered by Bulma ******************************************************************************/ - .tag.is-small { height: auto; } @@ -128,8 +125,6 @@ button:focus-visible .button-invisible-overlay { opacity: 1; } - - /** Tooltips ******************************************************************************/ @@ -151,7 +146,6 @@ button:focus-visible .button-invisible-overlay { cursor: not-allowed; } - /* Notifications page ******************************************************************************/ diff --git a/bookwyrm/static/css/themes/bookwyrm-dark.scss b/bookwyrm/static/css/themes/bookwyrm-dark.scss index 466d8026d..24c21bae2 100644 --- a/bookwyrm/static/css/themes/bookwyrm-dark.scss +++ b/bookwyrm/static/css/themes/bookwyrm-dark.scss @@ -69,7 +69,7 @@ $navbar-dropdown-item-hover-color: $white; } /* misc */ -$shadow: 0 0.5em 1em -0.125em rgba($black, 0.2), 0 0px 0 1px rgba($black, 0.02); +$shadow: 0 0.5em 1em -0.125em rgba($black, 0.2), 0 0 0 1px rgba($black, 0.02); $card-header-shadow: 0 0.125em 0.25em rgba($black, 0.1); $invisible-overlay-background-color: rgba($black, 0.66); $progress-value-background-color: $border-light; @@ -79,6 +79,5 @@ $progress-value-background-color: $border-light; $family-primary: $family-sans-serif; $family-secondary: $family-sans-serif; - @import "../bookwyrm.scss"; @import "../vendor/icons.css"; From 54b8d2c3f372c74cc7626f274d543e0366923a80 Mon Sep 17 00:00:00 2001 From: Vivianne Langdon Date: Thu, 17 Mar 2022 00:44:16 -0700 Subject: [PATCH 03/41] add import rule override for styles --- dev-tools/.stylelintrc.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dev-tools/.stylelintrc.js b/dev-tools/.stylelintrc.js index ba9c50e96..a3403e89c 100644 --- a/dev-tools/.stylelintrc.js +++ b/dev-tools/.stylelintrc.js @@ -18,5 +18,13 @@ module.exports = { "declaration-block-no-redundant-longhand-properties": null, "no-descending-specificity": null, "alpha-value-notation": null - } + }, + "overrides": [ + { + "files": [ "../**/themes/bookwyrm-*.scss" ], + "rules": { + "no-invalid-position-at-import-rule": null + } + } + ] }; From 225957ba8a6bdea48845d3f102725632cca99ad5 Mon Sep 17 00:00:00 2001 From: Vivianne Langdon Date: Thu, 17 Mar 2022 00:44:34 -0700 Subject: [PATCH 04/41] remove non-css extensions --- bookwyrm/static/css/bookwyrm.scss | 4 ++-- bookwyrm/static/css/themes/bookwyrm-dark.scss | 4 ++-- bookwyrm/static/css/themes/bookwyrm-light.scss | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bookwyrm/static/css/bookwyrm.scss b/bookwyrm/static/css/bookwyrm.scss index c44bf990c..17d6d9119 100644 --- a/bookwyrm/static/css/bookwyrm.scss +++ b/bookwyrm/static/css/bookwyrm.scss @@ -1,3 +1,3 @@ @charset "utf-8"; -@import "vendor/bulma/bulma.sass"; -@import "bookwyrm/all.scss"; +@import "vendor/bulma/bulma"; +@import "bookwyrm/all"; diff --git a/bookwyrm/static/css/themes/bookwyrm-dark.scss b/bookwyrm/static/css/themes/bookwyrm-dark.scss index 24c21bae2..35acbcb02 100644 --- a/bookwyrm/static/css/themes/bookwyrm-dark.scss +++ b/bookwyrm/static/css/themes/bookwyrm-dark.scss @@ -1,4 +1,4 @@ -@import "../vendor/bulma/sass/utilities/initial-variables.sass"; +@import "../vendor/bulma/sass/utilities/initial-variables"; /* Colors ******************************************************************************/ @@ -79,5 +79,5 @@ $progress-value-background-color: $border-light; $family-primary: $family-sans-serif; $family-secondary: $family-sans-serif; -@import "../bookwyrm.scss"; +@import "../bookwyrm"; @import "../vendor/icons.css"; diff --git a/bookwyrm/static/css/themes/bookwyrm-light.scss b/bookwyrm/static/css/themes/bookwyrm-light.scss index c74d2ee20..291ae5f08 100644 --- a/bookwyrm/static/css/themes/bookwyrm-light.scss +++ b/bookwyrm/static/css/themes/bookwyrm-light.scss @@ -1,4 +1,4 @@ -@import "../vendor/bulma/sass/utilities/derived-variables.sass"; +@import "../vendor/bulma/sass/utilities/derived-variables"; /* Colors ******************************************************************************/ @@ -55,5 +55,5 @@ $invisible-overlay-background-color: rgba($scheme-invert, 0.66); $family-primary: $family-sans-serif; $family-secondary: $family-sans-serif; -@import "../bookwyrm.scss"; +@import "../bookwyrm"; @import "../vendor/icons.css"; From 51bb4c6f5d733c3cb08f5565ead399be8b1d614b Mon Sep 17 00:00:00 2001 From: Vivianne Langdon Date: Thu, 17 Mar 2022 00:49:22 -0700 Subject: [PATCH 05/41] make bw-dev consistent --- bw-dev | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bw-dev b/bw-dev index 6b1d52255..4ce324301 100755 --- a/bw-dev +++ b/bw-dev @@ -139,20 +139,20 @@ case "$CMD" in docker-compose run --rm dev-tools black celerywyrm bookwyrm ;; prettier) - docker-compose run --rm dev-tools npm exec --prefix=dev-tools/ -- prettier \ + docker-compose run --rm dev-tools npm exec --prefix dev-tools -- prettier \ --write bookwyrm/static/js/*.js ;; stylelint) - docker-compose run --rm dev-tools npm exec --prefix=dev-tools/ -- stylelint \ - --fix --config=dev-tools/.stylelintrc.js --ignore-path=dev-tools/.stylelintignore \ + docker-compose run --rm dev-tools npm exec --prefix dev-tools -- stylelint \ + --fix --config dev-tools/.stylelintrc.js --ignore-path dev-tools/.stylelintignore \ bookwyrm/static/css ;; formatters) docker-compose run --rm dev-tools black celerywyrm bookwyrm - docker-compose run --rm dev-tools npm exec --prefix=dev-tools/ -- prettier \ + docker-compose run --rm dev-tools npm exec --prefix dev-tools -- prettier \ --write bookwyrm/static/js/*.js - docker-compose run --rm dev-tools npm exec --prefix=dev-tools/ -- stylelint \ - --fix --config=dev-tools/.stylelintrc.js --ignore-path=dev-tools/.stylelintignore \ + docker-compose run --rm dev-tools npm exec --prefix dev-tools -- stylelint \ + --fix --config dev-tools/.stylelintrc.js --ignore-path dev-tools/.stylelintignore \ bookwyrm/static/css ;; compilescss) From a05942fe15981f77761822ca1cc691d4658d76e5 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Sun, 6 Aug 2023 18:23:57 -0700 Subject: [PATCH 06/41] Allow searching for local users when logged out --- bookwyrm/views/search.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/bookwyrm/views/search.py b/bookwyrm/views/search.py index bc3b2aa57..2b7303fd7 100644 --- a/bookwyrm/views/search.py +++ b/bookwyrm/views/search.py @@ -91,18 +91,15 @@ def book_search(request): def user_search(request): - """cool kids members only user search""" + """user search: search for a user""" viewer = request.user query = request.GET.get("q") query = query.strip() data = {"type": "user", "query": query} - # logged out viewers can't search users - if not viewer.is_authenticated: - return TemplateResponse(request, "search/user.html", data) # use webfinger for mastodon style account@domain.com username to load the user if # they don't exist locally (handle_remote_webfinger will check the db) - if re.match(regex.FULL_USERNAME, query): + if re.match(regex.FULL_USERNAME, query) and viewer.is_authenticated: handle_remote_webfinger(query) results = ( @@ -118,6 +115,11 @@ def user_search(request): ) .order_by("-similarity") ) + + # don't expose remote users + if not viewer.is_authenticated: + results = results.filter(local=True) + paginated = Paginator(results, PAGE_LENGTH) page = paginated.get_page(request.GET.get("page")) data["results"] = page From d7adada29c1f39a11983823fe533478ce0dfa257 Mon Sep 17 00:00:00 2001 From: Margaret Fero Date: Tue, 15 Aug 2023 22:53:43 -0700 Subject: [PATCH 07/41] Add Spanish Articles Added articles for spanish language to list of articles in settings --- bookwyrm/settings.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bookwyrm/settings.py b/bookwyrm/settings.py index 829ddaef7..6c627c5c0 100644 --- a/bookwyrm/settings.py +++ b/bookwyrm/settings.py @@ -315,6 +315,7 @@ LANGUAGES = [ LANGUAGE_ARTICLES = { "English": {"the", "a", "an"}, + "Español (Spanish)": {"un", "una", "unos", "unas", "el", "la", "los", "las"}, } TIME_ZONE = "UTC" From dfa935bd72828b5560ca1887937ddaa1a4c309e3 Mon Sep 17 00:00:00 2001 From: Abraham Toriz Date: Thu, 20 Jul 2023 22:16:28 -0600 Subject: [PATCH 08/41] fix pointed ids of labels in invite request form --- bookwyrm/templates/settings/registration.html | 2 +- bookwyrm/templates/settings/registration_limited.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bookwyrm/templates/settings/registration.html b/bookwyrm/templates/settings/registration.html index 3ebfff9ae..2de131811 100644 --- a/bookwyrm/templates/settings/registration.html +++ b/bookwyrm/templates/settings/registration.html @@ -75,7 +75,7 @@ {% include 'snippets/form_errors.html' with errors_list=form.invite_request_text.errors id="desc_invite_request_text" %}
-
-
-
-
-
{% endif %} From 1778c56be0d8ff86af9a77f2ac2512b0f7bf66d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adeodato=20Sim=C3=B3?= Date: Mon, 9 Oct 2023 04:24:05 -0300 Subject: [PATCH 24/41] URL-encode book series name when linking to it Closes: #3021. --- bookwyrm/templates/book/book.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bookwyrm/templates/book/book.html b/bookwyrm/templates/book/book.html index 6dc53fba9..9083f9bdc 100644 --- a/bookwyrm/templates/book/book.html +++ b/bookwyrm/templates/book/book.html @@ -48,7 +48,7 @@ {% if book.authors.exists %} - + {% endif %} {{ book.series }}{% if book.series_number %} #{{ book.series_number }}{% endif %} {% if book.authors.exists %} From 97adf2f7fde94d6e4e110de60eaed2944b332ad8 Mon Sep 17 00:00:00 2001 From: Jascha Urbach Date: Sat, 14 Oct 2023 17:21:15 +0200 Subject: [PATCH 25/41] I changed my own comments to get rid of this warning which I could have better written in the first place. --- bookwyrm/static/js/forms.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bookwyrm/static/js/forms.js b/bookwyrm/static/js/forms.js index 08066f137..4a075506e 100644 --- a/bookwyrm/static/js/forms.js +++ b/bookwyrm/static/js/forms.js @@ -47,12 +47,11 @@ .querySelectorAll("[data-remove]") .forEach((node) => node.addEventListener("click", removeInput)); - // Get the element, add a keypress listener... + // Get element, add a keypress listener... document.getElementById("subjects").addEventListener("keypress", function (e) { - // e.target is the element where it listens! - // if e.target is input field within the "subjects" div, do stuff + // Linstening to element e.target + // If e.target is an input field within "subjects" div preventDefault() if (e.target && e.target.nodeName == "INPUT") { - // Item found, prevent default if (event.keyCode == 13) { event.preventDefault(); } From 0f79aea36fb17e80db81902cd048565c7bb15995 Mon Sep 17 00:00:00 2001 From: Jascha Urbach Date: Sat, 14 Oct 2023 17:52:58 +0200 Subject: [PATCH 26/41] introduce .prettierrc With this pullrequest I introduce .prettierrc with one rule: 'trailingComma': 'none' --- .prettierrc | 1 + bookwyrm/static/js/autocomplete.js | 84 +++++++++++++++--------------- bookwyrm/static/js/bookwyrm.js | 26 ++++----- bookwyrm/static/js/guided_tour.js | 4 +- bookwyrm/static/js/tabs.js | 4 +- 5 files changed, 60 insertions(+), 59 deletions(-) create mode 100644 .prettierrc diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 000000000..c549b16ba --- /dev/null +++ b/.prettierrc @@ -0,0 +1 @@ +'trailingComma': 'none' \ No newline at end of file diff --git a/bookwyrm/static/js/autocomplete.js b/bookwyrm/static/js/autocomplete.js index a98cd9634..16281f5a5 100644 --- a/bookwyrm/static/js/autocomplete.js +++ b/bookwyrm/static/js/autocomplete.js @@ -88,64 +88,64 @@ const tries = { mimetype: { a: { a: { - c: "AAC", + c: "AAC" }, z: { - w: "AZW", - }, + w: "AZW" + } }, d: { a: { i: { s: { - y: "Daisy", - }, - }, - }, + y: "Daisy" + } + } + } }, e: { p: { u: { - b: "EPUB", - }, - }, + b: "EPUB" + } + } }, f: { l: { a: { - c: "FLAC", - }, - }, + c: "FLAC" + } + } }, h: { t: { m: { - l: "HTML", - }, - }, + l: "HTML" + } + } }, m: { 4: { a: "M4A", - b: "M4B", + b: "M4B" }, o: { b: { - i: "MOBI", - }, + i: "MOBI" + } }, p: { - 3: "MP3", - }, + 3: "MP3" + } }, o: { g: { - g: "OGG", - }, + g: "OGG" + } }, p: { d: { - f: "PDF", + f: "PDF" }, l: { a: { @@ -154,13 +154,13 @@ const tries = { t: { e: { x: { - t: "Plaintext", - }, - }, - }, - }, - }, - }, + t: "Plaintext" + } + } + } + } + } + } }, r: { i: { @@ -170,15 +170,15 @@ const tries = { b: { o: { o: { - k: "Print book", - }, - }, - }, - }, - }, - }, - }, - }, - }, - }, + k: "Print book" + } + } + } + } + } + } + } + } + } + } }; diff --git a/bookwyrm/static/js/bookwyrm.js b/bookwyrm/static/js/bookwyrm.js index 67d64688f..b67ee55a0 100644 --- a/bookwyrm/static/js/bookwyrm.js +++ b/bookwyrm/static/js/bookwyrm.js @@ -352,8 +352,8 @@ let BookWyrm = new (class { method: "POST", body: new FormData(form), headers: { - Accept: "application/json", - }, + Accept: "application/json" + } }); } @@ -620,7 +620,7 @@ let BookWyrm = new (class { 'input:not([type="hidden"]):not([disabled])', "select:not([disabled])", "details:not([disabled])", - '[tabindex]:not([tabindex="-1"]):not([disabled])', + '[tabindex]:not([tabindex="-1"]):not([disabled])' ].join(",") ); const firstFocusableEl = focusableEls[0]; @@ -675,8 +675,8 @@ let BookWyrm = new (class { target: scannerNode, constraints: { facingMode: "environment", - deviceId: cameraId, - }, + deviceId: cameraId + } }, decoder: { readers: [ @@ -684,12 +684,12 @@ let BookWyrm = new (class { { format: "ean_reader", config: { - supplements: ["ean_2_reader", "ean_5_reader"], - }, - }, + supplements: ["ean_2_reader", "ean_5_reader"] + } + } ], - multiple: false, - }, + multiple: false + } }, (err) => { if (err) { @@ -756,7 +756,7 @@ let BookWyrm = new (class { .forEach((box) => { Quagga.ImageDebug.drawPath(box, { x: 0, y: 1 }, drawingCtx, { color: "green", - lineWidth: 2, + lineWidth: 2 }); }); } @@ -764,14 +764,14 @@ let BookWyrm = new (class { if (result.box) { Quagga.ImageDebug.drawPath(result.box, { x: 0, y: 1 }, drawingCtx, { color: "#00F", - lineWidth: 2, + lineWidth: 2 }); } if (result.codeResult && result.codeResult.code) { Quagga.ImageDebug.drawPath(result.line, { x: "x", y: "y" }, drawingCtx, { color: "red", - lineWidth: 3, + lineWidth: 3 }); } } diff --git a/bookwyrm/static/js/guided_tour.js b/bookwyrm/static/js/guided_tour.js index 56cdcdf57..a52de6edf 100644 --- a/bookwyrm/static/js/guided_tour.js +++ b/bookwyrm/static/js/guided_tour.js @@ -9,10 +9,10 @@ function disableGuidedTour(csrf_token) { "use strict"; fetch("/guided-tour/False", { headers: { - "X-CSRFToken": csrf_token, + "X-CSRFToken": csrf_token }, method: "POST", redirect: "follow", - mode: "same-origin", + mode: "same-origin" }); } diff --git a/bookwyrm/static/js/tabs.js b/bookwyrm/static/js/tabs.js index 1dcb0cace..5d5b426e8 100644 --- a/bookwyrm/static/js/tabs.js +++ b/bookwyrm/static/js/tabs.js @@ -32,7 +32,7 @@ class TabGroup { left: 37, up: 38, right: 39, - down: 40, + down: 40 }; } @@ -42,7 +42,7 @@ class TabGroup { 37: -1, 38: -1, 39: 1, - 40: 1, + 40: 1 }; } From 8f0f3e6ace98cf8812473b1569fc2f0b8204e437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adeodato=20Sim=C3=B3?= Date: Sun, 15 Oct 2023 19:43:51 -0300 Subject: [PATCH 27/41] ImportItem: preserve parsed timezones in date_started, date_read This is a follow-up to b564e514f ("Handle parsed dates that already have a timezone on import"), which was applied to `date_added` only. (Appart from consistency, this will allow to apply future parsing fixes more easily.) --- bookwyrm/models/import_job.py | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/bookwyrm/models/import_job.py b/bookwyrm/models/import_job.py index 8929e9037..8329ee955 100644 --- a/bookwyrm/models/import_job.py +++ b/bookwyrm/models/import_job.py @@ -259,12 +259,10 @@ class ImportItem(models.Model): except ValueError: return None - @property - def date_added(self): - """when the book was added to this dataset""" - if self.normalized_data.get("date_added"): + def _parse_datefield(self, field, /): + if self.normalized_data.get(field): parsed_date_added = dateutil.parser.parse( - self.normalized_data.get("date_added") + self.normalized_data.get(field) ) if timezone.is_aware(parsed_date_added): @@ -274,23 +272,20 @@ class ImportItem(models.Model): return timezone.make_aware(parsed_date_added) return None + @property + def date_added(self): + """when the book was added to this dataset""" + return self._parse_datefield("date_added") + @property def date_started(self): """when the book was started""" - if self.normalized_data.get("date_started"): - return timezone.make_aware( - dateutil.parser.parse(self.normalized_data.get("date_started")) - ) - return None + return self._parse_datefield("date_started") @property def date_read(self): """the date a book was completed""" - if self.normalized_data.get("date_finished"): - return timezone.make_aware( - dateutil.parser.parse(self.normalized_data.get("date_finished")) - ) - return None + return self._parse_datefield("date_finished") @property def reads(self): From c066d11eb1c62021a980ec1535b7c8fde0bbf9a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adeodato=20Sim=C3=B3?= Date: Sun, 15 Oct 2023 19:49:00 -0300 Subject: [PATCH 28/41] Bugfix: default missing date components to 1, not today's Fixes: #2660. --- bookwyrm/models/import_job.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/bookwyrm/models/import_job.py b/bookwyrm/models/import_job.py index 8329ee955..f5d86ad2e 100644 --- a/bookwyrm/models/import_job.py +++ b/bookwyrm/models/import_job.py @@ -1,4 +1,5 @@ """ track progress of goodreads imports """ +from datetime import datetime import math import re import dateutil.parser @@ -260,17 +261,14 @@ class ImportItem(models.Model): return None def _parse_datefield(self, field, /): - if self.normalized_data.get(field): - parsed_date_added = dateutil.parser.parse( - self.normalized_data.get(field) - ) + if not (date := self.normalized_data.get(field)): + return None - if timezone.is_aware(parsed_date_added): - # Keep timezone if import already had one - return parsed_date_added + defaults = datetime(1970, 1, 1) # "2022-10" => "2022-10-01" + parsed = dateutil.parser.parse(date, default=defaults) - return timezone.make_aware(parsed_date_added) - return None + # Keep timezone if import already had one, else use default. + return parsed if timezone.is_aware(parsed) else timezone.make_aware(parsed) @property def date_added(self): From c02306a66b23feb11e9436c0084a194c3485fda5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adeodato=20Sim=C3=B3?= Date: Sun, 15 Oct 2023 19:58:51 -0300 Subject: [PATCH 29/41] Default to Jan 1st too on incomplete dates received from ActivityPub --- bookwyrm/models/fields.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bookwyrm/models/fields.py b/bookwyrm/models/fields.py index d21c9363d..28effaf9b 100644 --- a/bookwyrm/models/fields.py +++ b/bookwyrm/models/fields.py @@ -1,5 +1,6 @@ """ activitypub-aware django model fields """ from dataclasses import MISSING +from datetime import datetime import re from uuid import uuid4 from urllib.parse import urljoin @@ -534,8 +535,10 @@ class DateTimeField(ActivitypubFieldMixin, models.DateTimeField): return value.isoformat() def field_from_activity(self, value, allow_external_connections=True): + missing_fields = datetime(1970, 1, 1) # "2022-10" => "2022-10-01" try: - date_value = dateutil.parser.parse(value) + # TODO(dato): investigate `ignoretz=True` wrt bookwyrm#3028. + date_value = dateutil.parser.parse(value, default=missing_fields) try: return timezone.make_aware(date_value) except ValueError: From 8afcb9b6d3e4ab46d38afed7e5bdc9cfd9c890f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adeodato=20Sim=C3=B3?= Date: Sun, 15 Oct 2023 22:03:45 -0300 Subject: [PATCH 30/41] Fix tests warning: ImportJob.updated_date received a naive datetime --- bookwyrm/tests/views/imports/test_import.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bookwyrm/tests/views/imports/test_import.py b/bookwyrm/tests/views/imports/test_import.py index ea88b197d..7dd87d4c2 100644 --- a/bookwyrm/tests/views/imports/test_import.py +++ b/bookwyrm/tests/views/imports/test_import.py @@ -7,6 +7,7 @@ from django.core.files.uploadedfile import SimpleUploadedFile from django.template.response import TemplateResponse from django.test import TestCase from django.test.client import RequestFactory +from django.utils import timezone from bookwyrm import forms, models, views from bookwyrm.tests.validate_html import validate_html @@ -128,7 +129,7 @@ class ImportViews(TestCase): def test_get_average_import_time_with_data(self): """Now, with data""" - now = datetime.datetime.now() + now = timezone.now() two_hours_ago = now - datetime.timedelta(hours=2) four_hours_ago = now - datetime.timedelta(hours=4) models.ImportJob.objects.create( @@ -152,7 +153,7 @@ class ImportViews(TestCase): def test_get_average_import_time_ignore_stopped(self): """Don't include stopped, do include no status""" - now = datetime.datetime.now() + now = timezone.now() two_hours_ago = now - datetime.timedelta(hours=2) four_hours_ago = now - datetime.timedelta(hours=4) models.ImportJob.objects.create( From 1937177e1a5df853d2cea1ba1436b4baa2290e14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adeodato=20Sim=C3=B3?= Date: Tue, 17 Oct 2023 02:25:26 -0300 Subject: [PATCH 31/41] dev-tools: use apt source for Node instead of setup script Extra bits: - use a single RUN instruction - silence upgrade notices from pip and npm --- dev-tools/Dockerfile | 20 ++++++++++---------- dev-tools/nodejs.sources | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 10 deletions(-) create mode 100644 dev-tools/nodejs.sources diff --git a/dev-tools/Dockerfile b/dev-tools/Dockerfile index 9abc7491e..7063aab1b 100644 --- a/dev-tools/Dockerfile +++ b/dev-tools/Dockerfile @@ -1,14 +1,14 @@ FROM python:3.9 - -ENV PYTHONUNBUFFERED 1 - -RUN mkdir /app WORKDIR /app -COPY package.json requirements.txt .stylelintrc.js .stylelintignore /app/ -RUN pip install -r requirements.txt +ENV PYTHONUNBUFFERED=1 +ENV NPM_CONFIG_UPDATE_NOTIFIER=false +ENV PIP_ROOT_USER_ACTION=ignore PIP_DISABLE_PIP_VERSION_CHECK=1 -RUN apt-get update && apt-get install -y curl -RUN curl -sL https://deb.nodesource.com/setup_18.x | bash - -RUN apt-get install -y nodejs && apt-get clean -RUN npm install . +COPY nodejs.sources /etc/apt/sources.list.d/ +COPY package.json requirements.txt .stylelintrc.js .stylelintignore /app/ + +RUN apt-get update && \ + apt-get install -y nodejs && \ + pip install -r requirements.txt && \ + npm install . diff --git a/dev-tools/nodejs.sources b/dev-tools/nodejs.sources new file mode 100644 index 000000000..1e0c3ba40 --- /dev/null +++ b/dev-tools/nodejs.sources @@ -0,0 +1,34 @@ +Types: deb +URIs: https://deb.nodesource.com/node_18.x +Suites: nodistro +Components: main +Signed-By: + -----BEGIN PGP PUBLIC KEY BLOCK----- + . + mQENBFdDN1ABCADaNd/I3j3tn40deQNgz7hB2NvT+syXe6k4ZmdiEcOfBvFrkS8B + hNS67t93etHsxEy7E0qwsZH32bKazMqe9zDwoa3aVImryjh6SHC9lMtW27JPHFeM + Srkt9YmH1WMwWcRO6eSY9B3PpazquhnvbammLuUojXRIxkDroy6Fw4UKmUNSRr32 + 9Ej87jRoR1B2/57Kfp2Y4+vFGGzSvh3AFQpBHq51qsNHALU6+8PjLfIt+5TPvaWR + TB+kAZnQZkaIQM2nr1n3oj6ak2RATY/+kjLizgFWzgEfbCrbsyq68UoY5FPBnu4Z + E3iDZpaIqwKr0seUC7iA1xM5eHi5kty1oB7HABEBAAG0Ik5Tb2xpZCA8bnNvbGlk + LWdwZ0Bub2Rlc291cmNlLmNvbT6JATgEEwECACIFAldDN1ACGwMGCwkIBwMCBhUI + AgkKCwQWAgMBAh4BAheAAAoJEC9ZtfmbG+C0y7wH/i4xnab36dtrYW7RZwL8i6Sc + NjMx4j9+U1kr/F6YtqWd+JwCbBdar5zRghxPcYEq/qf7MbgAYcs1eSOuTOb7n7+o + xUwdH2iCtHhKh3Jr2mRw1ks7BbFZPB5KmkxHaEBfLT4d+I91ZuUdPXJ+0SXs9gzk + Dbz65Uhoz3W03aiF8HeL5JNARZFMbHHNVL05U1sTGTCOtu+1c/33f3TulQ/XZ3Y4 + hwGCpLe0Tv7g7Lp3iLMZMWYPEa0a7S4u8he5IEJQLd8bE8jltcQvrdr3Fm8kI2Jg + BJmUmX4PSfhuTCFaR/yeCt3UoW883bs9LfbTzIx9DJGpRIu8Y0IL3b4sj/GoZVq5 + AQ0EV0M3UAEIAKrTaC62ayzqOIPa7nS90BHHck4Z33a2tZF/uof38xNOiyWGhT8u + JeFoTTHn5SQq5Ftyu4K3K2fbbpuu/APQF05AaljzVkDGNMW4pSkgOasdysj831cu + ssrHX2RYS22wg80k6C/Hwmh5F45faEuNxsV+bPx7oPUrt5n6GMx84vEP3i1+FDBi + 0pt/B/QnDFBXki1BGvJ35f5NwDefK8VaInxXP3ZN/WIbtn5dqxppkV/YkO7GiJlp + Jlju9rf3kKUIQzKQWxFsbCAPIHoWv7rH9RSxgDithXtG6Yg5R1aeBbJaPNXL9wpJ + YBJbiMjkAFaz4B95FOqZm3r7oHugiCGsHX0AEQEAAYkBHwQYAQIACQUCV0M3UAIb + DAAKCRAvWbX5mxvgtE/OB/0VN88DR3Y3fuqy7lq/dthkn7Dqm9YXdorZl3L152eE + IF882aG8FE3qZdaLGjQO4oShAyNWmRfSGuoH0XERXAI9n0r8m4mDMxE6rtP7tHet + y/5M8x3CTyuMgx5GLDaEUvBusnTD+/v/fBMwRK/cZ9du5PSG4R50rtst+oYyC2ao + x4I2SgjtF/cY7bECsZDplzatN3gv34PkcdIg8SLHAVlL4N5tzumDeizRspcSyoy2 + K2+hwKU4C4+dekLLTg8rjnRROvplV2KtaEk6rxKtIRFDCoQng8wfJuIMrDNKvqZw + FRGt7cbvW5MCnuH8MhItOl9Uxp1wHp6gtav/h8Gp6MBa + =MARt + -----END PGP PUBLIC KEY BLOCK----- From cd247a66897b5acbc1690961df82a361dd15a845 Mon Sep 17 00:00:00 2001 From: Jascha Urbach Date: Tue, 17 Oct 2023 19:49:32 +0200 Subject: [PATCH 32/41] Update .prettierrc Forgot to change the file pre-merch --- .prettierrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.prettierrc b/.prettierrc index c549b16ba..ed29060e6 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1 +1 @@ -'trailingComma': 'none' \ No newline at end of file +'trailingComma': 'es5' \ No newline at end of file From d55e0b6ba353f255606728aefe4d77a7efa6e29f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adeodato=20Sim=C3=B3?= Date: Tue, 17 Oct 2023 17:01:48 -0300 Subject: [PATCH 33/41] Final JS update to match 'es5' trailing comma style This is follow-up to cd247a668 ("Update .prettierrc"). --- bookwyrm/static/js/autocomplete.js | 84 +++++++++++++++--------------- bookwyrm/static/js/bookwyrm.js | 26 ++++----- bookwyrm/static/js/guided_tour.js | 4 +- bookwyrm/static/js/tabs.js | 4 +- 4 files changed, 59 insertions(+), 59 deletions(-) diff --git a/bookwyrm/static/js/autocomplete.js b/bookwyrm/static/js/autocomplete.js index 16281f5a5..a98cd9634 100644 --- a/bookwyrm/static/js/autocomplete.js +++ b/bookwyrm/static/js/autocomplete.js @@ -88,64 +88,64 @@ const tries = { mimetype: { a: { a: { - c: "AAC" + c: "AAC", }, z: { - w: "AZW" - } + w: "AZW", + }, }, d: { a: { i: { s: { - y: "Daisy" - } - } - } + y: "Daisy", + }, + }, + }, }, e: { p: { u: { - b: "EPUB" - } - } + b: "EPUB", + }, + }, }, f: { l: { a: { - c: "FLAC" - } - } + c: "FLAC", + }, + }, }, h: { t: { m: { - l: "HTML" - } - } + l: "HTML", + }, + }, }, m: { 4: { a: "M4A", - b: "M4B" + b: "M4B", }, o: { b: { - i: "MOBI" - } + i: "MOBI", + }, }, p: { - 3: "MP3" - } + 3: "MP3", + }, }, o: { g: { - g: "OGG" - } + g: "OGG", + }, }, p: { d: { - f: "PDF" + f: "PDF", }, l: { a: { @@ -154,13 +154,13 @@ const tries = { t: { e: { x: { - t: "Plaintext" - } - } - } - } - } - } + t: "Plaintext", + }, + }, + }, + }, + }, + }, }, r: { i: { @@ -170,15 +170,15 @@ const tries = { b: { o: { o: { - k: "Print book" - } - } - } - } - } - } - } - } - } - } + k: "Print book", + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, }; diff --git a/bookwyrm/static/js/bookwyrm.js b/bookwyrm/static/js/bookwyrm.js index b67ee55a0..67d64688f 100644 --- a/bookwyrm/static/js/bookwyrm.js +++ b/bookwyrm/static/js/bookwyrm.js @@ -352,8 +352,8 @@ let BookWyrm = new (class { method: "POST", body: new FormData(form), headers: { - Accept: "application/json" - } + Accept: "application/json", + }, }); } @@ -620,7 +620,7 @@ let BookWyrm = new (class { 'input:not([type="hidden"]):not([disabled])', "select:not([disabled])", "details:not([disabled])", - '[tabindex]:not([tabindex="-1"]):not([disabled])' + '[tabindex]:not([tabindex="-1"]):not([disabled])', ].join(",") ); const firstFocusableEl = focusableEls[0]; @@ -675,8 +675,8 @@ let BookWyrm = new (class { target: scannerNode, constraints: { facingMode: "environment", - deviceId: cameraId - } + deviceId: cameraId, + }, }, decoder: { readers: [ @@ -684,12 +684,12 @@ let BookWyrm = new (class { { format: "ean_reader", config: { - supplements: ["ean_2_reader", "ean_5_reader"] - } - } + supplements: ["ean_2_reader", "ean_5_reader"], + }, + }, ], - multiple: false - } + multiple: false, + }, }, (err) => { if (err) { @@ -756,7 +756,7 @@ let BookWyrm = new (class { .forEach((box) => { Quagga.ImageDebug.drawPath(box, { x: 0, y: 1 }, drawingCtx, { color: "green", - lineWidth: 2 + lineWidth: 2, }); }); } @@ -764,14 +764,14 @@ let BookWyrm = new (class { if (result.box) { Quagga.ImageDebug.drawPath(result.box, { x: 0, y: 1 }, drawingCtx, { color: "#00F", - lineWidth: 2 + lineWidth: 2, }); } if (result.codeResult && result.codeResult.code) { Quagga.ImageDebug.drawPath(result.line, { x: "x", y: "y" }, drawingCtx, { color: "red", - lineWidth: 3 + lineWidth: 3, }); } } diff --git a/bookwyrm/static/js/guided_tour.js b/bookwyrm/static/js/guided_tour.js index a52de6edf..56cdcdf57 100644 --- a/bookwyrm/static/js/guided_tour.js +++ b/bookwyrm/static/js/guided_tour.js @@ -9,10 +9,10 @@ function disableGuidedTour(csrf_token) { "use strict"; fetch("/guided-tour/False", { headers: { - "X-CSRFToken": csrf_token + "X-CSRFToken": csrf_token, }, method: "POST", redirect: "follow", - mode: "same-origin" + mode: "same-origin", }); } diff --git a/bookwyrm/static/js/tabs.js b/bookwyrm/static/js/tabs.js index 5d5b426e8..1dcb0cace 100644 --- a/bookwyrm/static/js/tabs.js +++ b/bookwyrm/static/js/tabs.js @@ -32,7 +32,7 @@ class TabGroup { left: 37, up: 38, right: 39, - down: 40 + down: 40, }; } @@ -42,7 +42,7 @@ class TabGroup { 37: -1, 38: -1, 39: 1, - 40: 1 + 40: 1, }; } From 25e8b259f715bfc839702a92fc99618de3e52d87 Mon Sep 17 00:00:00 2001 From: Sidharth Date: Fri, 13 Oct 2023 20:06:19 +0530 Subject: [PATCH 34/41] Show/Hide password icon --- bookwyrm/static/css/fonts/icomoon.eot | Bin 10812 -> 11424 bytes bookwyrm/static/css/fonts/icomoon.svg | 2 ++ bookwyrm/static/css/fonts/icomoon.ttf | Bin 10648 -> 11260 bytes bookwyrm/static/css/fonts/icomoon.woff | Bin 10724 -> 11336 bytes bookwyrm/static/css/vendor/icons.css | 6 ++++++ bookwyrm/static/js/bookwyrm.js | 26 +++++++++++++++++++++++++ bookwyrm/templates/layout.html | 7 ++++++- 7 files changed, 40 insertions(+), 1 deletion(-) diff --git a/bookwyrm/static/css/fonts/icomoon.eot b/bookwyrm/static/css/fonts/icomoon.eot index b86375a90a2468a4426e2464fb0eb7e5c9e5bfbe..33dc07eecba200ba863aea774449d288e68dfb00 100644 GIT binary patch delta 996 zcmYk5TSydP6vxjuv(9*9tlim}%2l^*cV||&QPAc-C#gI+{@hzQFl2zv3s2+0wtr^52Go!QY6=FIv2=N!)Y&JVt+==eEi z+zYT?G|H%^wZ(~n(IY2F$>>Sz=tFDV4**kW&8?lWp2x0s9)Q?TKe`m_?Lof_^$hy- zOIHUjzMX3;M*RlBz0%PhYjY+2uL0y2m{&V6ke+2agn9+Fv!k=G|5;T=7{G%)VCHIf zYi#MtLJ0K-)GeK{{vJ50P&lkmzl6Oj*4ciyE@KUK6o-uTbocfFjTtDK*YiNrpAv24 zX2ES#`FJrJI3QrxteRc(YC&yK8`0it9}|B_UJ-ij^K$00n%qbxfh50*CXp6ah3~>s z;el{oXcW!}PU~;%K@$55a}%d1(_{m6&k@%L-ZJTPbKy8N;6)rPM_7gx#C#$OWxik) z393Q2q!7uihcL;J1CCSxQ}}Vj%I_==_}vl~ma;s9bpgLx<`XE0Mk2$3fYTWW3`Zi- zZ52<+38g+SuU-iag~LN3<4iF$o6hq!N^u}itkm#)I!iOudPtT-y3ru+iB?q9)>c$R z_lP^sPi&Ec2O~D8+wC+?l!>x>MWcz)Q1n_csOp{K_(K9|Xn+)+BWM}Qp%yM83AZDM zD7dQu1Xp4iebF+X8YHTp_ymzv2=15mpF=7nxsU+S3k`T|KC$j3hk82|N38U7PUdE% z(?wfQ3L4chj$_Rk8D^Gl<~A1WrI~{^S7`GWGD>mTD^$wI_EC2jW^>vi@y2dd)r9)T zF|Qn#Z}x3z$xY%rbC>zPdDgsS@mg9eH?WGJl_Un`Z(<3Yg?6|Oy>J=2p$i{GDJYoh H_q_TGx)0mN delta 375 zcmZ1wxhI6pMvH-AhUP>zGnUL~)|V39QU`io9nBwBC8z`(Evh!c`?6ASjrS938i zFvTQ3xKo$kiP*)bEM}~rpeqrcoxXt!N8!hBqKF3MOAUB69a=<3{c)I11P}3 z&0+!MPXY2(GIC2QR@iYm1NlJp3_Ei2lM^pZI1OZ~gUpS~O{^$ju-9V(TBd#hD4>v+ zn43D&oAVEl{{d)8TS0zt2?H}whC#CeB+tOid}(qDW3@DhCk1pEGXoa`BZI6kvOV;Sj zcz&C&4BRXr3m6{USv(6yPp;84XVja#MRWV)VyzJ2D#2xfM}# + + diff --git a/bookwyrm/static/css/fonts/icomoon.ttf b/bookwyrm/static/css/fonts/icomoon.ttf index edcbd3b7553c0192cacd84b0039b2cd8a7a66383..89d3be8fa06b476920aeb3df8b4d5aff74950c57 100644 GIT binary patch delta 1026 zcmY+DZ%7ky7{{OA-MrtXa@KacE1kO5c6ZY?=iEOtg%Xt-Bgj<}LC*h0{wX8UUQ9ux zm(|`BL=gl<^rAGV7ZJXQ2>U}p5JWGG2)vNqL}8?^=XPp#-0k=KKF@Q{pU>@grFH3W z8VCRsz!K6d=LSJ{P%aaW~2T&iPKhlQ=bAf3m>IKy9zWy`k?l)K(0lb(4W=;-v?oQ30n2Vv| zEgCxdQ|E?YH-p70^d_7Gss8S(`z(J@C$Y%n(BSYHY!t7`Pr4si_Wh-q^Su{Plwn^i z@HmfCvujSxr$x0fE zJN|fSY1|(hZ)_Zo8GD9fsaX)3{Z-*`mA_dK%#`JrrI@P5^oIp$OR}!6rKPSexkcKz zzw1cs*pYC!W!Y`)7!zanNk$SQq2#lpF`{Qm;|~(Z(}^O5Df|E`)ItmNAPL!3MEp3b z0R%^)oIYqxFcKw^5DAJB^%I;g?;nSpN%0^7q6ZrAXc@6@B!_yn1|T8ed8in>HKy8c$UKOvl|KQ;r-*?tJ}otZ3IyC@|?*;d6Y^yS8S=(*K8yv=9pu${#y{U8UJV*PmH#o(XSmieK~N&z?o-EbO);W!M! P0G^s^@IxT;UVZi#>pJHH delta 355 zcmewpJ|noEfsuiMft#U$ftkU;KUm+0Ux?iZD6$8L6OwZi3--!ab1^V5$^iLO(i4jd zfV2RRzX3>dq~}zo$=p477RcYhz@V}uBQ-HaRdJ~k1A|%&P~I#9D8RwZVgck&0rFKc za!V>!*l{`o`9SpyJ96@q9TP82I1Oa0gA9(#O{^$juxA2VrhWm)SIA4uO`Yk@`3K1V z0JNm7AiuZ-=ujZgtN_U~Ff(78c%WJu#E}BJibx|6S@p7QaulQN z7(Mxh zhB>3&WC6|Xlh1302v-R%6FefsA!H{M1XKYEH@(SLTF=D|8NwJ+8HyN+88R928S;S6 OGGx$WFq~|meFOl|^;!o2 diff --git a/bookwyrm/static/css/fonts/icomoon.woff b/bookwyrm/static/css/fonts/icomoon.woff index 47d4bffb57ce17cf8b0ef46bbdb22873880becfc..95325ab4aa4a2bfb794a7d0e93b38c3013d36544 100644 GIT binary patch delta 1050 zcmYk5Uue^C5XbMA)TG@?oNbz@>$Y0kCf#b+cKxSy9a`+vQU$FtM9?~?RqUotbej*| zV2H1p2NA^iASk{l`rv~wd=Qa31;Hl~nV?|AS4Giv-mlrTp_kl!?|PT}kl&}hF9yU5 zyR%s!fLCBUG}C9-AMK6buFd;RSGvSXbg*1J4M0kmxlQekcSt;597T<>Vr*WrmgA?! zkD(?4_`Xql`RZtQX{dMg&mr{-OZJ};q&S`uRqHFL9RQ>lDz47Gz8Kc)5{ZONP( z8N|9>olX>vQ2TOnK3Oh~;o#0mj9qox!Z?SEApsXG(kQ?p_9W!ad&d>@wU?0AYn->Vr@siw5WT_{TNRvc7;ZuS{ z@lgqr0$J~_3z)*6KpbLYaV+XnurSPv9M;96@t%mpKp~%>j>SBlSZq34D4KbeWBw#nHA#&Hd37O`>hDjb3ajNt|DH3y zVME^O@%cQ4$CwyLKsK5f4ds9X#W?L$!5b1-LAfD?hlp8)jnEJHWe}fxB?;oL1`u3{ z=jft6k$8f{qa-59e30ONEB5L#%!d? z>gXQq#UVn~YBfluPpC6Eljr%Jbb?xY?{!WzgR@g!KH+~3WOfsp|SG@meVgXtMSKI7z%j3N_tgzJrxa}x^~7#K5vQd2;9uY5IE zdSWq1><^I70mTC8IhAP)3`{Hx3@S@NSmy4*vl*$0DGUs1D}ZXuKv-3AsZ$0}5GeKl z$X5Yj4sI5UjNFn61_pJYUWOeYyuyytIVV3EsLoG)4^SWugfC4v&5)Z|0kl{{2FOX?BnX68$ic^IpsfmSg{F$gd)GjIWY zs_;_urNT>{m*y|4Ubelw^@{72+5f-){{z(k?Rd%XQXDRK9WKZC|FJlWIJ4Lfv3Fu? z#1@JLiYbYH2bu>8HR;W~Ommbre^e7;l4q2h^^!F@GoIh(D+4#kcMJ>WUpbADH)?)&>69kxmCJRqqtaVDLU diff --git a/bookwyrm/static/css/vendor/icons.css b/bookwyrm/static/css/vendor/icons.css index b661ce8e7..6af5c2813 100644 --- a/bookwyrm/static/css/vendor/icons.css +++ b/bookwyrm/static/css/vendor/icons.css @@ -155,3 +155,9 @@ .icon-barcode:before { content: "\e937"; } +.icon-eye:before { + content: "\e9ce"; +} +.icon-eye-blocked:before { + content: "\e9d1"; +} diff --git a/bookwyrm/static/js/bookwyrm.js b/bookwyrm/static/js/bookwyrm.js index 67d64688f..a2351a98c 100644 --- a/bookwyrm/static/js/bookwyrm.js +++ b/bookwyrm/static/js/bookwyrm.js @@ -30,6 +30,12 @@ let BookWyrm = new (class { .querySelectorAll("[data-back]") .forEach((button) => button.addEventListener("click", this.back)); + document + .querySelectorAll("[data-password-icon]") + .forEach((button) => + button.addEventListener("click", this.togglePasswordVisibility.bind(this)) + ); + document .querySelectorAll('input[type="file"]') .forEach((node) => node.addEventListener("change", this.disableIfTooLarge.bind(this))); @@ -820,4 +826,24 @@ let BookWyrm = new (class { form.querySelector('input[name="preferred_timezone"]').value = tz; } + + togglePasswordVisibility(event) { + const iconElement = event.currentTarget.getElementsByTagName("button")[0]; + const passwordElementId = event.currentTarget.dataset.for; + const passwordInputElement = document.getElementById(passwordElementId); + + if (!passwordInputElement) return; + + if (passwordInputElement.type === "password") { + passwordInputElement.type = "text"; + this.addRemoveClass(iconElement, "icon-eye-blocked"); + this.addRemoveClass(iconElement, "icon-eye", true); + } else { + passwordInputElement.type = "password"; + this.addRemoveClass(iconElement, "icon-eye"); + this.addRemoveClass(iconElement, "icon-eye-blocked", true); + } + + this.toggleFocus(passwordElementId); + } })(); diff --git a/bookwyrm/templates/layout.html b/bookwyrm/templates/layout.html index ba53685f4..b8459856c 100644 --- a/bookwyrm/templates/layout.html +++ b/bookwyrm/templates/layout.html @@ -130,7 +130,12 @@
From b78d51410b0b4b911c14442f153923b8091f12b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adeodato=20Sim=C3=B3?= Date: Wed, 18 Oct 2023 18:52:39 -0300 Subject: [PATCH 35/41] bw-dev: drop use of `npm exec` by setting PATH in Docker image --- bw-dev | 22 ++++++++-------------- dev-tools/Dockerfile | 1 + 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/bw-dev b/bw-dev index 19ab1a355..57441f013 100755 --- a/bw-dev +++ b/bw-dev @@ -188,31 +188,25 @@ case "$CMD" in ;; prettier) prod_error - $DOCKER_COMPOSE run --rm dev-tools npm exec --prefix dev-tools -- prettier \ - --write bookwyrm/static/js/*.js + $DOCKER_COMPOSE run --rm dev-tools prettier --write bookwyrm/static/js/*.js ;; eslint) prod_error - $DOCKER_COMPOSE run --rm dev-tools npm exec --prefix devtools -- eslint \ - bookwyrm/static --ext .js + $DOCKER_COMPOSE run --rm dev-tools eslint bookwyrm/static --ext .js ;; stylelint) prod_error - $DOCKER_COMPOSE run --rm dev-tools npm exec --prefix dev-tools -- stylelint --fix \ - --config dev-tools/.stylelintrc.js --ignore-path dev-tools/.stylelintignore \ - bookwyrm/static/css + $DOCKER_COMPOSE run --rm dev-tools stylelint --fix bookwyrm/static/css \ + --config dev-tools/.stylelintrc.js --ignore-path dev-tools/.stylelintignore ;; formatters) prod_error runweb pylint bookwyrm/ $DOCKER_COMPOSE run --rm dev-tools black celerywyrm bookwyrm - $DOCKER_COMPOSE run --rm dev-tools npm exec --prefix dev-tools -- prettier \ - --write bookwyrm/static/js/*.js - $DOCKER_COMPOSE run --rm dev-tools npm exec --prefix devtools -- eslint \ - bookwyrm/static --ext .js - $DOCKER_COMPOSE run --rm dev-tools npm exec --prefix dev-tools -- stylelint --fix \ - --config dev-tools/.stylelintrc.js --ignore-path dev-tools/.stylelintignore \ - bookwyrm/static/css + $DOCKER_COMPOSE run --rm dev-tools prettier --write bookwyrm/static/js/*.js + $DOCKER_COMPOSE run --rm dev-tools eslint bookwyrm/static --ext .js + $DOCKER_COMPOSE run --rm dev-tools stylelint --fix bookwyrm/static/css \ + --config dev-tools/.stylelintrc.js --ignore-path dev-tools/.stylelintignore ;; mypy) prod_error diff --git a/dev-tools/Dockerfile b/dev-tools/Dockerfile index 338d96c66..f6a7bb793 100644 --- a/dev-tools/Dockerfile +++ b/dev-tools/Dockerfile @@ -1,6 +1,7 @@ FROM python:3.9 WORKDIR /app/dev-tools +ENV PATH="/app/dev-tools/node_modules/.bin:$PATH" ENV PYTHONUNBUFFERED=1 ENV NPM_CONFIG_UPDATE_NOTIFIER=false ENV PIP_ROOT_USER_ACTION=ignore PIP_DISABLE_PIP_VERSION_CHECK=1 From f88a0f82291f24e77aacf1b88a8d3635397029a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adeodato=20Sim=C3=B3?= Date: Wed, 18 Oct 2023 20:27:36 -0300 Subject: [PATCH 36/41] Run stylelint to fix remaining issues Including deletion of two duplicate stanzas introduced in 33c13608a8 ("Refixing light and dark themes"). --- bookwyrm/static/css/bookwyrm/_all.scss | 2 ++ .../css/bookwyrm/components/_book_cover.scss | 2 +- .../static/css/bookwyrm/components/_copy.scss | 32 +++++++++---------- .../static/css/bookwyrm/components/_tabs.scss | 4 +-- bookwyrm/static/css/themes/bookwyrm-dark.scss | 13 +++----- .../static/css/themes/bookwyrm-light.scss | 12 +++---- 6 files changed, 30 insertions(+), 35 deletions(-) diff --git a/bookwyrm/static/css/bookwyrm/_all.scss b/bookwyrm/static/css/bookwyrm/_all.scss index 5bb08b931..7e50fe3e1 100644 --- a/bookwyrm/static/css/bookwyrm/_all.scss +++ b/bookwyrm/static/css/bookwyrm/_all.scss @@ -38,10 +38,12 @@ body { width: 12px; height: 12px; } + ::-webkit-scrollbar-thumb { background: $scrollbar-thumb; border-radius: 0.5em; } + ::-webkit-scrollbar-track { background: $scrollbar-track; } diff --git a/bookwyrm/static/css/bookwyrm/components/_book_cover.scss b/bookwyrm/static/css/bookwyrm/components/_book_cover.scss index 48b564a0b..db9391cc1 100644 --- a/bookwyrm/static/css/bookwyrm/components/_book_cover.scss +++ b/bookwyrm/static/css/bookwyrm/components/_book_cover.scss @@ -43,7 +43,7 @@ max-height: 100%; /* Useful when stretching under-sized images. */ - image-rendering: optimizeQuality; + image-rendering: optimizequality; image-rendering: smooth; } diff --git a/bookwyrm/static/css/bookwyrm/components/_copy.scss b/bookwyrm/static/css/bookwyrm/components/_copy.scss index 7a47c1dba..2595401cc 100644 --- a/bookwyrm/static/css/bookwyrm/components/_copy.scss +++ b/bookwyrm/static/css/bookwyrm/components/_copy.scss @@ -30,20 +30,20 @@ } .copy-tooltip { - overflow: visible; - visibility: hidden; - width: 140px; - background-color: #555; - color: #fff; - text-align: center; - border-radius: 6px; - padding: 5px; - position: absolute; - z-index: 1; - margin-left: -30px; - margin-top: -45px; - opacity: 0; - transition: opacity 0.3s; + overflow: visible; + visibility: hidden; + width: 140px; + background-color: #555; + color: #fff; + text-align: center; + border-radius: 6px; + padding: 5px; + position: absolute; + z-index: 1; + margin-left: -30px; + margin-top: -45px; + opacity: 0; + transition: opacity 0.3s; } .copy-tooltip::after { @@ -54,5 +54,5 @@ margin-left: -60px; border-width: 5px; border-style: solid; - border-color: #555 transparent transparent transparent; - } + border-color: #555 transparent transparent; +} diff --git a/bookwyrm/static/css/bookwyrm/components/_tabs.scss b/bookwyrm/static/css/bookwyrm/components/_tabs.scss index 2d68a383b..8e00f6a88 100644 --- a/bookwyrm/static/css/bookwyrm/components/_tabs.scss +++ b/bookwyrm/static/css/bookwyrm/components/_tabs.scss @@ -44,12 +44,12 @@ .bw-tabs a:hover { border-bottom-color: transparent; - color: $text + color: $text; } .bw-tabs a.is-active { border-bottom-color: transparent; - color: $link + color: $link; } .bw-tabs.is-left { diff --git a/bookwyrm/static/css/themes/bookwyrm-dark.scss b/bookwyrm/static/css/themes/bookwyrm-dark.scss index df756fd02..f5e08e9a0 100644 --- a/bookwyrm/static/css/themes/bookwyrm-dark.scss +++ b/bookwyrm/static/css/themes/bookwyrm-dark.scss @@ -16,7 +16,7 @@ $danger-light: #481922; $light: #393939; $red: #ffa1b4; $black: #000; -$white-ter: hsl(0, 0%, 90%); +$white-ter: hsl(0deg, 0%, 90%); /* book cover standins */ $no-cover-color: #002549; @@ -100,19 +100,16 @@ $family-secondary: $family-sans-serif; .tabs li:not(.is-active) a { color: #2e7eb9 !important; } - .tabs li:not(.is-active) a:hover { - border-bottom-color: #2e7eb9 !important; -} -.tabs li:not(.is-active) a { - color: #2e7eb9 !important; +.tabs li:not(.is-active) a:hover { + border-bottom-color: #2e7eb9 !important; } + .tabs li.is-active a { color: #e6e6e6 !important; - border-bottom-color: #e6e6e6 !important ; + border-bottom-color: #e6e6e6 !important; } - #qrcode svg { background-color: #a6a6a6; } diff --git a/bookwyrm/static/css/themes/bookwyrm-light.scss b/bookwyrm/static/css/themes/bookwyrm-light.scss index 4a3f16a27..37e990127 100644 --- a/bookwyrm/static/css/themes/bookwyrm-light.scss +++ b/bookwyrm/static/css/themes/bookwyrm-light.scss @@ -57,7 +57,6 @@ $invisible-overlay-background-color: rgba($scheme-invert, 0.66); $family-primary: $family-sans-serif; $family-secondary: $family-sans-serif; - .has-text-muted { color: $grey-dark !important; } @@ -69,19 +68,16 @@ $family-secondary: $family-sans-serif; .tabs li:not(.is-active) a { color: #3273dc !important; } - .tabs li:not(.is-active) a:hover { - border-bottom-color: #3273dc !important; -} -.tabs li:not(.is-active) a { - color: #3273dc !important; +.tabs li:not(.is-active) a:hover { + border-bottom-color: #3273dc !important; } + .tabs li.is-active a { color: #4a4a4a !important; - border-bottom-color: #4a4a4a !important ; + border-bottom-color: #4a4a4a !important; } - @import "../bookwyrm"; @import "../vendor/icons.css"; @import "../vendor/shepherd"; From 1685ac1953121b20fae65214abcfaec733a53e0a Mon Sep 17 00:00:00 2001 From: Jascha Ezra Urbach Date: Thu, 19 Oct 2023 11:29:59 +0200 Subject: [PATCH 37/41] Move version out of settings (#3045) This removes the content of VERSION from settings.py and moves it into a seperate file which makes it easier to update versionnumbers via script in the future. --- VERSION | 1 + bookwyrm/settings.py | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 VERSION diff --git a/VERSION b/VERSION new file mode 100644 index 000000000..05e8a4593 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.6.6 diff --git a/bookwyrm/settings.py b/bookwyrm/settings.py index 94ec761db..16241f9df 100644 --- a/bookwyrm/settings.py +++ b/bookwyrm/settings.py @@ -4,6 +4,7 @@ from typing import AnyStr from environs import Env + import requests from django.utils.translation import gettext_lazy as _ from django.core.exceptions import ImproperlyConfigured @@ -14,7 +15,13 @@ from django.core.exceptions import ImproperlyConfigured env = Env() env.read_env() DOMAIN = env("DOMAIN") -VERSION = "0.6.6" + +with open("VERSION", encoding="utf-8") as f: + version = f.read() + version = version.replace("\n", "") +f.close() + +VERSION = version RELEASE_API = env( "RELEASE_API", From 4a9d80268ae270d74686e607849859546c5989f2 Mon Sep 17 00:00:00 2001 From: Jascha Urbach Date: Sat, 21 Oct 2023 17:16:55 +0200 Subject: [PATCH 38/41] Create bump-version.sh This scripts reads VERSION (should be semantic version), automatically suggest a "minor" version update, and ask for input to use either suggestion, or a new value. creates a pull request with updated VERSION and creates a tag for the new version. --- bump-version.sh | 78 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 bump-version.sh diff --git a/bump-version.sh b/bump-version.sh new file mode 100644 index 000000000..ad5575e96 --- /dev/null +++ b/bump-version.sh @@ -0,0 +1,78 @@ +#!/bin/bash + +NOW="$(date +'%B %d, %Y')" +RED="\033[1;31m" +GREEN="\033[0;32m" +YELLOW="\033[1;33m" +BLUE="\033[1;34m" +PURPLE="\033[1;35m" +CYAN="\033[1;36m" +WHITE="\033[1;37m" +RESET="\033[0m" + +LATEST_HASH=`git log --pretty=format:'%h' -n 1` + +QUESTION_FLAG="${GREEN}?" +WARNING_FLAG="${YELLOW}!" +NOTICE_FLAG="${CYAN}❯" + +# ADJUSTMENTS_MSG="${QUESTION_FLAG} ${CYAN}Now you can make adjustments to ${WHITE}CHANGELOG.md${CYAN}. Then press enter to continue." +PUSHING_MSG="${NOTICE_FLAG} Pushing new version to the ${WHITE}origin${CYAN}..." + +if [ -f VERSION ]; then + BASE_STRING=`cat VERSION` + BASE_LIST=(`echo $BASE_STRING | tr '.' ' '`) + V_MAJOR=${BASE_LIST[0]} + V_MINOR=${BASE_LIST[1]} + V_PATCH=${BASE_LIST[2]} + echo -e "${NOTICE_FLAG} Current version: ${WHITE}$BASE_STRING" + echo -e "${NOTICE_FLAG} Latest commit hash: ${WHITE}$LATEST_HASH" + V_MINOR=$((V_MINOR + 1)) + V_PATCH=0 + SUGGESTED_VERSION="$V_MAJOR.$V_MINOR.$V_PATCH" + echo -ne "${QUESTION_FLAG} ${CYAN}Enter a version number [${WHITE}$SUGGESTED_VERSION${CYAN}]: " + read INPUT_STRING + if [ "$INPUT_STRING" = "" ]; then + INPUT_STRING=$SUGGESTED_VERSION + fi + echo -e "${NOTICE_FLAG} Will set new version to be ${WHITE}$INPUT_STRING" + echo $INPUT_STRING > VERSION + echo "## $INPUT_STRING ($NOW)" > tmpfile +# git log --pretty=format:" - %s" "v$BASE_STRING"...HEAD >> tmpfile +# echo "" >> tmpfile +# echo "" >> tmpfile +# cat CHANGELOG.md >> tmpfile +# mv tmpfile CHANGELOG.md +# echo -e "$ADJUSTMENTS_MSG" +# read +# echo -e "$PUSHING_MSG" +# git add CHANGELOG.md VERSION + git commit -m "Bump version to ${INPUT_STRING}." + git tag -a -m "Tag version ${INPUT_STRING}." "v$INPUT_STRING" + git push origin --tags +else + echo -e "${WARNING_FLAG} Could not find a VERSION file." + echo -ne "${QUESTION_FLAG} ${CYAN}Do you want to create a version file and start from scratch? [${WHITE}y${CYAN}]: " + read RESPONSE + if [ "$RESPONSE" = "" ]; then RESPONSE="y"; fi + if [ "$RESPONSE" = "Y" ]; then RESPONSE="y"; fi + if [ "$RESPONSE" = "Yes" ]; then RESPONSE="y"; fi + if [ "$RESPONSE" = "yes" ]; then RESPONSE="y"; fi + if [ "$RESPONSE" = "YES" ]; then RESPONSE="y"; fi + if [ "$RESPONSE" = "y" ]; then + echo "0.1.0" > VERSION + echo "## 0.1.0 ($NOW)" > CHANGELOG.md +# git log --pretty=format:" - %s" >> CHANGELOG.md +# echo "" >> CHANGELOG.md +# echo "" >> CHANGELOG.md +# echo -e "$ADJUSTMENTS_MSG" +# read + echo -e "$PUSHING_MSG" + git add VERSION CHANGELOG.md + git commit -m "Add VERSION and CHANGELOG.md files, Bump version to v0.1.0." + git tag -a -m "Tag version 0.1.0." "v0.1.0" + git push origin --tags + fi +fi + +echo -e "${NOTICE_FLAG} Finished." From abb6bcd199c25297589e1a9282d93ea2de0195ea Mon Sep 17 00:00:00 2001 From: Jascha Ezra Urbach Date: Sat, 21 Oct 2023 17:28:44 +0200 Subject: [PATCH 39/41] Update bump-version.sh just a little fix --- bump-version.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bump-version.sh b/bump-version.sh index ad5575e96..231c05b50 100644 --- a/bump-version.sh +++ b/bump-version.sh @@ -37,7 +37,7 @@ if [ -f VERSION ]; then fi echo -e "${NOTICE_FLAG} Will set new version to be ${WHITE}$INPUT_STRING" echo $INPUT_STRING > VERSION - echo "## $INPUT_STRING ($NOW)" > tmpfile +# echo "## $INPUT_STRING ($NOW)" > tmpfile # git log --pretty=format:" - %s" "v$BASE_STRING"...HEAD >> tmpfile # echo "" >> tmpfile # echo "" >> tmpfile @@ -45,7 +45,7 @@ if [ -f VERSION ]; then # mv tmpfile CHANGELOG.md # echo -e "$ADJUSTMENTS_MSG" # read -# echo -e "$PUSHING_MSG" + echo -e "$PUSHING_MSG" # git add CHANGELOG.md VERSION git commit -m "Bump version to ${INPUT_STRING}." git tag -a -m "Tag version ${INPUT_STRING}." "v$INPUT_STRING" From 698e74a496468ec07a6b938abfb378d0bbd6bae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adeodato=20Sim=C3=B3?= <73768+dato@users.noreply.github.com> Date: Sat, 21 Oct 2023 12:53:24 -0300 Subject: [PATCH 40/41] Minor vocabulary fixes and structured data improvements (#3036) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Remove duplicate Review object under `rating` property This was preventing validation, since `rating` is not a valid property (`review` is, which is created from book.html already). * Drop `bestRating` property in ratings, since it defaults to 5 See ("If bestRating is omitted, 5 is assumed"). * Create Rating object (and its enclosing Review) in book/rating.html * Use `position` property for Book objects in a series `volumeNumber`, previously used, is only valid for objects of type PublicationVolume (which series members are not). * Give URL of book series when setting of `isPartOf` * series.html: Add empty BookSeries object --------- Co-authored-by: Adeodato Simó --- bookwyrm/templates/book/book.html | 14 +++++++------- bookwyrm/templates/book/rating.html | 15 ++++++++++----- bookwyrm/templates/book/series.html | 9 +++++---- .../templates/snippets/status/content_status.html | 12 ------------ .../templates/snippets/status/headers/rating.html | 3 --- 5 files changed, 22 insertions(+), 31 deletions(-) diff --git a/bookwyrm/templates/book/book.html b/bookwyrm/templates/book/book.html index 9083f9bdc..8e76fb014 100644 --- a/bookwyrm/templates/book/book.html +++ b/bookwyrm/templates/book/book.html @@ -44,16 +44,18 @@ {% endif %} {% if book.series %} - - - + + {% if book.authors.exists %} - + {% endif %} + {% endif %}

{% endif %} @@ -186,8 +188,6 @@ itemtype="https://schema.org/AggregateRating" > - {# @todo Is it possible to not hard-code the value? #} - diff --git a/bookwyrm/templates/book/rating.html b/bookwyrm/templates/book/rating.html index c0af67fab..9998a49dc 100644 --- a/bookwyrm/templates/book/rating.html +++ b/bookwyrm/templates/book/rating.html @@ -5,13 +5,18 @@ {% include 'snippets/avatar.html' with user=user %}
-
-
- {{ user.display_name }} +
+ -
+
+

{% trans "rated it" %}

- {% include 'snippets/stars.html' with rating=rating.rating %}
diff --git a/bookwyrm/templates/book/series.html b/bookwyrm/templates/book/series.html index dc8113813..8b945452f 100644 --- a/bookwyrm/templates/book/series.html +++ b/bookwyrm/templates/book/series.html @@ -5,15 +5,15 @@ {% block title %}{{ series_name }}{% endblock %} {% block content %} -
-

{{ series_name }}

+
+

{{ series_name }}

{% trans "Series by" %} @@ -22,6 +22,7 @@
{% for book in books %} {% with book=book %} + {# @todo Set `hasPart` property in some meaningful way #}
{% if book.series_number %}{% blocktrans with series_number=book.series_number %}Book {{ series_number }}{% endblocktrans %}{% else %}{% trans 'Unsorted Book' %}{% endif %} diff --git a/bookwyrm/templates/snippets/status/content_status.html b/bookwyrm/templates/snippets/status/content_status.html index 1dc8382b2..28ed61e83 100644 --- a/bookwyrm/templates/snippets/status/content_status.html +++ b/bookwyrm/templates/snippets/status/content_status.html @@ -6,14 +6,6 @@ {% load humanize %} {% with status_type=status.status_type %} -
-
{% if not hide_book %} {% with book=status.book|default:status.mention_books.first %} @@ -58,9 +50,6 @@ {% endif %} > - - {# @todo Is it possible to not hard-code the value? #} - {% include 'snippets/stars.html' with rating=status.rating %} @@ -154,6 +143,5 @@
-
{% endwith %} diff --git a/bookwyrm/templates/snippets/status/headers/rating.html b/bookwyrm/templates/snippets/status/headers/rating.html index bc40c04c8..fcef7eee7 100644 --- a/bookwyrm/templates/snippets/status/headers/rating.html +++ b/bookwyrm/templates/snippets/status/headers/rating.html @@ -16,9 +16,6 @@ > From 00bf2903bce62cae66fe539b0253a31540a1a304 Mon Sep 17 00:00:00 2001 From: Jascha Ezra Urbach Date: Sat, 21 Oct 2023 18:29:45 +0200 Subject: [PATCH 41/41] Bumped version number to 0.7.0 (#3052) --- VERSION | 2 +- bump-version.sh | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) mode change 100644 => 100755 bump-version.sh diff --git a/VERSION b/VERSION index 05e8a4593..faef31a43 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.6.6 +0.7.0 diff --git a/bump-version.sh b/bump-version.sh old mode 100644 new mode 100755 index 231c05b50..552d8409d --- a/bump-version.sh +++ b/bump-version.sh @@ -46,7 +46,8 @@ if [ -f VERSION ]; then # echo -e "$ADJUSTMENTS_MSG" # read echo -e "$PUSHING_MSG" -# git add CHANGELOG.md VERSION +# git add CHANGELOG.md + git add VERSION git commit -m "Bump version to ${INPUT_STRING}." git tag -a -m "Tag version ${INPUT_STRING}." "v$INPUT_STRING" git push origin --tags @@ -61,14 +62,15 @@ else if [ "$RESPONSE" = "YES" ]; then RESPONSE="y"; fi if [ "$RESPONSE" = "y" ]; then echo "0.1.0" > VERSION - echo "## 0.1.0 ($NOW)" > CHANGELOG.md +# echo "## 0.1.0 ($NOW)" > CHANGELOG.md # git log --pretty=format:" - %s" >> CHANGELOG.md # echo "" >> CHANGELOG.md # echo "" >> CHANGELOG.md # echo -e "$ADJUSTMENTS_MSG" # read echo -e "$PUSHING_MSG" - git add VERSION CHANGELOG.md +# git add CHANGELOG.md + git add VERSION git commit -m "Add VERSION and CHANGELOG.md files, Bump version to v0.1.0." git tag -a -m "Tag version 0.1.0." "v0.1.0" git push origin --tags