From 91c3f437f5c05aedbee15230fd9a091992522270 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=A0=D1=83=D0=B4?= =?UTF-8?q?=D0=B5=D0=BD=D0=B5=D1=86?= <andrey.rudenets@gmail.com> Date: Fri, 12 Sep 2014 11:33:36 +0400 Subject: [PATCH] =?UTF-8?q?FIX:=20=D1=80=D0=B5=D0=B4=D0=B0=D0=BA=D1=82?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BF=D1=80?= =?UTF-8?q?=D0=BE=D1=84=D0=B8=D0=BB=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../classes/Controller/Teacher/Profile.php | 1 + .../application/views/profile/settings.twig | 10 +++--- ~dev_rating/media/css/inputGroup.css | 19 ++---------- ~dev_rating/media/js/config.js | 3 +- ~dev_rating/media/js/profileSettings.js | 31 ++++++++++++++++--- 5 files changed, 38 insertions(+), 26 deletions(-) diff --git a/~dev_rating/application/classes/Controller/Teacher/Profile.php b/~dev_rating/application/classes/Controller/Teacher/Profile.php index dbabce6a7..ebbed6967 100644 --- a/~dev_rating/application/classes/Controller/Teacher/Profile.php +++ b/~dev_rating/application/classes/Controller/Teacher/Profile.php @@ -6,6 +6,7 @@ class Controller_Teacher_Profile extends Controller_UserEnvi { $twig = Twig::factory('profile/settings'); $twig->JobPositions = $this->getJobPositions(); $twig->Faculties = $this->getFaculties(); + $twig->Departments = DataArray::factory('Departments')->byFaculty($this->UserInfo['FacultyID']); $twig->User = $this->UserInfo; $this->response->body($twig); } diff --git a/~dev_rating/application/views/profile/settings.twig b/~dev_rating/application/views/profile/settings.twig index c42b1a359..e93a62824 100644 --- a/~dev_rating/application/views/profile/settings.twig +++ b/~dev_rating/application/views/profile/settings.twig @@ -28,19 +28,19 @@ <a href="settings.twig"></a> <div class="inputGroup_input"> <select id="jobPositionSelect"> - <option value="0">--- Академическая должность ---</option> {% for row in JobPositions %} - <option value="{{ row.ID }}" {% if User.JobPositionName == row.Name %}selected="selected"{% endif %}>{{ row.Name }}</option> + <option value="{{ row.ID }}" {% if User.JobPositionName == row.Name %}selected="selected"{% endif %}>{{ row.Name }}</option> {% endfor %} </select> <select id="facultySelect"> - <option value="0">--- Подразделение ЮФУ ---</option> {% for row in Faculties %} - <option value="{{ row.ID }}" {% if User.JobPositionName == row.Name %}selected="selected"{% endif %}>{{ row.Name }} ({{ row.Abbr }})</option> + <option value="{{ row.ID }}" {% if User.FacultyName == row.Name %}selected="selected"{% endif %}>{{ row.Name }} ({{ row.Abbr }})</option> {% endfor %} </select> <select id="departmentSelect"> - <option value="0">--- Кафедра ---</option> + {% for row in Departments %} + <option value="{{ row.ID }}" {% if User.DepID == row.ID %}selected="selected"{% endif %}>{{ row.Name }}</option> + {% endfor %} </select> </div> </div> diff --git a/~dev_rating/media/css/inputGroup.css b/~dev_rating/media/css/inputGroup.css index d14ad9ef9..e8d45d5b7 100644 --- a/~dev_rating/media/css/inputGroup.css +++ b/~dev_rating/media/css/inputGroup.css @@ -40,21 +40,8 @@ .inputGroup_submit button { - border: 0; - width: 80%; - padding: 6px 20px; - background: #3A84A6; - font-weight: bold; - font-size: 13px; - color: #ffffff; - border-radius: 3px; - moz-border-radius: 3px; - -webkit-border-radius: 3px; - -khtml-border-radius: 3px; -} - -.inputGroup_submit button:hover { - background: #3399CC; - cursor: pointer; + border: 1px solid #ddd; + padding: 4px; + width: 95%; } diff --git a/~dev_rating/media/js/config.js b/~dev_rating/media/js/config.js index 4ba9d44e6..3230ff9e3 100644 --- a/~dev_rating/media/js/config.js +++ b/~dev_rating/media/js/config.js @@ -1 +1,2 @@ -var URLdir = '/~dev_rating/'; \ No newline at end of file +var URLdir = '/~dev_rating/'; +var sitePath = 'http://mmcs.sfedu.ru/rating'; \ No newline at end of file diff --git a/~dev_rating/media/js/profileSettings.js b/~dev_rating/media/js/profileSettings.js index 3a7594d21..39d7f2095 100644 --- a/~dev_rating/media/js/profileSettings.js +++ b/~dev_rating/media/js/profileSettings.js @@ -1,13 +1,11 @@ $(function() { - $("#facultySelect [value='0']").attr('selected', 'selected'); - $('#departmentSelect').attr('disabled', 'disabled'); - $("#departmentSelect [value='0']").attr('selected', 'selected'); $('#inputGroupSubmit').attr('disabled', 'disabled'); // Выбор факультета $('#facultySelect').change(function(){ if (($('#facultySelect option:selected').val()!= '0')) { - $("#departmentSelect").html('<option value="0">--- Кафедра ---</option>'); + $('#inputGroupSubmit').removeAttr('disabled'); + $("#departmentSelect").html(''); $('#departmentSelect').attr('disabled', 'disabled'); $.post(URLdir + 'handler/settings/getDepartmentsList', {'facultyID': $('#facultySelect option:selected').val()}, function(data){ $.each(data, function(i){ @@ -22,12 +20,36 @@ $(function() } }); + $('#firstName').change(function(){ + if (($('#firstName').val()!= '0')) { + $('#inputGroupSubmit').removeAttr('disabled'); + } + }); + + $('#secondName').change(function(){ + if (($('#secondName').val()!= '0')) { + $('#inputGroupSubmit').removeAttr('disabled'); + } + }); + + $('#lastName').change(function(){ + if (($('#lastName').val()!= '0')) { + $('#inputGroupSubmit').removeAttr('disabled'); + } + }); + $('#departmentSelect').change(function(){ if (($('#departmentSelect option:selected').val()!= '0')) { $('#inputGroupSubmit').removeAttr('disabled'); } }); + $('#jobPositionSelect').change(function(){ + if (($('#jobPositionSelect option:selected').val()!= '0')) { + $('#inputGroupSubmit').removeAttr('disabled'); + } + }); + $('#inputGroupSubmit').click(function(){ $('#inputGroupSubmit').attr('disabled', 'disabled'); $.post(URLdir + 'handler/settings/editProfile', @@ -45,6 +67,7 @@ $(function() }); $('.inputGroupMessages').append('</ul>'); $('#inputGroupSubmit').removeAttr('disabled'); + window.location.href = sitePath; }, "json"); }); }); \ No newline at end of file -- GitLab