tweak mark dialog

This commit is contained in:
Your Name 2024-05-29 10:50:41 -04:00 committed by Henri Dickson
parent 5d88282f4e
commit 7f9cf95657
19 changed files with 349 additions and 225 deletions

1
.gitignore vendored
View file

@ -3,6 +3,7 @@
/.env /.env
/neodb.env /neodb.env
/compose.override.yml /compose.override.yml
/typings
# Byte-compiled / optimized / DLL files # Byte-compiled / optimized / DLL files
__pycache__/ __pycache__/

View file

@ -181,7 +181,7 @@ SITE_INFO = {
"site_description": env("NEODB_SITE_DESCRIPTION"), "site_description": env("NEODB_SITE_DESCRIPTION"),
"site_head": env("NEODB_SITE_HEAD"), "site_head": env("NEODB_SITE_HEAD"),
"site_links": [{"title": k, "url": v} for k, v in env("NEODB_SITE_LINKS").items()], "site_links": [{"title": k, "url": v} for k, v in env("NEODB_SITE_LINKS").items()],
"cdn_url": "/jsdelivr", "cdn_url": "https://cdn.jsdelivr.net" if DEBUG else "/jsdelivr",
# "cdn_url": "https://cdn.jsdelivr.net", # "cdn_url": "https://cdn.jsdelivr.net",
# "cdn_url": "https://fastly.jsdelivr.net", # "cdn_url": "https://fastly.jsdelivr.net",
} }

View file

@ -28,7 +28,7 @@
hx-target="body" hx-target="body"
hx-swap="beforeend"> hx-swap="beforeend">
{% if mark.comment_text %} {% if mark.comment_text %}
<i class="fa-solid fa-pen-to-square"></i> <i class="fa-regular fa-pen-to-square"></i>
{% else %} {% else %}
<i class="fa-regular fa-square-plus"></i> <i class="fa-regular fa-square-plus"></i>
{% endif %} {% endif %}

View file

@ -2,31 +2,22 @@
{% load i18n %} {% load i18n %}
<section> <section>
<h5> <h5>
{% trans "my tags" %} {% trans "my comment and tags" %}
{% if not mark.tags %} <small>
<small> <span class="action inline">
<span class="action inline">
<a href="#"
hx-get="{% url 'journal:mark' item.uuid %}"
class="item-mark-icon"
hx-target="body"
hx-swap="beforeend">
<i class="fa-regular fa-square-plus"></i>
</a>
</span>
</small>
{% endif %}
</h5>
{% if mark.tags %}
<span class="action">
<span>
<a href="#" <a href="#"
hx-get="{% url 'journal:mark' item.uuid %}" hx-get="{% url 'journal:mark' item.uuid %}"
hx-target="body" hx-target="body"
hx-swap="beforeend"><i class="fa-solid fa-pen-to-square"></i></a> hx-swap="beforeend">
{% if mark.comment or mark.tags %}
<i class="fa-regular fa-pen-to-square"></i>
{% else %}
<i class="fa-regular fa-square-plus"></i>
{% endif %}
</a>
</span> </span>
</span> </small>
{% endif %} </h5>
<div class="tag-list"> <div class="tag-list">
{% for tag in mark.tags %} {% for tag in mark.tags %}
<span> <span>
@ -34,32 +25,8 @@
</span> </span>
{% endfor %} {% endfor %}
</div> </div>
</section>
<section>
<h5>
{% trans "my comments" %}
{% if not mark.comment %}
<small>
<span class="action inline">
<a href="#"
hx-get="{% url 'journal:mark' item.uuid %}"
class="item-mark-icon"
hx-target="body"
hx-swap="beforeend">
<i class="fa-regular fa-square-plus"></i>
</a>
</span>
</small>
{% endif %}
</h5>
{% if mark.comment %} {% if mark.comment %}
<span class="action"> <span class="action">
<span>
<a href="#"
hx-get="{% url 'journal:mark' item.uuid %}"
hx-target="body"
hx-swap="beforeend"><i class="fa-solid fa-pen-to-square"></i></a>
</span>
{% if mark.comment.latest_post %} {% if mark.comment.latest_post %}
{% include "action_like_post.html" with post=mark.comment.latest_post %} {% include "action_like_post.html" with post=mark.comment.latest_post %}
{% include "action_boost_post.html" with post=mark.comment.latest_post %} {% include "action_boost_post.html" with post=mark.comment.latest_post %}
@ -79,7 +46,7 @@
<a href="#" <a href="#"
hx-get="{% url 'journal:comment' comment.item.uuid %}" hx-get="{% url 'journal:comment' comment.item.uuid %}"
hx-target="body" hx-target="body"
hx-swap="beforeend"><i class="fa-solid fa-pen-to-square"></i></a> hx-swap="beforeend"><i class="fa-regular fa-pen-to-square"></i></a>
</span> </span>
{% if comment.latest_post %} {% if comment.latest_post %}
{% include "action_like_post.html" with post=comment.latest_post %} {% include "action_like_post.html" with post=comment.latest_post %}
@ -112,7 +79,7 @@
<span> <span>
<a href="{% url 'journal:review_edit' item.uuid review.uuid %}" <a href="{% url 'journal:review_edit' item.uuid review.uuid %}"
class="item-mark-icon"> class="item-mark-icon">
<i class="fa-solid fa-pen-to-square"></i> <i class="fa-regular fa-pen-to-square"></i>
</a> </a>
</span> </span>
{% if review.latest_post %} {% if review.latest_post %}
@ -167,7 +134,7 @@
{% trans "mark history" %} {% trans "mark history" %}
<small> <small>
<span class="action inline"> <span class="action inline">
<a _="on click toggle .hide-action on #log-list then toggle .activated"><i class="fa-solid fa-pen-to-square"></i></a> <a _="on click toggle .hide-action on #log-list then toggle .activated"><i class="fa-regular fa-pen-to-square"></i></a>
</span> </span>
</small> </small>
</h5> </h5>

View file

@ -12,7 +12,7 @@
href="{% url 'catalog:history' item.url_path item.uuid %}"><i class="fa-solid fa-clock-rotate-left"></i></a> href="{% url 'catalog:history' item.url_path item.uuid %}"><i class="fa-solid fa-clock-rotate-left"></i></a>
</span> </span>
<span> <span>
<a title="{% trans "back to item" %}" href="{{ item.url }}"><i class="fa-regular fa-file-lines"></i></a> <a title="{% trans "back to item" %}" href="{{ item.url }}"><i class="fa-solid fa-file-lines"></i></a>
</span> </span>
</div> </div>
<h5>{% trans "Edit Options" %}</h5> <h5>{% trans "Edit Options" %}</h5>

View file

@ -51,7 +51,7 @@
{% if request.user.is_authenticated and not mark.shelf_type %} {% if request.user.is_authenticated and not mark.shelf_type %}
<div id="item-primary-action" class="right mark"> <div id="item-primary-action" class="right mark">
<div class="item-action item-mark-buttons"> <div class="item-action item-mark-buttons">
{% for k, v in shelf_actions %} {% for k, v in shelf_statuses %}
{% if v and k != 'dropped' %} {% if v and k != 'dropped' %}
<button class="primary" <button class="primary"
data-status="{{ k }}" data-status="{{ k }}"
@ -86,14 +86,16 @@
hx-get="{% url 'journal:mark' item.uuid %}" hx-get="{% url 'journal:mark' item.uuid %}"
hx-target="body" hx-target="body"
hx-swap="beforeend"> hx-swap="beforeend">
{{ mark.created_time | date }} {% trans mark.action_label %} <strong>{% trans mark.status_label %}</strong>
<br>
{% if mark.rating_grade %} {% if mark.rating_grade %}
<br>
{{ mark.rating_grade | rating_star }} {{ mark.rating_grade | rating_star }}
<!-- <span style="white-space: nowrap;"> <br>
{% endif %}
<small>{{ mark.created_time | date }}</small>
<!-- <span style="white-space: nowrap;">
<i class="fa-solid fa-star"></i><i class="fa-solid fa-star"></i><i class="fa-solid fa-star"></i><i class="fa-solid fa-star-half-stroke"></i><i class="fa-regular fa-star"></i> <i class="fa-solid fa-star"></i><i class="fa-solid fa-star"></i><i class="fa-solid fa-star"></i><i class="fa-solid fa-star-half-stroke"></i><i class="fa-regular fa-star"></i>
</span> --> </span> -->
{% endif %}
</button> </button>
</div> </div>
<div class="small-only" style="margin-top:2vh;"> <div class="small-only" style="margin-top:2vh;">
@ -140,7 +142,7 @@
<div class="item-edit"> <div class="item-edit">
<span class="action inline"> <span class="action inline">
<a href="{% url 'catalog:edit' item.url_path item.uuid %}" <a href="{% url 'catalog:edit' item.url_path item.uuid %}"
title="{% trans 'Edit this item' %}"><i class="fa-solid fa-pen-to-square"></i></a> title="{% trans 'Edit this item' %}"><i class="fa-regular fa-pen-to-square"></i></a>
</span> </span>
{% if item.last_editor and item.last_editor.preference.show_last_edit %} {% if item.last_editor and item.last_editor.preference.show_last_edit %}
<span> <span>
@ -217,7 +219,7 @@
</i> </i>
&nbsp;&nbsp; &nbsp;&nbsp;
<i> <i>
{% include '_people.html' with people=item.translator role='translated by' max=2 %} {% include '_people.html' with people=item.translator role='translator' max=2 %}
</i> </i>
</p> </p>
{% endif %} {% endif %}

View file

@ -90,6 +90,7 @@ def retrieve(request, item_path, item_uuid):
collection_list = [] collection_list = []
child_item_comments = [] child_item_comments = []
shelf_actions = ShelfManager.get_actions_for_category(item.category) shelf_actions = ShelfManager.get_actions_for_category(item.category)
shelf_statuses = ShelfManager.get_statuses_for_category(item.category)
if request.user.is_authenticated: if request.user.is_authenticated:
visible = q_piece_visible_to_user(request.user) visible = q_piece_visible_to_user(request.user)
mark = Mark(request.user.identity, item) mark = Mark(request.user.identity, item)
@ -124,6 +125,7 @@ def retrieve(request, item_path, item_uuid):
"my_collections": my_collections, "my_collections": my_collections,
"collection_list": collection_list, "collection_list": collection_list,
"shelf_actions": shelf_actions, "shelf_actions": shelf_actions,
"shelf_statuses": shelf_statuses,
}, },
) )

View file

@ -118,7 +118,9 @@ details {
.shelf { .shelf {
.action { .action {
margin-top: 0.1em; float: unset;
position: absolute;
right: 0;
} }
} }

View file

@ -97,7 +97,7 @@ dialog {
} }
.rating-editor { .rating-editor {
font-size: 120%; font-size: 250%;
padding-bottom: 1em; padding-bottom: 1em;
} }
} }

View file

@ -0,0 +1,9 @@
h1, h2, h3, h4, h5, h6 {
text-transform: capitalize;
}
label, legend, button {
:first-letter {
text-transform: capitalize;
}
}

View file

@ -13,7 +13,7 @@
>div:last-child { >div:last-child {
margin-top: calc(-0.3rem * var(--pico-line-height)); margin-top: calc(-0.3rem * var(--pico-line-height));
text-align: right; text-align: center;
} }
} }
@ -56,7 +56,6 @@
>div, >div,
>div:last-child { >div:last-child {
margin-top: unset; margin-top: unset;
text-align: center;
} }
} }
} }

View file

@ -19,3 +19,4 @@
@import '_login.scss'; @import '_login.scss';
@import '_form.scss'; @import '_form.scss';
@import '_post.scss'; @import '_post.scss';
@import '_l10n.scss';

View file

@ -1,6 +1,8 @@
import re import re
import uuid import uuid
from datetime import datetime
from functools import cached_property from functools import cached_property
from typing import Any
import django.dispatch import django.dispatch
from django.conf import settings from django.conf import settings
@ -66,11 +68,21 @@ class Mark:
) )
return "" return ""
@property
def status_label(self) -> str:
if self.shelfmember and self.shelf_type:
return ShelfManager.get_status_label(self.shelf_type, self.item.category)
if self.comment:
return ShelfManager.get_status_label(
ShelfType.PROGRESS, self.comment.item.category
)
return ""
@property @property
def action_label_for_feed(self) -> str: def action_label_for_feed(self) -> str:
return str(self.action_label) return str(self.action_label)
def get_action_for_feed(self, item_link=None): def get_action_for_feed(self, item_link: str | None = None):
if self.shelfmember and self.shelf_type: if self.shelfmember and self.shelf_type:
tpl = ShelfManager.get_action_template(self.shelf_type, self.item.category) tpl = ShelfManager.get_action_template(self.shelf_type, self.item.category)
elif self.comment: elif self.comment:
@ -94,11 +106,11 @@ class Mark:
) )
@property @property
def created_time(self): def created_time(self) -> datetime | None:
return self.shelfmember.created_time if self.shelfmember else None return self.shelfmember.created_time if self.shelfmember else None
@property @property
def metadata(self) -> dict | None: def metadata(self) -> dict[str, Any] | None:
return self.shelfmember.metadata if self.shelfmember else None return self.shelfmember.metadata if self.shelfmember else None
@property @property
@ -184,9 +196,9 @@ class Mark:
comment_text: str | None = None, comment_text: str | None = None,
rating_grade: int | None = None, rating_grade: int | None = None,
visibility: int | None = None, visibility: int | None = None,
metadata=None, metadata: dict[str, Any] | None = None,
created_time=None, created_time: datetime | None = None,
share_to_mastodon=False, share_to_mastodon: bool = False,
): ):
"""change shelf, comment or rating""" """change shelf, comment or rating"""
if created_time and created_time >= timezone.now(): if created_time and created_time >= timezone.now():
@ -277,7 +289,7 @@ class Mark:
# self.logs.delete() # When deleting a mark, all logs of the mark are deleted first. # self.logs.delete() # When deleting a mark, all logs of the mark are deleted first.
self.update(None) self.update(None)
def delete_log(self, log_id): def delete_log(self, log_id: int):
ShelfLogEntry.objects.filter( ShelfLogEntry.objects.filter(
owner=self.owner, item=self.item, id=log_id owner=self.owner, item=self.item, id=log_id
).delete() ).delete()

View file

@ -5,6 +5,8 @@ from typing import TYPE_CHECKING
from django.db import connection, models from django.db import connection, models
from django.utils import timezone from django.utils import timezone
from django.utils.translation import gettext_lazy as _ from django.utils.translation import gettext_lazy as _
from django.utils.translation import pgettext_lazy
from django.utils.translation import pgettext_lazy as __
from loguru import logger from loguru import logger
from catalog.models import Item, ItemCategory from catalog.models import Item, ItemCategory
@ -30,9 +32,10 @@ _SHELF_LABELS = [
[ [
ItemCategory.Book, ItemCategory.Book,
ShelfType.WISHLIST, ShelfType.WISHLIST,
_("books to read"), _("books to read"), # shelf label
_("want to read"), _("want to read"), # action label
_("wants to read {item}"), _("wants to read {item}"), # feed
_("to read"), # status label
], ],
[ [
ItemCategory.Book, ItemCategory.Book,
@ -40,6 +43,7 @@ _SHELF_LABELS = [
_("books reading"), _("books reading"),
_("start reading"), _("start reading"),
_("started reading {item}"), _("started reading {item}"),
_("reading"),
], ],
[ [
ItemCategory.Book, ItemCategory.Book,
@ -47,6 +51,7 @@ _SHELF_LABELS = [
_("books completed"), _("books completed"),
_("finish reading"), _("finish reading"),
_("finished reading {item}"), _("finished reading {item}"),
_("read"),
], ],
[ [
ItemCategory.Book, ItemCategory.Book,
@ -54,6 +59,7 @@ _SHELF_LABELS = [
_("books dropped"), _("books dropped"),
_("stop reading"), _("stop reading"),
_("stopped reading {item}"), _("stopped reading {item}"),
_("stopped reading"),
], ],
[ [
ItemCategory.Book, ItemCategory.Book,
@ -61,6 +67,7 @@ _SHELF_LABELS = [
_("books reviewed"), _("books reviewed"),
_("review"), _("review"),
_("wrote a review of {item}"), _("wrote a review of {item}"),
"",
], ],
[ [
ItemCategory.Movie, ItemCategory.Movie,
@ -68,6 +75,7 @@ _SHELF_LABELS = [
_("movies to watch"), _("movies to watch"),
_("want to watch"), _("want to watch"),
_("wants to watch {item}"), _("wants to watch {item}"),
_("to watch"),
], ],
[ [
ItemCategory.Movie, ItemCategory.Movie,
@ -75,6 +83,7 @@ _SHELF_LABELS = [
_("movies watching"), _("movies watching"),
_("start watching"), _("start watching"),
_("started watching {item}"), _("started watching {item}"),
_("watching"),
], ],
[ [
ItemCategory.Movie, ItemCategory.Movie,
@ -82,6 +91,7 @@ _SHELF_LABELS = [
_("movies watched"), _("movies watched"),
_("finish watching"), _("finish watching"),
_("finished watching {item}"), _("finished watching {item}"),
_("watched"),
], ],
[ [
ItemCategory.Movie, ItemCategory.Movie,
@ -89,6 +99,7 @@ _SHELF_LABELS = [
_("movies dropped"), _("movies dropped"),
_("stop watching"), _("stop watching"),
_("stopped watching {item}"), _("stopped watching {item}"),
_("stopped watching"),
], ],
[ [
ItemCategory.Movie, ItemCategory.Movie,
@ -96,6 +107,7 @@ _SHELF_LABELS = [
_("movies reviewed"), _("movies reviewed"),
_("review"), _("review"),
_("wrote a review of {item}"), _("wrote a review of {item}"),
"",
], ],
[ [
ItemCategory.TV, ItemCategory.TV,
@ -103,6 +115,7 @@ _SHELF_LABELS = [
_("TV shows to watch"), _("TV shows to watch"),
_("want to watch"), _("want to watch"),
_("wants to watch {item}"), _("wants to watch {item}"),
_("to watch"),
], ],
[ [
ItemCategory.TV, ItemCategory.TV,
@ -110,6 +123,7 @@ _SHELF_LABELS = [
_("TV shows watching"), _("TV shows watching"),
_("start watching"), _("start watching"),
_("started watching {item}"), _("started watching {item}"),
_("watching"),
], ],
[ [
ItemCategory.TV, ItemCategory.TV,
@ -117,6 +131,7 @@ _SHELF_LABELS = [
_("TV shows watched"), _("TV shows watched"),
_("finish watching"), _("finish watching"),
_("finished watching {item}"), _("finished watching {item}"),
_("watched"),
], ],
[ [
ItemCategory.TV, ItemCategory.TV,
@ -124,6 +139,7 @@ _SHELF_LABELS = [
_("TV shows dropped"), _("TV shows dropped"),
_("stop watching"), _("stop watching"),
_("stopped watching {item}"), _("stopped watching {item}"),
_("stopped watching"),
], ],
[ [
ItemCategory.TV, ItemCategory.TV,
@ -131,6 +147,7 @@ _SHELF_LABELS = [
_("TV shows reviewed"), _("TV shows reviewed"),
_("review"), _("review"),
_("wrote a review of {item}"), _("wrote a review of {item}"),
"",
], ],
[ [
ItemCategory.Music, ItemCategory.Music,
@ -138,6 +155,7 @@ _SHELF_LABELS = [
_("albums to listen"), _("albums to listen"),
_("want to listen"), _("want to listen"),
_("wants to listen {item}"), _("wants to listen {item}"),
_("to listen"),
], ],
[ [
ItemCategory.Music, ItemCategory.Music,
@ -145,6 +163,7 @@ _SHELF_LABELS = [
_("albums listening"), _("albums listening"),
_("start listening"), _("start listening"),
_("started listening {item}"), _("started listening {item}"),
_("listening"),
], ],
[ [
ItemCategory.Music, ItemCategory.Music,
@ -152,6 +171,7 @@ _SHELF_LABELS = [
_("albums listened"), _("albums listened"),
_("finish listening"), _("finish listening"),
_("finished listening {item}"), _("finished listening {item}"),
_("listened"),
], ],
[ [
ItemCategory.Music, ItemCategory.Music,
@ -159,6 +179,7 @@ _SHELF_LABELS = [
_("albums dropped"), _("albums dropped"),
_("stop listening"), _("stop listening"),
_("stopped listening {item}"), _("stopped listening {item}"),
_("stopped listening"),
], ],
[ [
ItemCategory.Music, ItemCategory.Music,
@ -166,6 +187,7 @@ _SHELF_LABELS = [
_("albums reviewed"), _("albums reviewed"),
_("review"), _("review"),
_("wrote a review of {item}"), _("wrote a review of {item}"),
"",
], ],
[ [
ItemCategory.Game, ItemCategory.Game,
@ -173,6 +195,7 @@ _SHELF_LABELS = [
_("games to play"), _("games to play"),
_("want to play"), _("want to play"),
_("wants to play {item}"), _("wants to play {item}"),
_("to play"),
], ],
[ [
ItemCategory.Game, ItemCategory.Game,
@ -180,6 +203,7 @@ _SHELF_LABELS = [
_("games playing"), _("games playing"),
_("start playing"), _("start playing"),
_("started playing {item}"), _("started playing {item}"),
_("playing"),
], ],
[ [
ItemCategory.Game, ItemCategory.Game,
@ -187,6 +211,7 @@ _SHELF_LABELS = [
_("games played"), _("games played"),
_("finish playing"), _("finish playing"),
_("finished playing {item}"), _("finished playing {item}"),
_("played"),
], ],
[ [
ItemCategory.Game, ItemCategory.Game,
@ -194,6 +219,7 @@ _SHELF_LABELS = [
_("games dropped"), _("games dropped"),
_("stop playing"), _("stop playing"),
_("stopped playing {item}"), _("stopped playing {item}"),
_("stopped playing"),
], ],
[ [
ItemCategory.Game, ItemCategory.Game,
@ -201,6 +227,7 @@ _SHELF_LABELS = [
_("games reviewed"), _("games reviewed"),
_("review"), _("review"),
_("wrote a review of {item}"), _("wrote a review of {item}"),
"",
], ],
[ [
ItemCategory.Podcast, ItemCategory.Podcast,
@ -208,6 +235,7 @@ _SHELF_LABELS = [
_("podcasts to listen"), _("podcasts to listen"),
_("want to listen"), _("want to listen"),
_("wants to listen {item}"), _("wants to listen {item}"),
_("to listen"),
], ],
[ [
ItemCategory.Podcast, ItemCategory.Podcast,
@ -215,6 +243,7 @@ _SHELF_LABELS = [
_("podcasts listening"), _("podcasts listening"),
_("start listening"), _("start listening"),
_("started listening {item}"), _("started listening {item}"),
_("listening"),
], ],
[ [
ItemCategory.Podcast, ItemCategory.Podcast,
@ -222,6 +251,7 @@ _SHELF_LABELS = [
_("podcasts listened"), _("podcasts listened"),
_("finish listening"), _("finish listening"),
_("finished listening {item}"), _("finished listening {item}"),
_("listened"),
], ],
[ [
ItemCategory.Podcast, ItemCategory.Podcast,
@ -229,6 +259,7 @@ _SHELF_LABELS = [
_("podcasts dropped"), _("podcasts dropped"),
_("stop listening"), _("stop listening"),
_("stopped listening {item}"), _("stopped listening {item}"),
_("stopped listening"),
], ],
[ [
ItemCategory.Podcast, ItemCategory.Podcast,
@ -236,6 +267,7 @@ _SHELF_LABELS = [
_("podcasts reviewed"), _("podcasts reviewed"),
_("review"), _("review"),
_("wrote a review of {item}"), _("wrote a review of {item}"),
"",
], ],
[ [
ItemCategory.Performance, ItemCategory.Performance,
@ -243,15 +275,17 @@ _SHELF_LABELS = [
_("performances to see"), _("performances to see"),
_("want to see"), _("want to see"),
_("wants to see {item}"), _("wants to see {item}"),
_("to see"),
], ],
# disable progress shelf for Performance # disable progress shelf for Performance
[ItemCategory.Performance, ShelfType.PROGRESS, "", "", ""], [ItemCategory.Performance, ShelfType.PROGRESS, "", "", "", ""],
[ [
ItemCategory.Performance, ItemCategory.Performance,
ShelfType.COMPLETE, ShelfType.COMPLETE,
_("performances saw"), _("performances saw"),
_("finish seeing"), _("finish seeing"),
_("finished seeing {item}"), _("finished seeing {item}"),
_("seen"),
], ],
[ [
ItemCategory.Performance, ItemCategory.Performance,
@ -259,6 +293,7 @@ _SHELF_LABELS = [
_("performances dropped"), _("performances dropped"),
_("stop seeing"), _("stop seeing"),
_("stopped seeing {item}"), _("stopped seeing {item}"),
_("stopped seeing"),
], ],
[ [
ItemCategory.Performance, ItemCategory.Performance,
@ -266,6 +301,7 @@ _SHELF_LABELS = [
_("performances reviewed"), _("performances reviewed"),
_("review"), _("review"),
_("wrote a review of {item}"), _("wrote a review of {item}"),
"",
], ],
] ]
# grammatically problematic, for translation only # grammatically problematic, for translation only
@ -511,6 +547,14 @@ class ShelfManager:
if n[0] == item_category and n[1] != _REVIEWED if n[0] == item_category and n[1] != _REVIEWED
] ]
@classmethod
def get_statuses_for_category(cls, item_category: ItemCategory):
return [
(n[1], n[5])
for n in _SHELF_LABELS
if n[0] == item_category and n[1] != _REVIEWED
]
@classmethod @classmethod
def get_label(cls, shelf_type: ShelfType | str, item_category: ItemCategory) -> str: def get_label(cls, shelf_type: ShelfType | str, item_category: ItemCategory) -> str:
st = str(shelf_type) st = str(shelf_type)
@ -525,6 +569,14 @@ class ShelfManager:
sts = [n[3] for n in _SHELF_LABELS if n[0] == item_category and n[1] == st] sts = [n[3] for n in _SHELF_LABELS if n[0] == item_category and n[1] == st]
return sts[0] if sts else st return sts[0] if sts else st
@classmethod
def get_status_label(
cls, shelf_type: ShelfType | str, item_category: ItemCategory
) -> str:
st = str(shelf_type)
sts = [n[5] for n in _SHELF_LABELS if n[0] == item_category and n[1] == st]
return sts[0] if sts else st
@classmethod @classmethod
def get_action_template( def get_action_template(
cls, shelf_type: ShelfType | str, item_category: ItemCategory cls, shelf_type: ShelfType | str, item_category: ItemCategory

View file

@ -59,7 +59,7 @@
id="id_share_to_mastodon" id="id_share_to_mastodon"
value="1" value="1"
{% if request.user.preference.mastodon_default_repost %}checked{% endif %}> {% if request.user.preference.mastodon_default_repost %}checked{% endif %}>
{% trans "Repost to your timeline" %} {% trans "Repost to timeline" %}
</label> </label>
{% endif %} {% endif %}
</fieldset> </fieldset>

View file

@ -19,23 +19,28 @@
<div> <div>
<form method="post" action="{% url 'journal:mark' item.uuid %}"> <form method="post" action="{% url 'journal:mark' item.uuid %}">
{% csrf_token %} {% csrf_token %}
{% if shelf_actions %} {% if shelf_statuses %}
<input type="hidden" id="mark-status" name="status" value="{{ shelf_type }}">
<div class="grid mark-line"> <div class="grid mark-line">
<div> <div>
<fieldset> <div role="group">
{% for k, v in shelf_actions %} {% for k, v in shelf_statuses %}
{% if v %} {% if v %}
<input type="radio" <button data-value="{{ k }}"
name="status" id="id_status_{{ k }}"
value="{{ k }}" style="padding-left:0.1em;
required padding-right:0.1em;
id="id_status_{{ k }}" width:25%;
{% if k == "wishlist" or k == "dropped" %} _="on click add .hidden to .rating-editor" {% else %} _="on click remove .hidden from .rating-editor" {% endif %} text-overflow: ellipsis;
{% if shelf_type == k %}checked=""{% endif %}> white-space: nowrap;
<label for="id_status_{{ k }}">{{ v }}</label> overflow: hidden"
{% if k == "wishlist" or k == "dropped" %} _="on click add .outline to .status-selector then remove .outline from me then set value of #mark-status to '{{ k }}' then add .hidden to .rating-editor then halt" {% else %} _="on click add .outline to .status-selector then remove .outline from me then set value of #mark-status to '{{ k }}' then remove .hidden from .rating-editor then halt" {% endif %}
{% if shelf_type == k %}class="status-selector"{% else %}class="status-selector outline"{% endif %}>
{{ v }}
</button>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</fieldset> </div>
</div> </div>
<div> <div>
<span class="rating-editor {% if shelf_type == 'wishlist' %}hidden{% endif %}" _="on mousemove(currentTarget, offsetX) set current_value to Math.round((10 * offsetX) / currentTarget.offsetWidth) if current_value <=10 then set star_div to the <span class="rating-editor {% if shelf_type == 'wishlist' %}hidden{% endif %}" _="on mousemove(currentTarget, offsetX) set current_value to Math.round((10 * offsetX) / currentTarget.offsetWidth) if current_value <=10 then set star_div to the
@ -76,7 +81,7 @@
data-initial-value="{{ tags }}"> data-initial-value="{{ tags }}">
</div> </div>
</div> </div>
<div class="grid"> <div class="grid" style="overflow-x:scroll;">
<div> <div>
<fieldset> <fieldset>
<input type="radio" <input type="radio"
@ -112,7 +117,7 @@
id="id_share_to_mastodon" id="id_share_to_mastodon"
value="1" value="1"
{% if request.user.preference.mastodon_default_repost %}checked{% endif %}> {% if request.user.preference.mastodon_default_repost %}checked{% endif %}>
{% trans "Repost to your timeline" %} {% trans "Repost to timeline" %}
</label> </label>
{% endif %} {% endif %}
</fieldset> </fieldset>

View file

@ -44,6 +44,7 @@ def mark(request: AuthedHttpRequest, item_uuid):
if request.method == "GET": if request.method == "GET":
tags = request.user.identity.tag_manager.get_item_tags(item) tags = request.user.identity.tag_manager.get_item_tags(item)
shelf_actions = ShelfManager.get_actions_for_category(item.category) shelf_actions = ShelfManager.get_actions_for_category(item.category)
shelf_statuses = ShelfManager.get_statuses_for_category(item.category)
shelf_type = request.GET.get("shelf_type", mark.shelf_type) shelf_type = request.GET.get("shelf_type", mark.shelf_type)
return render( return render(
request, request,
@ -54,6 +55,7 @@ def mark(request: AuthedHttpRequest, item_uuid):
"shelf_type": shelf_type, "shelf_type": shelf_type,
"tags": ",".join(tags), "tags": ",".join(tags),
"shelf_actions": shelf_actions, "shelf_actions": shelf_actions,
"shelf_statuses": shelf_statuses,
"date_today": timezone.localdate().isoformat(), "date_today": timezone.localdate().isoformat(),
}, },
) )

View file

@ -1,12 +1,12 @@
# NeoDB Translation. # NeoDB Translation.
# Copyright (C) 2024 NeoDB Developers # Copyright (C) 2024 NeoDB Developers
# This file is distributed under the same license as the PACKAGE package. # This file is distributed under the same license as the NeoDB package.
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-05-29 13:16-0400\n" "POT-Creation-Date: 2024-05-29 18:58-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -635,12 +635,12 @@ msgstr "无法加载条目,请确认链接正确。部分网站可能删除条
#: catalog/templates/_item_card_metadata_tvseason.html:7 #: catalog/templates/_item_card_metadata_tvseason.html:7
#: catalog/templates/_item_card_metadata_tvshow.html:7 #: catalog/templates/_item_card_metadata_tvshow.html:7
#: catalog/templates/_item_card_metadata_work.html:7 #: catalog/templates/_item_card_metadata_work.html:7
#: catalog/templates/item_base.html:160 #: catalog/templates/item_base.html:181
msgid "ratings" msgid "ratings"
msgstr "个评分" msgstr "个评分"
#: catalog/templates/_item_card_metadata_base.html:32 #: catalog/templates/_item_card_metadata_base.html:32
#: catalog/templates/item_base.html:210 #: catalog/templates/item_base.html:231
msgid "part of" msgid "part of"
msgstr "所属" msgstr "所属"
@ -682,10 +682,10 @@ msgstr "没有更多内容了。"
msgid "comment this episode" msgid "comment this episode"
msgstr "写该集短评" msgstr "写该集短评"
#: catalog/templates/_item_reviews.html:26 journal/models/shelf.py:62 #: catalog/templates/_item_reviews.html:26 journal/models/shelf.py:68
#: journal/models/shelf.py:97 journal/models/shelf.py:132 #: journal/models/shelf.py:108 journal/models/shelf.py:148
#: journal/models/shelf.py:167 journal/models/shelf.py:202 #: journal/models/shelf.py:188 journal/models/shelf.py:228
#: journal/models/shelf.py:237 journal/models/shelf.py:267 #: journal/models/shelf.py:268 journal/models/shelf.py:302
#: journal/templates/_sidebar_user_mark_list.html:26 #: journal/templates/_sidebar_user_mark_list.html:26
msgid "review" msgid "review"
msgstr "评论" msgstr "评论"
@ -707,22 +707,18 @@ msgid "clear history will not remove current mark"
msgstr "清除标记历史不会删除或改变现有标记" msgstr "清除标记历史不会删除或改变现有标记"
#: catalog/templates/_item_user_pieces.html:5 #: catalog/templates/_item_user_pieces.html:5
msgid "my tags" msgid "my comment and tags"
msgstr "我的标签" msgstr "我的短评和标签"
#: catalog/templates/_item_user_pieces.html:40 #: catalog/templates/_item_user_pieces.html:67
msgid "my comments"
msgstr "我的短评"
#: catalog/templates/_item_user_pieces.html:100
msgid "my review" msgid "my review"
msgstr "我的评论" msgstr "我的评论"
#: catalog/templates/_item_user_pieces.html:142 #: catalog/templates/_item_user_pieces.html:109
msgid "my collection" msgid "my collection"
msgstr "我的收藏单" msgstr "我的收藏单"
#: catalog/templates/_item_user_pieces.html:172 #: catalog/templates/_item_user_pieces.html:139
msgid "mark history" msgid "mark history"
msgstr "标记历史" msgstr "标记历史"
@ -877,7 +873,7 @@ msgstr "合并到另一条目"
#: catalog/templates/_sidebar_edit.html:210 #: catalog/templates/_sidebar_edit.html:210
#: catalog/templates/catalog_delete.html:11 #: catalog/templates/catalog_delete.html:11
#: developer/templates/oauth2_provider/application_detail.html:42 #: developer/templates/oauth2_provider/application_detail.html:42
#: journal/templates/collection.html:133 journal/templates/mark.html:157 #: journal/templates/collection.html:133 journal/templates/mark.html:161
#: journal/templates/piece_delete.html:9 journal/templates/review.html:83 #: journal/templates/piece_delete.html:9 journal/templates/review.html:83
msgid "Delete" msgid "Delete"
msgstr "删除" msgstr "删除"
@ -1032,7 +1028,7 @@ msgstr "创建"
#: developer/templates/oauth2_provider/application_form.html:35 #: developer/templates/oauth2_provider/application_form.html:35
#: journal/templates/add_to_collection.html:35 #: journal/templates/add_to_collection.html:35
#: journal/templates/collection_edit.html:38 journal/templates/comment.html:69 #: journal/templates/collection_edit.html:38 journal/templates/comment.html:69
#: journal/templates/mark.html:142 journal/templates/review_edit.html:39 #: journal/templates/mark.html:146 journal/templates/review_edit.html:39
#: journal/templates/tag_edit.html:60 users/templates/users/account.html:43 #: journal/templates/tag_edit.html:60 users/templates/users/account.html:43
#: users/templates/users/account.html:104 #: users/templates/users/account.html:104
#: users/templates/users/preferences.html:170 #: users/templates/users/preferences.html:170
@ -1123,43 +1119,43 @@ msgstr "系统繁忙,请稍等几秒钟再搜索。"
msgid "release year" msgid "release year"
msgstr "发行年份" msgstr "发行年份"
#: catalog/templates/item_base.html:65 #: catalog/templates/item_base.html:84
msgid "select one of the seasons to comment" msgid "select one of the seasons to comment"
msgstr "这是全剧条目,以下是可标记的单季" msgstr "这是全剧条目,以下是可标记的单季"
#: catalog/templates/item_base.html:100 #: catalog/templates/item_base.html:121
msgid "mark, comment and collect" msgid "mark, comment and collect"
msgstr "标签 · 短评 · 评论 · 收藏" msgstr "标签 · 短评 · 评论 · 收藏"
#: catalog/templates/item_base.html:111 #: catalog/templates/item_base.html:132
msgid "Login or register to review or add this item to your collection." msgid "Login or register to review or add this item to your collection."
msgstr "登录后可管理标记收藏" msgstr "登录后可管理标记收藏"
#: catalog/templates/item_base.html:119 #: catalog/templates/item_base.html:140
msgid "Related Collections" msgid "Related Collections"
msgstr "相关收藏单" msgstr "相关收藏单"
#: catalog/templates/item_base.html:134 #: catalog/templates/item_base.html:155
msgid "Unsupported item type." msgid "Unsupported item type."
msgstr "此类数据尚未支持" msgstr "此类数据尚未支持"
#: catalog/templates/item_base.html:143 #: catalog/templates/item_base.html:164
msgid "Edit this item" msgid "Edit this item"
msgstr "编辑这个条目" msgstr "编辑这个条目"
#: catalog/templates/item_base.html:147 #: catalog/templates/item_base.html:168
msgid "Last edited" msgid "Last edited"
msgstr "最近编辑" msgstr "最近编辑"
#: catalog/templates/item_base.html:184 #: catalog/templates/item_base.html:205
msgid "No enough ratings" msgid "No enough ratings"
msgstr "评分人数不足" msgstr "评分人数不足"
#: catalog/templates/item_base.html:228 #: catalog/templates/item_base.html:249
msgid "overview" msgid "overview"
msgstr "简介" msgstr "简介"
#: catalog/templates/item_base.html:234 #: catalog/templates/item_base.html:255
#: catalog/templates/item_mark_list.html:54 #: catalog/templates/item_mark_list.html:54
#: catalog/templates/item_review_list.html:50 common/templates/_sidebar.html:97 #: catalog/templates/item_review_list.html:50 common/templates/_sidebar.html:97
#: common/templates/_sidebar.html:197 journal/templates/collection_items.html:8 #: common/templates/_sidebar.html:197 journal/templates/collection_items.html:8
@ -1173,25 +1169,25 @@ msgstr "简介"
msgid "nothing so far." msgid "nothing so far."
msgstr "暂无内容。" msgstr "暂无内容。"
#: catalog/templates/item_base.html:241 #: catalog/templates/item_base.html:262
msgid "comments" msgid "comments"
msgstr "短评" msgstr "短评"
#: catalog/templates/item_base.html:244 #: catalog/templates/item_base.html:265
#: catalog/templates/item_mark_list.html:21 #: catalog/templates/item_mark_list.html:21
#: catalog/templates/item_mark_list.html:24 #: catalog/templates/item_mark_list.html:24
#: catalog/templates/item_review_list.html:20 #: catalog/templates/item_review_list.html:20
msgid "marks" msgid "marks"
msgstr "标记" msgstr "标记"
#: catalog/templates/item_base.html:245 #: catalog/templates/item_base.html:266
#: catalog/templates/item_mark_list.html:22 #: catalog/templates/item_mark_list.html:22
#: catalog/templates/item_mark_list.html:25 #: catalog/templates/item_mark_list.html:25
#: catalog/templates/item_review_list.html:21 #: catalog/templates/item_review_list.html:21
msgid "marks from who you follow" msgid "marks from who you follow"
msgstr "好友标记" msgstr "好友标记"
#: catalog/templates/item_base.html:259 #: catalog/templates/item_base.html:280
#: catalog/templates/item_mark_list.html:27 #: catalog/templates/item_mark_list.html:27
#: catalog/templates/item_review_list.html:22 #: catalog/templates/item_review_list.html:22
msgid "reviews" msgid "reviews"
@ -1372,7 +1368,7 @@ msgstr "权限不足"
#: catalog/views_edit.py:200 journal/views/collection.py:229 #: catalog/views_edit.py:200 journal/views/collection.py:229
#: journal/views/collection.py:296 journal/views/common.py:81 #: journal/views/collection.py:296 journal/views/common.py:81
#: journal/views/mark.py:140 journal/views/post.py:41 journal/views/post.py:55 #: journal/views/mark.py:142 journal/views/post.py:41 journal/views/post.py:55
#: journal/views/review.py:93 journal/views/review.py:96 users/views.py:169 #: journal/views/review.py:93 journal/views/review.py:96 users/views.py:169
msgid "Invalid parameter" msgid "Invalid parameter"
msgstr "无效参数" msgstr "无效参数"
@ -1697,7 +1693,7 @@ msgid "note"
msgstr "备注" msgstr "备注"
#: journal/models/common.py:28 journal/templates/collection_share.html:35 #: journal/models/common.py:28 journal/templates/collection_share.html:35
#: journal/templates/comment.html:35 journal/templates/mark.html:88 #: journal/templates/comment.html:35 journal/templates/mark.html:92
#: journal/templates/tag_edit.html:40 journal/templates/wrapped_share.html:43 #: journal/templates/tag_edit.html:40 journal/templates/wrapped_share.html:43
#: users/templates/users/data.html:47 users/templates/users/data.html:139 #: users/templates/users/data.html:47 users/templates/users/data.html:139
#: users/templates/users/preferences.html:54 #: users/templates/users/preferences.html:54
@ -1705,7 +1701,7 @@ msgid "Public"
msgstr "公开" msgstr "公开"
#: journal/models/common.py:29 journal/templates/collection_share.html:46 #: journal/models/common.py:29 journal/templates/collection_share.html:46
#: journal/templates/comment.html:42 journal/templates/mark.html:95 #: journal/templates/comment.html:42 journal/templates/mark.html:99
#: journal/templates/wrapped_share.html:49 users/templates/users/data.html:55 #: journal/templates/wrapped_share.html:49 users/templates/users/data.html:55
#: users/templates/users/data.html:147 #: users/templates/users/data.html:147
#: users/templates/users/preferences.html:61 #: users/templates/users/preferences.html:61
@ -1713,345 +1709,421 @@ msgid "Followers Only"
msgstr "仅关注者" msgstr "仅关注者"
#: journal/models/common.py:30 journal/templates/collection_share.html:57 #: journal/models/common.py:30 journal/templates/collection_share.html:57
#: journal/templates/comment.html:49 journal/templates/mark.html:102 #: journal/templates/comment.html:49 journal/templates/mark.html:106
#: journal/templates/wrapped_share.html:55 users/templates/users/data.html:63 #: journal/templates/wrapped_share.html:55 users/templates/users/data.html:63
#: users/templates/users/data.html:155 #: users/templates/users/data.html:155
#: users/templates/users/preferences.html:68 #: users/templates/users/preferences.html:68
msgid "Mentioned Only" msgid "Mentioned Only"
msgstr "自己和提到的人" msgstr "自己和提到的人"
#: journal/models/shelf.py:21 #: journal/models/shelf.py:23
msgid "WISHLIST" msgid "WISHLIST"
msgstr "" msgstr ""
#: journal/models/shelf.py:22 #: journal/models/shelf.py:24
msgid "PROGRESS" msgid "PROGRESS"
msgstr "" msgstr ""
#: journal/models/shelf.py:23 #: journal/models/shelf.py:25
msgid "COMPLETE" msgid "COMPLETE"
msgstr "" msgstr ""
#: journal/models/shelf.py:24 #: journal/models/shelf.py:26
msgid "DROPPED" msgid "DROPPED"
msgstr "" msgstr ""
#: journal/models/shelf.py:33 #: journal/models/shelf.py:35
msgid "books to read" msgid "books to read"
msgstr "想读的书" msgstr "想读的书"
#: journal/models/shelf.py:34 #: journal/models/shelf.py:36
msgid "want to read" msgid "want to read"
msgstr "想读" msgstr "想读"
#: journal/models/shelf.py:35 #: journal/models/shelf.py:37
#, python-brace-format #, python-brace-format
msgid "wants to read {item}" msgid "wants to read {item}"
msgstr "想读 {item}" msgstr "想读 {item}"
#: journal/models/shelf.py:40 #: journal/models/shelf.py:38
msgid "to read"
msgstr "想读"
#: journal/models/shelf.py:43
msgid "books reading" msgid "books reading"
msgstr "正在读的书" msgstr "正在读的书"
#: journal/models/shelf.py:41 #: journal/models/shelf.py:44
msgid "start reading" msgid "start reading"
msgstr "在读" msgstr "在读"
#: journal/models/shelf.py:42 #: journal/models/shelf.py:45
#, python-brace-format #, python-brace-format
msgid "started reading {item}" msgid "started reading {item}"
msgstr "在读 {item}" msgstr "在读 {item}"
#: journal/models/shelf.py:47 #: journal/models/shelf.py:46
msgid "reading"
msgstr "在读"
#: journal/models/shelf.py:51
msgid "books completed" msgid "books completed"
msgstr "读过的书" msgstr "读过的书"
#: journal/models/shelf.py:48 #: journal/models/shelf.py:52
msgid "finish reading" msgid "finish reading"
msgstr "读过" msgstr "读过"
#: journal/models/shelf.py:49 #: journal/models/shelf.py:53
#, python-brace-format #, python-brace-format
msgid "finished reading {item}" msgid "finished reading {item}"
msgstr "读过 {item}" msgstr "读过 {item}"
#: journal/models/shelf.py:54 #: journal/models/shelf.py:54
msgid "read"
msgstr "已读"
#: journal/models/shelf.py:59
msgid "books dropped" msgid "books dropped"
msgstr "不再读的书" msgstr "不再读的书"
#: journal/models/shelf.py:55 #: journal/models/shelf.py:60
msgid "stop reading" msgid "stop reading"
msgstr "不读了" msgstr "不读了"
#: journal/models/shelf.py:56 #: journal/models/shelf.py:61
#, python-brace-format #, python-brace-format
msgid "stopped reading {item}" msgid "stopped reading {item}"
msgstr "不再读 {item}" msgstr "不再读 {item}"
#: journal/models/shelf.py:61 #: journal/models/shelf.py:62
msgid "stopped reading"
msgstr "不读了"
#: journal/models/shelf.py:67
msgid "books reviewed" msgid "books reviewed"
msgstr "评论过的书" msgstr "评论过的书"
#: journal/models/shelf.py:63 journal/models/shelf.py:98 #: journal/models/shelf.py:69 journal/models/shelf.py:109
#: journal/models/shelf.py:133 journal/models/shelf.py:168 #: journal/models/shelf.py:149 journal/models/shelf.py:189
#: journal/models/shelf.py:203 journal/models/shelf.py:238 #: journal/models/shelf.py:229 journal/models/shelf.py:269
#: journal/models/shelf.py:268 #: journal/models/shelf.py:303
#, python-brace-format #, python-brace-format
msgid "wrote a review of {item}" msgid "wrote a review of {item}"
msgstr "写了关于 {item} 的评论" msgstr "写了关于 {item} 的评论"
#: journal/models/shelf.py:68 #: journal/models/shelf.py:75
msgid "movies to watch" msgid "movies to watch"
msgstr "想看的电影" msgstr "想看的电影"
#: journal/models/shelf.py:69 journal/models/shelf.py:104 #: journal/models/shelf.py:76 journal/models/shelf.py:116
msgid "want to watch" msgid "want to watch"
msgstr "想看" msgstr "想看"
#: journal/models/shelf.py:70 journal/models/shelf.py:105 #: journal/models/shelf.py:77 journal/models/shelf.py:117
#, python-brace-format #, python-brace-format
msgid "wants to watch {item}" msgid "wants to watch {item}"
msgstr "想看 {item}" msgstr "想看 {item}"
#: journal/models/shelf.py:75 #: journal/models/shelf.py:78 journal/models/shelf.py:118
msgid "to watch"
msgstr "想看"
#: journal/models/shelf.py:83
msgid "movies watching" msgid "movies watching"
msgstr "正在看的电影" msgstr "正在看的电影"
#: journal/models/shelf.py:76 journal/models/shelf.py:111 #: journal/models/shelf.py:84 journal/models/shelf.py:124
msgid "start watching" msgid "start watching"
msgstr "在看" msgstr "在看"
#: journal/models/shelf.py:77 journal/models/shelf.py:112 #: journal/models/shelf.py:85 journal/models/shelf.py:125
#, python-brace-format #, python-brace-format
msgid "started watching {item}" msgid "started watching {item}"
msgstr "在看 {item}" msgstr "在看 {item}"
#: journal/models/shelf.py:82 #: journal/models/shelf.py:86 journal/models/shelf.py:126
msgid "watching"
msgstr "在看"
#: journal/models/shelf.py:91
msgid "movies watched" msgid "movies watched"
msgstr "看过的电影" msgstr "看过的电影"
#: journal/models/shelf.py:83 journal/models/shelf.py:118 #: journal/models/shelf.py:92 journal/models/shelf.py:132
msgid "finish watching" msgid "finish watching"
msgstr "看过" msgstr "看过"
#: journal/models/shelf.py:84 journal/models/shelf.py:119 #: journal/models/shelf.py:93 journal/models/shelf.py:133
#, python-brace-format #, python-brace-format
msgid "finished watching {item}" msgid "finished watching {item}"
msgstr "看过 {item}" msgstr "看过 {item}"
#: journal/models/shelf.py:89 #: journal/models/shelf.py:94 journal/models/shelf.py:134
msgid "watched"
msgstr "看过"
#: journal/models/shelf.py:99
msgid "movies dropped" msgid "movies dropped"
msgstr "不再看的电影" msgstr "不再看的电影"
#: journal/models/shelf.py:90 journal/models/shelf.py:125 #: journal/models/shelf.py:100 journal/models/shelf.py:140
msgid "stop watching" msgid "stop watching"
msgstr "不看了" msgstr "不看了"
#: journal/models/shelf.py:91 journal/models/shelf.py:126 #: journal/models/shelf.py:101 journal/models/shelf.py:141
#, python-brace-format #, python-brace-format
msgid "stopped watching {item}" msgid "stopped watching {item}"
msgstr "不再看 {item}" msgstr "不再看 {item}"
#: journal/models/shelf.py:96 #: journal/models/shelf.py:102 journal/models/shelf.py:142
msgid "stopped watching"
msgstr "不看了"
#: journal/models/shelf.py:107
msgid "movies reviewed" msgid "movies reviewed"
msgstr "评论过的电影" msgstr "评论过的电影"
#: journal/models/shelf.py:103 #: journal/models/shelf.py:115
msgid "TV shows to watch" msgid "TV shows to watch"
msgstr "想看的剧集" msgstr "想看的剧集"
#: journal/models/shelf.py:110 #: journal/models/shelf.py:123
msgid "TV shows watching" msgid "TV shows watching"
msgstr "正在看的剧集" msgstr "正在看的剧集"
#: journal/models/shelf.py:117 #: journal/models/shelf.py:131
msgid "TV shows watched" msgid "TV shows watched"
msgstr "看过的剧集" msgstr "看过的剧集"
#: journal/models/shelf.py:124 #: journal/models/shelf.py:139
msgid "TV shows dropped" msgid "TV shows dropped"
msgstr "不再看的剧集" msgstr "不再看的剧集"
#: journal/models/shelf.py:131 #: journal/models/shelf.py:147
msgid "TV shows reviewed" msgid "TV shows reviewed"
msgstr "评论过的剧集" msgstr "评论过的剧集"
#: journal/models/shelf.py:138 #: journal/models/shelf.py:155
msgid "albums to listen" msgid "albums to listen"
msgstr "想听的专辑" msgstr "想听的专辑"
#: journal/models/shelf.py:139 journal/models/shelf.py:209 #: journal/models/shelf.py:156 journal/models/shelf.py:236
msgid "want to listen" msgid "want to listen"
msgstr "想听" msgstr "想听"
#: journal/models/shelf.py:140 journal/models/shelf.py:210 #: journal/models/shelf.py:157 journal/models/shelf.py:237
#, python-brace-format #, python-brace-format
msgid "wants to listen {item}" msgid "wants to listen {item}"
msgstr "想听 {item}" msgstr "想听 {item}"
#: journal/models/shelf.py:145 #: journal/models/shelf.py:158 journal/models/shelf.py:238
msgid "to listen"
msgstr "想听"
#: journal/models/shelf.py:163
msgid "albums listening" msgid "albums listening"
msgstr "正在听的专辑" msgstr "正在听的专辑"
#: journal/models/shelf.py:146 journal/models/shelf.py:216 #: journal/models/shelf.py:164 journal/models/shelf.py:244
msgid "start listening" msgid "start listening"
msgstr "在听" msgstr "在听"
#: journal/models/shelf.py:147 journal/models/shelf.py:217 #: journal/models/shelf.py:165 journal/models/shelf.py:245
#, python-brace-format #, python-brace-format
msgid "started listening {item}" msgid "started listening {item}"
msgstr "在听 {item}" msgstr "在听 {item}"
#: journal/models/shelf.py:152 #: journal/models/shelf.py:166 journal/models/shelf.py:246
msgid "listening"
msgstr "在听"
#: journal/models/shelf.py:171
msgid "albums listened" msgid "albums listened"
msgstr "听过的专辑" msgstr "听过的专辑"
#: journal/models/shelf.py:153 journal/models/shelf.py:223 #: journal/models/shelf.py:172 journal/models/shelf.py:252
msgid "finish listening" msgid "finish listening"
msgstr "听过" msgstr "听过"
#: journal/models/shelf.py:154 journal/models/shelf.py:224 #: journal/models/shelf.py:173 journal/models/shelf.py:253
#, python-brace-format #, python-brace-format
msgid "finished listening {item}" msgid "finished listening {item}"
msgstr "听过 {item}" msgstr "听过 {item}"
#: journal/models/shelf.py:159 #: journal/models/shelf.py:174 journal/models/shelf.py:254
msgid "listened"
msgstr "听过"
#: journal/models/shelf.py:179
msgid "albums dropped" msgid "albums dropped"
msgstr "不再听的专辑" msgstr "不再听的专辑"
#: journal/models/shelf.py:160 journal/models/shelf.py:230 #: journal/models/shelf.py:180 journal/models/shelf.py:260
msgid "stop listening" msgid "stop listening"
msgstr "不听了" msgstr "不听了"
#: journal/models/shelf.py:161 journal/models/shelf.py:231 #: journal/models/shelf.py:181 journal/models/shelf.py:261
#, python-brace-format #, python-brace-format
msgid "stopped listening {item}" msgid "stopped listening {item}"
msgstr "不听了 {item}" msgstr "不听了 {item}"
#: journal/models/shelf.py:166 #: journal/models/shelf.py:182 journal/models/shelf.py:262
msgid "stopped listening"
msgstr "不听了"
#: journal/models/shelf.py:187
msgid "albums reviewed" msgid "albums reviewed"
msgstr "评论过的专辑" msgstr "评论过的专辑"
#: journal/models/shelf.py:173 #: journal/models/shelf.py:195
msgid "games to play" msgid "games to play"
msgstr "想玩的游戏" msgstr "想玩的游戏"
#: journal/models/shelf.py:174 #: journal/models/shelf.py:196
msgid "want to play" msgid "want to play"
msgstr "想玩" msgstr "想玩"
#: journal/models/shelf.py:175 #: journal/models/shelf.py:197
#, python-brace-format #, python-brace-format
msgid "wants to play {item}" msgid "wants to play {item}"
msgstr "想玩 {item}" msgstr "想玩 {item}"
#: journal/models/shelf.py:180 #: journal/models/shelf.py:198
msgid "to play"
msgstr "想玩"
#: journal/models/shelf.py:203
msgid "games playing" msgid "games playing"
msgstr "正在玩的游戏" msgstr "正在玩的游戏"
#: journal/models/shelf.py:181 #: journal/models/shelf.py:204
msgid "start playing" msgid "start playing"
msgstr "在玩" msgstr "在玩"
#: journal/models/shelf.py:182 #: journal/models/shelf.py:205
#, python-brace-format #, python-brace-format
msgid "started playing {item}" msgid "started playing {item}"
msgstr "在玩 {item}" msgstr "在玩 {item}"
#: journal/models/shelf.py:187 #: journal/models/shelf.py:206
msgid "playing"
msgstr "在玩"
#: journal/models/shelf.py:211
msgid "games played" msgid "games played"
msgstr "玩过的游戏" msgstr "玩过的游戏"
#: journal/models/shelf.py:188 #: journal/models/shelf.py:212
msgid "finish playing" msgid "finish playing"
msgstr "玩过" msgstr "玩过"
#: journal/models/shelf.py:189 #: journal/models/shelf.py:213
#, python-brace-format #, python-brace-format
msgid "finished playing {item}" msgid "finished playing {item}"
msgstr "玩过 {item}" msgstr "玩过 {item}"
#: journal/models/shelf.py:194 #: journal/models/shelf.py:214
msgid "played"
msgstr "玩过"
#: journal/models/shelf.py:219
msgid "games dropped" msgid "games dropped"
msgstr "不再玩的游戏" msgstr "不再玩的游戏"
#: journal/models/shelf.py:195 #: journal/models/shelf.py:220
msgid "stop playing" msgid "stop playing"
msgstr "不玩了" msgstr "不玩了"
#: journal/models/shelf.py:196 #: journal/models/shelf.py:221
#, python-brace-format #, python-brace-format
msgid "stopped playing {item}" msgid "stopped playing {item}"
msgstr "不再玩 {item}" msgstr "不再玩 {item}"
#: journal/models/shelf.py:201 #: journal/models/shelf.py:222
msgid "stopped playing"
msgstr "不玩了"
#: journal/models/shelf.py:227
msgid "games reviewed" msgid "games reviewed"
msgstr "评论过的游戏" msgstr "评论过的游戏"
#: journal/models/shelf.py:208 #: journal/models/shelf.py:235
msgid "podcasts to listen" msgid "podcasts to listen"
msgstr "想听的播客" msgstr "想听的播客"
#: journal/models/shelf.py:215 #: journal/models/shelf.py:243
msgid "podcasts listening" msgid "podcasts listening"
msgstr "正在听的播客" msgstr "正在听的播客"
#: journal/models/shelf.py:222 #: journal/models/shelf.py:251
msgid "podcasts listened" msgid "podcasts listened"
msgstr "听过的播客" msgstr "听过的播客"
#: journal/models/shelf.py:229 #: journal/models/shelf.py:259
msgid "podcasts dropped" msgid "podcasts dropped"
msgstr "不再听的播客" msgstr "不再听的播客"
#: journal/models/shelf.py:236 #: journal/models/shelf.py:267
msgid "podcasts reviewed" msgid "podcasts reviewed"
msgstr "评论过的播客" msgstr "评论过的播客"
#: journal/models/shelf.py:243 #: journal/models/shelf.py:275
msgid "performances to see" msgid "performances to see"
msgstr "想看的演出" msgstr "想看的演出"
#: journal/models/shelf.py:244 #: journal/models/shelf.py:276
msgid "want to see" msgid "want to see"
msgstr "想看" msgstr "想看"
#: journal/models/shelf.py:245 #: journal/models/shelf.py:277
#, python-brace-format #, python-brace-format
msgid "wants to see {item}" msgid "wants to see {item}"
msgstr "想看 {item}" msgstr "想看 {item}"
#: journal/models/shelf.py:252 #: journal/models/shelf.py:278
msgid "to see"
msgstr "想看"
#: journal/models/shelf.py:285
msgid "performances saw" msgid "performances saw"
msgstr "看过的演出" msgstr "看过的演出"
#: journal/models/shelf.py:253 #: journal/models/shelf.py:286
msgid "finish seeing" msgid "finish seeing"
msgstr "看过" msgstr "看过"
#: journal/models/shelf.py:254 #: journal/models/shelf.py:287
#, python-brace-format #, python-brace-format
msgid "finished seeing {item}" msgid "finished seeing {item}"
msgstr "看过 {item}" msgstr "看过 {item}"
#: journal/models/shelf.py:259 #: journal/models/shelf.py:288
msgid "seen"
msgstr "看过"
#: journal/models/shelf.py:293
msgid "performances dropped" msgid "performances dropped"
msgstr "不再看的演出" msgstr "不再看的演出"
#: journal/models/shelf.py:260 #: journal/models/shelf.py:294
msgid "stop seeing" msgid "stop seeing"
msgstr "不看了" msgstr "不看了"
#: journal/models/shelf.py:261 #: journal/models/shelf.py:295
#, python-brace-format #, python-brace-format
msgid "stopped seeing {item}" msgid "stopped seeing {item}"
msgstr "不再看 {item}" msgstr "不再看 {item}"
#: journal/models/shelf.py:266 #: journal/models/shelf.py:296
msgid "stopped seeing"
msgstr "不看了"
#: journal/models/shelf.py:301
msgid "performances reviewed" msgid "performances reviewed"
msgstr "评论过的演出" msgstr "评论过的演出"
#: journal/models/shelf.py:424 #: journal/models/shelf.py:460
msgid "removed mark" msgid "removed mark"
msgstr "移除标记" msgstr "移除标记"
@ -2224,12 +2296,12 @@ msgstr "更新"
msgid "Comment" msgid "Comment"
msgstr "写短评" msgstr "写短评"
#: journal/templates/comment.html:24 journal/templates/mark.html:66 #: journal/templates/comment.html:24 journal/templates/mark.html:70
msgid "Tips: use &gt;!text!&lt; for spoilers; some instances may not be able to show posts longer than 360 charactors." msgid "Tips: use &gt;!text!&lt; for spoilers; some instances may not be able to show posts longer than 360 charactors."
msgstr "提示: 善用 &gt;!文字!&lt; 标记可隐藏剧透; 超过360字可能无法分享到联邦宇宙实例时间轴。" msgstr "提示: 善用 &gt;!文字!&lt; 标记可隐藏剧透; 超过360字可能无法分享到联邦宇宙实例时间轴。"
#: journal/templates/comment.html:62 journal/templates/mark.html:115 #: journal/templates/comment.html:62 journal/templates/mark.html:119
msgid "Repost to your timeline" msgid "Repost to timeline"
msgstr "转发到时间轴" msgstr "转发到时间轴"
#: journal/templates/comment.html:75 #: journal/templates/comment.html:75
@ -2240,20 +2312,20 @@ msgstr "分享播放位置"
msgid "Mark" msgid "Mark"
msgstr "标记" msgstr "标记"
#: journal/templates/mark.html:43 journal/templates/mark.html:47 #: journal/templates/mark.html:47 journal/templates/mark.html:51
#: journal/templates/mark.html:51 #: journal/templates/mark.html:55
msgid "not rated" msgid "not rated"
msgstr "未评分" msgstr "未评分"
#: journal/templates/mark.html:74 #: journal/templates/mark.html:78
msgid "add a tag and press Enter" msgid "add a tag and press Enter"
msgstr "回车增加标签" msgstr "回车增加标签"
#: journal/templates/mark.html:130 #: journal/templates/mark.html:134
msgid "change mark date" msgid "change mark date"
msgstr "指定标记日期" msgstr "指定标记日期"
#: journal/templates/mark.html:156 #: journal/templates/mark.html:160
msgid "Sure to delete mark, comment and tags for this item?" msgid "Sure to delete mark, comment and tags for this item?"
msgstr "确认删除这条标记、短评和标签?" msgstr "确认删除这条标记、短评和标签?"
@ -2502,7 +2574,7 @@ msgstr "找不到条目,请使用本站条目网址。"
msgid "Login required" msgid "Login required"
msgstr "登录后访问" msgstr "登录后访问"
#: journal/views/common.py:33 journal/views/mark.py:117 #: journal/views/common.py:33 journal/views/mark.py:119
msgid "Data saved but unable to repost to Fediverse instance." msgid "Data saved but unable to repost to Fediverse instance."
msgstr "数据已保存但未能转发到联邦实例。" msgstr "数据已保存但未能转发到联邦实例。"
@ -2514,11 +2586,11 @@ msgstr "正在重定向到你的联邦实例以重新认证。"
msgid "List not found." msgid "List not found."
msgstr "列表未找到" msgstr "列表未找到"
#: journal/views/mark.py:108 #: journal/views/mark.py:110
msgid "Content too long for your Fediverse instance." msgid "Content too long for your Fediverse instance."
msgstr "内容过长,超出了你的联邦实例的限制。" msgstr "内容过长,超出了你的联邦实例的限制。"
#: journal/views/mark.py:162 journal/views/review.py:30 #: journal/views/mark.py:164 journal/views/review.py:30
msgid "Content not found" msgid "Content not found"
msgstr "内容未找到" msgstr "内容未找到"
@ -3444,18 +3516,18 @@ msgid "local, this site only"
msgstr "仅本站" msgstr "仅本站"
#: users/templates/users/preferences.html:96 #: users/templates/users/preferences.html:96
msgid "Repost to your timeline by default" msgid "Turn on repost to timeline by default"
msgstr "发表时默认转发到时间轴" msgstr "发表时默认转发到时间轴"
#: users/templates/users/preferences.html:104 #: users/templates/users/preferences.html:104
msgid "Method for reposting to your timeline" msgid "Method for reposting to timeline"
msgstr "转发到时间轴的方式" msgstr "转发到时间轴的方式"
#: users/templates/users/preferences.html:119 #: users/templates/users/preferences.html:119
msgid "repost as new post" msgid "repost as new post"
msgstr "另发新帖文" msgstr "另发新帖文"
#: users/templates/users/preferences.html:120 #: users/templates/users/preferences.html:121
msgid "this method is less optimal, may generate duplicated posts and miss reactions." msgid "this method is less optimal, may generate duplicated posts and miss reactions."
msgstr "这种方式可能产生重复帖文,且其他人对新帖的回应、点赞不会被记录" msgstr "这种方式可能产生重复帖文,且其他人对新帖的回应、点赞不会被记录"

View file

@ -93,7 +93,7 @@
{% if request.user.mastodon_acct %} {% if request.user.mastodon_acct %}
<fieldset> <fieldset>
<label> <label>
{% trans "Repost to your timeline by default" %} {% trans "Turn on repost to timeline by default" %}
<input type="checkbox" <input type="checkbox"
name="mastodon_default_repost" name="mastodon_default_repost"
value="1" value="1"
@ -101,7 +101,7 @@
</label> </label>
</fieldset> </fieldset>
<fieldset> <fieldset>
{% trans "Method for reposting to your timeline" %} {% trans "Method for reposting to timeline" %}
<input type="radio" <input type="radio"
name="mastodon_repost_mode" name="mastodon_repost_mode"
value="0" value="0"
@ -115,10 +115,8 @@
required="" required=""
id="mastodon_repost_mode_1" id="mastodon_repost_mode_1"
{% if request.user.preference.mastodon_repost_mode == 1 %}checked{% endif %}> {% if request.user.preference.mastodon_repost_mode == 1 %}checked{% endif %}>
<label for="mastodon_repost_mode_1"> <label for="mastodon_repost_mode_1">{% trans "repost as new post" %}</label>
{% trans "repost as new post" %} <em data-tooltip="{% trans "this method is less optimal, may generate duplicated posts and miss reactions." %}"><i class="fa fa-question-circle"></i></em>
<em data-tooltip="{% trans "this method is less optimal, may generate duplicated posts and miss reactions." %}"><i class="fa fa-question-circle"></i></em>
</label>
</fieldset> </fieldset>
{% endif %} {% endif %}
<fieldset> <fieldset>