diff --git a/taskapp/locale/ru/LC_MESSAGES/django.po b/taskapp/locale/ru/LC_MESSAGES/django.po index c83af1f..a80eae4 100644 --- a/taskapp/locale/ru/LC_MESSAGES/django.po +++ b/taskapp/locale/ru/LC_MESSAGES/django.po @@ -308,7 +308,7 @@ msgstr "Задача действительна до" #: taskapp/templates/taskapp/view.html:28 msgid "time left" -msgstr "" +msgstr "Времени осталось" #: taskapp/templates/taskapp/view.html:29 msgid "Task type" @@ -335,9 +335,8 @@ msgid "Error in the form fields" msgstr "Ошибка в полях формы" #: taskapp/views.py:151 -#, python-format -msgid "User '%s' does not exist" -msgstr "" +msgid "User does not exist" +msgstr "Абонент не найден" msgid "Active tasks" msgstr "Активные задачи" @@ -359,3 +358,9 @@ msgstr "Задачи, которые необходимо выполнить" msgid "locality %s. Task type - %s. " msgstr "с. %s. Тип задачи - %s. " + +msgid "Name" +msgstr "ФИО" + +msgid "Address" +msgstr "Адрес" diff --git a/taskapp/templates/taskapp/tasklist.html b/taskapp/templates/taskapp/tasklist.html index d4a0002..a9e1071 100644 --- a/taskapp/templates/taskapp/tasklist.html +++ b/taskapp/templates/taskapp/tasklist.html @@ -7,14 +7,13 @@ # + {% trans 'Name' %} + {% trans 'Address' %} + {% trans 'The nature of the damage' %} {% trans 'Description' %} {% trans 'Task author' %} - {% trans 'The nature of the damage' %} - {% trans 'Condition' %} - {% trans 'A priority' %} {% trans 'Date of create' %} - {% trans 'Attachment' %} - {% trans 'Actions' %} + {% trans 'Actions' %} @@ -35,14 +34,22 @@ {% endif %} {{ task.id }} - {{ task.descr }} - {{ task.author.username }} + + {% if task.abon and task.abon.group %} + {{ task.abon.get_full_name }} + {{ task.abon.street|default:_('Not assigned') }} {{ task.abon.house|default:_('Not assigned') }} + {% else %} + {% trans 'User does not exist' %} + --- + {% endif %} + {{ task.get_mode_display }} - {{ task.get_state_display }} - {{ task.get_priority_display }} + {{ task.descr }} + {{ task.author.username }} {{ task.time_of_create|date:'d N Y H:i:s' }} - {% if task.attachment %}{{ task.get_attachment_fname|truncatechars:32|truncatechars:32 }}{% else %}―{% endif %} - + + @@ -58,13 +65,13 @@ {% empty %} - {% trans 'The list is empty' %} + {% trans 'The list is empty' %} {% endfor %} - + {% include 'taskapp/footer_btns.html' %} diff --git a/taskapp/templates/taskapp/tasklist_active.html b/taskapp/templates/taskapp/tasklist_active.html index 43672a0..7792679 100644 --- a/taskapp/templates/taskapp/tasklist_active.html +++ b/taskapp/templates/taskapp/tasklist_active.html @@ -7,14 +7,13 @@ # + {% trans 'Name' %} + {% trans 'Address' %} + {% trans 'The nature of the damage' %} {% trans 'Description' %} {% trans 'Task author' %} - {% trans 'The nature of the damage' %} - {% trans 'Condition' %} - {% trans 'A priority' %} {% trans 'Date of create' %} - {% trans 'Attachment' %} - {% trans 'Actions' %} + {% trans 'Actions' %} @@ -35,15 +34,22 @@ {% endif %} {{ task.id }} + + {% if task.abon and task.abon.group %} + {{ task.abon.get_full_name }} + {{ task.abon.street|default:_('Not assigned') }} {{ task.abon.house|default:_('Not assigned') }} + {% else %} + {% trans 'User does not exist' %} + --- + {% endif %} + + {{ task.get_mode_display }} {{ task.descr }} - {{ task.author.username }} - {{ task.get_mode_display }} - {{ task.get_state_display }} - {{ task.get_priority_display }} {{ task.time_of_create|date:'d N Y H:i:s' }} - {% if task.attachment %}{{ task.get_attachment_fname|truncatechars:32 }}{% else %}―{% endif %} - + + @@ -56,13 +62,13 @@ {% empty %} - {% trans 'The list is empty' %} + {% trans 'The list is empty' %} {% endfor %} - + {% include 'taskapp/footer_btns.html' %} diff --git a/taskapp/templates/taskapp/tasklist_all.html b/taskapp/templates/taskapp/tasklist_all.html index 1a49d87..9946814 100644 --- a/taskapp/templates/taskapp/tasklist_all.html +++ b/taskapp/templates/taskapp/tasklist_all.html @@ -19,14 +19,14 @@ # - {% trans 'Description' %} - {% trans 'Task author' %} + {% trans 'Name' %} + {% trans 'Address' %} {% trans 'The nature of the damage' %} + {% trans 'Description' %} + {% trans 'Task author' %} {% trans 'Condition' %} - {% trans 'A priority' %} {% trans 'Date of create' %} - {% trans 'Attachment' %} - {% trans 'Actions' %} + {% trans 'Actions' %} @@ -47,14 +47,23 @@ {% endif %} {{ task.id }} - {{ task.descr }} - {{ task.author.username }} + + {% if task.abon and task.abon.group %} + {{ task.abon.get_full_name }} + {{ task.abon.street|default:_('Not assigned') }} {{ task.abon.house|default:_('Not assigned') }} + {% else %} + {% trans 'User does not exist' %} + --- + {% endif %} + {{ task.get_mode_display }} + {{ task.descr }} + {{ task.author.username }} {{ task.get_state_display }} - {{ task.get_priority_display }} {{ task.time_of_create|date:'d N Y H:i:s' }} - {% if task.attachment %}{{ task.get_attachment_fname|truncatechars:32 }}{% else %}―{% endif %} - + + {% if perms.taskapp.change_task %} @@ -69,13 +78,13 @@ {% empty %} - {% trans 'The list is empty' %} + {% trans 'The list is empty' %} {% endfor %} - + {% if perms.taskapp.add_task %} {% trans 'Add new task' %} diff --git a/taskapp/templates/taskapp/tasklist_finish.html b/taskapp/templates/taskapp/tasklist_finish.html index 8400fe4..f5e55fe 100644 --- a/taskapp/templates/taskapp/tasklist_finish.html +++ b/taskapp/templates/taskapp/tasklist_finish.html @@ -7,14 +7,13 @@ # + {% trans 'Name' %} + {% trans 'Address' %} + {% trans 'The nature of the damage' %} {% trans 'Description' %} {% trans 'Task author' %} - {% trans 'The nature of the damage' %} - {% trans 'Condition' %} - {% trans 'A priority' %} {% trans 'Date of create' %} - {% trans 'Attachment' %} - {% trans 'Actions' %} + {% trans 'Actions' %} @@ -35,15 +34,22 @@ {% endif %} {{ task.id }} + + {% if task.abon and task.abon.group %} + {{ task.abon.get_full_name }} + {{ task.abon.street|default:_('Not assigned') }} {{ task.abon.house|default:_('Not assigned') }} + {% else %} + {% trans 'User does not exist' %} + --- + {% endif %} + + {{ task.get_mode_display }} {{ task.descr }} - {{ task.author.username }} - {{ task.get_mode_display }} - {{ task.get_state_display }} - {{ task.get_priority_display }} {{ task.time_of_create|date:'d N Y H:i:s' }} - {% if task.attachment %}{{ task.get_attachment_fname|truncatechars:32 }}{% else %}―{% endif %} - + + {% if perms.taskapp.change_task %} @@ -58,13 +64,13 @@ {% empty %} - {% trans 'The list is empty' %} + {% trans 'The list is empty' %} {% endfor %} - + {% include 'taskapp/footer_btns.html' %} diff --git a/taskapp/templates/taskapp/tasklist_own.html b/taskapp/templates/taskapp/tasklist_own.html index baaa3fe..c9e6aeb 100644 --- a/taskapp/templates/taskapp/tasklist_own.html +++ b/taskapp/templates/taskapp/tasklist_own.html @@ -7,12 +7,12 @@ # - {% trans 'Description' %} + {% trans 'Name' %} + {% trans 'Address' %} {% trans 'The nature of the damage' %} + {% trans 'Description' %} {% trans 'Condition' %} - {% trans 'A priority' %} {% trans 'Date of create' %} - {% trans 'Attachment' %} {% trans 'Actions' %} @@ -34,12 +34,20 @@ {% endif %} {{ task.id }} - {{ task.descr }} + + {% if task.abon and task.abon.group %} + {{ task.abon.get_full_name }} + {{ task.abon.street|default:_('Not assigned') }} {{ task.abon.house|default:_('Not assigned') }} + {% else %} + {% trans 'User does not exist' %} + --- + {% endif %} + {{ task.get_mode_display }} + {{ task.descr }} {{ task.get_state_display }} - {{ task.get_priority_display }} {{ task.time_of_create|date:'d N Y H:i:s' }} - {% if task.attachment %}{{ task.get_attachment_fname|truncatechars:32 }}{% else %}―{% endif %} + {% if perms.taskapp.change_task %} diff --git a/taskapp/templates/taskapp/view.html b/taskapp/templates/taskapp/view.html index a3c3dcb..5dfe159 100644 --- a/taskapp/templates/taskapp/view.html +++ b/taskapp/templates/taskapp/view.html @@ -17,16 +17,21 @@

{% trans 'Description' %}: {{ task.descr }}

+ + {% trans 'Task author' %}:
{{ task.author.username }}
+ {% trans 'Implementers' %}: + {% trans 'A priority' %}: {{ task.get_priority_display }}
{% trans 'The task is valid until' %} {{ task.out_date|date:'d E Y' }}
{% trans 'Date of create' %} {{ task.time_of_create|date:'d E Y' }}
{% trans 'time left' %} {{ time_diff }}
{% trans 'Task type' %}: {{ task.get_mode_display }}
+ {% trans 'Condition' %}: {{ task.get_state_display }}
{% trans 'Subscriber' %} {% if task.abon %} {{ task.abon.get_full_name }} diff --git a/taskapp/views.py b/taskapp/views.py index 8200cf5..ceb764e 100644 --- a/taskapp/views.py +++ b/taskapp/views.py @@ -7,7 +7,7 @@ from abonapp.models import Abon from django.utils.translation import ugettext as _ from datetime import date from .models import Task -from mydefs import pag_mn, only_admins, safe_int, MultipleException +from mydefs import pag_mn, only_admins, safe_int, MultipleException, RuTimedelta from .forms import TaskFrm @@ -91,7 +91,7 @@ def view(request, task_id): time_diff = tsk.out_date - toc return render(request, 'taskapp/view.html', { 'task': tsk, - 'time_diff': time_diff + 'time_diff': RuTimedelta(time_diff) }) @@ -148,7 +148,7 @@ def task_add_edit(request, task_id=0): elif uid: selected_abon = Abon.objects.get(username=str(uid)) except Abon.DoesNotExist: - messages.warning(request, _("User '%s' does not exist") % str(uid)) + messages.warning(request, _("User does not exist")) except MultipleException as errs: for err in errs.err_list: messages.add_message(request, messages.constants.ERROR, err)