Merge branch 'main' into progress-update-ui

This commit is contained in:
Mouse Reeve 2021-03-20 17:38:22 -07:00
commit dd15e87073
17 changed files with 408 additions and 328 deletions

31
.editorconfig Normal file
View file

@ -0,0 +1,31 @@
# @see https://editorconfig.org/
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
max_line_length = 100
# C-style doc comments
block_comment_start = /*
block_comment = *
block_comment_end = */
[{bw-dev,fr-dev,LICENSE}]
max_line_length = off
[*.{csv,json,html,md,po,py,svg,tsv}]
max_line_length = off
[*.{md,markdown}]
trim_trailing_whitespace = false
[*.{yml,yaml}]
indent_size = 2
max_line_length = off

View file

@ -1,4 +1,4 @@
name: Lint name: Lint Python
on: [push, pull_request] on: [push, pull_request]

21
.github/workflows/linters-global.yaml vendored Normal file
View file

@ -0,0 +1,21 @@
# @url https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: Lint Project
on:
push:
branches: [ main, ci ]
pull_request:
branches: [ main, ci ]
jobs:
linters:
name: linters
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

View file

@ -158,6 +158,24 @@ The `production` branch of BookWyrm contains a number of tools not on the `main`
Instructions for running BookWyrm in production: Instructions for running BookWyrm in production:
- Get the application code:
`git clone git@github.com:mouse-reeve/bookwyrm.git`
- Switch to the `production` branch
`git checkout production`
- Create your environment variables file
`cp .env.example .env`
- Add your domain, email address, SMTP credentials
- Set a secure redis password and secret key
- Set a secure database password for postgres
- Update your nginx configuration in `nginx/default.conf`
- Replace `your-domain.com` with your domain name
- Run the application (this should also set up a Certbot ssl cert for your domain) with
`docker-compose up --build`, and make sure all the images build successfully
- When docker has built successfully, stop the process with `CTRL-C`
- Comment out the `command: certonly...` line in `docker-compose.yml`
- Run docker-compose in the background with: `docker-compose up -d`
- Initialize the database with: `./bw-dev initdb`
- Set up schedule backups with cron that runs that `docker-compose exec db pg_dump -U <databasename>` and saves the backup to a safe location
- Get the application code: - Get the application code:
`git clone git@github.com:mouse-reeve/bookwyrm.git` `git clone git@github.com:mouse-reeve/bookwyrm.git`
- Switch to the `production` branch - Switch to the `production` branch

View file

@ -0,0 +1,4 @@
# @see https://editorconfig.org/
[*.svg]
insert_final_newline = unset

View file

@ -59,7 +59,9 @@ class TabGroup {
} }
initPanels() { initPanels() {
let selectedPanelId = this.tablist.querySelector('[role="tab"][aria-selected="true"]').getAttribute("aria-controls"); let selectedPanelId = this.tablist
.querySelector('[role="tab"][aria-selected="true"]')
.getAttribute("aria-controls");
for(let panel of this.panels) { for(let panel of this.panels) {
if(panel.getAttribute("id") !== selectedPanelId) { if(panel.getAttribute("id") !== selectedPanelId) {
panel.setAttribute("hidden", ""); panel.setAttribute("hidden", "");

View file

@ -18,8 +18,12 @@
<div class="control"> <div class="control">
<input <input
aria-label="{% if readthrough.progress_mode == 'PG' %}Current page{% else %}Percent read{% endif %}" aria-label="{% if readthrough.progress_mode == 'PG' %}Current page{% else %}Percent read{% endif %}"
class="input" type="number" min="0" class="input"
name="progress" size="3" value="{{ readthrough.progress|default:'' }}"> type="number"
min="0"
name="progress"
size="3"
value="{{ readthrough.progress|default:'' }}">
</div> </div>
<div class="control select"> <div class="control select">
<select name="progress_mode" aria-label="Progress mode"> <select name="progress_mode" aria-label="Progress mode">

View file

@ -73,7 +73,7 @@ msgstr "Deutsch"
#: bookwyrm/settings.py:144 #: bookwyrm/settings.py:144
msgid "Spanish" msgid "Spanish"
msgstr "" msgstr "Spanisch"
#: bookwyrm/settings.py:145 #: bookwyrm/settings.py:145
msgid "French" msgid "French"
@ -139,7 +139,7 @@ msgstr "%(pages)s Seiten"
#: bookwyrm/templates/book/book.html:86 #: bookwyrm/templates/book/book.html:86
#, python-format #, python-format
msgid "Published %(date)s by %(publisher)s." msgid "Published %(date)s by %(publisher)s."
msgstr "" msgstr "Am %(date)s von %(publisher)s veröffentlicht."
#: bookwyrm/templates/book/book.html:88 #: bookwyrm/templates/book/book.html:88
#, fuzzy, python-format #, fuzzy, python-format
@ -150,7 +150,7 @@ msgstr "Veröffentlichungsdatum:"
#: bookwyrm/templates/book/book.html:90 #: bookwyrm/templates/book/book.html:90
#, python-format #, python-format
msgid "Published by %(publisher)s." msgid "Published by %(publisher)s."
msgstr "" msgstr "Veröffentlicht von %(publisher)s."
#: bookwyrm/templates/book/book.html:95 #: bookwyrm/templates/book/book.html:95
msgid "View on OpenLibrary" msgid "View on OpenLibrary"
@ -283,7 +283,7 @@ msgstr "Cover hinzufügen"
#: bookwyrm/templates/book/cover_modal.html:23 #: bookwyrm/templates/book/cover_modal.html:23
#: bookwyrm/templates/book/edit_book.html:169 #: bookwyrm/templates/book/edit_book.html:169
msgid "Load cover from url:" msgid "Load cover from url:"
msgstr "" msgstr "Cover von URL laden:"
#: bookwyrm/templates/book/edit_book.html:5 #: bookwyrm/templates/book/edit_book.html:5
#: bookwyrm/templates/book/edit_book.html:11 #: bookwyrm/templates/book/edit_book.html:11
@ -316,12 +316,12 @@ msgstr "Zuletzt bearbeitet von:"
#: bookwyrm/templates/book/edit_book.html:40 #: bookwyrm/templates/book/edit_book.html:40
msgid "Confirm Book Info" msgid "Confirm Book Info"
msgstr "" msgstr "Buchinfo bestätigen"
#: bookwyrm/templates/book/edit_book.html:47 #: bookwyrm/templates/book/edit_book.html:47
#, python-format #, python-format
msgid "Is \"%(name)s\" an existing author?" msgid "Is \"%(name)s\" an existing author?"
msgstr "" msgstr "Existiert \"%(name)s\" bereits als Autor:in?"
#: bookwyrm/templates/book/edit_book.html:52 #: bookwyrm/templates/book/edit_book.html:52
#, fuzzy, python-format #, fuzzy, python-format
@ -331,20 +331,20 @@ msgstr "\"<em>%(book_title)s</em>\" beginnen"
#: bookwyrm/templates/book/edit_book.html:55 #: bookwyrm/templates/book/edit_book.html:55
msgid "This is a new author" msgid "This is a new author"
msgstr "" msgstr "Neue:r Autor:in"
#: bookwyrm/templates/book/edit_book.html:61 #: bookwyrm/templates/book/edit_book.html:61
#, python-format #, python-format
msgid "Creating a new author: %(name)s" msgid "Creating a new author: %(name)s"
msgstr "" msgstr "Neu als Autor:in erstellen: %(name)s"
#: bookwyrm/templates/book/edit_book.html:67 #: bookwyrm/templates/book/edit_book.html:67
msgid "Is this an edition of an existing work?" msgid "Is this an edition of an existing work?"
msgstr "" msgstr "Ist das eine Edition eines vorhandenen Werkes?"
#: bookwyrm/templates/book/edit_book.html:71 #: bookwyrm/templates/book/edit_book.html:71
msgid "This is a new work" msgid "This is a new work"
msgstr "" msgstr "Dies ist ein neues Werk."
#: bookwyrm/templates/book/edit_book.html:77 #: bookwyrm/templates/book/edit_book.html:77
#: bookwyrm/templates/password_reset.html:30 #: bookwyrm/templates/password_reset.html:30
@ -385,7 +385,7 @@ msgstr "Veröffentlicht"
#: bookwyrm/templates/book/edit_book.html:119 #: bookwyrm/templates/book/edit_book.html:119
msgid "Separate multiple publishers with commas." msgid "Separate multiple publishers with commas."
msgstr "" msgstr "Mehrere Herausgeber:innen durch Kommata trennen"
#: bookwyrm/templates/book/edit_book.html:125 #: bookwyrm/templates/book/edit_book.html:125
msgid "First published date:" msgid "First published date:"
@ -729,7 +729,7 @@ msgstr "Laden fehlgeschlagen"
#: bookwyrm/templates/import_status.html:44 #: bookwyrm/templates/import_status.html:44
#, python-format #, python-format
msgid "Jump to the bottom of the list to select the %(failed_count)s items which failed to import." msgid "Jump to the bottom of the list to select the %(failed_count)s items which failed to import."
msgstr "" msgstr "Zum Ende der Liste springen, um die %(failed_count)s Einträge, deren Import fehlschlug, auszuwählen."
#: bookwyrm/templates/import_status.html:79 #: bookwyrm/templates/import_status.html:79
msgid "Select all" msgid "Select all"
@ -882,7 +882,7 @@ msgstr "Admin kontaktieren"
#: bookwyrm/templates/layout.html:202 #: bookwyrm/templates/layout.html:202
#, python-format #, python-format
msgid "Support %(site_name)s on <a href=\"%(support_link)s\" target=\"_blank\">%(support_title)s</a>" msgid "Support %(site_name)s on <a href=\"%(support_link)s\" target=\"_blank\">%(support_title)s</a>"
msgstr "" msgstr "%(site_name)s auf <a href=\"%(support_link)s\" target=\"_blank\">%(support_title)s</a> unterstützen"
#: bookwyrm/templates/layout.html:206 #: bookwyrm/templates/layout.html:206
msgid "BookWyrm is open source software. You can contribute or report issues on <a href=\"https://github.com/mouse-reeve/bookwyrm\">GitHub</a>." msgid "BookWyrm is open source software. You can contribute or report issues on <a href=\"https://github.com/mouse-reeve/bookwyrm\">GitHub</a>."
@ -1046,11 +1046,11 @@ msgstr "Mehr über diese Seite"
#: bookwyrm/templates/moderation/report_preview.html:6 #: bookwyrm/templates/moderation/report_preview.html:6
#, python-format #, python-format
msgid "Report #%(report_id)s: %(username)s" msgid "Report #%(report_id)s: %(username)s"
msgstr "" msgstr "Meldung #%(report_id)s: %(username)s"
#: bookwyrm/templates/moderation/report.html:10 #: bookwyrm/templates/moderation/report.html:10
msgid "Back to reports" msgid "Back to reports"
msgstr "" msgstr "Zurück zu den Meldungen"
#: bookwyrm/templates/moderation/report.html:18 #: bookwyrm/templates/moderation/report.html:18
#, fuzzy #, fuzzy
@ -1072,15 +1072,15 @@ msgstr "Direktnachricht senden"
#: bookwyrm/templates/moderation/report.html:27 #: bookwyrm/templates/moderation/report.html:27
msgid "Deactivate user" msgid "Deactivate user"
msgstr "" msgstr "Nutzer:in deaktivieren"
#: bookwyrm/templates/moderation/report.html:29 #: bookwyrm/templates/moderation/report.html:29
msgid "Reactivate user" msgid "Reactivate user"
msgstr "" msgstr "Nutzer:in reaktivieren"
#: bookwyrm/templates/moderation/report.html:36 #: bookwyrm/templates/moderation/report.html:36
msgid "Moderator Comments" msgid "Moderator Comments"
msgstr "" msgstr "Moderator:innenkommentare"
#: bookwyrm/templates/moderation/report.html:54 #: bookwyrm/templates/moderation/report.html:54
#: bookwyrm/templates/snippets/create_status.html:12 #: bookwyrm/templates/snippets/create_status.html:12
@ -1096,11 +1096,11 @@ msgstr "Post löschen"
#: bookwyrm/templates/moderation/report.html:61 #: bookwyrm/templates/moderation/report.html:61
msgid "No statuses reported" msgid "No statuses reported"
msgstr "" msgstr "Keine Beiträge gemeldet"
#: bookwyrm/templates/moderation/report.html:67 #: bookwyrm/templates/moderation/report.html:67
msgid "Statuses has been deleted" msgid "Statuses has been deleted"
msgstr "" msgstr "Beiträge wurden gelöscht"
#: bookwyrm/templates/moderation/report_modal.html:6 #: bookwyrm/templates/moderation/report_modal.html:6
#, fuzzy, python-format #, fuzzy, python-format
@ -1111,7 +1111,7 @@ msgstr "Listen: %(username)s"
#: bookwyrm/templates/moderation/report_modal.html:21 #: bookwyrm/templates/moderation/report_modal.html:21
#, python-format #, python-format
msgid "This report will be sent to %(site_name)s's moderators for review." msgid "This report will be sent to %(site_name)s's moderators for review."
msgstr "" msgstr "Diese Meldung wird an die Moderator:innen von %(site_name)s weitergeletiet."
#: bookwyrm/templates/moderation/report_modal.html:22 #: bookwyrm/templates/moderation/report_modal.html:22
#, fuzzy #, fuzzy
@ -1121,11 +1121,11 @@ msgstr "Mehr über diese Seite"
#: bookwyrm/templates/moderation/report_modal.html:31 #: bookwyrm/templates/moderation/report_modal.html:31
msgid "Submit" msgid "Submit"
msgstr "" msgstr "Absenden"
#: bookwyrm/templates/moderation/report_preview.html:13 #: bookwyrm/templates/moderation/report_preview.html:13
msgid "No notes provided" msgid "No notes provided"
msgstr "" msgstr "Keine Notizen angegeben."
#: bookwyrm/templates/moderation/report_preview.html:20 #: bookwyrm/templates/moderation/report_preview.html:20
#, fuzzy, python-format #, fuzzy, python-format
@ -1135,11 +1135,11 @@ msgstr "Direktnachrichten mit <a href=\"%(path)s\">%(username)s</a>"
#: bookwyrm/templates/moderation/report_preview.html:30 #: bookwyrm/templates/moderation/report_preview.html:30
msgid "Re-open" msgid "Re-open"
msgstr "" msgstr "Wiedereröffnen"
#: bookwyrm/templates/moderation/report_preview.html:32 #: bookwyrm/templates/moderation/report_preview.html:32
msgid "Resolve" msgid "Resolve"
msgstr "" msgstr "Lösen"
#: bookwyrm/templates/moderation/reports.html:4 #: bookwyrm/templates/moderation/reports.html:4
#: bookwyrm/templates/moderation/reports.html:5 #: bookwyrm/templates/moderation/reports.html:5
@ -1273,7 +1273,7 @@ msgstr "Dein <a href=\"/import/%(related_id)s\">Import</a> ist abgeschlossen."
#: bookwyrm/templates/notifications.html:113 #: bookwyrm/templates/notifications.html:113
#, python-format #, python-format
msgid "A new <a href=\"%(path)s\">report</a> needs moderation." msgid "A new <a href=\"%(path)s\">report</a> needs moderation."
msgstr "" msgstr "Eine neue <a href=\"%(path)s\">Meldung</a> muss moderiert werden."
#: bookwyrm/templates/notifications.html:139 #: bookwyrm/templates/notifications.html:139
msgid "You're all caught up!" msgid "You're all caught up!"
@ -1345,7 +1345,7 @@ msgstr "Bio:"
#: bookwyrm/templates/preferences/edit_user.html:46 #: bookwyrm/templates/preferences/edit_user.html:46
msgid "Show set reading goal prompt in feed:" msgid "Show set reading goal prompt in feed:"
msgstr "" msgstr "Angegebenes Leseziel im Feed anzeigen."
#: bookwyrm/templates/preferences/edit_user.html:52 #: bookwyrm/templates/preferences/edit_user.html:52
msgid "Manually approve followers:" msgid "Manually approve followers:"