34 changed files with 209 additions and 189 deletions
-
22abonapp/templates/abonapp/abon_confirm_delete.html
-
30abonapp/views.py
-
13accounts_app/views.py
-
9devapp/locale/ru/LC_MESSAGES/django.po
-
2devapp/templates/devapp/dev.html
-
14devapp/templates/devapp/device_confirm_delete.html
-
2devapp/templates/devapp/devices.html
-
4devapp/templates/devapp/devices_null_group.html
-
2devapp/urls.py
-
31devapp/views.py
-
2dialing.py
-
3dialing_app/views.py
-
50djing/lib/__init__.py
-
35djing/lib/decorators.py
-
0djing/lib/messaging/__init__.py
-
7djing/lib/messaging/sms/__init__.py
-
0djing/lib/messaging/sms/base.py
-
0djing/lib/messaging/sms/consts.py
-
8djing/lib/messaging/sms/deliver.py
-
0djing/lib/messaging/sms/gsm0338.py
-
0djing/lib/messaging/sms/pdu.py
-
10djing/lib/messaging/sms/submit.py
-
0djing/lib/messaging/sms/udh.py
-
2djing/lib/messaging/sms/wap.py
-
0djing/lib/messaging/utils.py
-
23group_app/templates/group_app/group_confirm_delete.html
-
7messaging/sms/__init__.py
-
3tariff_app/locale/ru/LC_MESSAGES/django.po
-
30tariff_app/templates/tariff_app/modal_del_warning.html
-
15tariff_app/templates/tariff_app/tariff_confirm_delete.html
-
2tariff_app/urls.py
-
32tariff_app/views.py
-
3taskapp/views.py
-
19templates/base_delete_modal.html
@ -1,18 +1,10 @@ |
|||
{% extends 'base_delete_modal.html' %} |
|||
{% load i18n %} |
|||
<form role="form" action="{% url 'abonapp:del_abon' abon.group.pk abon.username %}" method="post">{% csrf_token %} |
|||
<div class="modal-header warning"> |
|||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> |
|||
<h4 class="modal-title"><span class="glyphicon glyphicon-earphone"></span>{% trans 'Remove subscriber' %}</h4> |
|||
</div> |
|||
|
|||
<div class="modal-body"> |
|||
{% block modal_form_url %} |
|||
{% url 'abonapp:del_abon' abon.group.pk abon.username %} |
|||
{% endblock %} |
|||
|
|||
<h4>{% trans 'Are you sure about them?' %}</h4> |
|||
|
|||
<button type="submit" class="btn btn-danger" value="DELETE"> |
|||
<span class="glyphicon glyphicon-remove"></span> {% trans 'Delete' %} |
|||
</button> |
|||
|
|||
</div> |
|||
|
|||
</form> |
|||
{% block modal_form_title %} |
|||
{% trans 'Remove subscriber' %} |
|||
{% endblock %} |
|||
@ -0,0 +1,14 @@ |
|||
{% extends 'base_delete_modal.html' %} |
|||
{% load i18n %} |
|||
|
|||
{% block modal_form_url %} |
|||
{% url 'devapp:del' object.group.pk object.pk %} |
|||
{% endblock %} |
|||
|
|||
{% block modal_form_title %} |
|||
{% trans 'Remove device' %} |
|||
{% endblock %} |
|||
|
|||
{% block modal_form_text %} |
|||
<h4>{% trans 'Are you sure you want to delete device?' %}</h4> |
|||
{% endblock %} |
|||
@ -0,0 +1,35 @@ |
|||
from functools import wraps |
|||
from django.conf import settings |
|||
from django.http import HttpResponseRedirect |
|||
from django.shortcuts import redirect |
|||
|
|||
|
|||
DEBUG = getattr(settings, 'DEBUG', False) |
|||
|
|||
|
|||
def require_ssl(view): |
|||
""" |
|||
Decorator that requires an SSL connection. If the current connection is not SSL, we redirect to the SSL version of |
|||
the page. |
|||
from: https://gist.github.com/ckinsey/9709984 |
|||
""" |
|||
|
|||
@wraps(view) |
|||
def wrapper(request, *args, **kwargs): |
|||
if not DEBUG and not request.is_secure(): |
|||
target_url = "https://" + request.META['HTTP_HOST'] + request.path_info |
|||
return HttpResponseRedirect(target_url) |
|||
return view(request, *args, **kwargs) |
|||
|
|||
return wrapper |
|||
|
|||
|
|||
# Allow to view only admins |
|||
def only_admins(fn): |
|||
@wraps(fn) |
|||
def wrapped(request, *args, **kwargs): |
|||
if request.user.is_admin: |
|||
return fn(request, *args, **kwargs) |
|||
else: |
|||
return redirect('client_side:home') |
|||
return wrapped |
|||
@ -0,0 +1,7 @@ |
|||
# See LICENSE |
|||
|
|||
from djing.lib.messaging.sms.deliver import SmsDeliver |
|||
from djing.lib.messaging.sms.submit import SmsSubmit |
|||
from djing.lib.messaging.sms.gsm0338 import is_gsm_text |
|||
|
|||
__all__ = ("SmsSubmit", "SmsDeliver", "is_gsm_text") |
|||
@ -1,13 +1,14 @@ |
|||
{% extends 'base_delete_modal.html' %} |
|||
{% load i18n %} |
|||
<form role="form" action="{% url 'group_app:del' object.pk %}" method="post">{% csrf_token %} |
|||
<div class="modal-header warning"> |
|||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> |
|||
<h4 class="modal-title"><span class="glyphicon glyphicon-list-alt"></span>{% trans 'Remove group' %}</h4> |
|||
</div> |
|||
<div class="modal-body"> |
|||
|
|||
{% block modal_form_url %} |
|||
{% url 'group_app:del' object.pk %} |
|||
{% endblock %} |
|||
|
|||
{% block modal_form_title %} |
|||
{% trans 'Remove group' %} |
|||
{% endblock %} |
|||
|
|||
{% block modal_form_text %} |
|||
<h4>{% blocktrans %}Are you sure you want to delete group {{ object }}?{% endblocktrans %}</h4> |
|||
<button type="submit" class="btn btn-danger" value="DELETE"> |
|||
<span class="glyphicon glyphicon-remove"></span> {% trans 'Delete' %} |
|||
</button> |
|||
</div> |
|||
</form> |
|||
{% endblock %} |
|||
@ -1,7 +0,0 @@ |
|||
# See LICENSE |
|||
|
|||
from messaging.sms.submit import SmsSubmit |
|||
from messaging.sms.deliver import SmsDeliver |
|||
from messaging.sms.gsm0338 import is_gsm_text |
|||
|
|||
__all__ = ["SmsSubmit", "SmsDeliver", "is_gsm_text"] |
|||
@ -1,30 +0,0 @@ |
|||
{% load i18n %} |
|||
|
|||
<form role="form" action="{% url 'tarifs:del' tid %}" method="post"> {% csrf_token %} |
|||
<div class="modal-header warning"> |
|||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> |
|||
<h4 class="modal-title"><span class="glyphicon glyphicon-exclamation-sign"></span>{% trans 'Delete service' %}</h4> |
|||
</div> |
|||
|
|||
{% include 'message_block.html' %} |
|||
|
|||
<div class="modal-body"> |
|||
<div class="form-group-sm"> |
|||
<label for="id_dev">{% trans 'Attention' %}</label> |
|||
<p>{% blocktrans %}after delete the tariff, subscribers who use that tariff will be disconnected from it.{% endblocktrans %}</p> |
|||
|
|||
<input type="hidden" name="confirm" value="yes"> |
|||
|
|||
</div> |
|||
|
|||
<div class="btn-group"> |
|||
<button type="submit" class="btn btn-sm btn-danger"> |
|||
<span class="glyphicon glyphicon-remove"></span> {% trans 'Delete' %} |
|||
</button> |
|||
<button type="reset" class="btn btn-sm btn-default"> |
|||
<span class="glyphicon glyphicon-retweet"></span> {% trans 'Reset' %} |
|||
</button> |
|||
</div> |
|||
</div> |
|||
|
|||
</form> |
|||
@ -0,0 +1,15 @@ |
|||
{% extends 'base_delete_modal.html' %} |
|||
{% load i18n %} |
|||
|
|||
{% block modal_form_url %} |
|||
{% url 'tarifs:del' tid %} |
|||
{% endblock %} |
|||
|
|||
{% block modal_form_title %} |
|||
{% trans 'Delete service' %} |
|||
{% endblock %} |
|||
|
|||
{% block modal_form_text %} |
|||
<label>{% trans 'Are you sure you want to delete tariff?' %}</label> |
|||
<p>{% blocktrans %}after delete the tariff, subscribers who use that tariff will be disconnected from it.{% endblocktrans %}</p> |
|||
{% endblock %} |
|||
@ -0,0 +1,19 @@ |
|||
{% load i18n %} |
|||
<form role="form" action="{% block modal_form_url %}#modal_url{% endblock %}" method="post">{% csrf_token %} |
|||
<div class="modal-header warning"> |
|||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> |
|||
<h4 class="modal-title"> |
|||
<span class="glyphicon glyphicon-earphone"></span> |
|||
{% block modal_form_title %}Form title{% endblock %} |
|||
</h4> |
|||
</div> |
|||
<div class="modal-body"> |
|||
{% block modal_form_text %} |
|||
<h4>{% trans 'Are you sure about them?' %}</h4> |
|||
{% endblock %} |
|||
<button type="submit" class="btn btn-danger" value="DELETE"> |
|||
<span class="glyphicon glyphicon-remove"></span> |
|||
{% block modal_btn_delete_text %}{% trans 'Delete' %}{% endblock %} |
|||
</button> |
|||
</div> |
|||
</form> |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue