From fb2abf872bdd9697eef8626218f9ab67a2321ba7 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: Sat, 30 Aug 2014 18:58:00 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D0=B3=D0=BB=D0=B0=D0=B2=D0=BD=D0=BE=D0=B9=20?= =?UTF-8?q?=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8=D1=86=D1=8B=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D0=BF=D1=80=D0=B5=D0=BF=D0=BE=D0=B4=D0=B0=D0=B2=D0=B0?= =?UTF-8?q?=D1=82=D0=B5=D0=BB=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 6 +- .../classes/Controller/Teacher/Index.php | 31 +++--- .../classes/Controller/Teacher/Rating.php | 2 +- .../classes/Controller/UserEnvi.php | 2 +- ~dev_rating/application/views/admin/base.twig | 1 + ~dev_rating/application/views/base.twig | 21 ++++ .../application/views/teacher/index.twig | 98 ++++++++++-------- ~dev_rating/deployConfig/database.php | 2 +- ~dev_rating/media/css/actionButton.css | 46 ++++++++ ~dev_rating/media/css/admin/base.css | 48 --------- ~dev_rating/media/css/base.css | 2 +- .../media/css/courses_teacher_var2.css | 55 +++------- ~dev_rating/media/img/addList.png | Bin 0 -> 1263 bytes 13 files changed, 153 insertions(+), 161 deletions(-) create mode 100644 ~dev_rating/media/css/actionButton.css create mode 100644 ~dev_rating/media/img/addList.png diff --git a/.gitignore b/.gitignore index dc422697c..d2f805b5d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,6 @@ ~dev_rating/application/cache/ ~dev_rating/application/logs/ ~dev_rating/application/config/ -~dev_rating/system/ -~dev_rating/modules/kotwig/cache/ - nbproject/ *.*~ -/.project - +/.project \ No newline at end of file diff --git a/~dev_rating/application/classes/Controller/Teacher/Index.php b/~dev_rating/application/classes/Controller/Teacher/Index.php index cd4617070..16d69cadd 100644 --- a/~dev_rating/application/classes/Controller/Teacher/Index.php +++ b/~dev_rating/application/classes/Controller/Teacher/Index.php @@ -8,34 +8,33 @@ class Controller_Teacher_Index extends Controller_UserEnvi { $model = new Model_Teacher_Index; $disciplines = $model->getDisciplinesForTeacher($this->UserInfo['TeacherID']); - $subjectsHandled = array(); $subjID = $discID = $i = $j = $k = 0; + $disciplinesHandled = array(); $subjID = $discID = $gradeNum = $i = $j = $k = 0; + $groupsInDiscipline = array(); foreach ($disciplines as $row) { - - if($subjID != $row['SubjectID']) + if($subjID != $row['SubjectID'] || $gradeNum != $row['StudyGroupGrade']) { $i++; $j = $k = 0; + $groupsInDiscipline = array(); $subjID = $row['SubjectID']; + $gradeNum = $row['StudyGroupGrade']; + $disciplinesHandled[$i]['Title'] = $row['SubjectName']; + $disciplinesHandled[$i]['GradeNum'] = $row['StudyGroupGrade']; } - $subjectsHandled['Subjects'][$i]['Title'] = $row['SubjectName']; if($discID != $row['DisciplineID']) { $j++; $k = 0; - $discID = $row['DisciplineID']; + $groupsInDiscipline = array(); + $disciplinesHandled[$i]['Disciplines'][$j]['ID'] = $discID = $row['DisciplineID']; + $disciplinesHandled[$i]['Disciplines'][$j]['ControlType'] = $this->getControlType($row['DisciplineType']); + $disciplinesHandled[$i]['Disciplines'][$j]['Teachers'] = $this->getTeachersForDiscipline($discID); } - - $subjectsHandled['Subjects'][$i]['Disciplines'][$j]['ID'] = $row['DisciplineID']; - $subjectsHandled['Subjects'][$i]['Disciplines'][$j]['GradeNum'] = $row['StudyGroupGrade']; - $subjectsHandled['Subjects'][$i]['Disciplines'][$j]['ControlType'] = $this->getControlType($row['DisciplineType']); - $subjectsHandled['Subjects'][$i]['Disciplines'][$j]['Teachers'] = $this->getTeachersForDiscipline($discID); - - $k++; - $subjectsHandled['Subjects'][$i]['Disciplines'][$j]['Groups'][$k]['Count'] = 10; - $subjectsHandled['Subjects'][$i]['Disciplines'][$j]['Groups'][$k]['Num'] = $row['StudyGroupNum']; - $subjectsHandled['Subjects'][$i]['Disciplines'][$j]['Groups'][$k]['ID'] = $row['StudyGroupID']; + if($row['StudyGroupNum'] != 0) + $groupsInDiscipline[++$k] = $row['StudyGroupGrade'].'.'.$row['StudyGroupNum']; + $disciplinesHandled[$i]['Disciplines'][$j]['Groups'] = implode(', ', $groupsInDiscipline); } - $twig->content = $subjectsHandled; + $twig->Subjects = $disciplinesHandled; $twig->User = $this->UserInfo; $this->response->body($twig); } diff --git a/~dev_rating/application/classes/Controller/Teacher/Rating.php b/~dev_rating/application/classes/Controller/Teacher/Rating.php index f8522373e..8a81eb5a8 100644 --- a/~dev_rating/application/classes/Controller/Teacher/Rating.php +++ b/~dev_rating/application/classes/Controller/Teacher/Rating.php @@ -13,7 +13,7 @@ class Controller_Teacher_Rating extends Controller_UserEnvi { $discipline = $db->GetMapForDiscipline($this->UserInfo['TeacherID'], $id); if($discipline->count() == 0) - throw HTTP_Exception::factory (404, "Дисциплины СЃ ID $id РЅРµ существует!"); + throw HTTP_Exception::factory (404, "Для дисциплины СЃ ID $id РЅРµ создана РЈРљР” или такой дисциплины РЅРµ существует!"); $disciplineHandled = array(); $maxRate = 0; $i = 0; $module = 0; diff --git a/~dev_rating/application/classes/Controller/UserEnvi.php b/~dev_rating/application/classes/Controller/UserEnvi.php index 8392d5fb6..f98264df8 100644 --- a/~dev_rating/application/classes/Controller/UserEnvi.php +++ b/~dev_rating/application/classes/Controller/UserEnvi.php @@ -21,7 +21,7 @@ class Controller_UserEnvi extends Controller { $bitmask = $sysModel->getBitmaskForRoute($route); if(!($bitmask & $userMark)) { - throw HTTP_Exception::factory(403, 'РќРµ пытайтесь попасть туда, РєСѓРґР° попадать РЅРµ следует: '.$route); + throw HTTP_Exception::factory(403, 'РќРµ пытайтесь попасть туда, РєСѓРґР° попадать РЅРµ следует.'); } } } diff --git a/~dev_rating/application/views/admin/base.twig b/~dev_rating/application/views/admin/base.twig index 4c5f366f4..258187963 100644 --- a/~dev_rating/application/views/admin/base.twig +++ b/~dev_rating/application/views/admin/base.twig @@ -34,6 +34,7 @@ <title>{% block title %}{% endblock %} | Admin - {{ System.Title }}</title> {{ HTML.style('media/css/admin/base.css')|raw }} {{ HTML.style('media/css/admin/macro.css')|raw }} + {{ HTML.style('media/css/actionButton.css')|raw }} {{ HTML.script('media/js/jquery-1.11.1.min.js')|raw }} {% block media %}{% endblock %} </head> diff --git a/~dev_rating/application/views/base.twig b/~dev_rating/application/views/base.twig index 63db7f3cd..ba6b58915 100644 --- a/~dev_rating/application/views/base.twig +++ b/~dev_rating/application/views/base.twig @@ -1,9 +1,30 @@ <!DOCTYPE html> +{% macro action(URL, image, title, message, actionID = '') %} +<a href="{{ URL }}"> + <div class="action"> + <div class="action_image"> + <img src="{{ image }}" /> + </div> + <div class="action_content"> + <div class="action_title"> + {{ title }} + </div> + <div class="action_message"> + {{ message|raw }} + </div> + </div> + </div> +</a> +{% endmacro %} + +{% import 'base' as base %} + <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>{% block title %}{% endblock %} | {{ System.Title }}</title> {{ HTML.style('media/css/base.css')|raw }} + {{ HTML.style('media/css/actionButton.css')|raw }} {{ HTML.script('media/js/jquery-1.11.1.min.js')|raw }} {% block media %}{% endblock %} </head> diff --git a/~dev_rating/application/views/teacher/index.twig b/~dev_rating/application/views/teacher/index.twig index 5bdd7e07f..85c45f817 100644 --- a/~dev_rating/application/views/teacher/index.twig +++ b/~dev_rating/application/views/teacher/index.twig @@ -5,55 +5,47 @@ {{ HTML.style('media/css/courses_teacher_var2.css')|raw }} {% endblock %} -{% macro outputSubject(subject, HTML) %} +{% macro outputSubject(Subject, HTML) %} <div class="discipline"> - <div class="discipline_header"> - <div class="discipline_title">{{ subject.Title }}</div> - </div> <div class="discipline_groups"> - - <table cellspacing="0" border="0" width="100%"> - <tr class="header_block"> - <td class='info_cell'>Номер РіСЂСѓРїРїС‹</td> - <td class='info_cell'>Число студентов</td> - <td class='common_cell'>Форма контроля</td> - <td class='common_cell'>Преподаватели</td> - <td class='common_cell'>Учебная карта</td> - </tr> - </table> - {% for discipline in subject.Disciplines %} - <div class="grade_title"> - {{ discipline.GradeNum }} РєСѓСЂСЃ - </div> + <div class="grade_title"> + {{ Subject.Title }} + {% if Subject.GradeNum > 0 %}| {{ Subject.GradeNum }} РєСѓСЂСЃ + {% endif %} + </div> + {% for Discipline in Subject.Disciplines %} + {% if loop.first %} <div class="group_table"> - <table cellspacing="0" border="0" width="100%"> - {% for group in discipline.Groups %} - {% if loop.index == 1 %} - <tr class="group_block"> - <td class='info_cell td_group'>{{ HTML.anchor('rating/'~discipline.ID, group.Num~' РіСЂСѓРїРїР°', {'title': 'Перейти Рє оцениванию'})|raw }}</td> - <td class='info_cell td_count'>{{ group.Count }}</td> - <td rowspan='2' class='common_cell td_control'>{{ discipline.ControlType }}</td> - <td rowspan='2' class='common_cell td_teachers'> - {% for teacher in discipline.Teachers %} - <div>{{ teacher }}</div> - {% endfor %} - </td> - <td rowspan='2' class='common_cell'> - {% set UKDcontent = "<div class='show_ukd_btn'>РЈРљР”</div>" %} - {{ HTML.anchor('map/structure/'~discipline.ID, UKDcontent, {'title': 'Просмотр Рё редактирование учебной карты дисциплины'})|raw }} - </td> - </tr> - {% else %} - <tr class="group_block"> - <td class='info_cell td_group'>{{ HTML.anchor('rating/'~discipline.ID, group.Num~' РіСЂСѓРїРїР°', {'title': 'Перейти Рє оцениванию'})|raw }}</td> - <td class='info_cell td_count'>{{ group.Count }}</td> - </tr> - {% endif %} - {% endfor %} + {% endif %} + <tr class="group_block"> + <td class='info_cell td_group'> + {{ Discipline.Groups|default('---') }} + </td> + <td class='common_cell td_control'> + {{ Discipline.ControlType|default('---') }} + </td> + <td class='common_cell td_teachers'> + {% for teacher in Discipline.Teachers %} + <div>{{ teacher }}</div> + {% else %} + --- + {% endfor %} + </td> + <td class='common_cell'> + {% set UKDcontent = "<div class='show_ukd_btn'>Оценивание</div>" %} + {{ HTML.anchor('rating/'~Discipline.ID, UKDcontent, {'title': 'Просмотр Рё редактирование учебной карты дисциплины'})|raw }} + </td> + <td class='common_cell'> + {% set UKDcontent = "<div class='show_ukd_btn'>Редактирование</div>" %} + {{ HTML.anchor('map/structure/'~Discipline.ID, UKDcontent, {'title': 'Просмотр Рё редактирование учебной карты дисциплины'})|raw }} + </td> + </tr> + {% if loop.last %} </table> </div> + {% endif %} {% endfor %} </div> </div> @@ -65,11 +57,25 @@ {% block main_content %} <div class="disciplines_wrapper"> - {% for subject in content.Subjects %} - {{ idx.outputSubject(subject, HTML) }} + {{ base.action(URL.site('map/create'), + URL.site('media/img/addList.png'), + 'Создать РЅРѕРІСѓСЋ дисциплину', + 'Добавить РІ систему '~System.Title~' дисциплину. '~ + 'Ртот шаг включает РІ себя создание РЈРљР”, добавление преподавателей, присоединение РіСЂСѓРїРї Рё '~ + 'выбор определенных студентов, которые Р±СѓРґСѓС‚ подписаны РЅР° дисциплину.') }} + <table cellspacing="0" border="0" width="100%"> + <tr class="header_block"> + <td class='info_cell'>Учебные РіСЂСѓРїРїС‹</td> + <td class='common_cell'>Форма контроля</td> + <td class='common_cell'>Преподаватели</td> + <td class='common_cell'>Оценивание</td> + <td class='common_cell'>Дисциплина</td> + </tr> + </table> + {% for Subject in Subjects %} + {{ idx.outputSubject(Subject, HTML) }} {% else %} - <p class="notification">Похоже, что Р’С‹ РЅРµ ведете РЅРё РѕРґРЅРѕРіРѕ предмета!</p> + <p class="notification">РњС‹ РЅРµ нашли </p> {% endfor %} - {{ HTML.anchor('map/create', 'Добавить РЈРљР”', {'title': 'Перейти Рє добавлению'})|raw }} </div> {% endblock %} \ No newline at end of file diff --git a/~dev_rating/deployConfig/database.php b/~dev_rating/deployConfig/database.php index 2636e3a2f..3da6bbe0e 100644 --- a/~dev_rating/deployConfig/database.php +++ b/~dev_rating/deployConfig/database.php @@ -17,7 +17,7 @@ return array 'username' => 'mmcs_rating', 'password' => 'Pefnesdy', 'persistent' => FALSE, - 'options' => array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8') + 'options' => array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8') ), /** * The following extra options are available for PDO: diff --git a/~dev_rating/media/css/actionButton.css b/~dev_rating/media/css/actionButton.css new file mode 100644 index 000000000..1c6cbf5c3 --- /dev/null +++ b/~dev_rating/media/css/actionButton.css @@ -0,0 +1,46 @@ + +.action_bar +{ + margin-top: 10px; +} + +.action +{ + background-color: #ffffff; + border: 1px solid #f2f2f2; + border-left: 0; + border-right: 0; + margin: 2px 0; + padding: 10px; +} + +.action:hover +{ + background-color: #f2f2f2; + text-decoration: none; +} + +.action > div +{ + display: inline-block; + vertical-align: middle; +} + +.action_content +{ + width: 90%; + margin-left: 5px; +} + +.action_title +{ + font-size: 17pt; + margin-bottom: 10px; + color: #0183ce; +} + +.action_message +{ + font-size: 9pt; + color: #000; +} diff --git a/~dev_rating/media/css/admin/base.css b/~dev_rating/media/css/admin/base.css index 0e372c3ce..893aa7dd6 100644 --- a/~dev_rating/media/css/admin/base.css +++ b/~dev_rating/media/css/admin/base.css @@ -186,54 +186,6 @@ a:hover { font-size: 10pt; } -/*-------------------------------------ACTION-----------------------------------------*/ - -.action_bar -{ - margin-top: 10px; -} - -.action -{ - background-color: #ffffff; - border: 1px solid #f2f2f2; - border-left: 0; - border-right: 0; - margin: 2px 0; - padding: 10px; -} - -.action:hover -{ - background-color: #f2f2f2; - text-decoration: none; -} - -.action > div -{ - display: inline-block; - vertical-align: middle; -} - -.action_content -{ - width: 90%; - margin-left: 5px; -} - -.action_title -{ - font-size: 17pt; - margin-bottom: 10px; - color: #0183ce; -} - -.action_message -{ - font-size: 9pt; - color: #000; -} - /*-------------------------------------FOOTER-----------------------------------------*/ .footer { diff --git a/~dev_rating/media/css/base.css b/~dev_rating/media/css/base.css index 51f4ddbfe..2403424fe 100644 --- a/~dev_rating/media/css/base.css +++ b/~dev_rating/media/css/base.css @@ -134,7 +134,7 @@ a:hover { .main_content { width: 100%; position: relative; - padding: 25px 0; + padding: 15px 0; } diff --git a/~dev_rating/media/css/courses_teacher_var2.css b/~dev_rating/media/css/courses_teacher_var2.css index c6e9dbf41..cbac6690a 100644 --- a/~dev_rating/media/css/courses_teacher_var2.css +++ b/~dev_rating/media/css/courses_teacher_var2.css @@ -19,11 +19,6 @@ /* ============ Заголовок дисциплины ============== */ -.discipline_groups -{ - margin-left: 25px; -} - .discipline_header {} @@ -34,10 +29,10 @@ font-weight: 700; } -.discipline_groups .header_block td +.header_block td { padding: 10px; - color: #4fbeec; + color: #3399CC; } .discipline_groups .group_table @@ -47,21 +42,20 @@ /* ============ Настройки цвета ============== */ -.discipline_groups .group_block .td_group { color: #4fbeec; } -.discipline_groups .group_block .td_count { color: #3A84A6; } -.discipline_groups .group_block .td_control { color: #3A84A6; } +.discipline_groups .group_block .td_group { color: #757575; } +.discipline_groups .group_block .td_control { color: #757575; } .discipline_groups .group_block .td_teachers { color: #757575; } /* ============ РЈРљР” ========================== */ .show_ukd_btn { - margin: 0 auto; + margin: 5px auto; display: block; border: 0; padding: 6px 20px; - width: 60px; - background: #757575; /*#3A84A6;*/ + max-width: 60%; + background: #39973f; /*#3A84A6;*/ font-weight: bold; font-size: 13px; color: #ffffff; @@ -77,18 +71,13 @@ cursor: pointer; } -/* ============ Плашка РєСѓСЂСЃР° ================= */ +/* ============ Плашка дисциплины ================= */ .discipline_groups .grade_title { - border: 2px solid #2bbd19; - background: #2bbd19; - color: #fff; - width: 90px; - position: relative; - margin-bottom: -2px; - padding-bottom: 2px; - text-align: center; + color: #3399CC; + padding: 5px; + text-align: left; } /* =========== Внутренние границы ============= */ @@ -101,32 +90,14 @@ /* ============ Внешние границы ============== */ -.discipline_groups .group_block .common_cell -{ - border-top: 2px solid; - border-bottom: 2px solid; - border-color: #ccc; -} - -.discipline_groups .group_block .common_cell:last-child -{ - border-right: 2px solid; - border-color: #ccc; -} - -.discipline_groups .group_block td:first-child -{ - border-left: 2px solid; - border-color: #ccc; -} -.discipline_groups .group_block:first-child .info_cell +.discipline_groups .group_block:first-child td { border-top: 2px solid; border-color: #ccc; } -.discipline_groups .group_block:last-child .info_cell +.discipline_groups .group_block:last-child td { border-bottom: 2px solid; border-color: #ccc; diff --git a/~dev_rating/media/img/addList.png b/~dev_rating/media/img/addList.png new file mode 100644 index 0000000000000000000000000000000000000000..1a77935cfec8f59847352aa4d9c36d6bfa077d89 GIT binary patch literal 1263 zcmV<L1Q7d)P)<h;3K|Lk000e1NJLTq001BW001Be1^@s6b9#F800004b3#c}2nYxW zd<bNS00009a7bBm000pQ000pQ0l?*=7ytkO8FWQhbW?9;ba!ELWdL_~cP?peYja~^ zaAhuUa%Y?FJQ@H11Z+t}K~z|U&6i(@)KwJ6Kj+RLMQ3txjS!?_Wg}=!o8R4O+y_C_ z^d-vjskeLxkrJc`G!&8wp|E;TgETaVLNH$q!dWC`9q;HaE%av<wq7j%lv{3_GxPhM z9{l~rU%NB<TXLcA)0y+<e$PGkocp^Ys!Fj~?Dc*BT@kUsTxJHNz|m|ryW{lf(-V<0 zT`U%RgCIC1BAFQ?j_@$>YQ0`xCL(K8RRPlB&NILb5jmi$zs>-;h{!rsU7@P03WdU2 z;5a}!EIT4{;OyD6TW5eAfKsWnx6x=^0kR?IaR5Vj<}<YOCI$uu{s5x0&qaDOlcY(I zZl$!=?gBOdzZqj*u2d?60KL7v8&q`*kWI3<h+H<tymscynI97;uypCtxtUDn4Z`a9 zzP}0B1fZ(#1B;T7hyFAgjh}#5+WAcP2xd*w9}&4@%#;cY4GoQ3Yu_e3f>bK?QOvv> z*a{@QGp?%YC(}v*z&W=Q*x5qA2iTL4JQ4n%Q{Z{t)5e(fz|~r<_TJFY(B)8H5|NEe zV+!K&i4y4U?w&Po-n=hVbq+u_n+141T<}w%I|(`5nu2(ID@-|p&d$zRz?_(BK^r+~ z68GQ9J|%(h%KR$)`BxAG$6||p2IyTle+Tx7$Wz9c#lTB3+lRoFxU+bk7cIEWIk!79 zluD)hu3fu!b7W-XW;~#$rze-mWLowPKu1T%jdHo%XlD<Pc#(7NBD85jXjWnhhKGl5 zw2O(uTDwqHEwDsHMpLPjt5hl@s(KT+82PoEg2#<9>wv47Oy=|G1yd*#9x}!}PizWA zB$$|(_+WT=xE2yWsHz7=WVMJi*YtfK&+{%83Wbg5&Ye5iHi4BZSEfbegsOG|)M~Xw zz%Bq|%rW4JxPK4?M<a62^VW;VVG+r<Da>MHOuw~uw{vbgv}nTX*RSV*&X}sJjSQe7 z@@BMi5jhOR$tQp@;Ln&&fNh@Vt#6sY;NajG@I#Y9^;FFK&A-@HzjV%h8_EYKk)x`c zopT*PaWapH?C<OAn?EH1Rn>exzf44)RMqZkwfb>$`(0hnsH#=f<*K?|L^g%HUnnB0 zC$DuEJW#LK*S2iJa=H9BP?@Yha^#2)R9hr%V+}W<s+&VOs@Nq}eGx!Jwh;D_s@gQ* z11VLV_P0KUB{8{HtyT}kjn26-;1Gbd_E~N>@{%<0J@A-_yihC_`-31z{5Z|$^B2nH zazjK$V`^iqeKeFWIp@ZDdU~?6XV2~e5RqK?mjGZi4eSN>0gnVh(4UkXV0?Uh4e)g; zm2$rCH}e9%0|?80C?t<`&3ILH#yPh?93`J=A_#)j0F_E*gxKwt5H;Y0L>XCY7Z_uf z1woLzbKGsH>Mzx5bpW7HD6BBX^mA*@Bb*0*4$Ho3Quq$%+*=Ya$$y2l_8nl`-TXx4 zWG<ImRW6qs_w-5ToZGId&jIZkxd!Zr$N}zY1tRqI_06x>>uaO0Auy_{4meS*RxiYT Z{{fF`-9uETsp$X!002ovPDHLkV1mdGQh)#e literal 0 HcmV?d00001 -- GitLab