diff --git a/bookwyrm/activitypub/person.py b/bookwyrm/activitypub/person.py index f1298b92..dafd1910 100644 --- a/bookwyrm/activitypub/person.py +++ b/bookwyrm/activitypub/person.py @@ -30,5 +30,5 @@ class Person(ActivityObject): icon: Image = field(default_factory=lambda: {}) bookwyrmUser: bool = False manuallyApprovesFollowers: str = False - discoverable: str = True + discoverable: str = False type: str = "Person" diff --git a/bookwyrm/forms.py b/bookwyrm/forms.py index d330211c..4e92b32e 100644 --- a/bookwyrm/forms.py +++ b/bookwyrm/forms.py @@ -3,7 +3,6 @@ import datetime from collections import defaultdict from django import forms -from django.core.exceptions import ValidationError from django.forms import ModelForm, PasswordInput, widgets from django.forms.widgets import Textarea from django.utils import timezone @@ -130,8 +129,9 @@ class EditUserForm(CustomForm): "name", "email", "summary", - "manually_approves_followers", "show_goal", + "manually_approves_followers", + "discoverable", ] help_texts = {f: None for f in fields} diff --git a/bookwyrm/migrations/0057_user_discoverable.py b/bookwyrm/migrations/0057_user_discoverable.py new file mode 100644 index 00000000..c49592bf --- /dev/null +++ b/bookwyrm/migrations/0057_user_discoverable.py @@ -0,0 +1,19 @@ +# Generated by Django 3.1.6 on 2021-03-21 21:44 + +import bookwyrm.models.fields +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("bookwyrm", "0056_auto_20210321_0303"), + ] + + operations = [ + migrations.AddField( + model_name="user", + name="discoverable", + field=bookwyrm.models.fields.BooleanField(default=False), + ), + ] diff --git a/bookwyrm/models/user.py b/bookwyrm/models/user.py index 46f08509..c2a74c63 100644 --- a/bookwyrm/models/user.py +++ b/bookwyrm/models/user.py @@ -103,6 +103,7 @@ class User(OrderedCollectionPageMixin, AbstractUser): last_active_date = models.DateTimeField(auto_now=True) manually_approves_followers = fields.BooleanField(default=False) show_goal = models.BooleanField(default=True) + discoverable = fields.BooleanField(default=False) name_field = "username" diff --git a/bookwyrm/templates/book/book.html b/bookwyrm/templates/book/book.html index 0d908110..0275eb1a 100644 --- a/bookwyrm/templates/book/book.html +++ b/bookwyrm/templates/book/book.html @@ -296,3 +296,7 @@ {% endblock %} + +{% block scripts %} + +{% endblock %} diff --git a/bookwyrm/templates/directory.html b/bookwyrm/templates/directory.html new file mode 100644 index 00000000..9323752f --- /dev/null +++ b/bookwyrm/templates/directory.html @@ -0,0 +1,67 @@ +{% extends 'layout.html' %} +{% load i18n %} +{% load bookwyrm_tags %} +{% load humanize %} + +{% block title %}{% trans "Directory" %}{% endblock %} + +{% block content %} +
+

+ {% trans "Directory" %} +

+
+
+ {% for user in users %} +
+
+
+
+ + {% include 'snippets/avatar.html' with user=user large=True %} + +
+ + {{ user.display_name }} + @{{ user|username }} + + {% include 'snippets/follow_button.html' with user=user %} +
+
+ + {% if user.summary %} +
+ {{ user.summary | to_markdown | safe | truncatechars_html:40 }} +
+ {% endif %} +
+ +
+
+ {% endfor %} +
+ +
+ {% include 'snippets/pagination.html' with page=users path="/directory" %} +
+ +{% endblock %} diff --git a/bookwyrm/templates/edit_author.html b/bookwyrm/templates/edit_author.html index 0316a66f..542b57f9 100644 --- a/bookwyrm/templates/edit_author.html +++ b/bookwyrm/templates/edit_author.html @@ -2,11 +2,11 @@ {% load i18n %} {% load humanize %} -{% block title %}{% trans "Edit Author" %}: {{ author.name }}{% endblock %} +{% block title %}{% trans "Edit Author:" %} {{ author.name }}{% endblock %} {% block content %}
-

+

Edit "{{ author.name }}"

diff --git a/bookwyrm/templates/feed/feed.html b/bookwyrm/templates/feed/feed.html index b7ff6e25..76afea7e 100644 --- a/bookwyrm/templates/feed/feed.html +++ b/bookwyrm/templates/feed/feed.html @@ -19,7 +19,7 @@
{# announcements and system messages #} -{% if request.user.show_goal and not goal and tab == 'home' %} +{% if request.user.show_goal and not goal and tab == 'home' and not activities.number > 1 %} {% now 'Y' as year %}
{% include 'snippets/goal_card.html' with year=year %} @@ -31,9 +31,10 @@ {% if not activities %}

{% trans "There aren't any activities right now! Try following a user to get started" %}

{% endif %} + {% for activity in activities %}
-{% include 'snippets/status/status.html' with status=activity %} + {% include 'snippets/status/status.html' with status=activity %}
{% endfor %} diff --git a/bookwyrm/templates/layout.html b/bookwyrm/templates/layout.html index c7d10b57..e57f6152 100644 --- a/bookwyrm/templates/layout.html +++ b/bookwyrm/templates/layout.html @@ -83,18 +83,18 @@