Browse Source

make notfications better

devel
Dmitry Novikov 7 years ago
parent
commit
37677275d3
  1. 32
      taskapp/handle.py
  2. 406
      taskapp/locale/ru/LC_MESSAGES/django.po
  3. 6
      taskapp/models.py
  4. 13
      taskapp/templates/taskapp/notification.html

32
taskapp/handle.py

@ -1,4 +1,5 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
from django.template.loader import render_to_string
from django.utils.translation import gettext as _ from django.utils.translation import gettext as _
from chatbot.send_func import send_notify from chatbot.send_func import send_notify
from chatbot.models import ChatException from chatbot.models import ChatException
@ -9,34 +10,23 @@ class TaskException(Exception):
pass pass
def handle(task, author, recipients, abon_group):
def handle(task, author, recipients):
errors = [] errors = []
for recipient in recipients: for recipient in recipients:
try: try:
dst_account = recipient
text = _('Task')
task_status = _('Task')
# If signal to myself then quietly # If signal to myself then quietly
if author == recipient: if author == recipient:
return return
# If task completed or failed # If task completed or failed
elif task.state == 'F' or task.state == 'C': elif task.state == 'F' or task.state == 'C':
text = _('Task completed')
if task.abon is not None:
fulltext = "%s:\n%s\n" % (
text,
'<a href="%s">%s</a>' % (task.abon.get_absolute_url(), task.abon.get_full_name())
)
else:
fulltext = "%s\n" % text
fulltext += _('locality %s.\n') % abon_group.title
if task.abon:
fulltext += _('address %(street)s %(house)s.\ntelephone %(telephone)s\n') % {
'street': task.abon.street.name if task.abon.street is not None else '<' + _('not chosen') + '>',
'house': task.abon.house,
'telephone': task.abon.telephone
}
fulltext += _('Task type - %s.') % task.get_mode_display() + '\n'
fulltext += task.descr if task.descr else ''
task_status = _('Task completed')
fulltext = render_to_string('taskapp/notification.html', {
'task': task,
'abon': task.abon,
'task_status': task_status
})
if task.state == 'F' or task.state == 'C': if task.state == 'F' or task.state == 'C':
# If task completed or failed than send one message to author # If task completed or failed than send one message to author
@ -45,7 +35,7 @@ def handle(task, author, recipients, abon_group):
except ChatException as e: except ChatException as e:
raise TaskException(e) raise TaskException(e)
else: else:
send_notify(fulltext, dst_account, tag='taskap')
send_notify(fulltext, recipient, tag='taskap')
except ChatException as e: except ChatException as e:
errors.append(e) errors.append(e)
if len(errors) > 0: if len(errors) > 0:

406
taskapp/locale/ru/LC_MESSAGES/django.po

@ -8,7 +8,7 @@ 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: 2018-04-24 23:27+0300\n"
"POT-Creation-Date: 2018-10-24 13:41+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Dmitry Novikov nerosketch@gmail.com\n" "Last-Translator: Dmitry Novikov nerosketch@gmail.com\n"
"Language: ru\n" "Language: ru\n"
@ -19,495 +19,489 @@ msgstr ""
"%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n" "%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n"
"%100>=11 && n%100<=14)? 2 : 3);\n" "%100>=11 && n%100<=14)? 2 : 3);\n"
#: taskapp/forms.py:19
#: forms.py:22
msgid "No responsible employee for the users group" msgid "No responsible employee for the users group"
msgstr "Нет ответственных за группу, в которой находится выбранный абонент" msgstr "Нет ответственных за группу, в которой находится выбранный абонент"
#: taskapp/forms.py:24
#: forms.py:27
msgid "You must select the subscriber" msgid "You must select the subscriber"
msgstr "Нужно выбрать абонента" msgstr "Нужно выбрать абонента"
#: taskapp/forms.py:32
#: forms.py:35
msgid "Short description" msgid "Short description"
msgstr "Краткое описание" msgstr "Краткое описание"
#: taskapp/handle.py:17 taskapp/views.py:255
#: handle.py:17 views.py:276
msgid "Task" msgid "Task"
msgstr "Задача" msgstr "Задача"
#: taskapp/handle.py:23
#: handle.py:23
msgid "Task completed" msgid "Task completed"
msgstr "Задача завершена" msgstr "Задача завершена"
#: taskapp/handle.py:28
#, python-format
msgid "locality %s.\n"
msgstr "с. %s\n"
#: taskapp/handle.py:30
#, python-format
msgid ""
"address %(street)s %(house)s.\n"
"telephone %(telephone)s\n"
msgstr "по адресу %(street)s %(house)s тел. %(telephone)s.\n"
#: taskapp/handle.py:31 taskapp/models.py:24
msgid "not chosen"
msgstr "не выбрано"
#: taskapp/handle.py:35
#, python-format
msgid "Task type - %s."
msgstr "Тип задачи - %s."
#: taskapp/models.py:12
#: models.py:13
msgid "Higher" msgid "Higher"
msgstr "Высший" msgstr "Высший"
#: taskapp/models.py:13
#: models.py:14
msgid "Average" msgid "Average"
msgstr "Средний" msgstr "Средний"
#: taskapp/models.py:14
#: models.py:15
msgid "Low" msgid "Low"
msgstr "Низкий" msgstr "Низкий"
#: taskapp/models.py:18
#: models.py:19
msgid "New" msgid "New"
msgstr "Новая" msgstr "Новая"
#: taskapp/models.py:19
#: models.py:20
msgid "Confused" msgid "Confused"
msgstr "Провалена" msgstr "Провалена"
#: taskapp/models.py:20
#: models.py:21
msgid "Completed" msgid "Completed"
msgstr "Выполнена" msgstr "Выполнена"
#: taskapp/models.py:25
#: models.py:25
msgid "not chosen"
msgstr "не выбрано"
#: models.py:26
msgid "ip conflict" msgid "ip conflict"
msgstr "Ip конфликт" msgstr "Ip конфликт"
#: taskapp/models.py:26
#: models.py:27
msgid "yellow triangle" msgid "yellow triangle"
msgstr "жёлтый треугольник" msgstr "жёлтый треугольник"
#: taskapp/models.py:27
#: models.py:28
msgid "red cross" msgid "red cross"
msgstr "красный крестик" msgstr "красный крестик"
#: taskapp/models.py:28
#: models.py:29
msgid "weak speed" msgid "weak speed"
msgstr "слабая скорость" msgstr "слабая скорость"
#: taskapp/models.py:29
#: models.py:30
msgid "cable break" msgid "cable break"
msgstr "обрыв кабеля" msgstr "обрыв кабеля"
#: taskapp/models.py:30
#: models.py:31
msgid "connection" msgid "connection"
msgstr "подключение" msgstr "подключение"
#: taskapp/models.py:31
#: models.py:32
msgid "periodic disappearance" msgid "periodic disappearance"
msgstr "переодическое пропадание" msgstr "переодическое пропадание"
#: taskapp/models.py:32
#: models.py:33
msgid "router setup" msgid "router setup"
msgstr "настройка роутера" msgstr "настройка роутера"
#: taskapp/models.py:33
#: models.py:34
msgid "configure onu" msgid "configure onu"
msgstr "настроить onu" msgstr "настроить onu"
#: taskapp/models.py:34
#: models.py:35
msgid "crimp cable" msgid "crimp cable"
msgstr "обжать кабель" msgstr "обжать кабель"
#: taskapp/models.py:35
#: models.py:36
msgid "Internet crash" msgid "Internet crash"
msgstr "Нет интернета" msgstr "Нет интернета"
#: taskapp/models.py:36
#: models.py:37
msgid "other" msgid "other"
msgstr "другое" msgstr "другое"
#: taskapp/models.py:43
#: models.py:44
msgid "Change task" msgid "Change task"
msgstr "Изменение задачи" msgstr "Изменение задачи"
#: taskapp/models.py:44
#: models.py:45
msgid "Create task" msgid "Create task"
msgstr "Создание задачи" msgstr "Создание задачи"
#: taskapp/models.py:45
#: models.py:46
msgid "Delete task" msgid "Delete task"
msgstr "Удаление задачи" msgstr "Удаление задачи"
#: taskapp/models.py:46
#: models.py:47
msgid "Completing tasks" msgid "Completing tasks"
msgstr "Завершение задачи" msgstr "Завершение задачи"
#: taskapp/models.py:47
#: models.py:48
msgid "The task failed" msgid "The task failed"
msgstr "Задача провалена" msgstr "Задача провалена"
#: taskapp/models.py:62 taskapp/templates/taskapp/details.html:8
#: taskapp/templates/taskapp/tasklist.html:13
#: taskapp/templates/taskapp/tasklist_all.html:25
#: taskapp/templates/taskapp/tasklist_empty.html:18
#: taskapp/templates/taskapp/tasklist_failed.html:18
#: taskapp/templates/taskapp/tasklist_finish.html:13
#: taskapp/templates/taskapp/tasklist_own.html:13
#: models.py:63 templates/taskapp/details.html:8
#: templates/taskapp/tasklist.html:12 templates/taskapp/tasklist_all.html:28
#: templates/taskapp/tasklist_empty.html:18
#: templates/taskapp/tasklist_failed.html:18
#: templates/taskapp/tasklist_finish.html:13
#: templates/taskapp/tasklist_own.html:13
msgid "Description" msgid "Description"
msgstr "Описание" msgstr "Описание"
#: taskapp/models.py:63
#: models.py:64
msgid "Recipients" msgid "Recipients"
msgstr "Исполнители" msgstr "Исполнители"
#: taskapp/models.py:66 taskapp/templates/taskapp/details.html:10
#: taskapp/templates/taskapp/tasklist.html:14
#: taskapp/templates/taskapp/tasklist_all.html:26
#: taskapp/templates/taskapp/tasklist_empty.html:19
#: taskapp/templates/taskapp/tasklist_failed.html:19
#: taskapp/templates/taskapp/tasklist_finish.html:14
#: models.py:67 templates/taskapp/details.html:10
#: templates/taskapp/tasklist.html:13 templates/taskapp/tasklist_all.html:29
#: templates/taskapp/tasklist_empty.html:19
#: templates/taskapp/tasklist_failed.html:19
#: templates/taskapp/tasklist_finish.html:14
msgid "Task author" msgid "Task author"
msgstr "Автор задачи" msgstr "Автор задачи"
#: taskapp/models.py:67 taskapp/templates/taskapp/details.html:23
#: models.py:68 templates/taskapp/details.html:23
msgid "A priority" msgid "A priority"
msgstr "Приоритет" msgstr "Приоритет"
#: taskapp/models.py:68 taskapp/templates/taskapp/add_edit_task.html:66
#: models.py:69 templates/taskapp/add_edit_task.html:66
msgid "Reality" msgid "Reality"
msgstr "Актуальность (дата, до которой нужно завершить задачу)" msgstr "Актуальность (дата, до которой нужно завершить задачу)"
#: taskapp/models.py:69 taskapp/templates/taskapp/details.html:25
#: taskapp/templates/taskapp/tasklist.html:15
#: taskapp/templates/taskapp/tasklist_all.html:28
#: taskapp/templates/taskapp/tasklist_empty.html:20
#: taskapp/templates/taskapp/tasklist_failed.html:20
#: taskapp/templates/taskapp/tasklist_finish.html:15
#: taskapp/templates/taskapp/tasklist_own.html:15
#: models.py:70 templates/taskapp/details.html:25
#: templates/taskapp/tasklist.html:14 templates/taskapp/tasklist_all.html:31
#: templates/taskapp/tasklist_empty.html:20
#: templates/taskapp/tasklist_failed.html:20
#: templates/taskapp/tasklist_finish.html:15
#: templates/taskapp/tasklist_own.html:15
msgid "Date of create" msgid "Date of create"
msgstr "Дата создания" msgstr "Дата создания"
#: taskapp/models.py:70 taskapp/templates/taskapp/details.html:28
#: taskapp/templates/taskapp/tasklist_all.html:27
#: taskapp/templates/taskapp/tasklist_own.html:14
#: models.py:71 templates/taskapp/details.html:28
#: templates/taskapp/tasklist_all.html:30
#: templates/taskapp/tasklist_own.html:14
msgid "Condition" msgid "Condition"
msgstr "Состояние" msgstr "Состояние"
#: taskapp/models.py:71
#: models.py:72
msgid "Attached image" msgid "Attached image"
msgstr "Прикреплённое изображение" msgstr "Прикреплённое изображение"
#: taskapp/models.py:72 taskapp/templates/taskapp/tasklist.html:12
#: taskapp/templates/taskapp/tasklist_all.html:24
#: taskapp/templates/taskapp/tasklist_empty.html:17
#: taskapp/templates/taskapp/tasklist_failed.html:17
#: taskapp/templates/taskapp/tasklist_finish.html:12
#: taskapp/templates/taskapp/tasklist_own.html:12
#: models.py:73 templates/taskapp/tasklist.html:11
#: templates/taskapp/tasklist_all.html:27
#: templates/taskapp/tasklist_empty.html:17
#: templates/taskapp/tasklist_failed.html:17
#: templates/taskapp/tasklist_finish.html:12
#: templates/taskapp/tasklist_own.html:12
msgid "The nature of the damage" msgid "The nature of the damage"
msgstr "Характер поломки" msgstr "Характер поломки"
#: taskapp/models.py:73 taskapp/templates/taskapp/add_edit_task.html:50
#: taskapp/templates/taskapp/details.html:29
#: models.py:74 templates/taskapp/add_edit_task.html:50
#: templates/taskapp/details.html:29
msgid "Subscriber" msgid "Subscriber"
msgstr "Абонент" msgstr "Абонент"
#: taskapp/models.py:79
#: models.py:80
msgid "Access to all tasks" msgid "Access to all tasks"
msgstr "Доступ ко всем задачам" msgstr "Доступ ко всем задачам"
#: taskapp/models.py:80
#: models.py:81
msgid "Reminders of tasks" msgid "Reminders of tasks"
msgstr "Напоминания о задачах" msgstr "Напоминания о задачах"
#: taskapp/models.py:120
#: models.py:117
msgid "Text of comment" msgid "Text of comment"
msgstr "Текст комментария" msgstr "Текст комментария"
#: taskapp/models.py:121
#: models.py:118
msgid "Owner task" msgid "Owner task"
msgstr "Владелец задачи" msgstr "Владелец задачи"
#: taskapp/models.py:122
#: models.py:119
msgid "Author" msgid "Author"
msgstr "Автор" msgstr "Автор"
#: taskapp/models.py:123
#: models.py:120
msgid "Time of create" msgid "Time of create"
msgstr "Дата создания" msgstr "Дата создания"
#: taskapp/models.py:133
#: models.py:130
msgid "Extra comment" msgid "Extra comment"
msgstr "Комментарий" msgstr "Комментарий"
#: taskapp/models.py:134
#: models.py:131
msgid "Extra comments" msgid "Extra comments"
msgstr "Комментарии" msgstr "Комментарии"
#: taskapp/templates/taskapp/add_edit_task.html:9
#: taskapp/templates/taskapp/tasklist_all.html:8
#: templates/taskapp/add_edit_task.html:8 templates/taskapp/tasklist_all.html:8
msgid "Tasks" msgid "Tasks"
msgstr "Задачи" msgstr "Задачи"
#: taskapp/templates/taskapp/add_edit_task.html:10
#: taskapp/templates/taskapp/tasklist.html:83
#: taskapp/templates/taskapp/tasklist_all.html:91
#: taskapp/templates/taskapp/tasklist_empty.html:66
#: taskapp/templates/taskapp/tasklist_failed.html:69
#: taskapp/templates/taskapp/tasklist_finish.html:68
#: taskapp/templates/taskapp/tasklist_own.html:61
#: templates/taskapp/add_edit_task.html:9 templates/taskapp/tasklist.html:82
#: templates/taskapp/tasklist_all.html:94
#: templates/taskapp/tasklist_empty.html:66
#: templates/taskapp/tasklist_failed.html:69
#: templates/taskapp/tasklist_finish.html:68
#: templates/taskapp/tasklist_own.html:61
msgid "Edit" msgid "Edit"
msgstr "Редактировать" msgstr "Редактировать"
#: taskapp/templates/taskapp/add_edit_task.html:10
#: templates/taskapp/add_edit_task.html:9
msgid "Create" msgid "Create"
msgstr "Создать" msgstr "Создать"
#: taskapp/templates/taskapp/add_edit_task.html:20
#: taskapp/templates/taskapp/footer_btns.html:5
#: taskapp/templates/taskapp/tasklist_all.html:112
#: taskapp/templates/taskapp/tasklist_all.html:113
#: templates/taskapp/add_edit_task.html:20 templates/taskapp/footer_btns.html:5
#: templates/taskapp/tasklist_all.html:115
#: templates/taskapp/tasklist_all.html:116
msgid "Add new task" msgid "Add new task"
msgstr "Добавьте задачу" msgstr "Добавьте задачу"
#: taskapp/templates/taskapp/add_edit_task.html:22
#: templates/taskapp/add_edit_task.html:22
msgid "Edit task" msgid "Edit task"
msgstr "Редактировать задачу" msgstr "Редактировать задачу"
#: taskapp/templates/taskapp/add_edit_task.html:57
#: taskapp/templates/taskapp/add_edit_task.html:60
#: templates/taskapp/add_edit_task.html:57
#: templates/taskapp/add_edit_task.html:60
msgid "Find the subscriber" msgid "Find the subscriber"
msgstr "Найти абонента" msgstr "Найти абонента"
#: taskapp/templates/taskapp/add_edit_task.html:86
#: templates/taskapp/add_edit_task.html:86
msgid "Save" msgid "Save"
msgstr "Сохранить" msgstr "Сохранить"
#: taskapp/templates/taskapp/add_edit_task.html:89
#: templates/taskapp/add_edit_task.html:89
msgid "Reset" msgid "Reset"
msgstr "Сбросить" msgstr "Сбросить"
#: taskapp/templates/taskapp/add_edit_task.html:93
#: taskapp/templates/taskapp/comments/extracomment_confirm_delete.html:15
#: taskapp/templates/taskapp/comments/task_comments.html:13
#: taskapp/templates/taskapp/tasklist_own.html:71
#: templates/taskapp/add_edit_task.html:93
#: templates/taskapp/comments/extracomment_confirm_delete.html:15
#: templates/taskapp/comments/task_comments.html:12
#: templates/taskapp/tasklist_own.html:71
msgid "Delete" msgid "Delete"
msgstr "Удалить" msgstr "Удалить"
#: taskapp/templates/taskapp/comments/extracomment_confirm_delete.html:6
#: templates/taskapp/comments/extracomment_confirm_delete.html:6
msgid "Delete comment" msgid "Delete comment"
msgstr "Удаление комментарий" msgstr "Удаление комментарий"
#: taskapp/templates/taskapp/comments/extracomment_confirm_delete.html:10
#: templates/taskapp/comments/extracomment_confirm_delete.html:10
#, python-format #, python-format
msgid "Are you sure you want to delete \"%(object)s\"?" msgid "Are you sure you want to delete \"%(object)s\"?"
msgstr "Вы уверены что хотите удалить \"%(object)s\"?" msgstr "Вы уверены что хотите удалить \"%(object)s\"?"
#: taskapp/templates/taskapp/comments/task_comments.html:5
#: templates/taskapp/comments/task_comments.html:4
msgid "Task comments" msgid "Task comments"
msgstr "Комментарии задачи" msgstr "Комментарии задачи"
#: taskapp/templates/taskapp/comments/task_comments.html:25
#: templates/taskapp/comments/task_comments.html:24
msgid "Comment history is empty" msgid "Comment history is empty"
msgstr "Коментариев нет" msgstr "Коментариев нет"
#: taskapp/templates/taskapp/comments/task_comments.html:33
#: templates/taskapp/comments/task_comments.html:33
msgid "Send" msgid "Send"
msgstr "Отправить" msgstr "Отправить"
#: taskapp/templates/taskapp/details.html:4
#: templates/taskapp/details.html:4
msgid "Task details" msgid "Task details"
msgstr "Детали задачи" msgstr "Детали задачи"
#: taskapp/templates/taskapp/details.html:14
#: taskapp/templates/taskapp/details.html:33
#: taskapp/templates/taskapp/tasklist_all.html:59
#: taskapp/templates/taskapp/tasklist_all.html:72
#: taskapp/templates/taskapp/tasklist_empty.html:46
#: taskapp/templates/taskapp/tasklist_empty.html:59
#: taskapp/templates/taskapp/tasklist_failed.html:46
#: taskapp/templates/taskapp/tasklist_failed.html:59
#: taskapp/templates/taskapp/tasklist_finish.html:45
#: taskapp/templates/taskapp/tasklist_finish.html:46
#: taskapp/templates/taskapp/tasklist_own.html:46
#: taskapp/templates/taskapp/tasklist_own.html:47
#: templates/taskapp/details.html:14 templates/taskapp/details.html:33
#: templates/taskapp/tasklist_all.html:62
#: templates/taskapp/tasklist_all.html:75
#: templates/taskapp/tasklist_empty.html:46
#: templates/taskapp/tasklist_empty.html:59
#: templates/taskapp/tasklist_failed.html:46
#: templates/taskapp/tasklist_failed.html:59
#: templates/taskapp/tasklist_finish.html:45
#: templates/taskapp/tasklist_finish.html:46
#: templates/taskapp/tasklist_own.html:46
#: templates/taskapp/tasklist_own.html:47
msgid "Not assigned" msgid "Not assigned"
msgstr "&lt;Не назначено&gt;" msgstr "&lt;Не назначено&gt;"
#: taskapp/templates/taskapp/details.html:17
#: templates/taskapp/details.html:17
msgid "Implementers" msgid "Implementers"
msgstr "Исполнители" msgstr "Исполнители"
#: taskapp/templates/taskapp/details.html:24
#: templates/taskapp/details.html:24
msgid "The task is valid until" msgid "The task is valid until"
msgstr "Задача действительна до" msgstr "Задача действительна до"
#: taskapp/templates/taskapp/details.html:27
#: templates/taskapp/details.html:27
msgid "Task type" msgid "Task type"
msgstr "Тип задачи" msgstr "Тип задачи"
#: taskapp/templates/taskapp/details.html:36
#: templates/taskapp/details.html:36
msgid "Attachment" msgid "Attachment"
msgstr "Приложение" msgstr "Приложение"
#: taskapp/templates/taskapp/footer_btns.html:10
#: templates/taskapp/footer_btns.html:10
msgid "View all tasks" msgid "View all tasks"
msgstr "Просмотреть все задачи" msgstr "Просмотреть все задачи"
#: taskapp/templates/taskapp/footer_btns.html:14
#: templates/taskapp/footer_btns.html:14
msgid "View empty tasks" msgid "View empty tasks"
msgstr "Задачи без получателей" msgstr "Задачи без получателей"
#: taskapp/templates/taskapp/tasklist.html:10
#: taskapp/templates/taskapp/tasklist_all.html:22
#: templates/taskapp/notification.html:2
msgid ""
"\n"
" <pre>\n"
" %(task_status)s\n"
" <a href=\"%(abon_url)s\">%(abon)s</a>\n"
" In group: %(group)s\n"
" Street: %(street)s\n"
" House: %(house)s\n"
" Tel: %(telephone)s\n"
" Task type: %(task_type)s\n"
" </pre>\n"
" <p>%(task_detail)s</p>\n"
msgstr ""
"\n"
" <pre>\n"
" %(task_status)s\n"
" <a href=\"%(abon_url)s\">%(abon)s</a>\n"
" Группа: %(group)s\n"
" Улица: %(street)s\n"
" Дом: %(house)s\n"
" Телефон: %(telephone)s\n"
" Тип задачи: %(task_type)s\n"
" </pre>\n"
" <p>%(task_detail)s</p>\n"
#: templates/taskapp/tasklist.html:9 templates/taskapp/tasklist_all.html:25
msgid "Name and comment count" msgid "Name and comment count"
msgstr "Имя и количество комментов" msgstr "Имя и количество комментов"
#: taskapp/templates/taskapp/tasklist.html:11
#: taskapp/templates/taskapp/tasklist_all.html:23
#: taskapp/templates/taskapp/tasklist_empty.html:16
#: taskapp/templates/taskapp/tasklist_failed.html:16
#: taskapp/templates/taskapp/tasklist_finish.html:11
#: taskapp/templates/taskapp/tasklist_own.html:11
#: templates/taskapp/tasklist.html:10 templates/taskapp/tasklist_all.html:26
#: templates/taskapp/tasklist_empty.html:16
#: templates/taskapp/tasklist_failed.html:16
#: templates/taskapp/tasklist_finish.html:11
#: templates/taskapp/tasklist_own.html:11
msgid "Address" msgid "Address"
msgstr "Адрес" msgstr "Адрес"
#: taskapp/templates/taskapp/tasklist.html:16
#: taskapp/templates/taskapp/tasklist_all.html:29
#: taskapp/templates/taskapp/tasklist_empty.html:21
#: taskapp/templates/taskapp/tasklist_failed.html:21
#: taskapp/templates/taskapp/tasklist_own.html:16
#: templates/taskapp/tasklist.html:15 templates/taskapp/tasklist_all.html:32
#: templates/taskapp/tasklist_empty.html:21
#: templates/taskapp/tasklist_failed.html:21
#: templates/taskapp/tasklist_own.html:16
msgid "Actions" msgid "Actions"
msgstr "Действия" msgstr "Действия"
#: taskapp/templates/taskapp/tasklist.html:49
#: taskapp/templates/taskapp/tasklist_all.html:61
#: taskapp/templates/taskapp/tasklist_empty.html:48
#: taskapp/templates/taskapp/tasklist_failed.html:48
#: taskapp/templates/taskapp/tasklist_finish.html:49
#: taskapp/templates/taskapp/tasklist_own.html:50
#: templates/taskapp/tasklist.html:48 templates/taskapp/tasklist_all.html:64
#: templates/taskapp/tasklist_empty.html:48
#: templates/taskapp/tasklist_failed.html:48
#: templates/taskapp/tasklist_finish.html:49
#: templates/taskapp/tasklist_own.html:50
msgid "User does not exist" msgid "User does not exist"
msgstr "Абонент не найден" msgstr "Абонент не найден"
#: taskapp/templates/taskapp/tasklist.html:59
#: templates/taskapp/tasklist.html:58
msgid "Author does not exist" msgid "Author does not exist"
msgstr "Автор не найден" msgstr "Автор не найден"
#: taskapp/templates/taskapp/tasklist.html:67
#: taskapp/templates/taskapp/tasklist_all.html:81
#: templates/taskapp/tasklist.html:66 templates/taskapp/tasklist_all.html:84
msgid "Today" msgid "Today"
msgstr "Сегодня" msgstr "Сегодня"
#: taskapp/templates/taskapp/tasklist.html:69
#: taskapp/templates/taskapp/tasklist_all.html:83
#: templates/taskapp/tasklist.html:68 templates/taskapp/tasklist_all.html:86
msgid "Yesterday" msgid "Yesterday"
msgstr "Вчера" msgstr "Вчера"
#: taskapp/templates/taskapp/tasklist.html:76
#: taskapp/templates/taskapp/tasklist_failed.html:65
#: templates/taskapp/tasklist.html:75 templates/taskapp/tasklist_failed.html:65
msgid "Complete" msgid "Complete"
msgstr "Завершить" msgstr "Завершить"
#: taskapp/templates/taskapp/tasklist.html:79
#: templates/taskapp/tasklist.html:78
msgid "Mark as unsuccessful" msgid "Mark as unsuccessful"
msgstr "Отметить задачу как проваленную" msgstr "Отметить задачу как проваленную"
#: taskapp/templates/taskapp/tasklist.html:91
#: taskapp/templates/taskapp/tasklist_all.html:104
#: taskapp/templates/taskapp/tasklist_empty.html:74
#: taskapp/templates/taskapp/tasklist_failed.html:77
#: taskapp/templates/taskapp/tasklist_finish.html:76
#: templates/taskapp/tasklist.html:90 templates/taskapp/tasklist_all.html:107
#: templates/taskapp/tasklist_empty.html:74
#: templates/taskapp/tasklist_failed.html:77
#: templates/taskapp/tasklist_finish.html:76
msgid "The list is empty" msgid "The list is empty"
msgstr "Список пуст" msgstr "Список пуст"
#: taskapp/templates/taskapp/tasklist_all.html:9
#: templates/taskapp/tasklist_all.html:9
msgid "All tasks" msgid "All tasks"
msgstr "Все задачи" msgstr "Все задачи"
#: taskapp/templates/taskapp/tasklist_all.html:15
#: templates/taskapp/tasklist_all.html:15
msgid "Records of all the tasks in the system" msgid "Records of all the tasks in the system"
msgstr "Лог всех задач в системе" msgstr "Лог всех задач в системе"
#: taskapp/templates/taskapp/tasklist_all.html:66
#: taskapp/templates/taskapp/tasklist_finish.html:54
#: templates/taskapp/tasklist_all.html:69
#: templates/taskapp/tasklist_finish.html:54
msgid "None" msgid "None"
msgstr "Нету" msgstr "Нету"
#: taskapp/templates/taskapp/tasklist_all.html:96
#: taskapp/templates/taskapp/tasklist_own.html:66
#: templates/taskapp/tasklist_all.html:99
#: templates/taskapp/tasklist_own.html:66
msgid "Remind" msgid "Remind"
msgstr "Напомнить" msgstr "Напомнить"
#: taskapp/templates/taskapp/tasklist_empty.html:5
#: templates/taskapp/tasklist_empty.html:5
msgid "Tasks in which no recipients" msgid "Tasks in which no recipients"
msgstr "Задачи, в которых нет получателей" msgstr "Задачи, в которых нет получателей"
#: taskapp/templates/taskapp/tasklist_empty.html:15
#: taskapp/templates/taskapp/tasklist_failed.html:15
#: taskapp/templates/taskapp/tasklist_finish.html:10
#: taskapp/templates/taskapp/tasklist_own.html:10
#: templates/taskapp/tasklist_empty.html:15
#: templates/taskapp/tasklist_failed.html:15
#: templates/taskapp/tasklist_finish.html:10
#: templates/taskapp/tasklist_own.html:10
msgid "Name" msgid "Name"
msgstr "ФИО" msgstr "ФИО"
#: taskapp/templates/taskapp/tasklist_failed.html:5
#: templates/taskapp/tasklist_failed.html:5
msgid "Tasks in which was trouble while at runtime" msgid "Tasks in which was trouble while at runtime"
msgstr "Задачи в которых возникли проблемы во время выполнения" msgstr "Задачи в которых возникли проблемы во время выполнения"
#: taskapp/templates/taskapp/tasklist_finish.html:61
#: templates/taskapp/tasklist_finish.html:61
msgid "Author does not specified" msgid "Author does not specified"
msgstr "Автор не указан" msgstr "Автор не указан"
#: taskapp/templates/taskapp/tasklist_own.html:79
#: templates/taskapp/tasklist_own.html:79
msgid "All your tasks has been performed" msgid "All your tasks has been performed"
msgstr "Все ваши задачи выполнены" msgstr "Все ваши задачи выполнены"
#: taskapp/views.py:109
#: views.py:124
msgid "You cannot delete task that assigned to you" msgid "You cannot delete task that assigned to you"
msgstr "Вы не можете удалять назначенные на вас задачи" msgstr "Вы не можете удалять назначенные на вас задачи"
#: taskapp/views.py:156
#: views.py:175
msgid "Task has successfully created" msgid "Task has successfully created"
msgstr "Задача успешно создана" msgstr "Задача успешно создана"
#: taskapp/views.py:158
#: views.py:177
msgid "Task has changed successfully" msgid "Task has changed successfully"
msgstr "Задача успешно изменена" msgstr "Задача успешно изменена"
#: taskapp/views.py:178
#: views.py:197
msgid "time left" msgid "time left"
msgstr "Времени осталось" msgstr "Времени осталось"
#: taskapp/views.py:180
#: views.py:199
#, python-format #, python-format
msgid "Expired timeout -%(time_left)s" msgid "Expired timeout -%(time_left)s"
msgstr "Время ожидания истекло -%(time_left)s" msgstr "Время ожидания истекло -%(time_left)s"
#: taskapp/views.py:201
#: views.py:220
msgid "fix form errors" msgid "fix form errors"
msgstr "исправте ошибки формы" msgstr "исправте ошибки формы"
msgid "Failed tasks"
msgstr "Проваленные задачи"
#~ msgid "locality %s.\n"
#~ msgstr "с. %s\n"
msgid "All my tasks"
msgstr "Все мои задачи"
#~ msgid "Failed tasks"
#~ msgstr "Проваленные задачи"
msgid "Completed tasks"
msgstr "Выполненные задачи"
#~ msgid "All my tasks"
#~ msgstr "Все мои задачи"
msgid "New tasks"
msgstr "Новые задачи"
#~ msgid "Completed tasks"
#~ msgstr "Выполненные задачи"
msgid "Scheduled tasks me"
msgstr "Назначенные мной задачи"
#~ msgid "New tasks"
#~ msgstr "Новые задачи"
msgid "Tasks to be performed"
msgstr "Задачи, которые необходимо выполнить"
#~ msgid "Scheduled tasks me"
#~ msgstr "Назначенные мной задачи"
#~ msgid "locality %s. Task type - %s. "
#~ msgstr "с. %s. Тип задачи - %s. "
#~ msgid "Tasks to be performed"
#~ msgstr "Задачи, которые необходимо выполнить"

6
taskapp/models.py

@ -101,13 +101,9 @@ class Task(models.Model):
self.save(update_fields=('state',)) self.save(update_fields=('state',))
def send_notification(self): def send_notification(self):
if self.abon:
group = self.abon.group
else:
group = ''
task_handle( task_handle(
self, self.author, self, self.author,
self.recipients.all(), group
self.recipients.all()
) )
def get_attachment_fname(self): def get_attachment_fname(self):

13
taskapp/templates/taskapp/notification.html

@ -0,0 +1,13 @@
{% load i18n %}
{% blocktrans with abon_url=abon.get_absolute_url group=abon.group street=abon.street house=abon.house telephone=abon.telephone task_type=task.get_mode_display task_detail=task.descr %}
<pre>
{{ task_status }}
<a href="{{ abon_url }}">{{ abon }}</a>
In group: {{ group }}
Street: {{ street }}
House: {{ house }}
Tel: {{ telephone }}
Task type: {{ task_type }}
</pre>
<p>{{ task_detail }}</p>
{% endblocktrans %}
Loading…
Cancel
Save