Skip to content
Snippets Groups Projects
Commit 28574724 authored by Andrew Rudenets's avatar Andrew Rudenets
Browse files
parents 2e71f38f 2b4d4bf1
Branches
Tags
No related merge requests found
......@@ -10,6 +10,7 @@
{% block main_content %}
<div class="pageProfileSettings">
<div class="settingsSection">
<p>Логин может состоять из латинских букв, цифр и знаков: - и _</p>
<div class="itemBlock">
<div class="title">Логин:</div>
<div class="field"><input type="text" class="inputLogin inputText" value="{{ User.Login }}"></div>
......@@ -26,7 +27,7 @@
<div class="title">Новый адрес:</div>
<div class="field"><input type="text" class="inputNewEmail inputText" value=""></div>
</div>
<button class="changeEmail saveSettings">Сохранить адрес</button>
<button class="changeEmail saveSettings">Сохранить адрес not work now</button>
</div>
<div class="settingsSection">
......@@ -34,6 +35,7 @@
<div class="title">Старый пароль:</div>
<div class="field"><input type="text" class="inputCurrentPass inputText" value=""></div>
</div>
<p>Пароль должен состоять из 5 и более символов</p>
<div class="itemBlock">
<div class="title">Новый пароль:</div>
<div class="field"><input type="text" class="inputNewPass inputText" value=""></div>
......
......@@ -2,56 +2,16 @@
padding: 0 25px;
}
h2.profileName {
display: inline;
float: left;
width: 50%;
font-size: 28px;
font-weight: normal;
color: #3399CC;
line-height: 160%;
}
p.level {
display: inline;
float: right;
width: 50%;
text-align: right;
font-size: 18px;
color: #363636;
line-height: 160%;
}
p.smallNotice {
clear: both;
padding-bottom: 15px;
font-size: 14px;
color: #666;
line-height: 160%;
}
.smallNotice a{
color: red;
}
.blockReport {
display: none;
background: #f4f4f4;
padding: 20px;
}
.blockReport textarea {
width: 900px;
height: 90px;
padding: 5px;
resize: vertical;
}
.blockReport .sendReport {
float: right
}
.settingsSection {
position: relative;
margin: 0 auto;
margin-bottom: 10px;
width: 500px;
}
/* Подсказка */
.settingsSection p{
text-align: center; font-size: 15px;
}
.settingsSection .itemBlock {
margin: 25px 0px;
}
......
var $ = jQuery;
$(function() {
var tdClass = new Array();;
var isFocusCell = false; //
var isFocusCell = false; // Стоит фокус или нет
var oldRateCell;
//
// Ставим фокус
function tdFocus(thisObj, thisClass){
tdClass = thisClass.split(' ');
oldRateCell = thisObj.children('input').val();
$('.'+tdClass[0]).each(function(){
$(this).css('background-color', '#f1f1f1');
});
......@@ -14,8 +16,9 @@ $(function() {
});
}
//
// Убираем фокус
function tdUnFocus(thisObj){
oldRateCell = undefined;
$('.'+tdClass[0]).each(function(){
$(this).css('background-color', '#fff');
});
......@@ -24,39 +27,36 @@ $(function() {
});
}
function Rating($this) {
function Rating(thisObj) {
// Получаем подмодуль
var reg = /col_\d+/;
var col = ''+reg.exec($this.attr('class'));
var col = ''+reg.exec(thisObj.attr('class'));
col = $('.'+col+':first').attr('id');
// Получаем студента
var reg = /row_\d+/;
var row = ''+reg.exec($this.attr('class'));
var row = ''+reg.exec(thisObj.attr('class'));
row = $('.'+row+':first').attr('id');
alert(col+' '+row+' '+$this.children('input').val());
var edit = false; // Типа говорим, что балл нужно добавить, а не изменить
if (-1 < $this.attr('class').indexOf('edit'))
if (-1 < thisObj.attr('class').indexOf('edit'))
edit = true; // Типа изменить балл
if (edit) {
alert('changeRate');
$.post('/~dev_rating/handler/rating/changeRate', {'student': row, 'submodule': col, 'rate': $this.children('input').val() },
function(data){
alert(data);
}
);
}
else {
alert('setRate');
$.post('/~dev_rating/handler/rating/setRate', {'student': row, 'submodule': col, 'rate': $this.children('input').val() },
function(data){
alert(data);
}
);
}
if (oldRateCell != thisObj.children('input').val())
if (edit) {
$.post('/~dev_rating/handler/rating/changeRate', {'student': row, 'submodule': col, 'rate': thisObj.children('input').val() },
function(data){
alert(data);
}
);
}
else {
$.post('/~dev_rating/handler/rating/setRate', {'student': row, 'submodule': col, 'rate': thisObj.children('input').val() },
function(data){
alert(data);
}
);
}
}
$('.rateCell').mouseenter(function(){
......@@ -76,8 +76,8 @@ $(function() {
$('.rateCell').focusout(function(){
isFocusCell = false;
tdUnFocus($(this));
Rating($(this));
tdUnFocus($(this));
});
// В inputCredit (где баллы вводить) разрешаем вводить только цифры
......
......@@ -27,11 +27,10 @@ $(function() {
if (checkInput['login'] == true)
$.post('/~dev_rating/handler/settings/changeLogin', {'login': $('.inputLogin').val()},
function(data){
alert(data);
data = $.parseJSON(data);
if(data.success === true) {
alert('Ок');
} else alert('fuck');
} else alert('Error');
}
);
});
......@@ -74,6 +73,10 @@ $(function() {
},
function(data){
alert(data);
data = $.parseJSON(data);
if(data.success === true) {
alert('Ок');
} else alert('Error');
}
);
});
......
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