diff --git a/.css-config-sample/_instance-settings.scss b/.css-config-sample/_instance-settings.scss deleted file mode 100644 index e86c1ce0..00000000 --- a/.css-config-sample/_instance-settings.scss +++ /dev/null @@ -1,3 +0,0 @@ -@charset "utf-8"; - -// Copy this file to bookwyrm/static/css/ and set your instance custom styles. diff --git a/.gitignore b/.gitignore index 92fc85bc..ec2a08f8 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,8 @@ .env /images/ bookwyrm/static/css/bookwyrm.css -bookwyrm/static/css/_instance-settings.scss +bookwyrm/static/css/themes/ +!bookwyrm/static/css/themes/bookwyrm-*.scss # Testing .coverage diff --git a/README.md b/README.md index 161f91b9..bd7344df 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ Social reading and reviewing, decentralized with ActivityPub - [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. +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://joinbookwyrm.com/instances/) list. You can request an invite by entering your email address at https://bookwyrm.social. diff --git a/bookwyrm/activitypub/person.py b/bookwyrm/activitypub/person.py index 576e7f9a..61c15a57 100644 --- a/bookwyrm/activitypub/person.py +++ b/bookwyrm/activitypub/person.py @@ -39,4 +39,5 @@ class Person(ActivityObject): bookwyrmUser: bool = False manuallyApprovesFollowers: str = False discoverable: str = False + hideFollows: str = False type: str = "Person" diff --git a/bookwyrm/forms.py b/bookwyrm/forms.py index 01228b8e..f152ed4e 100644 --- a/bookwyrm/forms.py +++ b/bookwyrm/forms.py @@ -153,8 +153,10 @@ class EditUserForm(CustomForm): "manually_approves_followers", "default_post_privacy", "discoverable", + "hide_follows", "preferred_timezone", "preferred_language", + "theme", ] help_texts = {f: None for f in fields} widgets = { diff --git a/bookwyrm/migrations/0142_user_hide_follows.py b/bookwyrm/migrations/0142_user_hide_follows.py new file mode 100644 index 00000000..f052d7ef --- /dev/null +++ b/bookwyrm/migrations/0142_user_hide_follows.py @@ -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), + ), + ] diff --git a/bookwyrm/migrations/0143_merge_0142_auto_20220227_1752_0142_user_hide_follows.py b/bookwyrm/migrations/0143_merge_0142_auto_20220227_1752_0142_user_hide_follows.py new file mode 100644 index 00000000..b36fa9f9 --- /dev/null +++ b/bookwyrm/migrations/0143_merge_0142_auto_20220227_1752_0142_user_hide_follows.py @@ -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 = [] diff --git a/bookwyrm/models/status.py b/bookwyrm/models/status.py index 29b3ba9c..17fcd458 100644 --- a/bookwyrm/models/status.py +++ b/bookwyrm/models/status.py @@ -227,7 +227,7 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel): @classmethod def privacy_filter(cls, viewer, privacy_levels=None): queryset = super().privacy_filter(viewer, privacy_levels=privacy_levels) - return queryset.filter(deleted=False) + return queryset.filter(deleted=False, user__is_active=True) @classmethod def direct_filter(cls, queryset, viewer): diff --git a/bookwyrm/models/user.py b/bookwyrm/models/user.py index 1198717e..e4b98db3 100644 --- a/bookwyrm/models/user.py +++ b/bookwyrm/models/user.py @@ -137,6 +137,7 @@ class User(OrderedCollectionPageMixin, AbstractUser): last_active_date = models.DateTimeField(default=timezone.now) manually_approves_followers = fields.BooleanField(default=False) theme = models.ForeignKey("Theme", null=True, blank=True, on_delete=models.SET_NULL) + hide_follows = fields.BooleanField(default=False) # options to turn features on and off show_goal = models.BooleanField(default=True) @@ -490,10 +491,13 @@ def set_remote_server(user_id): get_remote_reviews.delay(user.outbox) -def get_or_create_remote_server(domain): +def get_or_create_remote_server(domain, refresh=False): """get info on a remote server""" + server = FederatedServer() try: - return FederatedServer.objects.get(server_name=domain) + server = FederatedServer.objects.get(server_name=domain) + if not refresh: + return server except FederatedServer.DoesNotExist: pass @@ -508,13 +512,15 @@ def get_or_create_remote_server(domain): application_type = data.get("software", {}).get("name") application_version = data.get("software", {}).get("version") except ConnectorException: + if server.id: + return server application_type = application_version = None - server = FederatedServer.objects.create( - server_name=domain, - application_type=application_type, - application_version=application_version, - ) + server.server_name = domain + server.application_type = application_type + server.application_version = application_version + + server.save() return server diff --git a/bookwyrm/static/css/bookwyrm.scss b/bookwyrm/static/css/bookwyrm.scss index ee25b728..43779545 100644 --- a/bookwyrm/static/css/bookwyrm.scss +++ b/bookwyrm/static/css/bookwyrm.scss @@ -1,6 +1,4 @@ @charset "utf-8"; -@import "instance-settings"; @import "vendor/bulma/bulma.sass"; -@import "vendor/icons.css"; @import "bookwyrm/all.scss"; diff --git a/bookwyrm/static/css/themes/bookwyrm-dark.scss b/bookwyrm/static/css/themes/bookwyrm-dark.scss index 1230c726..216fa1e8 100644 --- a/bookwyrm/static/css/themes/bookwyrm-dark.scss +++ b/bookwyrm/static/css/themes/bookwyrm-dark.scss @@ -80,4 +80,5 @@ $family-primary: $family-sans-serif; $family-secondary: $family-sans-serif; -@import "../bookwyrm.scss"; \ No newline at end of file +@import "../bookwyrm.scss"; +@import "../vendor/icons.css"; diff --git a/bookwyrm/static/css/themes/bookwyrm-light.scss b/bookwyrm/static/css/themes/bookwyrm-light.scss index 91cad72e..c74d2ee2 100644 --- a/bookwyrm/static/css/themes/bookwyrm-light.scss +++ b/bookwyrm/static/css/themes/bookwyrm-light.scss @@ -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"; \ No newline at end of file +@import "../bookwyrm.scss"; +@import "../vendor/icons.css"; diff --git a/bookwyrm/templates/book/book.html b/bookwyrm/templates/book/book.html index 60e3d4fd..0e2fd5d3 100644 --- a/bookwyrm/templates/book/book.html +++ b/bookwyrm/templates/book/book.html @@ -352,7 +352,7 @@ {% endfor %} - {% if request.user.list_set.exists %} + {% if list_options.exists %}