diff --git a/application/bootstrap.php b/application/bootstrap.php index e28950c5366681808e8611e14a468ef1f9db8ab2..bc29727290c72d5f9e439ac25a5738e1ff13975c 100644 --- a/application/bootstrap.php +++ b/application/bootstrap.php @@ -242,6 +242,13 @@ Route::set('stdnt:profile', 'student/profile') /* --------------- Преподаватели ---------------- */ +Route::set('map:create', 'map/create') + ->defaults(array( + 'directory' => 'teacher', + 'controller' => 'map', + 'action' => 'create' + )); + Route::set('map:edit', 'map/<id>', array('id' => '[0-9]+')) ->defaults(array( 'directory' => 'teacher', diff --git a/application/classes/Controller/Teacher/Map.php b/application/classes/Controller/Teacher/Map.php index 3fc87a5795191cdcebe7ef4d57fc352162943f13..aecfd09f466f19638688fb0a78ff6bc63f55b53b 100644 --- a/application/classes/Controller/Teacher/Map.php +++ b/application/classes/Controller/Teacher/Map.php @@ -20,7 +20,7 @@ class Controller_Teacher_Map extends Controller_UserEnvi { public function action_create() { - $twig = Twig::factory('teacher/map/add'); + $twig = Twig::factory('teacher/map/create'); $twig->User = $this->UserInfo; $this->response->body($twig); diff --git a/application/views/base.twig b/application/views/base.twig index 20c129b919fa24a3f7ea62fb4e086b929a4de92f..5991fbb6eee73dee7bbb1e699ebbd0986243476d 100644 --- a/application/views/base.twig +++ b/application/views/base.twig @@ -1,3 +1,4 @@ +<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> @@ -7,7 +8,7 @@ {% block media %}{% endblock %} </head> <body> -<div id="wrap"> +<div id="wrap" class="page"> <div class="header_wrapper"> <div class="header"> diff --git a/application/views/settings.twig b/application/views/settings.twig index 4e338e5f6d08dc1acb542c4d16ff57be45e1c6d8..8a90fcf93bf162b1ec181a37209d78470f1fc285 100644 --- a/application/views/settings.twig +++ b/application/views/settings.twig @@ -10,7 +10,7 @@ {% block main_content %} <div class="pageProfileSettings"> <div class="settingsSection"> - <p>Логин может состоять из латинских букв, цифр и символа _</p> + <p class="help">Логин может состоять из латинских букв, цифр и символа _</p> <div class="itemBlock"> <div class="title">Логин:</div> <div class="field"><input type="text" class="inputLogin inputText" value="{{ User.Login }}"></div> @@ -35,7 +35,7 @@ <div class="title">Старый пароль:</div> <div class="field"><input type="text" class="inputCurrentPass inputText" value=""></div> </div> - <p>Пароль должен состоять из 5 и более символов</p> + <p class="help">Пароль должен состоять из 5 и более символов</p> <div class="itemBlock"> <div class="title">Новый пароль:</div> <div class="field"><input type="text" class="inputNewPass inputText" value=""></div> diff --git a/application/views/teacher/index.twig b/application/views/teacher/index.twig index ff434f32a3bd1491fcc99019184af8b523efb9c7..bdf702b7e0cc2df3b435ca5b98603475ef52b114 100644 --- a/application/views/teacher/index.twig +++ b/application/views/teacher/index.twig @@ -67,7 +67,8 @@ {% for subject in content.Subjects %} {{ idx.outputSubject(subject, HTML) }} {% else %} - Похоже, что Вы не ведете ни одного предмета! + <p class="notification">Похоже, что Вы не ведете ни одного предмета!</p> {% endfor %} + {{ HTML.anchor('map/create', 'Добавить УКД', {'title': 'Перейти к добавлению'})|raw }} </div> {% endblock %} \ No newline at end of file diff --git a/application/views/teacher/map/create.twig b/application/views/teacher/map/create.twig new file mode 100644 index 0000000000000000000000000000000000000000..70082528492cbf308ce73479adc146da4e985ea7 --- /dev/null +++ b/application/views/teacher/map/create.twig @@ -0,0 +1,15 @@ +{% extends 'base' %} + +{% block title %}Конструктор УКД{% endblock %} {# head -> title #} +{% block media %} {# head -> css, js #} + {{ HTML.style('media/css/construct.css')|raw }} + {{ HTML.script('media/js/construct/edit.js')|raw }} + + {{ HTML.style('media/js/wnd/wnd.css')|raw }} + {{ HTML.script('media/js/wnd/wnd.js')|raw }} +{% endblock %} + +{% block main_top_title %}Добавление УКД{% endblock %} +{% block main_content %} + +{% endblock %} diff --git a/application/views/teacher/map/edit.twig b/application/views/teacher/map/edit.twig index d0e36dbaf0e2bda657a0096e5f624f0e3e418825..9d5407f5d277edb7ba00f52acbf7439e3a9b5731 100644 --- a/application/views/teacher/map/edit.twig +++ b/application/views/teacher/map/edit.twig @@ -4,12 +4,16 @@ {% block media %} {# head -> css, js #} {{ HTML.style('media/css/construct.css')|raw }} {{ HTML.script('media/js/construct/edit.js')|raw }} + + {{ HTML.style('media/js/wnd/wnd.css')|raw }} + {{ HTML.script('media/js/wnd/wnd.js')|raw }} {% endblock %} {% block main_top_title %}Редактирование УКД{% endblock %} {% block main_content %} <div class="discipline"> <p class="top_center_info">Учебная карта дисциплины на 1 семестр 2014 года</p> + <a href="javascript:wnd.open({title: 'Тестовое окно', content: '<p>The text</p>', width: 700})">Открыть окно</a> <div class="section"> <select class="SelectSubject"> <option value="0">Выберите предмет:</option> diff --git a/media/css/base.css b/media/css/base.css index f0b3653ccb39a38e8bf2fff28958d88729a1536a..011faa2d81e865e6b530c41f6b5558113074bb92 100644 --- a/media/css/base.css +++ b/media/css/base.css @@ -1,9 +1,15 @@ *{ - font-family: Arial, Tahoma, Lucida Grande, Sans-Serif, Lucida Sans;; + font-family: Arial, Tahoma, Lucida Grande, Sans-Serif, Lucida Sans; + margin: 0; + padding: 0; + border: 0; +} +/* Для корректного отображения окон */ +html, +body { + height: 100%; } body { - padding: 0; - margin: 0; background-color: #f1f1f1; } div { @@ -90,8 +96,7 @@ a:hover { .main_content { width: 100%; position: relative; - padding-top: 25px; - padding-bottom: 20px; + padding: 25px 0; } @@ -128,12 +133,6 @@ html>body #wrap height: auto; min-height: 100%; } -html,body -{ - height: 100%; - padding:0; - margin:0; -} #footer_fixBug { height: 30px; } @@ -156,8 +155,12 @@ html,body width: 100%; } -/*------------------------------------------------------------------------------------*/ - +/*----------------------Обшие--------------------------*/ +/* Оповещение */ +p.notification{ + margin: 10px 0; + text-align: center; font-size: 16px; +} diff --git a/media/css/settings.css b/media/css/settings.css index 8e453053cf6e6d2644cf8f8d1a746e6208fbd85b..476868726d1f52af9bdb38638c11a9d38a0aa920 100644 --- a/media/css/settings.css +++ b/media/css/settings.css @@ -9,7 +9,8 @@ width: 500px; } /* Подсказка */ - .settingsSection p{ + .settingsSection .help{ + margin: 10px 0; text-align: center; font-size: 15px; } .settingsSection .itemBlock { diff --git a/media/js/wnd/close.png b/media/js/wnd/close.png new file mode 100644 index 0000000000000000000000000000000000000000..e2d7885a6396c0f18338739e0665073e16fa8629 Binary files /dev/null and b/media/js/wnd/close.png differ diff --git a/media/js/wnd/wnd.css b/media/js/wnd/wnd.css new file mode 100644 index 0000000000000000000000000000000000000000..7563d252a53a03e3356d98422d64b31d6abdcbeb --- /dev/null +++ b/media/js/wnd/wnd.css @@ -0,0 +1,43 @@ +.window { + display: none; + position: absolute; + top: 0; + left: 0; + z-index: 1000; + width: 100%; + height: 100%; + background-color: rgba(0,0,0,.5); + font-family: sans-serif; +} + .window-shadow { + position: absolute; + width: 100%; + height: 100%; + } + .window-block { + position: relative; + z-index: 1; + margin: 20px auto; + background-color: #fff; + } + .window-title { + line-height: 20px; + font-size: 13px; + text-align: center; + } + .window-close { + position: absolute; + top: 0; + right: 0; + display: block; + width: 20px; + height: 20px; + background: url("close.png") center; + } + .window-content { + padding: 5px 10px; + } + .window-content p { + line-height: 16px; + font-size: 14px; + } \ No newline at end of file diff --git a/media/js/wnd/wnd.js b/media/js/wnd/wnd.js new file mode 100644 index 0000000000000000000000000000000000000000..302449b2cebed1fa85cdf54a5acfeabb529ec043 --- /dev/null +++ b/media/js/wnd/wnd.js @@ -0,0 +1,40 @@ +wnd = {} +wnd.$ = {} + +wnd.isShow = false; +wnd.show = function () { + wnd.isShow = true; + wnd.scroll = $(window).scrollTop(); + wnd.$.page.css("position", "fixed"); + wnd.$.page.css("margin-top", -wnd.scroll); + wnd.$.window.css("display", "block"); +} +wnd.hide = function () { + wnd.isShow = false; + wnd.$.page.css("position", "static"); + wnd.$.page.css("margin-top", 0); + $(window).scrollTop(wnd.scroll); + wnd.$.window.css("display", "none"); +} + +wnd.open = function(data) { + wnd.$.title.html(data.title || ''); + wnd.$.content.html(data.content || ''); + wnd.$.block.width(data.width || 600) + + wnd.show(); + + wnd.$.window.css("min-width", wnd.$.block.width() + 40); + wnd.$.window.css("min-height", wnd.$.block.height() + 40); +} +wnd.close = wnd.hide; + +$(function() { + // Блок окна + $("body").append("<div class=\"window\"><div class=\"window-shadow\" onclick=\"wnd.close()\"></div><div class=\"window-block\"><div class=\"window-title\"></div><a href=\"javascript:wnd.close()\" class=\"window-close\"></a><div class=\"window-content\"></div></div></div>"); + wnd.$.page = $(".page"); + wnd.$.window = $(".window"); + wnd.$.block = $(".window-block"); + wnd.$.title = $(".window-title"); + wnd.$.content = $(".window-content"); +}); \ No newline at end of file