Skip to content
Snippets Groups Projects
Commit fb2abf87 authored by Andrew Rudenets's avatar Andrew Rudenets
Browse files

Изменение главной страницы для преподавателя

parent b1fa3446
Branches
Tags
No related merge requests found
Showing
with 153 additions and 161 deletions
~dev_rating/application/cache/ ~dev_rating/application/cache/
~dev_rating/application/logs/ ~dev_rating/application/logs/
~dev_rating/application/config/ ~dev_rating/application/config/
~dev_rating/system/
~dev_rating/modules/kotwig/cache/
nbproject/ nbproject/
*.*~ *.*~
/.project /.project
\ No newline at end of file
...@@ -8,34 +8,33 @@ class Controller_Teacher_Index extends Controller_UserEnvi { ...@@ -8,34 +8,33 @@ class Controller_Teacher_Index extends Controller_UserEnvi {
$model = new Model_Teacher_Index; $model = new Model_Teacher_Index;
$disciplines = $model->getDisciplinesForTeacher($this->UserInfo['TeacherID']); $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) { foreach ($disciplines as $row) {
if($subjID != $row['SubjectID'] || $gradeNum != $row['StudyGroupGrade'])
if($subjID != $row['SubjectID'])
{ {
$i++; $j = $k = 0; $i++; $j = $k = 0;
$groupsInDiscipline = array();
$subjID = $row['SubjectID']; $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']) if($discID != $row['DisciplineID'])
{ {
$j++; $k = 0; $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);
} }
if($row['StudyGroupNum'] != 0)
$subjectsHandled['Subjects'][$i]['Disciplines'][$j]['ID'] = $row['DisciplineID']; $groupsInDiscipline[++$k] = $row['StudyGroupGrade'].'.'.$row['StudyGroupNum'];
$subjectsHandled['Subjects'][$i]['Disciplines'][$j]['GradeNum'] = $row['StudyGroupGrade']; $disciplinesHandled[$i]['Disciplines'][$j]['Groups'] = implode(', ', $groupsInDiscipline);
$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'];
} }
$twig->content = $subjectsHandled; $twig->Subjects = $disciplinesHandled;
$twig->User = $this->UserInfo; $twig->User = $this->UserInfo;
$this->response->body($twig); $this->response->body($twig);
} }
......
...@@ -13,7 +13,7 @@ class Controller_Teacher_Rating extends Controller_UserEnvi { ...@@ -13,7 +13,7 @@ class Controller_Teacher_Rating extends Controller_UserEnvi {
$discipline = $db->GetMapForDiscipline($this->UserInfo['TeacherID'], $id); $discipline = $db->GetMapForDiscipline($this->UserInfo['TeacherID'], $id);
if($discipline->count() == 0) if($discipline->count() == 0)
throw HTTP_Exception::factory (404, "Дисциплины с ID $id не существует!"); throw HTTP_Exception::factory (404, ля дисциплины с ID $id не создана УКД или такой дисциплины не существует!");
$disciplineHandled = array(); $disciplineHandled = array();
$maxRate = 0; $i = 0; $module = 0; $maxRate = 0; $i = 0; $module = 0;
......
...@@ -21,7 +21,7 @@ class Controller_UserEnvi extends Controller { ...@@ -21,7 +21,7 @@ class Controller_UserEnvi extends Controller {
$bitmask = $sysModel->getBitmaskForRoute($route); $bitmask = $sysModel->getBitmaskForRoute($route);
if(!($bitmask & $userMark)) if(!($bitmask & $userMark))
{ {
throw HTTP_Exception::factory(403, 'Не пытайтесь попасть туда, куда попадать не следует: '.$route); throw HTTP_Exception::factory(403, 'Не пытайтесь попасть туда, куда попадать не следует.');
} }
} }
} }
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
<title>{% block title %}{% endblock %} | Admin - {{ System.Title }}</title> <title>{% block title %}{% endblock %} | Admin - {{ System.Title }}</title>
{{ HTML.style('media/css/admin/base.css')|raw }} {{ HTML.style('media/css/admin/base.css')|raw }}
{{ HTML.style('media/css/admin/macro.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 }} {{ HTML.script('media/js/jquery-1.11.1.min.js')|raw }}
{% block media %}{% endblock %} {% block media %}{% endblock %}
</head> </head>
......
<!DOCTYPE html> <!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> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>{% block title %}{% endblock %} | {{ System.Title }}</title> <title>{% block title %}{% endblock %} | {{ System.Title }}</title>
{{ HTML.style('media/css/base.css')|raw }} {{ 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 }} {{ HTML.script('media/js/jquery-1.11.1.min.js')|raw }}
{% block media %}{% endblock %} {% block media %}{% endblock %}
</head> </head>
......
...@@ -5,55 +5,47 @@ ...@@ -5,55 +5,47 @@
{{ HTML.style('media/css/courses_teacher_var2.css')|raw }} {{ HTML.style('media/css/courses_teacher_var2.css')|raw }}
{% endblock %} {% endblock %}
{% macro outputSubject(subject, HTML) %} {% macro outputSubject(Subject, HTML) %}
<div class="discipline"> <div class="discipline">
<div class="discipline_header">
<div class="discipline_title">{{ subject.Title }}</div>
</div>
<div class="discipline_groups"> <div class="discipline_groups">
<div class="grade_title">
<table cellspacing="0" border="0" width="100%"> {{ Subject.Title }}
<tr class="header_block"> {% if Subject.GradeNum > 0 %}| {{ Subject.GradeNum }} курс
<td class='info_cell'>Номер группы</td> {% endif %}
<td class='info_cell'>Число студентов</td> </div>
<td class='common_cell'>Форма контроля</td> {% for Discipline in Subject.Disciplines %}
<td class='common_cell'>Преподаватели</td> {% if loop.first %}
<td class='common_cell'>Учебная карта</td>
</tr>
</table>
{% for discipline in subject.Disciplines %}
<div class="grade_title">
{{ discipline.GradeNum }} курс
</div>
<div class="group_table"> <div class="group_table">
<table cellspacing="0" border="0" width="100%"> <table cellspacing="0" border="0" width="100%">
{% for group in discipline.Groups %} {% endif %}
{% if loop.index == 1 %} <tr class="group_block">
<tr class="group_block"> <td class='info_cell td_group'>
<td class='info_cell td_group'>{{ HTML.anchor('rating/'~discipline.ID, group.Num~' группа', {'title': 'Перейти к оцениванию'})|raw }}</td> {{ Discipline.Groups|default('---') }}
<td class='info_cell td_count'>{{ group.Count }}</td> </td>
<td rowspan='2' class='common_cell td_control'>{{ discipline.ControlType }}</td> <td class='common_cell td_control'>
<td rowspan='2' class='common_cell td_teachers'> {{ Discipline.ControlType|default('---') }}
{% for teacher in discipline.Teachers %} </td>
<div>{{ teacher }}</div> <td class='common_cell td_teachers'>
{% endfor %} {% for teacher in Discipline.Teachers %}
</td> <div>{{ teacher }}</div>
<td rowspan='2' class='common_cell'> {% else %}
{% set UKDcontent = "<div class='show_ukd_btn'>УКД</div>" %} ---
{{ HTML.anchor('map/structure/'~discipline.ID, UKDcontent, {'title': 'Просмотр и редактирование учебной карты дисциплины'})|raw }} {% endfor %}
</td> </td>
</tr> <td class='common_cell'>
{% else %} {% set UKDcontent = "<div class='show_ukd_btn'>Оценивание</div>" %}
<tr class="group_block"> {{ HTML.anchor('rating/'~Discipline.ID, UKDcontent, {'title': 'Просмотр и редактирование учебной карты дисциплины'})|raw }}
<td class='info_cell td_group'>{{ HTML.anchor('rating/'~discipline.ID, group.Num~' группа', {'title': 'Перейти к оцениванию'})|raw }}</td> </td>
<td class='info_cell td_count'>{{ group.Count }}</td> <td class='common_cell'>
</tr> {% set UKDcontent = "<div class='show_ukd_btn'>Редактирование</div>" %}
{% endif %} {{ HTML.anchor('map/structure/'~Discipline.ID, UKDcontent, {'title': 'Просмотр и редактирование учебной карты дисциплины'})|raw }}
{% endfor %} </td>
</tr>
{% if loop.last %}
</table> </table>
</div> </div>
{% endif %}
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
...@@ -65,11 +57,25 @@ ...@@ -65,11 +57,25 @@
{% block main_content %} {% block main_content %}
<div class="disciplines_wrapper"> <div class="disciplines_wrapper">
{% for subject in content.Subjects %} {{ base.action(URL.site('map/create'),
{{ idx.outputSubject(subject, HTML) }} 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 %} {% else %}
<p class="notification">Похоже, что Вы не ведете ни одного предмета!</p> <p class="notification">Мы не нашли </p>
{% endfor %} {% endfor %}
{{ HTML.anchor('map/create', 'Добавить УКД', {'title': 'Перейти к добавлению'})|raw }}
</div> </div>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -17,7 +17,7 @@ return array ...@@ -17,7 +17,7 @@ return array
'username' => 'mmcs_rating', 'username' => 'mmcs_rating',
'password' => 'Pefnesdy', 'password' => 'Pefnesdy',
'persistent' => FALSE, '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: * The following extra options are available for PDO:
......
.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;
}
...@@ -186,54 +186,6 @@ a:hover { ...@@ -186,54 +186,6 @@ a:hover {
font-size: 10pt; 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-----------------------------------------*/
.footer { .footer {
......
...@@ -134,7 +134,7 @@ a:hover { ...@@ -134,7 +134,7 @@ a:hover {
.main_content { .main_content {
width: 100%; width: 100%;
position: relative; position: relative;
padding: 25px 0; padding: 15px 0;
} }
......
...@@ -19,11 +19,6 @@ ...@@ -19,11 +19,6 @@
/* ============ Заголовок дисциплины ============== */ /* ============ Заголовок дисциплины ============== */
.discipline_groups
{
margin-left: 25px;
}
.discipline_header .discipline_header
{} {}
...@@ -34,10 +29,10 @@ ...@@ -34,10 +29,10 @@
font-weight: 700; font-weight: 700;
} }
.discipline_groups .header_block td .header_block td
{ {
padding: 10px; padding: 10px;
color: #4fbeec; color: #3399CC;
} }
.discipline_groups .group_table .discipline_groups .group_table
...@@ -47,21 +42,20 @@ ...@@ -47,21 +42,20 @@
/* ============ Настройки цвета ============== */ /* ============ Настройки цвета ============== */
.discipline_groups .group_block .td_group { color: #4fbeec; } .discipline_groups .group_block .td_group { color: #757575; }
.discipline_groups .group_block .td_count { color: #3A84A6; } .discipline_groups .group_block .td_control { color: #757575; }
.discipline_groups .group_block .td_control { color: #3A84A6; }
.discipline_groups .group_block .td_teachers { color: #757575; } .discipline_groups .group_block .td_teachers { color: #757575; }
/* ============ УКД ========================== */ /* ============ УКД ========================== */
.show_ukd_btn { .show_ukd_btn {
margin: 0 auto; margin: 5px auto;
display: block; display: block;
border: 0; border: 0;
padding: 6px 20px; padding: 6px 20px;
width: 60px; max-width: 60%;
background: #757575; /*#3A84A6;*/ background: #39973f; /*#3A84A6;*/
font-weight: bold; font-weight: bold;
font-size: 13px; font-size: 13px;
color: #ffffff; color: #ffffff;
...@@ -77,18 +71,13 @@ ...@@ -77,18 +71,13 @@
cursor: pointer; cursor: pointer;
} }
/* ============ Плашка курса ================= */ /* ============ Плашка дисциплины ================= */
.discipline_groups .grade_title .discipline_groups .grade_title
{ {
border: 2px solid #2bbd19; color: #3399CC;
background: #2bbd19; padding: 5px;
color: #fff; text-align: left;
width: 90px;
position: relative;
margin-bottom: -2px;
padding-bottom: 2px;
text-align: center;
} }
/* =========== Внутренние границы ============= */ /* =========== Внутренние границы ============= */
...@@ -101,32 +90,14 @@ ...@@ -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-top: 2px solid;
border-color: #ccc; border-color: #ccc;
} }
.discipline_groups .group_block:last-child .info_cell .discipline_groups .group_block:last-child td
{ {
border-bottom: 2px solid; border-bottom: 2px solid;
border-color: #ccc; border-color: #ccc;
......
~dev_rating/media/img/addList.png

1.23 KiB

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