Skip to content
Snippets Groups Projects
Commit 156ea777 authored by PavelBegunkov's avatar PavelBegunkov
Browse files

to be continued

parent 4640893c
Branches
Tags
No related merge requests found
......@@ -11,7 +11,7 @@
<select class="SelectStudyGroup default_select">
<option value="0">Выберите группу:</option>
{% for Group in StudyGroups %}
<option value="{{ Group.GroupID }}">Группа {{ Group.GroupNum }} - {{ Group.SpecName }}</option>
<option value="{{ Group.GroupID }}">Группа {{ Group.GroupNum }}{% if Group.SpecName is not null %} - {{ Group.SpecName }}{% endif %}</option>
{% endfor %}
</select>
<button class="AttachGroupButton default_BlueButton">Прикрепить группу</button>
......@@ -20,7 +20,7 @@
<h2 class="BlueTitle">Прикрепленные группы</h2>
{% for Group in GroupsForDiscipline %}
<div class="AttachedGroup" id="{{ Group.GroupID }}">
<div class="StudyGroupInfo">Курс {{ Group.GroupGrade }}, Группа {{ Group.GroupNum }} - {{ Group.SpecName }}</div>
<div class="StudyGroupInfo">Группа {{ Group.GroupNum }}{% if Group.SpecName is not null %} - {{ Group.SpecName }}{% endif %}</div>
<div class="UnbindGroup">Отсоединить группу</div>
</div>
{% endfor %}
......
......@@ -4,18 +4,18 @@ $(function() {
// Изменения базовых параметров дисциплины
$(".AddDiscipline").click(function(){
$(this).attr("disabled", true);
var main = $(".main_content");
var main = $(this).parent().parent();
var BonusRate = main.find(".BonusRate").first().prop("checked");
$.post(
URLdir + 'handler/map/AddDiscipline',
{
'Grade': main.find('.SelectGrade').first().val(),
'SubjectID': main.find('.SelectSubject').first().val(),
'Grade': main.find('select.SelectGrade').first().val(),
'SubjectID': main.find('select.SelectSubject').first().val(),
'BonusRate': BonusRate,
'ExamType': main.find('input:radio[name=ExamType]:checked').first().val(),
'LectionCount': main.find('.InputLectionCount').first().val(),
'PracticeCount': main.find('.InputPracticeCount').first().val(),
'FacultyID': main.find('.SelectFaculty').first().val()
'ExamType': main.find('input.InputText').filter(':radio:checked').first().val(),
'LectionCount': main.find('input.InputLectionCount').first().val(),
'PracticeCount': main.find('input.InputPracticeCount').first().val(),
'FacultyID': main.find('select.SelectFaculty').first().val()
},
function(data){
data = $.parseJSON(data);
......
......@@ -2,14 +2,15 @@ var $ = jQuery;
$(function() {
// ---- Изменения базовых параметров дисциплины ---
var main = $('div.main_content');
// Изменение предмета
$('.SelectSubject').change(function(){
main.find('select.SelectSubject').change(function(){
$.post(
URLdir + 'handler/map/ChangeDisciplineSubject',
{
'DisciplineID': DisciplineID,
'SubjectID': $('.SelectSubject').val()
'SubjectID': $(this).val()
},
function(data) {
data = $.parseJSON(data);
......@@ -21,12 +22,12 @@ $(function() {
});
// Изменение курса
$('.SelectDisGrade').change(function(){ // SelectGrade совпадает с другим, поэтому SelectDisGrade
main.find('select.SelectDisGrade').change(function(){ // SelectGrade совпадает с другим, поэтому SelectDisGrade
$.post(
URLdir + 'handler/map/ChangeDisciplineGrade',
{
'DisciplineID': DisciplineID,
'GradeID': $('.SelectDisGrade').val()
'GradeID': $(this).val()
},
function(data) {
data = $.parseJSON(data);
......@@ -38,20 +39,19 @@ $(function() {
});
// Бонусные баллы
$('.BonusRate').change(function(){
main.find('input.BonusRate').change(function(){
$.post(
URLdir + 'handler/map/ChangeStatusBonusModule',
{
'DisciplineID': DisciplineID,
'BonusRate': $(".BonusRate").prop("checked")
'BonusRate': $(this).prop("checked")
},
function(data) {
data = $.parseJSON(data);
if(data.success === true) {
if (data.action == 'add')
EventInspector_ShowMsg('Бонусные баллы добавлены', 'success');
if (data.action == 'delete')
EventInspector_ShowMsg('Бонусные баллы удалены', 'success');
var message = (data.action == 'add')? 'Бонусные баллы добавлены'
: 'Бонусные баллы удалены';
EventInspector_ShowMsg(message, 'success');
}
else EventInspector_ShowMsg('Ошибка: Бонусные баллы', 'error');
}
......@@ -59,12 +59,12 @@ $(function() {
});
// Изменение контроля
$('.ExamType').change(function(){
main.find('input.ExamType').change(function(){
$.post(
URLdir + 'handler/map/ChangeDisciplineControl',
{
'DisciplineID': DisciplineID,
'Control': $('input:radio[name=ExamType]:checked').val()
'Control': $(this).val()
},
function(data) {
data = $.parseJSON(data);
......@@ -75,14 +75,20 @@ $(function() {
);
});
LessonType = {
Practice: '0',
Lection: '1'
};
// Изменение лекционных часов
$('.InputLectionCount').focusout(function(){
main.find('input.InputLectionCount').focusout(function(){
$.post(
URLdir + 'handler/map/ChangeDisciplineHours',
{
'DisciplineID': DisciplineID,
'Hours': $('.InputLectionCount').val(),
'Type': '1'
'Hours': $(this).val(),
'Type': LessonType.Lection
},
function(data) {
data = $.parseJSON(data);
......@@ -94,13 +100,13 @@ $(function() {
});
// Изменение практических часов
$('.InputPracticeCount').focusout(function(){
main.find('input.InputPracticeCount').focusout(function(){
$.post(
URLdir + 'handler/map/ChangeDisciplineHours',
{
'DisciplineID': DisciplineID,
'Hours': $('.InputPracticeCount').val(),
'Type': '0'
'Hours': $(this).val(),
'Type': LessonType.Practice
},
function(data) {
data = $.parseJSON(data);
......
......@@ -12,7 +12,7 @@ $(function() {
function GetSubjectsList()
{
var FacultyID = 0;
var optionVal = parseInt($('.SelectFaculty option:selected').val());
var optionVal = parseInt($('select.SelectFaculty').children('option:selected').val());
if (optionVal <= 0)
return;
......@@ -77,10 +77,8 @@ $(function() {
var size = (SortSubjects.Count > 4)?'4':'2';
SelectSubject.attr('size', size);
}
else {
SelectSubject.append('<option disabled>По запросу ничего не найдено.</option>');
SelectSubject.attr('size', '2');
}
else
SelectSubject.append('<option disabled>По запросу ничего не найдено.</option>').attr('size', '2');
SelectSubject.show();
});
......@@ -110,12 +108,10 @@ $(function() {
});
{
var jTemp = $('.HiddenInputFacultyID').first();
if (jTemp) {
FacultyID = jTemp.val(); // Факультет, к которой привязана дисциплина
jTemp.remove(); // Тут даже Шерлок Холмс бессилен
}
var jTemp = $('.HiddenInputFacultyID').first();
if (jTemp) {
FacultyID = jTemp.val(); // Факультет, к которой привязана дисциплина
jTemp.remove(); // Тут даже Шерлок Холмс бессилен
}
})
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment