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_date.py b/bookwyrm/migrations/0109_status_edited_date.py new file mode 100644 index 00000000..3d4d733b --- /dev/null +++ b/bookwyrm/migrations/0109_status_edited_date.py @@ -0,0 +1,19 @@ +# Generated by Django 3.2.5 on 2021-10-15 15:54 + +import bookwyrm.models.fields +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ("bookwyrm", "0108_alter_user_preferred_language"), + ] + + operations = [ + migrations.AddField( + model_name="status", + 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 1325aa88..8a11a14f 100644 --- a/bookwyrm/models/status.py +++ b/bookwyrm/models/status.py @@ -43,6 +43,9 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel): published_date = fields.DateTimeField( default=timezone.now, activitypub_field="published" ) + 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/snippets/create_status/comment.html b/bookwyrm/templates/snippets/create_status/comment.html index 4bf1fc24..82ccdbe7 100644 --- a/bookwyrm/templates/snippets/create_status/comment.html +++ b/bookwyrm/templates/snippets/create_status/comment.html @@ -35,7 +35,7 @@ uuid: a unique identifier used to make html "id" attributes unique and clarify j size="3" value="{% firstof draft.progress readthrough.progress '' %}" id="progress_{{ uuid }}" - data-cache-draft="id_progress_comment_{{ book.id }}" + {% if not draft %}data-cache-draft="id_progress_comment_{{ book.id }}"{% endif %} >