Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c92ecfef1 | ||
|
|
6861e365ce | ||
|
|
76db829026 | ||
|
|
857dc05852 | ||
|
|
b48b120405 | ||
|
|
916c11c516 | ||
|
|
8fdbc18e65 | ||
|
|
78789bd7f3 | ||
|
|
27b1cfbec8 | ||
|
|
5ad7caf844 | ||
|
|
16dc05b2db | ||
|
|
3e510b3b4c | ||
|
|
e3eb9c119f | ||
|
|
a9f5acb480 | ||
|
|
4c25f36816 | ||
|
|
084001791b | ||
|
|
15018b3cd8 | ||
|
|
8624987a8e | ||
|
|
ba7968410c | ||
|
|
9f15d631f4 | ||
|
|
1249666fad | ||
|
|
ee826400df | ||
|
|
1a11cf8c85 | ||
|
|
f747ce17f3 | ||
|
|
a22820c278 | ||
|
|
dc88c838aa | ||
|
|
691448457a | ||
|
|
5cae479c4b | ||
|
|
9857d7bae8 | ||
|
|
240dc350fe | ||
|
|
5e14fe465c | ||
|
|
840502c68f | ||
|
|
73f0efa537 | ||
|
|
94f38205f4 | ||
|
|
d6fbeb1fd0 | ||
|
|
534ce3f2e3 | ||
|
|
da79a17374 | ||
|
|
13d909c219 |
No files matched your search
@@ -7,3 +7,4 @@ private*.json
|
|||||||
/node_modules
|
/node_modules
|
||||||
/bower_components
|
/bower_components
|
||||||
/public
|
/public
|
||||||
|
/build
|
||||||
@@ -21,7 +21,7 @@ body {
|
|||||||
.content {
|
.content {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
width: 90%;
|
width: 90%;
|
||||||
margin: 0 auto;
|
margin: 3em auto 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
a {
|
a {
|
||||||
|
|||||||
+56
-53
@@ -1,76 +1,79 @@
|
|||||||
header {
|
.main-menu {
|
||||||
nav {
|
|
||||||
overflow-x: scroll;
|
|
||||||
-webkit-overflow-scrolling: touch;
|
|
||||||
width: 100%;
|
|
||||||
max-height: 15em;
|
|
||||||
|
|
||||||
background-color: black;
|
position: fixed;
|
||||||
font-size: 1.1em;
|
z-index: 100;
|
||||||
color: #666;
|
overflow-x: scroll;
|
||||||
|
-webkit-overflow-scrolling: touch;
|
||||||
|
width: 100%;
|
||||||
|
//max-height: 15em;
|
||||||
|
|
||||||
& :link, & :visited {
|
background-color: black;
|
||||||
text-decoration: none;
|
font-size: 1.1em;
|
||||||
border-bottom: 1px solid #333;
|
color: #666;
|
||||||
color: #a2a2a2;
|
|
||||||
|
list-style: none;
|
||||||
|
white-space: nowrap;
|
||||||
|
|
||||||
|
& :link, & :visited {
|
||||||
|
text-decoration: none;
|
||||||
|
border-bottom: 1px solid #333;
|
||||||
|
color: #a2a2a2;
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
display: inline-block; /* 6 */
|
||||||
|
padding: 0.3em 0.2em 0.5em;
|
||||||
|
margin: 0 0.5em;
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
margin-left: 1em;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ul {
|
a:hover {
|
||||||
list-style: none;
|
color: white;
|
||||||
white-space: nowrap;
|
border-bottom: 1px solid #555;
|
||||||
|
}
|
||||||
|
|
||||||
li {
|
.selected {
|
||||||
display: inline-block; /* 6 */
|
border-top: 4px solid white;
|
||||||
padding: 0.3em 0.2em 0.5em;
|
font-weight: bold;
|
||||||
margin: 0 0.5em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
a:hover {
|
a:link, a:visited {
|
||||||
color: white;
|
color: white;
|
||||||
border-bottom: 1px solid #555;
|
text-decoration: none;
|
||||||
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.selected {
|
&.blue {
|
||||||
border-top: 4px solid white;
|
border-top: 4px solid #3f9cea;
|
||||||
font-weight: bold;
|
}
|
||||||
|
|
||||||
a:link, a:visited {
|
&.green {
|
||||||
color: white;
|
border-top: 4px solid #5cbe40;
|
||||||
text-decoration: none;
|
}
|
||||||
border-bottom: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.blue {
|
&.yellow {
|
||||||
border-top: 4px solid #3f9cea;
|
border-top: 4px solid #ffee00;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.green {
|
&.pink {
|
||||||
border-top: 4px solid #5cbe40;
|
border-top: 4px solid #f655a0;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.yellow {
|
&.red {
|
||||||
border-top: 4px solid #ffee00;
|
border-top: 4px solid #f61b14;
|
||||||
}
|
|
||||||
|
|
||||||
&.pink {
|
|
||||||
border-top: 4px solid #f655a0;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.red {
|
|
||||||
border-top: 4px solid #f61b14;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 31.25em) {
|
@media (min-width: 31.25em) {
|
||||||
header{
|
header{
|
||||||
max-height: none;
|
//max-height: none;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
nav ul {
|
.main-menu {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
.schedule-slider {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 30em;
|
||||||
|
//width: 90%;
|
||||||
|
//margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.schedule-slider__slide {
|
||||||
|
height: 100%;
|
||||||
|
overflow-y: auto;
|
||||||
|
|
||||||
|
&.current {
|
||||||
|
border-left: .3em solid #4b8ff3;
|
||||||
|
border-right: .3em solid #4b8ff3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.schedule-slider__body {
|
||||||
|
}
|
||||||
|
|
||||||
|
.schedule-slider__head {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 2em;
|
||||||
|
margin: 0 0 .5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.schedule-record {
|
||||||
|
min-height: 10em;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
&.even{
|
||||||
|
background-color: #f3f3fd;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.empty {
|
||||||
|
.schedule-record__head{
|
||||||
|
color: #bbb;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin: .2em 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.schedule-record__head {
|
||||||
|
padding: .25em 0;
|
||||||
|
font-size: 1.2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.schedule-record__main {
|
||||||
|
}
|
||||||
|
|
||||||
|
.schedule-record__name {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 1.2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.schedule-record__group {
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
$current-week-day-color: #4b8ff3;
|
||||||
|
|
||||||
|
.schedule-table {
|
||||||
|
margin: 0 auto;
|
||||||
|
width: 100%;
|
||||||
|
min-width: 50em;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
table {
|
||||||
|
margin: 2em auto;
|
||||||
|
border-spacing: 0;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
thead {
|
||||||
|
animation-duration: 0.3s;
|
||||||
|
|
||||||
|
th {
|
||||||
|
font-weight: normal;
|
||||||
|
vertical-align: baseline;
|
||||||
|
height: 80px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.date {
|
||||||
|
font-size: 1.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.group {
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tbody tr:nth-child(even) {
|
||||||
|
background-color: #f0f2da;
|
||||||
|
}
|
||||||
|
|
||||||
|
td {
|
||||||
|
vertical-align: baseline;
|
||||||
|
|
||||||
|
&:not(.group) {
|
||||||
|
width: 15%;
|
||||||
|
padding: .75em 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.group {
|
||||||
|
width: 5%;
|
||||||
|
|
||||||
|
p.name {
|
||||||
|
font-size: 1.25em;
|
||||||
|
font-weight: 800;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
thead.fix {
|
||||||
|
position: fixed;
|
||||||
|
top: 41px;
|
||||||
|
background-color: rgba(255, 255, 255, .95);
|
||||||
|
z-index: 50;
|
||||||
|
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.5);
|
||||||
|
|
||||||
|
.current {
|
||||||
|
border: none;
|
||||||
|
border-radius: 0;
|
||||||
|
color: $current-week-day-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
th {
|
||||||
|
height: auto;
|
||||||
|
|
||||||
|
.day {
|
||||||
|
margin: .5em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.date {
|
||||||
|
margin: 0 0 .25em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tbody.fix:before {
|
||||||
|
content: '';
|
||||||
|
display: block;
|
||||||
|
margin-top: 80px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
p {
|
||||||
|
margin-bottom: .2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: black;
|
||||||
|
|
||||||
|
text-decoration: none;
|
||||||
|
border-bottom: 1px solid #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lesson {
|
||||||
|
font-size: 1.1em;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.teacher {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
.current {
|
||||||
|
border-left: 2px solid $current-week-day-color;
|
||||||
|
border-right: 2px solid $current-week-day-color;
|
||||||
|
}
|
||||||
|
|
||||||
|
.canceled:before {
|
||||||
|
position: absolute;
|
||||||
|
content: "";
|
||||||
|
width: 70%;
|
||||||
|
height: 100%;
|
||||||
|
top: 0;
|
||||||
|
left: 15%;
|
||||||
|
background-image: url(lesson-canceled.svg);
|
||||||
|
}
|
||||||
|
}
|
||||||
+4
-194
@@ -9,203 +9,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.schedule{
|
.schedule {
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: 30px auto 0 auto;
|
margin: 30px auto 0 auto;
|
||||||
padding-bottom: 50px;
|
padding-bottom: 50px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
.schedule-block{
|
& > p {
|
||||||
overflow-x: scroll;
|
margin: 0 0 1em;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
table{
|
|
||||||
position: relative;
|
|
||||||
margin: 30px auto 0 auto;
|
|
||||||
|
|
||||||
border-spacing: 0px;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
td{
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
&:not(.group){
|
|
||||||
min-width: 150px;
|
|
||||||
/* width: 15%;*/
|
|
||||||
width: 150px;
|
|
||||||
padding: 8px 10px 8px;
|
|
||||||
|
|
||||||
vertical-align:baseline;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.group{
|
|
||||||
min-width: 60px;
|
|
||||||
/* width: 5%;*/
|
|
||||||
width: 60px;
|
|
||||||
position: relative;
|
|
||||||
vertical-align:baseline;
|
|
||||||
|
|
||||||
p.name{
|
|
||||||
font-size: 1.4em;
|
|
||||||
font-weight: 800;
|
|
||||||
color: #242424;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
thead{
|
|
||||||
animation-duration: 0.3s;
|
|
||||||
|
|
||||||
th{
|
|
||||||
font-weight: normal;
|
|
||||||
vertical-align: baseline;
|
|
||||||
height: 80px;
|
|
||||||
padding: 10px 0 0;
|
|
||||||
|
|
||||||
&.weekend{
|
|
||||||
color: #f52;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.date{
|
|
||||||
font-size: 1.5em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.group{
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tbody tr:nth-child(even){
|
|
||||||
background-color: #f3f3fd;
|
|
||||||
}
|
|
||||||
|
|
||||||
.lesson{
|
|
||||||
font-size: 1.1em;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.teacher{
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
|
|
||||||
p{
|
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
a{
|
|
||||||
color: black;
|
|
||||||
|
|
||||||
text-decoration: none;
|
|
||||||
border-bottom: 1px solid #ccc;
|
|
||||||
}
|
|
||||||
|
|
||||||
.current{
|
|
||||||
border-left: 2px solid #4b8ff3;
|
|
||||||
border-right: 2px solid #4b8ff3;
|
|
||||||
|
|
||||||
&.first{
|
|
||||||
border-radius: 15px 15px 0 0;
|
|
||||||
border-top: 2px solid #4b8ff3;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.last{
|
|
||||||
border-radius: 0 0 15px 15px;
|
|
||||||
border-bottom: 2px solid #4b8ff3;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.canceled:before{
|
|
||||||
position: absolute;
|
|
||||||
content: "";
|
|
||||||
width:70%;
|
|
||||||
height: 100%;
|
|
||||||
top: 0;
|
|
||||||
left: 15%;
|
|
||||||
background-image: url(lesson-canceled.svg);
|
|
||||||
}
|
|
||||||
|
|
||||||
ul{
|
|
||||||
margin: 0px auto 30px auto;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
li{
|
|
||||||
display: inline-block;
|
|
||||||
padding: 5px 10px;
|
|
||||||
margin: 0 5px;
|
|
||||||
|
|
||||||
&.current{
|
|
||||||
color: #68aeff;
|
|
||||||
border: none;
|
|
||||||
font-weight: bold;
|
|
||||||
/* color: #555;*/
|
|
||||||
/* padding: 5px 15px;*/
|
|
||||||
/* border: 1px solid #4b8ff3;*/
|
|
||||||
/* border-radius: 100px;*/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
a{
|
|
||||||
color: #3f9cea;
|
|
||||||
border-bottom: 1px dashed #ccc;
|
|
||||||
display: inline-block;
|
|
||||||
padding: 0px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
thead.fix{
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
background-color: rgba(255, 255, 255, 0.96);
|
|
||||||
z-index: 100;
|
|
||||||
box-shadow: 0 2px 3px rgba(0, 0, 0, 0.5);
|
|
||||||
border-radius: 0 0 20px 20px;
|
|
||||||
|
|
||||||
.current{
|
|
||||||
border: none;
|
|
||||||
border-radius: 0px;
|
|
||||||
color: #3f9cea;
|
|
||||||
width: 155px;
|
|
||||||
}
|
|
||||||
|
|
||||||
th{
|
|
||||||
height: auto;
|
|
||||||
|
|
||||||
:not(.group){
|
|
||||||
min-width: 150px;
|
|
||||||
/* width: 15%;*/
|
|
||||||
width: 150px;
|
|
||||||
padding: 8px 10px 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.group{
|
|
||||||
width: 63px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.day{
|
|
||||||
margin: 0;
|
|
||||||
line-height: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.date{
|
|
||||||
margin: 15px 0;
|
|
||||||
line-height: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tbody.fix:before{
|
|
||||||
content: "";
|
|
||||||
display: block;
|
|
||||||
margin-top: 90px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media screen and (max-device-width: 400px){
|
|
||||||
.schedule{
|
|
||||||
thead.fix{
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+22
-9
@@ -2,13 +2,20 @@
|
|||||||
* Created by tmshv on 04/11/14.
|
* Created by tmshv on 04/11/14.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var app = angular.module("hudozhka", [
|
var deps = [
|
||||||
|
require('./modules/schedule')
|
||||||
|
]
|
||||||
|
.map(function(m){
|
||||||
|
return m.name;
|
||||||
|
});
|
||||||
|
|
||||||
|
var app = angular.module("hudozhka", deps.concat([
|
||||||
"hudozhka.data",
|
"hudozhka.data",
|
||||||
"ngRoute",
|
"ngRoute",
|
||||||
"angulartics",
|
"angulartics",
|
||||||
"angulartics.google.analytics",
|
"angulartics.google.analytics",
|
||||||
"angularSpinner"
|
"angularSpinner"
|
||||||
]);
|
]));
|
||||||
|
|
||||||
app.config(function ($locationProvider, $routeProvider) {
|
app.config(function ($locationProvider, $routeProvider) {
|
||||||
$locationProvider.hashPrefix("!");
|
$locationProvider.hashPrefix("!");
|
||||||
@@ -19,25 +26,25 @@ app.config(function ($locationProvider, $routeProvider) {
|
|||||||
name: "/",
|
name: "/",
|
||||||
templateUrl: "/views/home.html",
|
templateUrl: "/views/home.html",
|
||||||
controller: "HomePageController",
|
controller: "HomePageController",
|
||||||
title:"ДХШ Шлиссельбурга"
|
title: "ДХШ Шлиссельбурга"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "/schedule",
|
name: "/schedule/:period?/:semester?",
|
||||||
templateUrl: "/views/schedule.html",
|
templateUrl: "/views/schedule.html",
|
||||||
controller: "SchedulePageController",
|
controller: "SchedulePageController",
|
||||||
title:"Расписание"
|
title: "Расписание"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "/team",
|
name: "/team",
|
||||||
templateUrl: "/views/team.html",
|
templateUrl: "/views/team.html",
|
||||||
controller: "TeamPageController",
|
controller: "TeamPageController",
|
||||||
title:"Преподаватели"
|
title: "Преподаватели"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "/gallery",
|
name: "/gallery",
|
||||||
templateUrl: "/views/gallery.html",
|
templateUrl: "/views/gallery.html",
|
||||||
controller: "GalleryPageController",
|
controller: "GalleryPageController",
|
||||||
title:"Работы учащихся"
|
title: "Работы учащихся"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "/gallery/:year/:course/:album",
|
name: "/gallery/:year/:course/:album",
|
||||||
@@ -53,6 +60,7 @@ app.config(function ($locationProvider, $routeProvider) {
|
|||||||
];
|
];
|
||||||
|
|
||||||
routes.forEach(function (route) {
|
routes.forEach(function (route) {
|
||||||
|
if (typeof route === 'function') route = route();
|
||||||
$routeProvider.when(route.name, route);
|
$routeProvider.when(route.name, route);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -61,10 +69,10 @@ app.config(function ($locationProvider, $routeProvider) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
app.run(function($location, $rootScope, $http) {
|
app.run(function ($location, $rootScope, $http) {
|
||||||
$rootScope.$on("$routeChangeSuccess", function (event, current) {
|
$rootScope.$on("$routeChangeSuccess", function (event, current) {
|
||||||
var title = current["$$route"].title;
|
var title = current["$$route"].title;
|
||||||
if(title) $rootScope.title = title;
|
if (title) $rootScope.title = title;
|
||||||
});
|
});
|
||||||
|
|
||||||
$http.defaults.headers.common["Accept"] = "application/json";
|
$http.defaults.headers.common["Accept"] = "application/json";
|
||||||
@@ -72,6 +80,7 @@ app.run(function($location, $rootScope, $http) {
|
|||||||
|
|
||||||
require("./api/api")(app);
|
require("./api/api")(app);
|
||||||
require("./services/io")(app);
|
require("./services/io")(app);
|
||||||
|
require("./directives/mainMenu")(app);
|
||||||
require("./ui/menu")(app);
|
require("./ui/menu")(app);
|
||||||
require("./ui/breadcrumbs")(app);
|
require("./ui/breadcrumbs")(app);
|
||||||
require("./ui/timeline")(app);
|
require("./ui/timeline")(app);
|
||||||
@@ -97,4 +106,8 @@ app.controller("TeamPageController", function ($scope) {
|
|||||||
|
|
||||||
app.controller("DocsPageController", function ($scope) {
|
app.controller("DocsPageController", function ($scope) {
|
||||||
$scope.pageClass = "page-docs";
|
$scope.pageClass = "page-docs";
|
||||||
|
});
|
||||||
|
|
||||||
|
app.controller("AppController", function ($scope, menu) {
|
||||||
|
$scope.menuProvider = menu.items;
|
||||||
});
|
});
|
||||||
@@ -4,7 +4,14 @@ module.exports = function (app) {
|
|||||||
$scope.now = new Date().getFullYear();
|
$scope.now = new Date().getFullYear();
|
||||||
|
|
||||||
$rootScope.$on('$routeChangeSuccess', function (event, current) {
|
$rootScope.$on('$routeChangeSuccess', function (event, current) {
|
||||||
$scope.developer = current['$$route'].originalPath == '/';
|
var originalPath;
|
||||||
|
try{
|
||||||
|
originalPath = current['$$route'].originalPath;
|
||||||
|
}catch(e){
|
||||||
|
originalPath = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$scope.developer = originalPath == '/';
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
+1
-1
@@ -6,7 +6,7 @@ angular.module("hudozhka.data", [])
|
|||||||
.service("team", function () {
|
.service("team", function () {
|
||||||
return require("../models/team");
|
return require("../models/team");
|
||||||
})
|
})
|
||||||
.service("schedule", function () {
|
.service("scheduleData", function () {
|
||||||
return require("../models/schedule");
|
return require("../models/schedule");
|
||||||
})
|
})
|
||||||
.service("docs", function () {
|
.service("docs", function () {
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
module.exports = function (app) {
|
||||||
|
app.directive('mainMenu', function (menu) {
|
||||||
|
return {
|
||||||
|
restrict: 'E',
|
||||||
|
templateUrl: '/views/menu.html',
|
||||||
|
scope: {
|
||||||
|
menu: '=items'
|
||||||
|
},
|
||||||
|
link: function(scope, element){
|
||||||
|
scope.isActive = function (item) {
|
||||||
|
if (menu.current) {
|
||||||
|
return item.url == menu.current.url;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
scope.isValid = function (item) {
|
||||||
|
return 'url' in item;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
@@ -0,0 +1,155 @@
|
|||||||
|
var getDates = require('../../utils/date').getDates;
|
||||||
|
|
||||||
|
module.exports = angular.module('hudozka.schedule', [])
|
||||||
|
.directive('schedule', function ($compile) {
|
||||||
|
return {
|
||||||
|
restrict: 'E',
|
||||||
|
scope: {
|
||||||
|
groups: '='
|
||||||
|
},
|
||||||
|
link: function (scope, element) {
|
||||||
|
var template = `<schedule-table groups="${scope.groups}"></schedule-table>`;
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (window.matchMedia('(max-device-width: 30em)').matches) {
|
||||||
|
template = `<schedule-slider groups="${scope.groups}"></schedule-slider>`
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
}
|
||||||
|
|
||||||
|
element.html(template).show();
|
||||||
|
$compile(element.contents())(scope);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.directive('scheduleTable', function () {
|
||||||
|
return {
|
||||||
|
templateUrl: '/views/schedule/table.html',
|
||||||
|
link: function (scope, element) {
|
||||||
|
//var this_element = element[0];
|
||||||
|
|
||||||
|
var now = new Date();
|
||||||
|
var dates = getDates(now);
|
||||||
|
|
||||||
|
scope.isToday = function (weekDayIndex) {
|
||||||
|
return (now.getDay() - 1) === weekDayIndex;
|
||||||
|
};
|
||||||
|
|
||||||
|
scope.weekDay = function (weekDayIndex) {
|
||||||
|
return dates[weekDayIndex];
|
||||||
|
};
|
||||||
|
|
||||||
|
var $tbody = element.find('table tbody');
|
||||||
|
var $thead = element.find('table thead');
|
||||||
|
var $td_list = [];
|
||||||
|
|
||||||
|
var min;
|
||||||
|
var max;
|
||||||
|
$(window).scroll(function () {
|
||||||
|
const scrollOffset = 150;
|
||||||
|
if(!min) min = element.find('table tbody tr:first-child')[0].offsetTop + scrollOffset;
|
||||||
|
if(!max) max = element.find('table tbody tr:last-child')[0].offsetTop + scrollOffset;
|
||||||
|
|
||||||
|
if(!$td_list.length) $td_list = element.find('table tbody tr:first-child td');
|
||||||
|
$td_list.each(function (i) {
|
||||||
|
var w = this.offsetWidth;
|
||||||
|
$thead.find('th')[i].style.width = `${w}px`;
|
||||||
|
});
|
||||||
|
|
||||||
|
var scroll = $(this).scrollTop();
|
||||||
|
if (scroll >= min && scroll <= max) {
|
||||||
|
$thead.addClass('fix animated fadeInDown');
|
||||||
|
$tbody.addClass('fix');
|
||||||
|
} else {
|
||||||
|
$thead.removeClass('fix animated fadeInDown');
|
||||||
|
$tbody.removeClass('fix');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.directive('scheduleSlider', function ($compile) {
|
||||||
|
return {
|
||||||
|
restrict: 'E',
|
||||||
|
template: '<div class="schedule-slick"></div>',
|
||||||
|
|
||||||
|
link: function (scope, element) {
|
||||||
|
var $slick = element.find('.schedule-slick');
|
||||||
|
|
||||||
|
scope.$watch('groups', function (value) {
|
||||||
|
try {
|
||||||
|
$slick.slick('unslick');
|
||||||
|
} catch (e) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value) {
|
||||||
|
var days = week(value);
|
||||||
|
scope.days = days;
|
||||||
|
|
||||||
|
$slick.html(
|
||||||
|
days.map(function (day, i) {
|
||||||
|
return `<schedule-slide day="days[${i}]"></schedule-slide>`
|
||||||
|
}).join('')
|
||||||
|
).show();
|
||||||
|
$compile($slick.contents())(scope);
|
||||||
|
|
||||||
|
$slick.slick({
|
||||||
|
mobileFirst: true,
|
||||||
|
infinite: false,
|
||||||
|
dots: false,
|
||||||
|
arrows: false,
|
||||||
|
touchThreshold: 20,
|
||||||
|
speed: 250,
|
||||||
|
slidesToShow: 1,
|
||||||
|
centerMode: false
|
||||||
|
});
|
||||||
|
|
||||||
|
var now = new Date();
|
||||||
|
var currentWeekIndex = now.getDay() - 1;
|
||||||
|
$slick.slick('slickGoTo', currentWeekIndex);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.directive('scheduleSlide', function () {
|
||||||
|
return {
|
||||||
|
restrict: 'E',
|
||||||
|
templateUrl: "/views/schedule/slide.html",
|
||||||
|
scope: {
|
||||||
|
day: '='
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.directive('scheduleRecord', function () {
|
||||||
|
return {
|
||||||
|
restrict: 'E',
|
||||||
|
templateUrl: "/views/schedule/record.html",
|
||||||
|
scope: {
|
||||||
|
record: '=',
|
||||||
|
i: '='
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function week(schedule) {
|
||||||
|
var now = new Date();
|
||||||
|
var dates = getDates(now);
|
||||||
|
|
||||||
|
return ['Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота']
|
||||||
|
.map(function (day, i) {
|
||||||
|
return {
|
||||||
|
current: i === now.getDay() - 1,
|
||||||
|
day: day,
|
||||||
|
date: dates[i],
|
||||||
|
groups: schedule.map(function (group) {
|
||||||
|
return {
|
||||||
|
name: group.name,
|
||||||
|
time: group.time,
|
||||||
|
content: group.days[i]
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
+76
-76
@@ -1,81 +1,81 @@
|
|||||||
var populate = require("../../utils/populate").populate;
|
var populate = require('../../utils/populate').populate;
|
||||||
const course = require("../../models/course");
|
const course = require('../../models/course');
|
||||||
|
|
||||||
module.exports = function (app) {
|
function indexEquals(i) {
|
||||||
app.controller("ScheduleController", function ($scope, $http, schedule, team) {
|
return function (_, index) {
|
||||||
var now = new Date();
|
return i === index;
|
||||||
var dates = getDates(now);
|
|
||||||
|
|
||||||
var sem = "autumn";
|
|
||||||
$scope.sem = [["spring", "весеннего"], ["autumn", "осеннего"]].reduce(function (s, word) {
|
|
||||||
if (word[0] === sem) return word[1];
|
|
||||||
});
|
|
||||||
$scope.year = "2014-2015";
|
|
||||||
|
|
||||||
$http.get("/schedule/2014-2015/spring")
|
|
||||||
.success(function (s) {
|
|
||||||
$scope.schedule = schedule.populate(s.schedule, [
|
|
||||||
populate(team.short, "teacher"),
|
|
||||||
populate(course.name, "lesson")
|
|
||||||
]);
|
|
||||||
});
|
|
||||||
|
|
||||||
$scope.isToday = function (weekDayIndex) {
|
|
||||||
return (now.getDay() - 1) === weekDayIndex;
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.weekDay = function (weekDayIndex) {
|
|
||||||
return dates[weekDayIndex];
|
|
||||||
};
|
|
||||||
|
|
||||||
$(window).scroll(function () {
|
|
||||||
if ($(this).scrollTop() >= 220) {
|
|
||||||
$(".schedule table thead").addClass("fix animated fadeInDown");
|
|
||||||
$(".schedule table tbody").addClass("fix");
|
|
||||||
} else {
|
|
||||||
$(".schedule table thead").removeClass("fix animated fadeInDown");
|
|
||||||
$(".schedule table tbody").removeClass("fix");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generates list of numbers
|
|
||||||
* @param {Number} start starting value
|
|
||||||
* @param {Number} num amount of numbers in list
|
|
||||||
* @param {Number} step difference value
|
|
||||||
* @return {Array} list of numbers
|
|
||||||
*/
|
|
||||||
function range(start, num, step) {
|
|
||||||
var list = [];
|
|
||||||
var val = start;
|
|
||||||
for (var i = 0; i < num; i++) {
|
|
||||||
list.push(val);
|
|
||||||
val += step;
|
|
||||||
}
|
}
|
||||||
return list;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///**
|
function isRequested(period, semester) {
|
||||||
// * Monday date of current week
|
return function (schedule) {
|
||||||
// * @param {[type]} d [description]
|
return schedule.period === period && schedule.semester === semester;
|
||||||
// * @return {[type]} [description]
|
}
|
||||||
// */
|
}
|
||||||
//function getMonday(d) {
|
|
||||||
// d = new Date(d);
|
|
||||||
// var day = d.getDay();
|
|
||||||
// var diff = d.getDate() - day + (day == 0 ? -6 : 1); // adjust when day is sunday
|
|
||||||
// return new Date(d.setDate(diff));
|
|
||||||
//}
|
|
||||||
|
|
||||||
function getDates(start) {
|
module.exports = function (app) {
|
||||||
var day = start.getDay();
|
app.controller('ScheduleController', function ($scope, $http, $location, $routeParams, scheduleData, team, menu) {
|
||||||
return range(0, 6, 1).reduce(function (dates, weekDay) {
|
menu.activate('/schedule');
|
||||||
var d = 1 + weekDay - day;
|
|
||||||
var time = start.getTime() + (1000 * 60 * 60 * 24) * d;
|
var current_period = $routeParams.period;
|
||||||
var date = new Date(time);
|
var current_semester = $routeParams.semester;
|
||||||
dates.push(date.getDate());
|
var isScheduleRequested = current_period && current_semester;
|
||||||
return dates;
|
|
||||||
}, []);
|
$http.get("/schedules", {cache: true})
|
||||||
}
|
.success(function (schedules) {
|
||||||
|
// By url params or last element
|
||||||
|
var select_fn = isScheduleRequested ? isRequested(current_period, current_semester) : indexEquals(schedules.length - 1);
|
||||||
|
|
||||||
|
schedules = schedules.map(function (schedule) {
|
||||||
|
var sem = [['spring', 'Весена'], ['autumn', 'Осень']].reduce(function (s, word) {
|
||||||
|
if (word[0] === schedule.semester) return word[1];
|
||||||
|
else return s[1];
|
||||||
|
});
|
||||||
|
schedule.text = `${sem} ${schedule.period} года`;
|
||||||
|
|
||||||
|
return schedule;
|
||||||
|
});
|
||||||
|
|
||||||
|
schedules.forEach(function (schedule, i) {
|
||||||
|
if (select_fn(schedule, i)) {
|
||||||
|
$scope.currentSchedule = schedules[i];
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$scope.schedules = schedules;
|
||||||
|
$scope.loadSchedule($scope.currentSchedule, isScheduleRequested);
|
||||||
|
});
|
||||||
|
|
||||||
|
$scope.loadSchedule = function (s, updateURL) {
|
||||||
|
var id = s._id;
|
||||||
|
var schedule_item = getScheduleByID(id);
|
||||||
|
|
||||||
|
if (schedule_item) {
|
||||||
|
var sem = schedule_item.semester;
|
||||||
|
var period = schedule_item.period;
|
||||||
|
|
||||||
|
var url = `/schedule/${period}/${sem}`;
|
||||||
|
$http.get(url, {cache: true})
|
||||||
|
.success(function (scheduleRecord) {
|
||||||
|
$scope.groups = scheduleData.populate(scheduleRecord.schedule, [
|
||||||
|
populate(team.short, 'teacher'),
|
||||||
|
populate(course.name, 'lesson')
|
||||||
|
]);
|
||||||
|
|
||||||
|
if (updateURL) {
|
||||||
|
$location.url(url);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
function getScheduleByID(id) {
|
||||||
|
var schedules = $scope.schedules;
|
||||||
|
for (var i = 0, l = schedules.length; i < l; i++) {
|
||||||
|
var s = schedules[i];
|
||||||
|
if (id === s._id) return s;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
@@ -3,9 +3,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
module.exports = function (app) {
|
module.exports = function (app) {
|
||||||
var socket = io();
|
var socket;
|
||||||
|
function init(){
|
||||||
|
socket = io();
|
||||||
|
}
|
||||||
|
|
||||||
app.service("io", function(){
|
app.service("io", function () {
|
||||||
|
if (!socket) init();
|
||||||
return socket;
|
return socket;
|
||||||
})
|
});
|
||||||
};
|
};
|
||||||
+6
-18
@@ -21,26 +21,14 @@ module.exports = function (app) {
|
|||||||
|
|
||||||
var menu = new Menu();
|
var menu = new Menu();
|
||||||
$rootScope.$on('$routeChangeSuccess', function (event, current) {
|
$rootScope.$on('$routeChangeSuccess', function (event, current) {
|
||||||
var path = current['$$route'].originalPath;
|
try{
|
||||||
menu.activate(path);
|
var path = current['$$route'].originalPath;
|
||||||
|
menu.activate(path);
|
||||||
|
}catch(e){
|
||||||
|
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return menu;
|
return menu;
|
||||||
});
|
});
|
||||||
|
|
||||||
app.controller("MenuController", function ($scope, menu) {
|
|
||||||
$scope.menu = menu;
|
|
||||||
|
|
||||||
$scope.isActive = function (item) {
|
|
||||||
if(menu.current) {
|
|
||||||
return item.url == menu.current.url;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.isValid = function (item) {
|
|
||||||
return 'url' in item;
|
|
||||||
};
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
NODE_ENV=production gulp
|
||||||
|
|
||||||
tarfile=build.tar.gz
|
tarfile=build.tar.gz
|
||||||
tarpath=$TMPDIR$tarfile
|
tarpath=$TMPDIR$tarfile
|
||||||
|
|
||||||
|
|||||||
+34
-31
@@ -1,6 +1,8 @@
|
|||||||
var path = require("path");
|
var path = require("path");
|
||||||
var gulp = require("gulp");
|
var gulp = require("gulp");
|
||||||
|
var _if = require("gulp-if");
|
||||||
var sass = require("gulp-sass");
|
var sass = require("gulp-sass");
|
||||||
|
var babel = require("babelify");
|
||||||
var minify_css = require("gulp-minify-css");
|
var minify_css = require("gulp-minify-css");
|
||||||
var autoprefixer = require("gulp-autoprefixer");
|
var autoprefixer = require("gulp-autoprefixer");
|
||||||
var imageMin = require("gulp-imagemin");
|
var imageMin = require("gulp-imagemin");
|
||||||
@@ -9,6 +11,26 @@ var concat = require("gulp-concat");
|
|||||||
var browserify = require("gulp-browserify");
|
var browserify = require("gulp-browserify");
|
||||||
var annotate = require("browserify-ngannotate");
|
var annotate = require("browserify-ngannotate");
|
||||||
|
|
||||||
|
var is_production = process.env['NODE_ENV'] == 'production';
|
||||||
|
|
||||||
|
gulp.task("concat-bower", function () {
|
||||||
|
var files = [
|
||||||
|
"public/bower_components/jquery/dist/jquery.min.js",
|
||||||
|
"public/bower_components/angular/angular.min.js",
|
||||||
|
"public/bower_components/angular-route/angular-route.min.js",
|
||||||
|
"public/bower_components/angular-animate/angular-animate.min.js",
|
||||||
|
"public/bower_components/angulartics/dist/angulartics.min.js",
|
||||||
|
"public/bower_components/angulartics/dist/angulartics-ga.min.js",
|
||||||
|
"public/bower_components/spin.js/spin.js",
|
||||||
|
"public/bower_components/angular-spinner/angular-spinner.min.js",
|
||||||
|
"public/bower_components/socket.io-client/socket.io.js"
|
||||||
|
];
|
||||||
|
gulp.src(files)
|
||||||
|
.pipe(concat("libs.js"))
|
||||||
|
.pipe(uglify())
|
||||||
|
.pipe(gulp.dest("public"));
|
||||||
|
});
|
||||||
|
|
||||||
gulp.task("sass", function () {
|
gulp.task("sass", function () {
|
||||||
gulp.src("./assets/style/*.scss")
|
gulp.src("./assets/style/*.scss")
|
||||||
.pipe(sass())
|
.pipe(sass())
|
||||||
@@ -25,43 +47,24 @@ gulp.task("copy", function(){
|
|||||||
gulp.src("./assets/graphics/*")
|
gulp.src("./assets/graphics/*")
|
||||||
.pipe(gulp.dest("./public/graphics"));
|
.pipe(gulp.dest("./public/graphics"));
|
||||||
|
|
||||||
gulp.src("./3rdparty/*")
|
gulp.src([
|
||||||
.pipe(gulp.dest("./public"));
|
"./3rdparty/*",
|
||||||
|
"robots.txt"
|
||||||
gulp.src("robots.txt")
|
])
|
||||||
.pipe(gulp.dest("./public"));
|
|
||||||
|
|
||||||
gulp.src("sitemap.xml")
|
|
||||||
.pipe(gulp.dest("./public"));
|
.pipe(gulp.dest("./public"));
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task("compile", function(){
|
gulp.task("compile", function(){
|
||||||
gulp.src("client/app.js")
|
gulp.src([
|
||||||
|
"client/app.js",
|
||||||
|
"client/document.js",
|
||||||
|
"client/data.js",
|
||||||
|
"client/instagram.js"
|
||||||
|
])
|
||||||
.pipe(browserify({
|
.pipe(browserify({
|
||||||
transform: [annotate]
|
transform: [annotate, babel]
|
||||||
}))
|
}))
|
||||||
.pipe(uglify())
|
.pipe(_if(is_production, uglify()))
|
||||||
.pipe(gulp.dest("public"));
|
|
||||||
|
|
||||||
gulp.src("client/document.js")
|
|
||||||
.pipe(browserify({
|
|
||||||
transform: [annotate]
|
|
||||||
}))
|
|
||||||
.pipe(uglify())
|
|
||||||
.pipe(gulp.dest("public"));
|
|
||||||
|
|
||||||
gulp.src("client/data.js")
|
|
||||||
.pipe(browserify({
|
|
||||||
transform: [annotate]
|
|
||||||
}))
|
|
||||||
.pipe(uglify())
|
|
||||||
.pipe(gulp.dest("public"));
|
|
||||||
|
|
||||||
gulp.src("client/instagram.js")
|
|
||||||
.pipe(browserify({
|
|
||||||
transform: [annotate]
|
|
||||||
}))
|
|
||||||
.pipe(uglify())
|
|
||||||
.pipe(gulp.dest("public"));
|
.pipe(gulp.dest("public"));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -11,6 +11,10 @@
|
|||||||
"id": "sculpting",
|
"id": "sculpting",
|
||||||
"name": "Скульптура"
|
"name": "Скульптура"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "ceramic",
|
||||||
|
"name": "Керамика"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "composition",
|
"id": "composition",
|
||||||
"name": "Композиция"
|
"name": "Композиция"
|
||||||
|
|||||||
@@ -101,5 +101,14 @@
|
|||||||
"diploma": "ВСВ 1321444",
|
"diploma": "ВСВ 1321444",
|
||||||
"status": "",
|
"status": "",
|
||||||
"picture": "http://static.shburg.org/art/team/teacher.jpg"
|
"picture": "http://static.shburg.org/art/team/teacher.jpg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "ea-burovtseva",
|
||||||
|
"name": "Ев Ал Буровцева",
|
||||||
|
"position": "Преподаватель керамики",
|
||||||
|
"edu": "",
|
||||||
|
"diploma": "",
|
||||||
|
"status": "",
|
||||||
|
"picture": ""
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -28,15 +28,18 @@
|
|||||||
"koa.io": "0.0.3",
|
"koa.io": "0.0.3",
|
||||||
"mz": "^1.3.0",
|
"mz": "^1.3.0",
|
||||||
"promised-mongo": "git+https://git@github.com/tmshv/promised-mongo",
|
"promised-mongo": "git+https://git@github.com/tmshv/promised-mongo",
|
||||||
|
"sitemap": "^0.9.0",
|
||||||
"thunkify": "^2.1.2"
|
"thunkify": "^2.1.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"babelify": "^6.1.3",
|
||||||
"bower": "^1.3.12",
|
"bower": "^1.3.12",
|
||||||
"browserify-ngannotate": "^0.7.1",
|
"browserify-ngannotate": "^0.7.1",
|
||||||
"gulp": "^3.8.10",
|
"gulp": "^3.8.10",
|
||||||
"gulp-autoprefixer": "0.0.6",
|
"gulp-autoprefixer": "0.0.6",
|
||||||
"gulp-browserify": "^0.5.0",
|
"gulp-browserify": "^0.5.0",
|
||||||
"gulp-concat": "^2.4.1",
|
"gulp-concat": "^2.4.1",
|
||||||
|
"gulp-if": "^1.2.5",
|
||||||
"gulp-imagemin": "~0.1.5",
|
"gulp-imagemin": "~0.1.5",
|
||||||
"gulp-minify-css": "~0.3.0",
|
"gulp-minify-css": "~0.3.0",
|
||||||
"gulp-sass": "^1.2.2",
|
"gulp-sass": "^1.2.2",
|
||||||
|
|||||||
+1
-3
@@ -1,7 +1,5 @@
|
|||||||
User-agent: *
|
User-agent: *
|
||||||
Disallow:
|
Disallow: /news
|
||||||
Allow: /
|
Allow: /
|
||||||
Host: art.shlisselburg.org
|
Host: art.shlisselburg.org
|
||||||
Sitemap: http://art.shlisselburg.org/sitemap.xml
|
Sitemap: http://art.shlisselburg.org/sitemap.xml
|
||||||
Crawl-delay: 3
|
|
||||||
Crawl-rate: 1/3
|
|
||||||
@@ -44,4 +44,20 @@ module.exports = function (app) {
|
|||||||
}
|
}
|
||||||
))
|
))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
app.use(
|
||||||
|
route.get("/schedules", router.accepts(
|
||||||
|
{
|
||||||
|
"text/html": router.index(),
|
||||||
|
"text/plain": router.index(),
|
||||||
|
|
||||||
|
"application/json": function *() {
|
||||||
|
this.type = "application/json";
|
||||||
|
var data = yield db.c("schedules").find({}, {period:1 , semester: 1}).toArray();
|
||||||
|
if(!data) this.status = 404;
|
||||||
|
else this.body = data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
))
|
||||||
|
);
|
||||||
};
|
};
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
/**
|
||||||
|
* Created by tmshv on 22/11/14.
|
||||||
|
*/
|
||||||
|
|
||||||
|
var co = require("co");
|
||||||
|
var sitemap = require("sitemap");
|
||||||
|
var route = require("koa-route");
|
||||||
|
var router = require("./");
|
||||||
|
var db = require("../core/db");
|
||||||
|
|
||||||
|
module.exports = function (app) {
|
||||||
|
app.use(route.get("/sitemap.xml", function *() {
|
||||||
|
var urls = yield [menu(), gallery()];
|
||||||
|
urls = urls.reduce(function (urls, i) {
|
||||||
|
return urls.concat(i);
|
||||||
|
});
|
||||||
|
|
||||||
|
var sm = sitemap.createSitemap({
|
||||||
|
hostname: 'http://art.shlisselburg.org',
|
||||||
|
cacheTime: 600000, // 600 sec - cache purge period
|
||||||
|
urls: urls
|
||||||
|
});
|
||||||
|
|
||||||
|
var data = yield new Promise(function (resolve) {
|
||||||
|
sm.toXML(resolve);
|
||||||
|
});
|
||||||
|
|
||||||
|
this.set('Content-Type', 'application/xml');
|
||||||
|
this.body = data;
|
||||||
|
}));
|
||||||
|
};
|
||||||
|
|
||||||
|
function *menu(){
|
||||||
|
return require('../models/menu.json')
|
||||||
|
.filter(function(item){
|
||||||
|
return 'url' in item
|
||||||
|
})
|
||||||
|
.map(function (item) {
|
||||||
|
return {
|
||||||
|
url: item.url,
|
||||||
|
changefreq: 'daily'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function *gallery(){
|
||||||
|
var albums = yield db.c("albums")
|
||||||
|
.find({})
|
||||||
|
.toArray();
|
||||||
|
|
||||||
|
return albums.map(function (album) {
|
||||||
|
return {
|
||||||
|
url: `/gallery/${album.date.getFullYear()}${album.course_uri}${album.uri}`,
|
||||||
|
changefreq: 'monthly'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
@@ -20,6 +20,15 @@ app.use(bodyParser());
|
|||||||
app.use(logger());
|
app.use(logger());
|
||||||
app.use(conditional());
|
app.use(conditional());
|
||||||
app.use(etag());
|
app.use(etag());
|
||||||
|
|
||||||
|
app.use(function *(next) {
|
||||||
|
yield* next;
|
||||||
|
|
||||||
|
try{
|
||||||
|
var xp = this.response.header['x-prerender'] == 'true';
|
||||||
|
if(xp) this.body = this.body.replace('<meta name="fragment" content="!">', '');
|
||||||
|
}catch(e){}
|
||||||
|
});
|
||||||
app.use(prerender(config.prerender));
|
app.use(prerender(config.prerender));
|
||||||
|
|
||||||
app.use(serve(path.join(__dirname, "public")));
|
app.use(serve(path.join(__dirname, "public")));
|
||||||
@@ -52,6 +61,8 @@ app.use(route.get("/document/:doc", routes.index(
|
|||||||
path.join(__dirname, "templates/document.html")
|
path.join(__dirname, "templates/document.html")
|
||||||
)));
|
)));
|
||||||
|
|
||||||
|
require("./routes/sitemap")(app);
|
||||||
|
|
||||||
require("./routes/schedule")(app);
|
require("./routes/schedule")(app);
|
||||||
require("./routes/news")(app);
|
require("./routes/news")(app);
|
||||||
require("./routes/gallery")(app);
|
require("./routes/gallery")(app);
|
||||||
|
|||||||
-28
@@ -1,28 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
|
|
||||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
||||||
<url>
|
|
||||||
<loc>http://art.shlisselburg.org</loc>
|
|
||||||
<changefreq>daily</changefreq>
|
|
||||||
</url>
|
|
||||||
|
|
||||||
<url>
|
|
||||||
<loc>http://art.shlisselburg.org/schedule</loc>
|
|
||||||
<changefreq>weekly</changefreq>
|
|
||||||
</url>
|
|
||||||
|
|
||||||
<url>
|
|
||||||
<loc>http://art.shlisselburg.org/team</loc>
|
|
||||||
<changefreq>montly</changefreq>
|
|
||||||
</url>
|
|
||||||
|
|
||||||
<url>
|
|
||||||
<loc>http://art.shlisselburg.org/gallery</loc>
|
|
||||||
<changefreq>weekly</changefreq>
|
|
||||||
</url>
|
|
||||||
|
|
||||||
<url>
|
|
||||||
<loc>http://art.shlisselburg.org/docs</loc>
|
|
||||||
<changefreq>weekly</changefreq>
|
|
||||||
</url>
|
|
||||||
</urlset>
|
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html ng-app="hudozhka">
|
|
||||||
<head>
|
|
||||||
<base href="/">
|
|
||||||
<meta name="fragment" content="!">
|
|
||||||
<meta name="google-site-verification" content="8BxOTw-Q02DS2KAdcGcnIMwiPZ58DVB18XpOfRibCcg">
|
|
||||||
<meta name="viewport" content="width=device-width, maximum-scale=1.0" />
|
|
||||||
|
|
||||||
<title ng-bind="title">ДШХ Шлиссельбурга</title>
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="/style.css">
|
|
||||||
<link rel="stylesheet" href="/animate.min.css">
|
|
||||||
<link rel="stylesheet" href="/fonts/stylesheet.css">
|
|
||||||
|
|
||||||
<script src="/bower_components/jquery/dist/jquery.min.js"></script>
|
|
||||||
<script src="/bower_components/angular/angular.min.js"></script>
|
|
||||||
<script src="/bower_components/angular-route/angular-route.min.js"></script>
|
|
||||||
<script src="/bower_components/angular-animate/angular-animate.min.js"></script>
|
|
||||||
<script src="/bower_components/angulartics/dist/angulartics.min.js"></script>
|
|
||||||
<script src="/bower_components/angulartics/dist/angulartics-ga.min.js"></script>
|
|
||||||
<script src="/bower_components/spin.js/spin.js"></script>
|
|
||||||
<script src="/bower_components/angular-spinner/angular-spinner.min.js"></script>
|
|
||||||
<script src="/bower_components/socket.io-client/socket.io.js"></script>
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="/bower_components/fotorama/fotorama.css">
|
|
||||||
<script src="/bower_components/fotorama/fotorama.js"></script>
|
|
||||||
|
|
||||||
<script src="/data.js"></script>
|
|
||||||
<script src="/app.js"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="wrapper">
|
|
||||||
<header>
|
|
||||||
<nav role="navigation" ng-controller="MenuController">
|
|
||||||
<ul>
|
|
||||||
<li ng-repeat="item in menu.items" class="{{item.color}}" ng-class="{selected: isActive(item)}">
|
|
||||||
<span ng-hide="isValid(item)">{{item.text}}</span>
|
|
||||||
<a href="{{item.url}}" ng-show="isValid(item)">{{item.text}}</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<div class="content">
|
|
||||||
<div class="page {{pageClass}}" ng-view autoscroll="true"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<footer>
|
|
||||||
<div class="info-block">
|
|
||||||
<div>
|
|
||||||
<h4>Документы</h4>
|
|
||||||
<ul>
|
|
||||||
<li><a target="_blank" href="/document/edu-license">Лицензия на осуществление образовательной деятельности</a></li>
|
|
||||||
<li><a target="_blank" href="/document/gov-certificate">Свидетельство о государственной регистрации права</a></li>
|
|
||||||
<li><a target="_blank" href="/document/EGRYL1">Свидетельство о внесении в «ЕГРЮЛ»</a></li>
|
|
||||||
<li><a target="_blank" href="/document/VAT">ИНН</a></li>
|
|
||||||
<li><a target="_blank" href="/document/statue-2013">Устав школы</a></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<div>
|
|
||||||
<h4>Ссылки на образовательные сайты</h4>
|
|
||||||
<ul>
|
|
||||||
<li><a href="http://минобрнауки.рф">минобрнауки.рф</a> — Министерство образования и науки Российской Федерации</li>
|
|
||||||
<li><a href="http://edu.ru">edu.ru</a> — Федеральный сайт «Российское образование»</li>
|
|
||||||
<li><a href="http://window.edu.ru">window.edu.ru</a> — Единое окно доступа к образовательным ресурсам</li>
|
|
||||||
<li><a href="http://school-collection.edu.ru">school-collection.edu.ru</a> — Единая коллекция цифровых образовательных ресурсов</li>
|
|
||||||
<li><a href="http://fcior.edu.ru">fcior.edu.ru</a> — Федеральный центр информационных образовательных ресурсов</li>
|
|
||||||
</ul>
|
|
||||||
<ul>
|
|
||||||
<li><a href="http://dkhshmga.ru">dkhshmga.ru</a> — Художественная школа Мги</li>
|
|
||||||
<li><a href="http://kirovskdmh.ucoz.ru">kirovskdmh.ucoz.ru</a> — Музыкальная школа Кировска</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="contacts" ng-controller="ContactsController">
|
|
||||||
<div>
|
|
||||||
<h4>Контактная информация</h4>
|
|
||||||
<p>Адрес: {{address}}</p>
|
|
||||||
<p>Телефон: {{telephone}}</p>
|
|
||||||
<p>Почта: <a href="mailto:{{email}}">{{email}}</a></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="copyright" ng-controller="CopyrightController">
|
|
||||||
<span>© 2014...{{now}} Художественная школа Шлиссельбурга</span>
|
|
||||||
<span ng-show="developer">Разработка и поддержка сайта — <a href="tmshv.ru?utm_source=artshburg&utm_medium=developer&utm_campaign=tmshv_ru">www.tmshv.ru</a></span>
|
|
||||||
</div>
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
+27
-36
@@ -1,61 +1,52 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html ng-app="hudozhka">
|
<html ng-app="hudozhka">
|
||||||
<head>
|
<head>
|
||||||
<base href="/">
|
|
||||||
<meta name="fragment" content="!">
|
<meta name="fragment" content="!">
|
||||||
<meta name="google-site-verification" content="8BxOTw-Q02DS2KAdcGcnIMwiPZ58DVB18XpOfRibCcg">
|
<meta name="google-site-verification" content="8BxOTw-Q02DS2KAdcGcnIMwiPZ58DVB18XpOfRibCcg">
|
||||||
|
<meta name="msvalidate.01" content="E878301FE3E3F12D233A6B1156889601" />
|
||||||
<meta name="viewport" content="width=device-width, maximum-scale=1.0" />
|
<meta name="viewport" content="width=device-width, maximum-scale=1.0" />
|
||||||
|
|
||||||
<title ng-bind="title">ДШХ Шлиссельбурга</title>
|
<base href="/">
|
||||||
|
<title ng-bind="title">ДХШ Шлиссельбурга</title>
|
||||||
|
|
||||||
<link rel="stylesheet" href="/style.css">
|
<link rel="stylesheet" href="/style.css">
|
||||||
<link rel="stylesheet" href="/animate.min.css">
|
<link rel="stylesheet" href="/animate.min.css">
|
||||||
<link rel="stylesheet" href="/fonts/stylesheet.css">
|
<link rel="stylesheet" href="/fonts/stylesheet.css">
|
||||||
|
|
||||||
<script src="/bower_components/jquery/dist/jquery.min.js"></script>
|
<script src="/libs.js"></script>
|
||||||
<script src="/bower_components/angular/angular.min.js"></script>
|
|
||||||
<script src="/bower_components/angular-route/angular-route.min.js"></script>
|
|
||||||
<script src="/bower_components/angular-animate/angular-animate.min.js"></script>
|
|
||||||
<script src="/bower_components/angulartics/dist/angulartics.min.js"></script>
|
|
||||||
<script src="/bower_components/angulartics/dist/angulartics-ga.min.js"></script>
|
|
||||||
<script src="/bower_components/spin.js/spin.js"></script>
|
|
||||||
<script src="/bower_components/angular-spinner/angular-spinner.min.js"></script>
|
|
||||||
<script src="/bower_components/socket.io-client/socket.io.js"></script>
|
|
||||||
|
|
||||||
<link rel="stylesheet" href="/bower_components/fotorama/fotorama.css">
|
<link href="http://cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.4/fotorama.css" rel="stylesheet">
|
||||||
<script src="/bower_components/fotorama/fotorama.js"></script>
|
<script src="http://cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.4/fotorama.js"></script>
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="//cdn.jsdelivr.net/jquery.slick/1.5.7/slick.css"/>
|
||||||
|
<script src="//cdn.jsdelivr.net/jquery.slick/1.5.7/slick.min.js"></script>
|
||||||
|
|
||||||
<script src="/data.js"></script>
|
<script src="/data.js"></script>
|
||||||
<script src="/app.js"></script>
|
<script src="/app.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
(function (i, s, o, g, r, a, m) {
|
if(window.location.host.indexOf('localhost') === -1){
|
||||||
i['GoogleAnalyticsObject'] = r;
|
(function (i, s, o, g, r, a, m) {
|
||||||
i[r] = i[r] || function () {
|
i['GoogleAnalyticsObject'] = r;
|
||||||
(i[r].q = i[r].q || []).push(arguments)
|
i[r] = i[r] || function () {
|
||||||
}, i[r].l = 1 * new Date();
|
(i[r].q = i[r].q || []).push(arguments)
|
||||||
a = s.createElement(o),
|
}, i[r].l = 1 * new Date();
|
||||||
m = s.getElementsByTagName(o)[0];
|
a = s.createElement(o),
|
||||||
a.async = 1;
|
m = s.getElementsByTagName(o)[0];
|
||||||
a.src = g;
|
a.async = 1;
|
||||||
m.parentNode.insertBefore(a, m)
|
a.src = g;
|
||||||
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
|
m.parentNode.insertBefore(a, m)
|
||||||
|
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
|
||||||
|
|
||||||
ga('create', 'UA-60209057-1', 'auto');
|
ga('create', 'UA-60209057-1', 'auto');
|
||||||
// ga('send', 'pageview');
|
//ga('send', 'pageview');
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="wrapper">
|
<div class="wrapper" ng-controller="AppController">
|
||||||
<header>
|
<header>
|
||||||
<nav role="navigation" ng-controller="MenuController">
|
<main-menu items="menuProvider"></main-menu>
|
||||||
<ul>
|
|
||||||
<li ng-repeat="item in menu.items" class="{{item.color}}" ng-class="{selected: isActive(item)}">
|
|
||||||
<span ng-hide="isValid(item)">{{item.text}}</span>
|
|
||||||
<a href="{{item.url}}" ng-show="isValid(item)">{{item.text}}</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div class="content">
|
<div class="content">
|
||||||
@@ -100,7 +91,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="copyright" ng-controller="CopyrightController">
|
<div class="copyright" ng-controller="CopyrightController">
|
||||||
<span>© 2014...{{now}} Художественная школа Шлиссельбурга</span>
|
<span>© 2012...{{now}} Художественная школа Шлиссельбурга</span>
|
||||||
<span ng-show="developer">Разработка и поддержка сайта — <a href="http://tmshv.ru?utm_source=artshburg&utm_medium=developer&utm_campaign=tmshv_ru">www.tmshv.ru</a></span>
|
<span ng-show="developer">Разработка и поддержка сайта — <a href="http://tmshv.ru?utm_source=artshburg&utm_medium=developer&utm_campaign=tmshv_ru">www.tmshv.ru</a></span>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
<nav role="navigation" class="main-menu">
|
||||||
|
<li ng-repeat="item in menu" class="{{item.color}}" ng-class="{selected: isActive(item)}">
|
||||||
|
<span ng-hide="isValid(item)">{{item.text}}</span>
|
||||||
|
<a href="{{item.url}}" ng-show="isValid(item)">{{item.text}}</a>
|
||||||
|
</li>
|
||||||
|
</nav>
|
||||||
@@ -1,61 +1,9 @@
|
|||||||
<div class="schedule" ng-controller="ScheduleController">
|
<div class="schedule" ng-controller="ScheduleController">
|
||||||
<p> Расписание {{sem}} семестра {{year}} года</p>
|
<p>
|
||||||
<div class="schedule-block">
|
<label>
|
||||||
<table>
|
<select ng-model="currentSchedule" ng-change="loadSchedule(currentSchedule, true)" ng-options="s.text for s in schedules"></select>
|
||||||
<thead class="">
|
</label>
|
||||||
<tr>
|
</p>
|
||||||
<th class="group">Гр.</th>
|
|
||||||
<th ng-class="{current: isToday(0)}">
|
|
||||||
<p class="day">Понедельник</p>
|
|
||||||
|
|
||||||
<p class="date">{{weekDay(0)}}</p>
|
<schedule groups="groups"></schedule>
|
||||||
</th>
|
|
||||||
<th ng-class="{current: isToday(1)}">
|
|
||||||
<p class="day">Вторник</p>
|
|
||||||
|
|
||||||
<p class="date">{{weekDay(1)}}</p>
|
|
||||||
</th>
|
|
||||||
<th ng-class="{current: isToday(2)}">
|
|
||||||
<p class="day">Среда</p>
|
|
||||||
|
|
||||||
<p class="date">{{weekDay(2)}}</p>
|
|
||||||
</th>
|
|
||||||
<th ng-class="{current: isToday(3)}">
|
|
||||||
<p class="day">Четверг</p>
|
|
||||||
|
|
||||||
<p class="date">{{weekDay(3)}}</p>
|
|
||||||
</th>
|
|
||||||
<th ng-class="{current: isToday(4)}">
|
|
||||||
<p class="day">Пятница</p>
|
|
||||||
|
|
||||||
<p class="date">{{weekDay(4)}}</p>
|
|
||||||
</th>
|
|
||||||
<th ng-class="{current: isToday(5)}">
|
|
||||||
<p class="day">Суббота</p>
|
|
||||||
|
|
||||||
<p class="date">{{weekDay(5)}}</p>
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody class="">
|
|
||||||
<tr ng-repeat="group in schedule">
|
|
||||||
<td class="group">
|
|
||||||
<p class="name">{{group.name}}</p>
|
|
||||||
|
|
||||||
<p class="time">{{group.time}}</p>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<td ng-repeat="day in group.days track by $index" ng-class="{current: isToday($index)}">
|
|
||||||
<p class="lesson"><a href="">{{day.lesson}}</a></p>
|
|
||||||
|
|
||||||
<p class="teacher"><a href="">{{day.teacher}}</a></p>
|
|
||||||
|
|
||||||
<p class="time">{{day.time[0]}}</p>
|
|
||||||
|
|
||||||
<p class="time">{{day.time[1]}}</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<div class="schedule-record" ng-class="{even: i % 2 === 0, empty: !record.content.lesson}">
|
||||||
|
<div class="schedule-record__head">Группа {{record.name}} ({{record.time}})</div>
|
||||||
|
<div class="schedule-record__main">
|
||||||
|
<p class="schedule-record__name">{{record.content.lesson}}</p>
|
||||||
|
<p class="schedule-record__tutor">{{record.content.teacher}}</p>
|
||||||
|
<p class="schedule-record__time" ng-repeat="time in record.content.time">{{time}}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<div class="schedule-slider__slide" ng-class="{current: day.current}">
|
||||||
|
<div class="schedule-slider__head">
|
||||||
|
<p>{{day.day}}</p>
|
||||||
|
<p>{{day.date}}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="schedule-slider__body">
|
||||||
|
<schedule-record ng-repeat="group in day.groups track by $index" record="group" i="$index"></schedule-record>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
<div class="schedule-table" ng-show="groups">
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="group">Гр.</th>
|
||||||
|
<th ng-class="{current: isToday(0)}">
|
||||||
|
<p class="day">Понедельник</p>
|
||||||
|
|
||||||
|
<p class="date">{{weekDay(0)}}</p>
|
||||||
|
</th>
|
||||||
|
<th ng-class="{current: isToday(1)}">
|
||||||
|
<p class="day">Вторник</p>
|
||||||
|
|
||||||
|
<p class="date">{{weekDay(1)}}</p>
|
||||||
|
</th>
|
||||||
|
<th ng-class="{current: isToday(2)}">
|
||||||
|
<p class="day">Среда</p>
|
||||||
|
|
||||||
|
<p class="date">{{weekDay(2)}}</p>
|
||||||
|
</th>
|
||||||
|
<th ng-class="{current: isToday(3)}">
|
||||||
|
<p class="day">Четверг</p>
|
||||||
|
|
||||||
|
<p class="date">{{weekDay(3)}}</p>
|
||||||
|
</th>
|
||||||
|
<th ng-class="{current: isToday(4)}">
|
||||||
|
<p class="day">Пятница</p>
|
||||||
|
|
||||||
|
<p class="date">{{weekDay(4)}}</p>
|
||||||
|
</th>
|
||||||
|
<th ng-class="{current: isToday(5)}">
|
||||||
|
<p class="day">Суббота</p>
|
||||||
|
|
||||||
|
<p class="date">{{weekDay(5)}}</p>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tbody>
|
||||||
|
<tr ng-repeat="group in groups">
|
||||||
|
<td class="group">
|
||||||
|
<p class="name">{{group.name}}</p>
|
||||||
|
<p class="time">{{group.time}}</p>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td ng-repeat="day in group.days track by $index" ng-class="{current: isToday($index)}">
|
||||||
|
<p class="lesson"><a href="">{{day.lesson}}</a></p>
|
||||||
|
<p class="teacher"><a href="">{{day.teacher}}</a></p>
|
||||||
|
<p class="time">{{day.time[0]}}</p>
|
||||||
|
<p class="time">{{day.time[1]}}</p>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
module.exports = {
|
||||||
|
range: range
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generates list of numbers
|
||||||
|
* @param {Number} start starting value
|
||||||
|
* @param {Number} num amount of numbers in list
|
||||||
|
* @param {Number} step difference value
|
||||||
|
* @return {Array} list of numbers
|
||||||
|
*/
|
||||||
|
function range(start, num, step) {
|
||||||
|
var list = [];
|
||||||
|
var val = start;
|
||||||
|
for (var i = 0; i < num; i++) {
|
||||||
|
list.push(val);
|
||||||
|
val += step;
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
var range = require('./common').range;
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
getDates: getDates
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param start
|
||||||
|
* @returns {*}
|
||||||
|
*/
|
||||||
|
function getDates(start) {
|
||||||
|
var day = start.getDay();
|
||||||
|
return range(0, 6, 1).reduce(function (dates, weekDay) {
|
||||||
|
var d = 1 + weekDay - day;
|
||||||
|
var time = start.getTime() + (1000 * 60 * 60 * 24) * d;
|
||||||
|
var date = new Date(time);
|
||||||
|
dates.push(date.getDate());
|
||||||
|
return dates;
|
||||||
|
}, []);
|
||||||
|
}
|
||||||
Reference in new issue
Block a user