25 changed files with 357 additions and 8010 deletions
-
6abonapp/models.py
-
17accounts_app/views.py
-
1ip_pool/models.py
-
1ip_pool/views.py
-
7027static/css/bootstrap.min.css
-
72static/css/custom.css
-
709static/js/bootstrap.min.js
-
201static/js/my.js
-
2taskapp/context_proc.py
-
9taskapp/forms.py
-
8taskapp/handle.sh
-
38taskapp/models.py
-
1taskapp/urls.py
-
79taskapp/views.py
-
6templates/accounts/acc_list.html
-
14templates/accounts/ext.htm
-
43templates/accounts/profile_chgroup.html
-
7templates/base.html
-
20templates/taskapp/add_edit_task.html
-
12templates/taskapp/tasklist.html
-
13templates/taskapp/tasklist_active.html
-
12templates/taskapp/tasklist_all.html
-
13templates/taskapp/tasklist_finish.html
-
13templates/taskapp/tasklist_own.html
-
43templates/taskapp/view.html
7027
static/css/bootstrap.min.css
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
709
static/js/bootstrap.min.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -1,120 +1,125 @@ |
|||
function errShow(errContent) { |
|||
//window.history.back();
|
|||
//window.history.back();
|
|||
|
|||
$('#modContent').html('<div class="modal-header warning">\ |
|||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>\ |
|||
<h4 class="modal-title" id="myModalLabel"><span class="glyphicon glyphicon-warning-sign"></span>\ |
|||
Ошибка\ |
|||
$('#modContent').html('<div class="modal-header warning">\ |
|||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>\ |
|||
<h4 class="modal-title" id="myModalLabel"><span class="glyphicon glyphicon-warning-sign"></span>\ |
|||
Ошибка\ |
|||
</h4>\ |
|||
</div>\ |
|||
<div class="modal-body">' + |
|||
errContent |
|||
+ '</div>\ |
|||
errContent |
|||
+ '</div>\ |
|||
<div class="modal-footer">\ |
|||
<button type="button" class="btn btn-default" data-dismiss="modal">Закрыть</button>\ |
|||
<button type="button" class="btn btn-default" data-dismiss="modal">Закрыть</button>\ |
|||
</div>'); |
|||
$('#modFrm').modal(); |
|||
$('#modFrm').modal(); |
|||
|
|||
} |
|||
|
|||
$(document).ajaxError(function (ev, jqXHR, ajaxSettings, thrownError) { |
|||
//loaderShow(false);
|
|||
errShow(jqXHR.status + ': ' + jqXHR.statusText); |
|||
//loaderShow(false);
|
|||
errShow(jqXHR.status + ': ' + jqXHR.statusText); |
|||
}); |
|||
|
|||
|
|||
// SelectAjax
|
|||
(function ($) { |
|||
$.fn.selectajax = function (opt) { |
|||
|
|||
var settings = $.extend( { |
|||
url : '/api' |
|||
}, opt); |
|||
|
|||
var selectbtn = this.children('button.selectajax-btn'); |
|||
var selectinp = this.children('input[type=text].selectajax-inp'); |
|||
var selecthid = this.children('input[type=hidden].selectajax-hid'); |
|||
var selectul = this.children('ul.selectajax-ul'); |
|||
|
|||
var selectajax_click = function(){ |
|||
var a = $(this).children('a'); |
|||
var hr = a.attr('href'); |
|||
var tx = a.text(); |
|||
selecthid.val(hr.substr(1)); |
|||
console.debug(tx); |
|||
selectbtn.text(tx).removeClass('hidden'); |
|||
selectinp.addClass('hidden').val(tx); |
|||
}; |
|||
|
|||
var refresh = function(){ |
|||
$.getJSON(settings.url, {'s': this.value}, function (r) { |
|||
selectul.empty(); |
|||
r.forEach(function (o) { |
|||
var li = $('<li><a href="#' + o.id + '">' + o.name + ": " + o.fio + '</a></li>'); |
|||
selectul.append(li); |
|||
li.on('click', selectajax_click) |
|||
}); |
|||
}); |
|||
}; |
|||
|
|||
selectinp.on('keyup', refresh).on('focusin',refresh); |
|||
|
|||
selectbtn.on('click',function(){ |
|||
selectinp.removeClass('hidden'); |
|||
$(this).addClass('hidden'); |
|||
selectinp.focus().trigger('click.bs.dropdown'); |
|||
return false; |
|||
}); |
|||
|
|||
selectul.children().on('click', selectajax_click); |
|||
}; |
|||
$.fn.selectajax = function (opt) { |
|||
|
|||
var settings = $.extend( { |
|||
url : '/api' |
|||
}, opt); |
|||
|
|||
var selectbtn = this.children('button.selectajax-btn'); |
|||
var selectinp = this.children('input[type=text].selectajax-inp'); |
|||
var selecthid = this.children('input[type=hidden].selectajax-hid'); |
|||
var selectul = this.children('ul.selectajax-ul'); |
|||
|
|||
var selectajax_click = function(){ |
|||
var a = $(this).children('a'); |
|||
var hr = a.attr('href'); |
|||
var tx = a.text(); |
|||
selecthid.val(hr.substr(1)); |
|||
console.debug(tx); |
|||
selectbtn.text(tx).removeClass('hidden'); |
|||
selectinp.addClass('hidden').val(tx); |
|||
}; |
|||
|
|||
var refresh = function(){ |
|||
$.getJSON(settings.url, {'s': this.value}, function (r) { |
|||
selectul.empty(); |
|||
r.forEach(function (o) { |
|||
var li = $('<li><a href="#' + o.id + '">' + o.name + ": " + o.fio + '</a></li>'); |
|||
selectul.append(li); |
|||
li.on('click', selectajax_click) |
|||
}); |
|||
}); |
|||
}; |
|||
|
|||
selectinp.on('keyup', refresh).on('focusin',refresh); |
|||
|
|||
selectbtn.on('click',function(){ |
|||
selectinp.removeClass('hidden'); |
|||
$(this).addClass('hidden'); |
|||
selectinp.focus().trigger('click.bs.dropdown'); |
|||
return false; |
|||
}); |
|||
|
|||
selectul.children().on('click', selectajax_click); |
|||
}; |
|||
})(jQuery); |
|||
|
|||
|
|||
$(document).ready(function () { |
|||
|
|||
// ajax tabs
|
|||
$('.nav-tabs a').on('show.bs.tab', function (e) { |
|||
var ct = $(e.target).attr('href'); |
|||
var remoteUrl = $(this).attr('data-tab-remote'); |
|||
if (remoteUrl !== '') { |
|||
$(ct).load(remoteUrl); |
|||
} |
|||
}); |
|||
|
|||
// Live html5 image preview
|
|||
if (window.File && window.FileReader && window.FileList && window.Blob) { |
|||
$('input[type=file].live_review').on('change', function () { |
|||
var reader = new FileReader(); |
|||
var img = $('img[alt=ava]')[0]; |
|||
reader.readAsDataURL(this.files[0]); |
|||
reader.onload = function (e) { |
|||
img.src = e.target.result; |
|||
} |
|||
}); |
|||
} else { |
|||
console.warn("Ваш браузер не поддерживает FileAPI"); |
|||
} |
|||
|
|||
|
|||
// Validate inputs of form
|
|||
$('input.form-control[pattern]').keyup(function () { |
|||
var pr = $(this).closest('.form-group-sm,.form-group'); |
|||
pr.removeClass('has-success'); |
|||
pr.removeClass('has-error'); |
|||
pr.find('.form-control-feedback').remove(); |
|||
if ($(this)[0].checkValidity()) { |
|||
pr.addClass('has-success'); |
|||
$(this).after('<span class="glyphicon glyphicon-ok form-control-feedback"></span>'); |
|||
} else { |
|||
pr.addClass('has-error'); |
|||
$(this).after('<span class="glyphicon glyphicon-remove form-control-feedback"></span>'); |
|||
} |
|||
}); |
|||
|
|||
|
|||
$('div.selectajax').selectajax({ |
|||
url: '/abons/api/abon_filter' |
|||
}); |
|||
|
|||
// ajax tabs
|
|||
$('.nav-tabs a').on('show.bs.tab', function (e) { |
|||
var ct = $(e.target).attr('href'); |
|||
var remoteUrl = $(this).attr('data-tab-remote'); |
|||
if (remoteUrl !== '') { |
|||
$(ct).load(remoteUrl); |
|||
} |
|||
}); |
|||
|
|||
// Live html5 image preview
|
|||
if (window.File && window.FileReader && window.FileList && window.Blob) { |
|||
$('input[type=file].live_review').on('change', function () { |
|||
var reader = new FileReader(); |
|||
var img = $('img[alt=ava]')[0]; |
|||
reader.readAsDataURL(this.files[0]); |
|||
reader.onload = function (e) { |
|||
img.src = e.target.result; |
|||
} |
|||
}); |
|||
} else { |
|||
var t = "Ваш браузер не поддерживает FileAPI"; |
|||
console.warn(t); |
|||
alert(t); |
|||
} |
|||
|
|||
|
|||
// Validate inputs of form
|
|||
$('input.form-control[pattern]').keyup(function () { |
|||
var pr = $(this).closest('.form-group-sm,.form-group'); |
|||
pr.removeClass('has-success'); |
|||
pr.removeClass('has-error'); |
|||
pr.find('.form-control-feedback').remove(); |
|||
if ($(this)[0].checkValidity()) { |
|||
pr.addClass('has-success'); |
|||
$(this).after('<span class="glyphicon glyphicon-ok form-control-feedback"></span>'); |
|||
} else { |
|||
pr.addClass('has-error'); |
|||
$(this).after('<span class="glyphicon glyphicon-remove form-control-feedback"></span>'); |
|||
} |
|||
}); |
|||
|
|||
|
|||
$('div.selectajax').selectajax({ |
|||
url: '/abons/api/abon_filter' |
|||
}); |
|||
|
|||
$('[data-toggle=offcanvas]').click(function () { |
|||
$('.row-offcanvas').toggleClass('active'); |
|||
}); |
|||
}); |
|||
@ -1,34 +1,23 @@ |
|||
{% extends request.is_ajax|yesno:'nullcont.htm,accounts/ext.htm' %} |
|||
{% block content %} |
|||
|
|||
<legend>Принадлежность аккаунта группам</legend> |
|||
<form action="{% url 'acc_app:profile_permissions' userprofile.id %}" method="post" role="form">{% csrf_token %} |
|||
<div class="form-group"> |
|||
<label for="sel_left">Доступные группы</label> |
|||
<select name="allgroups" multiple id="sel_left" class="form-group"> |
|||
{% for gr in allgroups %} |
|||
<option value="{{ gr.id }}">{{ gr.name }}</option> |
|||
{% endfor %} |
|||
</select> |
|||
<legend>Ответственность администратора к группам абонентов</legend> |
|||
<form action="{% url 'acc_app:profile_setup_group' userprofile.id %}" method="post" role="form">{% csrf_token %} |
|||
{% for ag in abongroups %} |
|||
<div class="checkbox"> |
|||
<label> |
|||
{% if userprofile in ag.profiles.all %} |
|||
<input name="ag" type="checkbox" value="{{ ag.id }}" checked/> |
|||
{% else %} |
|||
<input name="ag" type="checkbox" value="{{ ag.id }}"/> |
|||
{% endif %} |
|||
{{ ag.title }} |
|||
</label> |
|||
</div> |
|||
{% endfor %} |
|||
<div class="btn-group"> |
|||
<input type="submit" class="btn btn-primary" value="Сохранить"> <input type="reset" class="btn btn-default" value="Сбросить"> |
|||
</div> |
|||
<ul class="form-group"> |
|||
<li><a href="javascript:chooser_select('sel_left','sel_right');" class="btn btn-sm btn-default"> |
|||
<span class="glyphicon glyphicon-chevron-right"></span> |
|||
</a></li> |
|||
<li><a href="javascript:chooser_select('sel_right','sel_left');" class="btn btn-sm btn-default"> |
|||
<span class="glyphicon glyphicon-chevron-left"></span> |
|||
</a></li> |
|||
</ul> |
|||
<div class="form-group"> |
|||
<label for="sel_right">Группы пользователя</label> |
|||
<select name="ingroups" multiple id="sel_right" class="form-group"> |
|||
{% for gr in usergroups %} |
|||
<option value="{{ gr.id }}">{{ gr.name }}</option> |
|||
{% endfor %} |
|||
</select> |
|||
</div> |
|||
<br/> |
|||
<input type="submit" value="Сохранить"> <input type="reset" value="Сбросить"> |
|||
</form> |
|||
|
|||
{% endblock %} |
|||
@ -0,0 +1,43 @@ |
|||
{% extends request.is_ajax|yesno:'bajax.html,base.html' %} |
|||
{% block main %} |
|||
|
|||
<ol class="breadcrumb"> |
|||
<li><span class="glyphicon glyphicon-home"></span></li> |
|||
<li><a href="{% url 'taskapp:home' %}">Задачи</a></li> |
|||
<li class="active">#{{ task.id }}</li> |
|||
</ol> |
|||
|
|||
<div class="panel panel-default"> |
|||
<div class="panel-heading"> |
|||
<h3 class="panel-title">Описание задачи</h3> |
|||
</div> |
|||
<div class="panel-body"> |
|||
|
|||
<p>Описание: {{ task.descr }}</p> |
|||
Исполнители: |
|||
<ul> |
|||
{% for recipient in task.recipients.all %} |
|||
<li><a href="{% url 'acc_app:other_profile' recipient.id %}" target="_blank">{{ recipient.get_full_name }}</a></li> |
|||
{% endfor %} |
|||
</ul> |
|||
Задача действительна до {{ task.out_date|date:'d E Y' }}<br> |
|||
Дата создания {{ task.time_of_create|date:'d E Y' }}<br> |
|||
Времени осталось {{ time_diff }}<br> |
|||
Тип задачи: {{ task.get_mode_display }}<br> |
|||
Абонент |
|||
{% if task.abon %} |
|||
<a href="{% url 'abonapp:abon_home' task.abon.group.id task.abon.id %}" target="_blank">{{ task.abon.get_full_name }}</a> |
|||
{% else %} |
|||
<i><Не выбран></i> |
|||
{% endif %}<br> |
|||
{% if task.attachment %} |
|||
Приложение: |
|||
<a href="{{ task.attachment.url }}" class="thumbnail" target="_blank"> |
|||
<img src="{{ task.attachment.url }}"> |
|||
</a> |
|||
{% endif %} |
|||
|
|||
</div> |
|||
</div> |
|||
|
|||
{% endblock %} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue