diff --git a/bookwyrm/activitypub/note.py b/bookwyrm/activitypub/note.py index d61471fe..eb18b8b8 100644 --- a/bookwyrm/activitypub/note.py +++ b/bookwyrm/activitypub/note.py @@ -35,6 +35,7 @@ class Note(ActivityObject): tag: List[Link] = field(default_factory=lambda: []) attachment: List[Document] = field(default_factory=lambda: []) sensitive: bool = False + updated: str = None type: str = "Note" diff --git a/bookwyrm/activitypub/verbs.py b/bookwyrm/activitypub/verbs.py index 50a479b7..b32b0413 100644 --- a/bookwyrm/activitypub/verbs.py +++ b/bookwyrm/activitypub/verbs.py @@ -69,8 +69,9 @@ class Update(Verb): def action(self): """update a model instance from the dataclass""" - if self.object: - self.object.to_model(allow_create=False) + if not self.object: + return + self.object.to_model(allow_create=False) @dataclass(init=False) diff --git a/bookwyrm/migrations/0109_status_edited.py b/bookwyrm/migrations/0109_status_edited_date.py similarity index 50% rename from bookwyrm/migrations/0109_status_edited.py rename to bookwyrm/migrations/0109_status_edited_date.py index 58fda209..3d4d733b 100644 --- a/bookwyrm/migrations/0109_status_edited.py +++ b/bookwyrm/migrations/0109_status_edited_date.py @@ -1,6 +1,7 @@ -# Generated by Django 3.2.5 on 2021-10-15 00:28 +# Generated by Django 3.2.5 on 2021-10-15 15:54 -from django.db import migrations, models +import bookwyrm.models.fields +from django.db import migrations class Migration(migrations.Migration): @@ -12,7 +13,7 @@ class Migration(migrations.Migration): operations = [ migrations.AddField( model_name="status", - name="edited", - field=models.BooleanField(default=False), + name="edited_date", + field=bookwyrm.models.fields.DateTimeField(blank=True, null=True), ), ] diff --git a/bookwyrm/models/status.py b/bookwyrm/models/status.py index fe051056..d27efda7 100644 --- a/bookwyrm/models/status.py +++ b/bookwyrm/models/status.py @@ -44,7 +44,9 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel): published_date = fields.DateTimeField( default=timezone.now, activitypub_field="published" ) - edited = models.BooleanField(default=False) + edited_date = fields.DateTimeField( + blank=True, null=True, activitypub_field="updated" + ) deleted = models.BooleanField(default=False) deleted_date = models.DateTimeField(blank=True, null=True) favorites = models.ManyToManyField( diff --git a/bookwyrm/settings.py b/bookwyrm/settings.py index 1794db9f..44d65cca 100644 --- a/bookwyrm/settings.py +++ b/bookwyrm/settings.py @@ -9,12 +9,12 @@ from django.utils.translation import gettext_lazy as _ env = Env() env.read_env() DOMAIN = env("DOMAIN") -VERSION = "0.0.1" +VERSION = "0.1.0" PAGE_LENGTH = env("PAGE_LENGTH", 15) DEFAULT_LANGUAGE = env("DEFAULT_LANGUAGE", "English") -JS_CACHE = "c02929b1" +JS_CACHE = "3eb4edb1" # email EMAIL_BACKEND = env("EMAIL_BACKEND", "django.core.mail.backends.smtp.EmailBackend") diff --git a/bookwyrm/static/css/bookwyrm.css b/bookwyrm/static/css/bookwyrm.css index eca7914a..0d280fd5 100644 --- a/bookwyrm/static/css/bookwyrm.css +++ b/bookwyrm/static/css/bookwyrm.css @@ -509,6 +509,20 @@ ol.ordered-list li::before { border-left: 2px solid #e0e0e0; } +/* Breadcrumbs + ******************************************************************************/ + +.breadcrumb li:first-child * { + padding-left: 0; +} + +.breadcrumb li > * { + align-items: center; + display: flex; + justify-content: center; + padding: 0 0.75em; +} + /* Dimensions * @todo These could be in rem. ******************************************************************************/ diff --git a/bookwyrm/templates/book/book_identifiers.html b/bookwyrm/templates/book/book_identifiers.html index 8c8313f3..19ab619d 100644 --- a/bookwyrm/templates/book/book_identifiers.html +++ b/bookwyrm/templates/book/book_identifiers.html @@ -1,7 +1,7 @@ {% spaceless %} {% load i18n %} -{% if book.isbn13 or book.oclc_number or book.asin %} +{% if book.isbn_13 or book.oclc_number or book.asin %}
{% if book.isbn_13 %}
diff --git a/bookwyrm/templates/snippets/page_text.html b/bookwyrm/templates/snippets/page_text.html index dc7a6a33..2ce8eb36 100644 --- a/bookwyrm/templates/snippets/page_text.html +++ b/bookwyrm/templates/snippets/page_text.html @@ -1,7 +1,19 @@ +{% spaceless %} + {% load humanize %} {% load i18n %} + {% if total_pages %} -{% blocktrans with page=page|intcomma total_pages=total_pages|intcomma %}page {{ page }} of {{ total_pages }}{% endblocktrans %} + +{% blocktrans trimmed with page=page|intcomma total_pages=total_pages|intcomma %} +page {{ page }} of {{ total_pages }} +{% endblocktrans %} + {% else %} -{% blocktrans with page=page|intcomma %}page {{ page }}{% endblocktrans %} + +{% blocktrans trimmed with page=page|intcomma %} +page {{ page }} +{% endblocktrans %} + {% endif %} +{% endspaceless %} diff --git a/bookwyrm/templates/snippets/status/header.html b/bookwyrm/templates/snippets/status/header.html index c2f529be..ae25932f 100644 --- a/bookwyrm/templates/snippets/status/header.html +++ b/bookwyrm/templates/snippets/status/header.html @@ -30,22 +30,39 @@ {% include "snippets/status/header_content.html" %} - {% if status.edited %} - (edited) - {% endif %} -

- {{ status.published_date|published_date }} - {% if status.progress %} - - {% if status.progress_mode == 'PG' %} - ({% include 'snippets/page_text.html' with page=status.progress total_pages=status.book.pages %}) - {% else %} - ({{ status.progress }}%) - {% endif %} - - {% endif %} - {% include 'snippets/privacy-icons.html' with item=status %} -

+
diff --git a/bookwyrm/templates/snippets/status/layout.html b/bookwyrm/templates/snippets/status/layout.html index 9d1863ee..93620a08 100644 --- a/bookwyrm/templates/snippets/status/layout.html +++ b/bookwyrm/templates/snippets/status/layout.html @@ -67,7 +67,7 @@ {% endblock %} {% block card-bonus %} -{% if request.user.is_authenticated and not moderation_mode %} +{% if request.user.is_authenticated and not moderation_mode and not no_interact %} {% with status.id|uuid as uuid %}