diff --git a/contributors/views/contributors_for_period.py b/contributors/views/contributors_for_period.py index 3391b0ba..c7989b10 100644 --- a/contributors/views/contributors_for_period.py +++ b/contributors/views/contributors_for_period.py @@ -13,6 +13,7 @@ def get_context_data(self, **kwargs): """Add context.""" context = super().get_context_data(**kwargs) context['dt_month_ago'] = misc.datetime_month_ago() + context['is_week'] = self.extra_context.get('period') == 'week' return context def get_queryset(self): # noqa: WPS615 diff --git a/locale/ru/LC_MESSAGES/django.mo b/locale/ru/LC_MESSAGES/django.mo index b5b83e38..c0c29191 100644 Binary files a/locale/ru/LC_MESSAGES/django.mo and b/locale/ru/LC_MESSAGES/django.mo differ diff --git a/locale/ru/LC_MESSAGES/django.po b/locale/ru/LC_MESSAGES/django.po index bf3aff4d..7165da26 100644 --- a/locale/ru/LC_MESSAGES/django.po +++ b/locale/ru/LC_MESSAGES/django.po @@ -641,6 +641,10 @@ msgstr "Пул-реквесты по" msgid "Contributors for month" msgstr "Участники за месяц" +#: templates/contributors_for_period.html +msgid "Contributors for week" +msgstr "Участники за неделю" + #: templates/home.html msgid "Top 10 contributors" msgstr "Топ 10 участников" diff --git a/templates/components/navbar.html b/templates/components/navbar.html index 95905e1b..2c65d5b4 100644 --- a/templates/components/navbar.html +++ b/templates/components/navbar.html @@ -23,7 +23,7 @@ {% trans "Contributors" %} diff --git a/templates/components/time_note.html b/templates/components/time_note.html index 591d4f36..9cc406df 100644 --- a/templates/components/time_note.html +++ b/templates/components/time_note.html @@ -2,19 +2,13 @@ - - - - diff --git a/templates/contributors_for_period.html b/templates/contributors_for_period.html index a23ee828..fab5bf2a 100644 --- a/templates/contributors_for_period.html +++ b/templates/contributors_for_period.html @@ -1,11 +1,32 @@ {% extends 'base.html' %} {% load i18n %} -{% block title %}{% trans "Contributors for month" %}{% endblock %} +{% block title %} + {% if is_week %} + {% trans "Contributors for week" %} + {% else %} + {% trans "Contributors for month" %} + {% endif %} +{% endblock %} + -{% block og_title %}{% trans "Contributors for month" %}{% endblock og_title %} +{% block og_title %} + {% if is_week %} + {% trans "Contributors for week" %} + {% else %} + {% trans "Contributors for month" %} + {% endif %} +{% endblock og_title %} -{% block header %}{% trans "Contributors" %}{% endblock %} + +{% block header %} + {% if is_week %} + {% trans "Contributors for week" %} + {% else %} + {% trans "Contributors for month" %} + {% endif %} +{% endblock %} + {% block additional %} {% include 'components/time_note.html' %} {% endblock %}