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/logs/
~dev_rating/application/config/
~dev_rating/system/
~dev_rating/modules/kotwig/cache/
nbproject/
*.*~
/.project
/.project
\ No newline at end of file
......@@ -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);
}
......
......@@ -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;
......
......@@ -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, 'Не пытайтесь попасть туда, куда попадать не следует.');
}
}
}
......
......@@ -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>
......
<!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>
......
......@@ -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
......@@ -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:
......
.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 {
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 {
......
......@@ -134,7 +134,7 @@ a:hover {
.main_content {
width: 100%;
position: relative;
padding: 25px 0;
padding: 15px 0;
}
......
......@@ -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;
......
~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