Browse Source

Merge branch 'new_customers' into devel

devel
Dmitry Novikov 7 years ago
parent
commit
578bb98dab
  1. 2
      abonapp/templates/abonapp/addAbon.html
  2. 2
      abonapp/templates/abonapp/addInvoice.html
  3. 2
      abonapp/templates/abonapp/buy_tariff.html
  4. 4
      abonapp/templates/abonapp/debtors.html
  5. 2
      abonapp/templates/abonapp/ext.htm
  6. 2
      abonapp/templates/abonapp/group_list.html
  7. 2
      abonapp/templates/abonapp/group_tariffs.html
  8. 2
      abonapp/templates/abonapp/invoiceForPayment.html
  9. 4
      abonapp/templates/abonapp/log.html
  10. 2
      abonapp/templates/abonapp/peoples.html
  11. 2
      devapp/templates/devapp/add_dev.html
  12. 3
      devapp/templates/devapp/dev.html
  13. 2
      devapp/templates/devapp/devices.html
  14. 4
      devapp/templates/devapp/devices_null_group.html
  15. 1
      devapp/templates/devapp/ext.htm
  16. 2
      devapp/templates/devapp/fix_dev_group.html
  17. 2
      devapp/templates/devapp/group_list.html
  18. 3
      devapp/views.py
  19. 1
      djing/settings.py
  20. 1
      djing/urls.py
  21. 4
      finapp/templates/finapp/fin_report.html
  22. 1
      finapp/templates/finapp/payHistory.html
  23. 14
      finapp/templates/finapp/payalltimegateway_form.html
  24. 1
      finapp/templates/finapp/payalltimegateway_list.html
  25. 3
      group_app/templates/group_app/ext.html
  26. 2
      group_app/templates/group_app/group_list.html
  27. 2
      gw_app/templates/gw_app/nasmodel_add.html
  28. 2
      gw_app/templates/gw_app/nasmodel_list.html
  29. 2
      gw_app/templates/gw_app/nasmodel_update.html
  30. 2
      ip_pool/templates/ip_pool/net_add.html
  31. 2
      ip_pool/templates/ip_pool/net_edit.html
  32. 2
      ip_pool/templates/ip_pool/network_list.html
  33. 0
      new_customers/__init__.py
  34. 5
      new_customers/admin.py
  35. 5
      new_customers/apps.py
  36. 11
      new_customers/forms.py
  37. 98
      new_customers/locale/ru/LC_MESSAGES/django.po
  38. 0
      new_customers/migrations/__init__.py
  39. 58
      new_customers/models.py
  40. 58
      new_customers/templates/new_customers/potentialsubscriber_detail.html
  41. 17
      new_customers/templates/new_customers/potentialsubscriber_form.html
  42. 70
      new_customers/templates/new_customers/potentialsubscriber_list.html
  43. 12
      new_customers/urls.py
  44. 37
      new_customers/views.py
  45. 2
      searchapp/templates/searchapp/index.html
  46. 8
      tariff_app/templates/tariff_app/editTarif.html
  47. 2
      tariff_app/templates/tariff_app/ext.html
  48. 8
      tariff_app/templates/tariff_app/periodic_pays/add_edit.html
  49. 2
      tariff_app/templates/tariff_app/service_users.html
  50. 7
      taskapp/templates/taskapp/add_edit_task.html
  51. 1
      taskapp/templates/taskapp/ext.htm
  52. 1
      taskapp/templates/taskapp/tasklist_all.html
  53. 2
      taskapp/templates/taskapp/tasklist_empty.html
  54. 2
      taskapp/templates/taskapp/tasklist_failed.html
  55. 4
      taskapp/templates/taskapp/tasklist_finish.html
  56. 4
      taskapp/templates/taskapp/tasklist_own.html
  57. 2
      templates/all_base.html
  58. 7
      templates/base.html

2
abonapp/templates/abonapp/addAbon.html

@ -1,6 +1,8 @@
{% extends request.is_ajax|yesno:'bajax.html,base.html' %} {% extends request.is_ajax|yesno:'bajax.html,base.html' %}
{% load i18n bootstrap3 %} {% load i18n bootstrap3 %}
{% block title %}{% trans 'Add abon' %}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>

2
abonapp/templates/abonapp/addInvoice.html

@ -1,6 +1,8 @@
{% extends request.is_ajax|yesno:'bajax.html,base.html' %} {% extends request.is_ajax|yesno:'bajax.html,base.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans 'Add debt' %}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>

2
abonapp/templates/abonapp/buy_tariff.html

@ -1,6 +1,8 @@
{% extends request.is_ajax|yesno:'bajax.html,base.html' %} {% extends request.is_ajax|yesno:'bajax.html,base.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans 'Pick a service' %}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>

4
abonapp/templates/abonapp/debtors.html

@ -1,6 +1,8 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans 'People with debts' %}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>
@ -55,4 +57,4 @@
</tbody> </tbody>
</table> </table>
</div> </div>
{% endblock %}
{% endblock %}

2
abonapp/templates/abonapp/ext.htm

@ -1,6 +1,8 @@
{% extends request.is_ajax|yesno:'bajax.html,base.html' %} {% extends request.is_ajax|yesno:'bajax.html,base.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{{ abon.get_full_name }}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>

2
abonapp/templates/abonapp/group_list.html

@ -1,6 +1,8 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load dpagination i18n %} {% load dpagination i18n %}
{% block title %}{% trans 'User groups' %}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>

2
abonapp/templates/abonapp/group_tariffs.html

@ -1,6 +1,8 @@
{% extends request.is_ajax|yesno:'bajax.html,base.html' %} {% extends request.is_ajax|yesno:'bajax.html,base.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans 'Belonging services for groups' %}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>

2
abonapp/templates/abonapp/invoiceForPayment.html

@ -1,6 +1,8 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans 'Debts' %}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>

4
abonapp/templates/abonapp/log.html

@ -1,6 +1,8 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans 'History of subscriber' %}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>
@ -58,4 +60,4 @@
</table> </table>
</div> </div>
{% endblock %}
{% endblock %}

2
abonapp/templates/abonapp/peoples.html

@ -1,6 +1,8 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load i18n dpagination %} {% load i18n dpagination %}
{% block title %}{{ group.title }}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>

2
devapp/templates/devapp/add_dev.html

@ -1,6 +1,8 @@
{% extends request.is_ajax|yesno:'bajax.html,base.html' %} {% extends request.is_ajax|yesno:'bajax.html,base.html' %}
{% load i18n bootstrap3 %} {% load i18n bootstrap3 %}
{% block title %}{% trans 'Add new device' %}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>

3
devapp/templates/devapp/dev.html

@ -1,5 +1,8 @@
{% extends request.is_ajax|yesno:'nullcont.htm,devapp/ext.htm' %} {% extends request.is_ajax|yesno:'nullcont.htm,devapp/ext.htm' %}
{% load i18n bootstrap3 %} {% load i18n bootstrap3 %}
{% block title %}{{ form.comment.value }}{% endblock %}
{% block content %} {% block content %}
<div class="panel panel-default"> <div class="panel panel-default">

2
devapp/templates/devapp/devices.html

@ -1,6 +1,8 @@
{% extends request.is_ajax|yesno:'bajax.html,base.html' %} {% extends request.is_ajax|yesno:'bajax.html,base.html' %}
{% load i18n dpagination %} {% load i18n dpagination %}
{% block title %}{% trans 'Devices' %} - {{ group.title }}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>

4
devapp/templates/devapp/devices_null_group.html

@ -1,6 +1,8 @@
{% extends request.is_ajax|yesno:'bajax.html,base.html' %} {% extends request.is_ajax|yesno:'bajax.html,base.html' %}
{% load i18n dpagination %} {% load i18n dpagination %}
{% block title %}{% trans 'Devices without group' %}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>
@ -80,4 +82,4 @@
</table> </table>
</div> </div>
{% endblock %}
{% endblock %}

1
devapp/templates/devapp/ext.htm

@ -1,6 +1,7 @@
{% extends request.is_ajax|yesno:'bajax.html,base.html' %} {% extends request.is_ajax|yesno:'bajax.html,base.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{{ dev.comment }}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">

2
devapp/templates/devapp/fix_dev_group.html

@ -1,6 +1,8 @@
{% extends request.is_ajax|yesno:'bajax.html,base.html' %} {% extends request.is_ajax|yesno:'bajax.html,base.html' %}
{% load i18n bootstrap3 %} {% load i18n bootstrap3 %}
{% block title %}{% trans 'Fix device group' %}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>

2
devapp/templates/devapp/group_list.html

@ -1,6 +1,8 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans 'Devices' %}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>

3
devapp/views.py

@ -599,9 +599,8 @@ class GroupsListView(LoginAdminMixin, global_base_views.OrderedFilteredList):
model = Group model = Group
def get_queryset(self): def get_queryset(self):
groups = super(GroupsListView, self).get_queryset()
groups = get_objects_for_user(self.request.user, groups = get_objects_for_user(self.request.user,
'group_app.view_group', klass=groups,
'group_app.view_group', klass=Group,
accept_global_perms=False) accept_global_perms=False)
return groups return groups

1
djing/settings.py

@ -58,6 +58,7 @@ INSTALLED_APPS = [
'messenger', 'messenger',
'msg_app', 'msg_app',
'group_app', 'group_app',
'new_customers',
'guardian', 'guardian',
'pinax_theme_bootstrap', 'pinax_theme_bootstrap',
'bootstrapform', 'bootstrapform',

1
djing/urls.py

@ -19,6 +19,7 @@ urlpatterns = [
path('ip_pool/', include('ip_pool.urls', namespace='ip_pool')), path('ip_pool/', include('ip_pool.urls', namespace='ip_pool')),
path('messenger/', include('messenger.urls', namespace='messenger')), path('messenger/', include('messenger.urls', namespace='messenger')),
path('gw/', include('gw_app.urls', namespace='gw_app')), path('gw/', include('gw_app.urls', namespace='gw_app')),
path('new_customers/', include('new_customers.urls', namespace='new_customers')),
path('fin/', include('finapp.urls', namespace='finapp')) path('fin/', include('finapp.urls', namespace='finapp'))
# Switch language # Switch language

4
finapp/templates/finapp/fin_report.html

@ -1,6 +1,8 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans 'Money by days' %}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>
@ -46,4 +48,4 @@
</table> </table>
</div> </div>
{% endblock %}
{% endblock %}

1
finapp/templates/finapp/payHistory.html

@ -1,6 +1,7 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{{ pay_gw.title }}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">

14
finapp/templates/finapp/payalltimegateway_form.html

@ -1,6 +1,14 @@
{% extends request.is_ajax|yesno:'bajax.html,base.html' %} {% extends request.is_ajax|yesno:'bajax.html,base.html' %}
{% load i18n bootstrap3 %} {% load i18n bootstrap3 %}
{% block title %}
{% if object %}
{% trans 'Change payment gateway' %}
{% else %}
{% trans 'Add payment gateway' %}
{% endif %}
{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>
@ -17,7 +25,11 @@
{% block page-header %} {% block page-header %}
{% trans 'Make new payment gateway' %}
{% if object %}
{% trans 'Change payment gateway' %}
{% else %}
{% trans 'Add payment gateway' %}
{% endif %}
{% endblock %} {% endblock %}

1
finapp/templates/finapp/payalltimegateway_list.html

@ -1,6 +1,7 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans 'List of payment gateways' %}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">

3
group_app/templates/group_app/ext.html

@ -1,6 +1,7 @@
{% extends request.is_ajax|yesno:'bajax.html,base.html' %} {% extends request.is_ajax|yesno:'bajax.html,base.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans 'Groups' %}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
@ -22,4 +23,4 @@
{% block content %}{% endblock %} {% block content %}{% endblock %}
</div> </div>
</div> </div>
{% endblock %}
{% endblock %}

2
group_app/templates/group_app/group_list.html

@ -1,6 +1,8 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load i18n dpagination%} {% load i18n dpagination%}
{% block title %}{% trans 'Groups' %}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>

2
gw_app/templates/gw_app/nasmodel_add.html

@ -1,6 +1,8 @@
{% extends request.is_ajax|yesno:'bajax.html,base.html' %} {% extends request.is_ajax|yesno:'bajax.html,base.html' %}
{% load i18n bootstrap3 %} {% load i18n bootstrap3 %}
{% block title %}{% trans 'Add new gateway' %}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>

2
gw_app/templates/gw_app/nasmodel_list.html

@ -1,6 +1,8 @@
{% extends request.is_ajax|yesno:'bajax.html,base.html' %} {% extends request.is_ajax|yesno:'bajax.html,base.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans 'Gateways' %}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>

2
gw_app/templates/gw_app/nasmodel_update.html

@ -1,6 +1,8 @@
{% extends request.is_ajax|yesno:'bajax.html,base.html' %} {% extends request.is_ajax|yesno:'bajax.html,base.html' %}
{% load i18n bootstrap3 %} {% load i18n bootstrap3 %}
{% block title %}{% trans 'Edit gateway' %}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>

2
ip_pool/templates/ip_pool/net_add.html

@ -5,6 +5,8 @@
{# <script src="/static/js/cidr.js"></script>#} {# <script src="/static/js/cidr.js"></script>#}
{#{% endblock %}#} {#{% endblock %}#}
{% block title %}{% trans 'Add network' %}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>

2
ip_pool/templates/ip_pool/net_edit.html

@ -5,6 +5,8 @@
{# <script src="/static/js/cidr.js"></script>#} {# <script src="/static/js/cidr.js"></script>#}
{#{% endblock %}#} {#{% endblock %}#}
{% block title %}{{ object }}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>

2
ip_pool/templates/ip_pool/network_list.html

@ -1,6 +1,8 @@
{% extends 'ip_pool/ext.html' %} {% extends 'ip_pool/ext.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans 'Networks' %}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>

0
new_customers/__init__.py

5
new_customers/admin.py

@ -0,0 +1,5 @@
from django.contrib import admin
from new_customers.models import PotentialSubscriber
admin.site.register(PotentialSubscriber)

5
new_customers/apps.py

@ -0,0 +1,5 @@
from django.apps import AppConfig
class NewCustomersConfig(AppConfig):
name = 'new_customers'

11
new_customers/forms.py

@ -0,0 +1,11 @@
from django import forms
from new_customers.models import PotentialSubscriber
class CustomerModelForm(forms.ModelForm):
class Meta:
model = PotentialSubscriber
exclude = ('make_data',)
widgets = {
'deadline': forms.DateInput(attrs={'type': 'date'})
}

98
new_customers/locale/ru/LC_MESSAGES/django.po

@ -0,0 +1,98 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# Dmitry Novikov nerosketch@gmail.com, 2019.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2019-06-17 00:43+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Dmitry Novikov nerosketch@gmail.com\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && 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"
#: models.py:11
msgid "fio"
msgstr "ФИО"
#: models.py:14
msgid "Telephone"
msgstr "Номер телефона"
#: models.py:24
msgid "User group"
msgstr "Группа нового абонента"
#: models.py:27
msgid "Town"
msgstr "Посёлок"
#: models.py:28
msgid "Town, if group does not already exist"
msgstr "Населённый пункт, если группа ещё не существует"
#: models.py:31
msgid "Street"
msgstr "Улица"
#: models.py:33
msgid "House"
msgstr "Дом"
#: models.py:39
msgid "Comment"
msgstr "Комментарий"
#: models.py:43
msgid "Create date"
msgstr "Дата создания"
#: models.py:45
msgid "Deadline connection"
msgstr "Планируемая дата подключения"
#: models.py:46
msgid "Date when connection must be finished"
msgstr "Дата, до которой подключение должно быть завершено"
#: models.py:55
msgid "Potential customer"
msgstr "Новый абонент"
#: models.py:56
msgid "Potential customers"
msgstr "Новые абоненты"
#: templates/new_customers/potentialsubscriber_form.html:5
msgid "Create potential client"
msgstr "Создать заявку на подключение"
#: templates/new_customers/potentialsubscriber_form.html:13
#: templates/new_customers/potentialsubscriber_list.html:45
msgid "Add"
msgstr "Добавить"
#: templates/new_customers/potentialsubscriber_list.html:8
#: templates/new_customers/potentialsubscriber_list.html:14
msgid "Potential subscribers"
msgstr "Заявки на подключение"
#: templates/new_customers/potentialsubscriber_list.html:21
msgid "New subscribers"
msgstr "Новые абоненты"
#: templates/new_customers/potentialsubscriber_list.html:22
msgid "People that may be clients"
msgstr "Подключки. Клиенты, которые должны стать абонентами"
#: templates/new_customers/potentialsubscriber_list.html:38
msgid "Not have new subscribers"
msgstr "Нет новых подключек"

0
new_customers/migrations/__init__.py

58
new_customers/models.py

@ -0,0 +1,58 @@
from django.shortcuts import resolve_url
from django.utils.translation import gettext_lazy as _
from django.db import models
from django.conf import settings
from django.core.validators import RegexValidator
from group_app.models import Group
class PotentialSubscriber(models.Model):
fio = models.CharField(_('fio'), max_length=256)
telephone = models.CharField(
max_length=16,
verbose_name=_('Telephone'),
blank=True,
null=True,
validators=(RegexValidator(
getattr(settings, 'TELEPHONE_REGEXP', r'^(\+[7893]\d{10,11})?$')
),)
)
group = models.ForeignKey(
Group,
on_delete=models.SET_NULL,
blank=True, null=True,
verbose_name=_('User group')
)
town = models.CharField(
_('Town'),
help_text=_('Town, if group does not already exist'),
max_length=127, blank=True, null=True
)
street = models.CharField(_('Street'), max_length=127, blank=True, null=True)
house = models.CharField(
_('House'),
max_length=12,
null=True,
blank=True
)
description = models.TextField(
_('Comment'),
null=True,
blank=True
)
make_data = models.DateTimeField(_('Create date'), auto_now_add=True)
deadline = models.DateField(
_('Deadline connection'),
help_text=_('Date when connection must be finished'),
blank=True, null=True
)
def get_absolute_url(self):
return resolve_url('new_customers:user', uid=self.pk)
class Meta:
db_table = 'new_customers'
verbose_name = _('Potential customer')
verbose_name_plural = _('Potential customers')
ordering = '-id',

58
new_customers/templates/new_customers/potentialsubscriber_detail.html

@ -0,0 +1,58 @@
{% extends request.is_ajax|yesno:'bajax.html,base.html' %}
{% load i18n bootstrap3 %}
{% block title %}
{{ object.fio|default:_('Not assigned') }}
{% endblock %}
{% block breadcrumb %}
<ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li>
<li><a href="{% url 'new_customers:customers_list' %}">{% trans 'Potential subscribers' %}</a></li>
<li class="active">{{ object.fio }}</li>
</ol>
{% endblock %}
{% block page-header %}
{{ object.fio|default:_('Not assigned') }}
{% endblock %}
{% block main %}
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">{% trans 'Potential subscriber' %}</h3>
</div>
<div class="panel-body">
<dl class="dl-horizontal">
{% for model_field in model_fields %}
<dt>{{ model_field.verbose_name }}</dt>
<dd>{{ model_field.value }}</dd>
{% endfor %}
</dl>
<form role="form" action="{% url 'new_customers:new_user' %}" method="post">{% csrf_token %}
{% bootstrap_form form %}
<div class="btn-group btn-group-sm">
<a href="#" class="btn btn-primary">
<span class="glyphicon glyphicon-save"></span> {% trans 'Save' %}
</a>
<a href="#" class="btn btn-success">
<span class="glyphicon glyphicon-fire"></span> {% trans 'Make client' %}
</a>
<a href="#" class="btn btn-default">
<span class="glyphicon glyphicon-remove-circle"></span> {% trans 'Cancel' %}
</a>
</div>
</form>
</div>
</div>
{% endblock %}

17
new_customers/templates/new_customers/potentialsubscriber_form.html

@ -0,0 +1,17 @@
{% load i18n bootstrap3 %}
<form role="form" action="{% url 'new_customers:new_user' %}" method="post">{% csrf_token %}
<div class="modal-header primary">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title"><span class="glyphicon glyphicon-question-sign"></span>{% trans 'Create potential client' %}</h4>
</div>
<div class="modal-body">
{% bootstrap_form form %}
<div class="btn-group">
<button type="submit" class="btn btn-primary">
<span class="glyphicon glyphicon-plus"></span> {% trans 'Add' %}
</button>
</div>
</div>
</form>

70
new_customers/templates/new_customers/potentialsubscriber_list.html

@ -0,0 +1,70 @@
{% extends request.is_ajax|yesno:'bajax.html,base.html' %}
{% load i18n %}
{% block title %}{% trans 'Potential subscribers' %}{% endblock %}
{% block breadcrumb %}
<ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li>
<li class="active">{% trans 'Potential subscribers' %}</li>
</ol>
{% endblock %}
{% block page_header %}
<h3>{% trans 'Potential subscribers' %}</h3>
{% endblock %}
{% block main %}
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">{% trans 'New subscribers' %}</h3>
<span>{% trans 'People that may be clients' %}</span>
</div>
<div class="list-group">
{% for new_user in object_list %}
{% with user_group=new_user.group %}
<a href="{{ new_user.get_absolute_url }}" class="list-group-item">
<div class="pull-right">
<small>{{ new_user.make_data|date:'d M, H:i:s' }}</small>
{% if user_group.deadline %}
<small>{{ new_user.deadline|date:'d M, H:i:s' }}</small>
{% endif %}
</div>
<h4>{{ new_user.fio }} <small>{{ new_user.telephone }}</small></h4>
{% if user_group %}
{{ user_group.title }}
{% else %}
{{ town|default_if_none:'' }}
{% endif %}
{{ new_user.street }}, {{ new_user.house }}
{% if new_user.description %}
<p>{{ new_user.description }}</p>
{% endif %}
</a>
{% endwith %}
{% empty %}
<a href="#" class="list-group-item">
<p class="list-group-item-text">{% trans 'Not have new subscribers' %}</p>
</a>
{% endfor %}
</div>
<div class="panel-footer">
<div class="btn-group">
<a href="{% url 'new_customers:new_user' %}" class="btn btn-default btn-modal">
<span class="glyphicon glyphicon-plus"></span> {% trans 'Add' %}
</a>
</div>
</div>
</div>
{% endblock %}

12
new_customers/urls.py

@ -0,0 +1,12 @@
from django.urls import path
from new_customers import views
app_name = 'new_customers'
urlpatterns = [
path('', views.CustomersList.as_view(), name='customers_list'),
path('new/', views.CustomerNew.as_view(), name='new_user'),
path('<int:uid>/', views.CustomerDetail.as_view(), name='user'),
]

37
new_customers/views.py

@ -0,0 +1,37 @@
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.views.generic import ListView, DetailView, CreateView
from djing.global_base_views import OrderingMixin
from djing.lib.mixins import LoginAdminMixin, LoginAdminPermissionMixin
from new_customers.forms import CustomerModelForm
from new_customers.models import PotentialSubscriber
class CustomersList(LoginAdminMixin, OrderingMixin, ListView):
model = PotentialSubscriber
class CustomerDetail(LoginAdminPermissionMixin, DetailView):
model = PotentialSubscriber
pk_url_kwarg = 'uid'
permission_required = 'new_customers.view_potentialsubscriber'
def get_context_data(self, **kwargs):
model_fields = filter(lambda x: hasattr(self.object, x.name), self.object._meta.fields)
model_fields = filter(lambda x: getattr(self.object, x.name), model_fields)
model_fields = filter(lambda x: x.name != 'id', model_fields)
context = {
'form': CustomerModelForm(instance=self.object),
'model_fields': map(lambda f: {
'verbose_name': f.verbose_name,
'value': getattr(self.object, f.name)
}, model_fields)
}
context.update(kwargs)
return super().get_context_data(**context)
class CustomerNew(LoginAdminMixin, PermissionRequiredMixin, CreateView):
model = PotentialSubscriber
form_class = CustomerModelForm
permission_required = 'new_customers.add_potentialsubscriber'

2
searchapp/templates/searchapp/index.html

@ -1,6 +1,8 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans 'Search' %}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>

8
tariff_app/templates/tariff_app/editTarif.html

@ -1,6 +1,14 @@
{% extends request.is_ajax|yesno:'bajax.html,base.html' %} {% extends request.is_ajax|yesno:'bajax.html,base.html' %}
{% load i18n bootstrap3 %} {% load i18n bootstrap3 %}
{% block title %}
{% if tarif_id == 0 %}
{% trans 'Add' %}
{% else %}
{{ form.title.value }}
{% endif %}
{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>

2
tariff_app/templates/tariff_app/ext.html

@ -1,6 +1,8 @@
{% extends request.is_ajax|yesno:'bajax.html,base.html' %} {% extends request.is_ajax|yesno:'bajax.html,base.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans 'Services' %}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>

8
tariff_app/templates/tariff_app/periodic_pays/add_edit.html

@ -1,6 +1,14 @@
{% extends request.is_ajax|yesno:'bajax.html,base.html' %} {% extends request.is_ajax|yesno:'bajax.html,base.html' %}
{% load i18n bootstrap3 %} {% load i18n bootstrap3 %}
{% block title %}
{% if pay_instance %}
{% trans 'Change periodic pay' %}
{% else %}
{% trans 'Add new periodic pay' %}
{% endif %}
{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>

2
tariff_app/templates/tariff_app/service_users.html

@ -1,6 +1,8 @@
{% extends 'base.html' %} {% extends 'base.html' %}
{% load i18n dpagination %} {% load i18n dpagination %}
{% block title %}{% trans 'Service users' %}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">
<li><span class="glyphicon glyphicon-home"></span></li> <li><span class="glyphicon glyphicon-home"></span></li>

7
taskapp/templates/taskapp/add_edit_task.html

@ -1,6 +1,13 @@
{% extends request.is_ajax|yesno:'bajax.html,base.html' %} {% extends request.is_ajax|yesno:'bajax.html,base.html' %}
{% load i18n bootstrap3 globaltags %} {% load i18n bootstrap3 globaltags %}
{% block title %}
{% if task.id %}
{% trans 'Edit' %}
{% else %}
{% trans 'Create' %}
{% endif %}
{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">

1
taskapp/templates/taskapp/ext.htm

@ -1,6 +1,7 @@
{% extends request.is_ajax|yesno:'bajax.html,base.html' %} {% extends request.is_ajax|yesno:'bajax.html,base.html' %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans 'Tasks' %}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">

1
taskapp/templates/taskapp/tasklist_all.html

@ -1,6 +1,7 @@
{% extends request.is_ajax|yesno:'bajax.html,base.html' %} {% extends request.is_ajax|yesno:'bajax.html,base.html' %}
{% load i18n tasktags %} {% load i18n tasktags %}
{% block title %}{% trans 'All tasks' %}{% endblock %}
{% block breadcrumb %} {% block breadcrumb %}
<ol class="breadcrumb"> <ol class="breadcrumb">

2
taskapp/templates/taskapp/tasklist_empty.html

@ -1,6 +1,8 @@
{% extends request.is_ajax|yesno:'nullcont.htm,taskapp/ext.htm' %} {% extends request.is_ajax|yesno:'nullcont.htm,taskapp/ext.htm' %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans 'Tasks in which no recipients' %}{% endblock %}
{% block page-header %} {% block page-header %}
{% trans 'Tasks in which no recipients' %} {% trans 'Tasks in which no recipients' %}
{% endblock %} {% endblock %}

2
taskapp/templates/taskapp/tasklist_failed.html

@ -1,6 +1,8 @@
{% extends request.is_ajax|yesno:'nullcont.htm,taskapp/ext.htm' %} {% extends request.is_ajax|yesno:'nullcont.htm,taskapp/ext.htm' %}
{% load i18n %} {% load i18n %}
{% block title %}{% trans 'Failed tasks' %}{% endblock %}
{% block page-header %} {% block page-header %}
{% trans 'Tasks in which was trouble while at runtime' %} {% trans 'Tasks in which was trouble while at runtime' %}
{% endblock %} {% endblock %}

4
taskapp/templates/taskapp/tasklist_finish.html

@ -1,7 +1,9 @@
{% extends request.is_ajax|yesno:'nullcont.htm,taskapp/ext.htm' %} {% extends request.is_ajax|yesno:'nullcont.htm,taskapp/ext.htm' %}
{% load i18n %} {% load i18n %}
{% block content %}
{% block title %}{% trans 'Completed tasks' %}{% endblock %}
{% block content %}
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-bordered"> <table class="table table-striped table-bordered">
<thead> <thead>

4
taskapp/templates/taskapp/tasklist_own.html

@ -1,7 +1,9 @@
{% extends request.is_ajax|yesno:'nullcont.htm,taskapp/ext.htm' %} {% extends request.is_ajax|yesno:'nullcont.htm,taskapp/ext.htm' %}
{% load i18n %} {% load i18n %}
{% block content %}
{% block title %}{% trans 'Scheduled tasks me' %}{% endblock %}
{% block content %}
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-bordered"> <table class="table table-striped table-bordered">
<thead> <thead>

2
templates/all_base.html

@ -1,7 +1,7 @@
<!DOCTYPE html>{% load i18n globaltags static %} <!DOCTYPE html>{% load i18n globaltags static %}
<html lang="{{ LANGUAGE_CODE }}"> <html lang="{{ LANGUAGE_CODE }}">
<head> <head>
<title>{% global_var 'COMPANY_NAME' %} - {% trans 'Admin side' %}</title>
<title>{% block title %}{% global_var 'COMPANY_NAME' %} - {% trans 'Admin side' %}{% endblock %}</title>
<meta charset="UTF-8"> <meta charset="UTF-8">
<!--[if lt IE 9]><meta http-equiv="refresh" content="0;URL={% static 'bad_ie.html' %}" /><![endif]--> <!--[if lt IE 9]><meta http-equiv="refresh" content="0;URL={% static 'bad_ie.html' %}" /><![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">

7
templates/base.html

@ -122,6 +122,13 @@
</li> </li>
{% endif %} {% endif %}
{% url 'new_customers:customers_list' as newclist %}
<li{% if newclist in request.path %} class="active"{% endif %}>
<a href="{{ newclist }}">
<span class="glyphicon glyphicon-question-sign"></span> {% trans 'Potential subscribers' %}
</a>
</li>
</ul> </ul>
</div> </div>

Loading…
Cancel
Save