From bcf846880e9c01b6fdca9f74429d72215d62afe5 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 20 Dec 2021 22:59:32 -0500 Subject: [PATCH] allow mark/review visible to oneself --- books/forms.py | 15 ++------ .../templates/books/create_update_review.html | 2 +- books/templates/books/delete_review.html | 2 +- books/templates/books/detail.html | 12 +++--- books/templates/books/mark_list.html | 2 +- books/templates/books/review_detail.html | 2 +- books/templates/books/review_list.html | 2 +- books/views.py | 17 ++++++--- common/forms.py | 38 ++++++++++--------- common/models.py | 9 +++-- games/forms.py | 13 +------ .../templates/games/create_update_review.html | 2 +- games/templates/games/delete_review.html | 2 +- games/templates/games/detail.html | 12 +++--- games/templates/games/mark_list.html | 2 +- games/templates/games/review_detail.html | 2 +- games/templates/games/review_list.html | 2 +- games/views.py | 16 +++++--- mastodon/api.py | 19 +--------- movies/forms.py | 13 +------ .../movies/create_update_review.html | 2 +- movies/templates/movies/delete_review.html | 2 +- movies/templates/movies/detail.html | 12 +++--- movies/templates/movies/mark_list.html | 2 +- movies/templates/movies/review_detail.html | 2 +- movies/templates/movies/review_list.html | 2 +- movies/views.py | 16 +++++--- music/forms.py | 26 ++----------- music/templates/music/album_detail.html | 12 +++--- music/templates/music/album_mark_list.html | 2 +- .../templates/music/album_review_detail.html | 2 +- music/templates/music/album_review_list.html | 2 +- .../music/create_update_album_review.html | 2 +- .../music/create_update_song_review.html | 2 +- .../templates/music/delete_album_review.html | 2 +- music/templates/music/delete_song_review.html | 2 +- music/templates/music/song_detail.html | 12 +++--- music/templates/music/song_mark_list.html | 2 +- music/templates/music/song_review_detail.html | 2 +- music/templates/music/song_review_list.html | 2 +- music/views.py | 30 ++++++++++----- sync/jobs.py | 4 +- users/templates/users/book_list.html | 2 +- users/templates/users/game_list.html | 2 +- users/templates/users/movie_list.html | 2 +- users/templates/users/music_list.html | 2 +- 46 files changed, 156 insertions(+), 178 deletions(-) diff --git a/books/forms.py b/books/forms.py index da7ecee6..098fad5d 100644 --- a/books/forms.py +++ b/books/forms.py @@ -96,11 +96,8 @@ class BookMarkForm(MarkForm): 'status', 'rating', 'text', - 'is_private', - ] - labels = { - 'rating': _("评分"), - } + 'visibility', + ] widgets = { 'book': forms.TextInput(attrs={"hidden": ""}), } @@ -115,14 +112,8 @@ class BookReviewForm(ReviewForm): 'book', 'title', 'content', - 'is_private' + 'visibility' ] - labels = { - 'book': "", - 'title': _("标题"), - 'content': _("正文"), - 'share_to_mastodon': _("分享到长毛象") - } widgets = { 'book': forms.TextInput(attrs={"hidden": ""}), } diff --git a/books/templates/books/create_update_review.html b/books/templates/books/create_update_review.html index 1d056b7c..acdeb325 100644 --- a/books/templates/books/create_update_review.html +++ b/books/templates/books/create_update_review.html @@ -80,7 +80,7 @@
- {{ form.is_private.label }}{{ form.is_private }} + {{ form.visibility.label }}{{ form.visibility }}