diff --git a/docs/changes.rst b/docs/changes.rst index 88ba862e2061..c41b62c0d2a1 100644 --- a/docs/changes.rst +++ b/docs/changes.rst @@ -3,6 +3,10 @@ Weblate 5.8.4 Not yet released. +**Improvements** + +* :ref:`search-users` can search based on user changes. + **Bug fixes** * Fixed occasional crash in :ref:`rss`. diff --git a/docs/user/search.rst b/docs/user/search.rst index 1794a4a3ab15..317ae7c6f517 100644 --- a/docs/user/search.rst +++ b/docs/user/search.rst @@ -3,6 +3,8 @@ Searching ========= +.. _search-strings: + Searching for strings +++++++++++++++++++++ @@ -178,6 +180,7 @@ There are many options to order the strings according to your needs: .. image:: /screenshots/query-sort.webp +.. _search-users: Searching for users +++++++++++++++++++ @@ -198,6 +201,10 @@ The user browsing has similar search abilities: User has contributed to a given language in the past 90 days. ``contributes:TEXT`` User has contributed to a given project or component in the past 90 days. +``change_time:DATETIME`` + Same as in :ref:`search-strings`. +``change_action:TEXT`` + Same as in :ref:`search-strings`. Additional lookups are available in the :ref:`management-interface`: diff --git a/weblate/templates/snippets/info.html b/weblate/templates/snippets/info.html index d35c03de12ad..b171801c7646 100644 --- a/weblate/templates/snippets/info.html +++ b/weblate/templates/snippets/info.html @@ -470,7 +470,7 @@

{% trans "Trends of last 30 days" %}

- +
{{ metrics.contributors|number_format }}
{% trans "Contributors" %}
diff --git a/weblate/utils/search.py b/weblate/utils/search.py index 6cf665a6d8d2..16d50b74d8f6 100644 --- a/weblate/utils/search.py +++ b/weblate/utils/search.py @@ -296,6 +296,9 @@ def convert_change_action(self, text: str) -> int: except KeyError: return Change.ACTION_STRINGS[text] + def convert_change_time(self, text: str) -> datetime | tuple[datetime, datetime]: + return self.convert_datetime(text) + def field_name(self, field: str, suffix: str | None = None) -> str: if suffix is None: suffix = OPERATOR_MAP[self.operator] @@ -536,9 +539,6 @@ def path_field(self, text: str, context: dict) -> Q: return Q(translation__language=obj) raise TypeError(f"Unsupported path lookup: {obj}") - def convert_change_time(self, text: str) -> datetime | tuple[datetime, datetime]: - return self.convert_datetime(text) - def convert_changed(self, text: str) -> datetime | tuple[datetime, datetime]: return self.convert_datetime(text) @@ -591,6 +591,8 @@ class UserTermExpr(BaseTermExpr): PLAIN_FIELDS: set[str] = {"username", "full_name"} NONTEXT_FIELDS: dict[str, str] = { "joined": "date_joined", + "change_time": "change__timestamp", + "change_action": "change__action", } EXACT_FIELD_MAP: dict[str, str] = { "language": "profile__languages__code",