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 @@ ...@@ -10,6 +10,7 @@
{% block main_content %} {% block main_content %}
<div class="pageProfileSettings"> <div class="pageProfileSettings">
<div class="settingsSection"> <div class="settingsSection">
<p>Логин может состоять из латинских букв, цифр и знаков: - и _</p>
<div class="itemBlock"> <div class="itemBlock">
<div class="title">Логин:</div> <div class="title">Логин:</div>
<div class="field"><input type="text" class="inputLogin inputText" value="{{ User.Login }}"></div> <div class="field"><input type="text" class="inputLogin inputText" value="{{ User.Login }}"></div>
...@@ -26,7 +27,7 @@ ...@@ -26,7 +27,7 @@
<div class="title">Новый адрес:</div> <div class="title">Новый адрес:</div>
<div class="field"><input type="text" class="inputNewEmail inputText" value=""></div> <div class="field"><input type="text" class="inputNewEmail inputText" value=""></div>
</div> </div>
<button class="changeEmail saveSettings">Сохранить адрес</button> <button class="changeEmail saveSettings">Сохранить адрес not work now</button>
</div> </div>
<div class="settingsSection"> <div class="settingsSection">
...@@ -34,6 +35,7 @@ ...@@ -34,6 +35,7 @@
<div class="title">Старый пароль:</div> <div class="title">Старый пароль:</div>
<div class="field"><input type="text" class="inputCurrentPass inputText" value=""></div> <div class="field"><input type="text" class="inputCurrentPass inputText" value=""></div>
</div> </div>
<p>Пароль должен состоять из 5 и более символов</p>
<div class="itemBlock"> <div class="itemBlock">
<div class="title">Новый пароль:</div> <div class="title">Новый пароль:</div>
<div class="field"><input type="text" class="inputNewPass inputText" value=""></div> <div class="field"><input type="text" class="inputNewPass inputText" value=""></div>
......
...@@ -2,56 +2,16 @@ ...@@ -2,56 +2,16 @@
padding: 0 25px; 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 { .settingsSection {
position: relative; position: relative;
margin: 0 auto; margin: 0 auto;
margin-bottom: 10px; margin-bottom: 10px;
width: 500px; width: 500px;
} }
/* Подсказка */
.settingsSection p{
text-align: center; font-size: 15px;
}
.settingsSection .itemBlock { .settingsSection .itemBlock {
margin: 25px 0px; margin: 25px 0px;
} }
......
var $ = jQuery; var $ = jQuery;
$(function() { $(function() {
var tdClass = new Array();; var tdClass = new Array();;
var isFocusCell = false; // var isFocusCell = false; // Стоит фокус или нет
var oldRateCell;
// // Ставим фокус
function tdFocus(thisObj, thisClass){ function tdFocus(thisObj, thisClass){
tdClass = thisClass.split(' '); tdClass = thisClass.split(' ');
oldRateCell = thisObj.children('input').val();
$('.'+tdClass[0]).each(function(){ $('.'+tdClass[0]).each(function(){
$(this).css('background-color', '#f1f1f1'); $(this).css('background-color', '#f1f1f1');
}); });
...@@ -14,8 +16,9 @@ $(function() { ...@@ -14,8 +16,9 @@ $(function() {
}); });
} }
// // Убираем фокус
function tdUnFocus(thisObj){ function tdUnFocus(thisObj){
oldRateCell = undefined;
$('.'+tdClass[0]).each(function(){ $('.'+tdClass[0]).each(function(){
$(this).css('background-color', '#fff'); $(this).css('background-color', '#fff');
}); });
...@@ -24,39 +27,36 @@ $(function() { ...@@ -24,39 +27,36 @@ $(function() {
}); });
} }
function Rating($this) { function Rating(thisObj) {
// Получаем подмодуль // Получаем подмодуль
var reg = /col_\d+/; var reg = /col_\d+/;
var col = ''+reg.exec($this.attr('class')); var col = ''+reg.exec(thisObj.attr('class'));
col = $('.'+col+':first').attr('id'); col = $('.'+col+':first').attr('id');
// Получаем студента // Получаем студента
var reg = /row_\d+/; var reg = /row_\d+/;
var row = ''+reg.exec($this.attr('class')); var row = ''+reg.exec(thisObj.attr('class'));
row = $('.'+row+':first').attr('id'); row = $('.'+row+':first').attr('id');
alert(col+' '+row+' '+$this.children('input').val());
var edit = false; // Типа говорим, что балл нужно добавить, а не изменить var edit = false; // Типа говорим, что балл нужно добавить, а не изменить
if (-1 < $this.attr('class').indexOf('edit')) if (-1 < thisObj.attr('class').indexOf('edit'))
edit = true; // Типа изменить балл edit = true; // Типа изменить балл
if (edit) { if (oldRateCell != thisObj.children('input').val())
alert('changeRate'); if (edit) {
$.post('/~dev_rating/handler/rating/changeRate', {'student': row, 'submodule': col, 'rate': $this.children('input').val() }, $.post('/~dev_rating/handler/rating/changeRate', {'student': row, 'submodule': col, 'rate': thisObj.children('input').val() },
function(data){ function(data){
alert(data); alert(data);
} }
); );
} }
else { else {
alert('setRate'); $.post('/~dev_rating/handler/rating/setRate', {'student': row, 'submodule': col, 'rate': thisObj.children('input').val() },
$.post('/~dev_rating/handler/rating/setRate', {'student': row, 'submodule': col, 'rate': $this.children('input').val() }, function(data){
function(data){ alert(data);
alert(data); }
} );
); }
}
} }
$('.rateCell').mouseenter(function(){ $('.rateCell').mouseenter(function(){
...@@ -76,8 +76,8 @@ $(function() { ...@@ -76,8 +76,8 @@ $(function() {
$('.rateCell').focusout(function(){ $('.rateCell').focusout(function(){
isFocusCell = false; isFocusCell = false;
tdUnFocus($(this));
Rating($(this)); Rating($(this));
tdUnFocus($(this));
}); });
// В inputCredit (где баллы вводить) разрешаем вводить только цифры // В inputCredit (где баллы вводить) разрешаем вводить только цифры
......
...@@ -27,11 +27,10 @@ $(function() { ...@@ -27,11 +27,10 @@ $(function() {
if (checkInput['login'] == true) if (checkInput['login'] == true)
$.post('/~dev_rating/handler/settings/changeLogin', {'login': $('.inputLogin').val()}, $.post('/~dev_rating/handler/settings/changeLogin', {'login': $('.inputLogin').val()},
function(data){ function(data){
alert(data);
data = $.parseJSON(data); data = $.parseJSON(data);
if(data.success === true) { if(data.success === true) {
alert('Ок'); alert('Ок');
} else alert('fuck'); } else alert('Error');
} }
); );
}); });
...@@ -74,6 +73,10 @@ $(function() { ...@@ -74,6 +73,10 @@ $(function() {
}, },
function(data){ function(data){
alert(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