56 Commits
Author SHA1 Message Date
tmshv 00e9d65789 linear timeline; 2015-03-28 00:04:08 +03:00
tmshv b9d52b5327 + development index; 2015-03-28 00:02:22 +03:00
tmshv 385cecfc97 default router index file moved to config; 2015-03-28 00:01:49 +03:00
tmshv a67b3244ef fix: package.json are broken; 2015-03-28 00:00:50 +03:00
tmshv a2ae10771e v 3.1.0 2015-03-16 17:27:49 +03:00
tmshv dc130ad394 + io; other changes; 2015-03-16 17:21:01 +03:00
tmshv 754c8bf9a4 helmet code style; 2015-03-14 04:28:49 +03:00
tmshv d69bec8c22 - bin/insta 2015-03-14 04:26:07 +03:00
tmshv f687425bdc news bugfix: sorting news when paging 2015-03-14 04:24:18 +03:00
tmshv 1ebfcea16b base instagram supporting; 2015-03-14 04:23:43 +03:00
tmshv 17923e3730 instagram now works as prototype; 2015-03-10 13:41:49 +03:00
tmshv 67ea5ea96c + koa-bodyparser; 2015-03-10 13:34:39 +03:00
tmshv 1069868ef0 timeline more spinner width update; 2015-03-09 00:56:41 +03:00
tmshv df2ec90daa + test 2015-03-09 00:44:05 +03:00
tmshv bed2cfad22 timeline more; spinner; common update; 2015-03-09 00:43:46 +03:00
tmshv 38fac9c033 news pinned feature; 2015-03-08 07:39:29 +03:00
tmshv e7c77e18c6 timeline update; 2015-03-08 06:56:36 +03:00
tmshv 38e0a4dadd instagram update; 2015-03-08 06:56:20 +03:00
tmshv 0372a81304 .gitignore private update; 2015-03-08 06:55:15 +03:00
tmshv 0a3c530599 timeline update; 2015-03-07 18:55:07 +03:00
tmshv 435c8aef7f news sorting by date 2015-03-07 18:54:05 +03:00
tmshv 36febf0e3b news route update; + /news/<name>; mime routers 2015-03-07 09:23:59 +03:00
tmshv 5b477aa41c layout update; mobile version; data update; 2015-03-02 04:44:53 +03:00
tmshv 8d0f88ec81 main title update; 2015-03-01 20:19:18 +03:00
tmshv b7f1599777 new title; new telephone; home page update; 2015-03-01 20:17:31 +03:00
tmshv ec67d8d9d8 package.json update; 2015-03-01 19:18:59 +03:00
tmshv 8b533f52a6 - main.js 2015-03-01 19:08:40 +03:00
tmshv 6994549360 + 404 page 2015-03-01 19:05:50 +03:00
tmshv 85ca132c3e document title; 2015-03-01 18:23:46 +03:00
tmshv af5f5dc5b1 document simplification; document metrika -> analytics; 2015-03-01 17:52:09 +03:00
tmshv ba2891d09b document simplification; document image size fixed; 2015-03-01 16:55:08 +03:00
tmshv d892105e9f simple document simplification 2015-03-01 16:48:35 +03:00
tmshv 467753a2e1 + helmet 2015-03-01 09:52:09 +03:00
tmshv ec51adbfbe proxy improvements 2015-03-01 09:50:47 +03:00
tmshv cc14b51fbb stability fixes; speed improvements; 2015-03-01 09:04:25 +03:00
tmshv 5dee8fd44a deploying update and speed imporvements 2015-03-01 09:03:30 +03:00
tmshv d178c1220f cleanup nginx.conf 2015-03-01 09:02:49 +03:00
tmshv 4d0c64bb93 code cleaning up; - pages/; -routers/; 2015-03-01 04:49:49 +03:00
tmshv 6e4749476a file reorganisation; + 3rdparty 2015-03-01 04:40:51 +03:00
tmshv 141a8ebdf4 client js minification 2015-03-01 03:20:39 +03:00
tmshv 54d3ee8ecc css minification 2015-03-01 03:03:24 +03:00
tmshv 02906582ac feed -> news; - api/ 2015-03-01 02:59:49 +03:00
tmshv 22edc3b275 + koa-useragent 2015-03-01 01:59:26 +03:00
tmshv a694abb3e5 updated schedule api; updated index routing; + routing based on Accept header; 2015-03-01 01:59:00 +03:00
tmshv 6af90258c9 client modules renamed 2015-03-01 01:56:21 +03:00
tmshv 38381b5605 + titles 2015-02-28 19:17:40 +03:00
tmshv f6a43ca7e1 yandex metrika -> google analytics 2015-02-28 10:12:50 +03:00
tmshv 1de5e31515 + prerender support (untested) 2015-02-28 09:49:23 +03:00
tmshv 14d89adb9d private data moved out of config.js 2015-02-28 09:49:07 +03:00
tmshv f3eb176dc4 bower update 2015-02-28 08:10:02 +03:00
tmshv 1226573b8b express -> koa (use --harmony flag); bower_components -> public/bower_components; views -> templates/views; 2015-02-28 08:07:00 +03:00
tmshv 6c27308c07 removed wildcard for views/index.html 2015-02-28 06:28:14 +03:00
tmshv 737bebec15 from mongoose to promised-mongo 2015-02-28 05:35:49 +03:00
tmshv 627a18c5fa bin insta 2014-11-26 22:02:36 +03:00
tmshv 1d2e17a581 fix instagram 2014-11-26 22:02:23 +03:00
tmshv 7f7dcf84f3 configured to home.tmshv 2014-11-26 22:01:46 +03:00
95 changed files with 1898 additions and 2469 deletions

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
{
"directory" : "public/bower_components"
}
+3 -1
View File
@@ -2,6 +2,8 @@
.idea
*.sublime*
private*.json
/node_modules
/bower_components
/public
/public
File renamed without changes.
-22
View File
@@ -1,22 +0,0 @@
/**
* Created by tmshv on 22/11/14.
*/
var Router = require("express").Router;
var Post = require("../schema/post");
module.exports = function (app) {
var router;
router = new Router();
router.route("/api/feed")
.get(function (req, res) {
Post.find({}).exec(function (error, list) {
if (error) return res.error(error);
res.json(list.map(function (post) {
return post.toObject();
}));
});
});
app.use(router);
};
Binary file not shown.

After

Width:  |  Height:  |  Size: 618 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 618 B

+11 -7
View File
@@ -15,15 +15,9 @@
}
.docblock{
// width:100%;
margin-bottom: 40px;
text-align: center;
// .docs{
// text-align: left;
// }
h2{
margin-left: 50px;
text-align: left;
@@ -61,4 +55,14 @@
padding: 0;
display: block;
}
}
}
@media screen and (max-device-width: 400px){
.doc{
margin: 30px 35px;
img{
max-width: 250px;
}
}
}
+15
View File
@@ -0,0 +1,15 @@
.error-404{
text-align: center;
margin: 40px;
h1{
font-size: 16pt;
font-weight: normal;
}
img{
margin: 20px;
width: 40%;
max-width: 800px;
}
}
+26 -1
View File
@@ -2,6 +2,8 @@ footer{
position: relative;
background-color: black;
color: #ffffff;
overflow-x: scroll;
margin: 0;
&:before{
content: '';
@@ -14,7 +16,7 @@ footer{
.info-block{
display: flex;
margin: 0 20px;
margin: 0;
& > div{
margin: 0 30px 0 10px;
@@ -28,4 +30,27 @@ footer{
ul{
list-style: none;
}
}
.footer-content{
min-width: 500px;
}
@media screen and (max-device-width: 500px){
footer{
font-size: 8pt;
.info-block{
display: block;
margin: 0;
& > div{
margin: 0 30px 0 10px;
}
p{
margin: 0;
}
}
}
}
+26
View File
@@ -8,3 +8,29 @@
animation: scaleUp 0.3s both ease-in;
}
}
.main-block {
width: 100%;
margin-top: 5px;
.telephone {
font-size: 1.25em;
margin-left: 30px;
}
h1 {
font-size: 18pt;
text-align: center;
font-weight: normal;
margin: 0;
padding: 0;
}
}
@media screen and (max-device-width: 500px) {
.main-block {
.telephone {
display: none;
}
}
}
+1 -19
View File
@@ -1,27 +1,9 @@
//html {
// overflow-y: hidden;
//}
body {
font-family: "PT Sans", Arial, sans-serif;
margin: 0;
padding: 0;
}
.main {
margin-top: 5px;
.telephone {
font-size: 1.25em;
margin-left: 30px;
}
h1 {
text-align: right;
margin: 20px 50px 0 0;
font-weight: normal;
padding: 0;
}
min-width: 320px;
}
a {
+17 -1
View File
@@ -8,7 +8,7 @@
font-size: 13pt;
ul {
margin: 0 0 0 20px;
margin: 0 0 0 10px;
li {
display: inline-block;
@@ -62,3 +62,19 @@
}
}
@media screen and (max-device-width: 500px){
.menu {
font-size: 10pt;
ul {
margin: 0 0 0 5px;
padding: 0 0 0 0;
li {
display: inline-block;
padding: 3px 3px 10px 3px;
margin: 0 4px 5px 0;
}
}
}
}
+13 -1
View File
@@ -15,6 +15,10 @@
padding-bottom: 50px;
text-align: center;
.schedule-block{
overflow-x: scroll;
}
table{
position: relative;
margin: 30px auto 0 auto;
@@ -196,4 +200,12 @@
display: block;
margin-top: 90px;
}
}
}
@media screen and (max-device-width: 400px){
.schedule{
thead.fix{
display: none;
}
}
}
+46 -2
View File
@@ -1,9 +1,9 @@
.tape-block{
width: 70%;
max-width: 700px;
max-width: 800px;
min-width: 300px;
margin: 100px auto 100px;
margin: 50px auto 100px;
}
.tape-block-content{
@@ -40,4 +40,48 @@
right: -25px;
background-image: url(/graphics/tape-rb.png);
}
}
@media screen and (max-device-width: 400px) {
.tape-block {
width: 70%;
max-width: 250px;
min-width: 200px;
margin: 50px auto 100px;
}
.tape-block-content {
.tape {
width: 62px;
height: 62px;
position: absolute;
z-index: 10;
}
.tape-tl {
top: -20px;
left: -20px;
background-image: url(/graphics/m-tape-tl.png);
background-size: 100%;
}
.tape-tr {
top: -20px;
right: -20px;
background-image: url(/graphics/m-tape-tr.png);
}
.tape-bl {
bottom: 10px;
left: -20px;
background-image: url(/graphics/m-tape-bl.png);
}
.tape-br {
bottom: 10px;
right: -20px;
background-image: url(/graphics/m-tape-br.png);
}
}
}
+1 -7
View File
@@ -1,5 +1,5 @@
.timeline {
.post {
.timeline-record {
.user{
margin-top: 4px;
@@ -22,12 +22,6 @@
}
.body{
padding: 20px 20px 50px;
// padding: 12px 0 0;
// h2{
//
// }
a{
border-bottom: none;
}
+70 -82
View File
@@ -1,103 +1,91 @@
.timeline{
min-width: 500px;
min-width: 400px;
position: relative;
margin: 0 0 50px;
display: block;
width: 75%;
margin: 0 auto 50px;
}
&:before{
content: '';
width: 10px;
height: 10px;
position: absolute;
background-color: black;
top: 0;
left: calc(50% - 6px);
border-radius: 50%;
z-index: 1;
.timeline-record{
position: relative;
.body {
margin: 0 0 50px;
img{
margin: 0 auto;
display: block;
min-height: 500px;
}
}
}
.post{
position: relative;
display: flex;
.head, .body{
@media screen and (max-device-width: 400px) {
.timeline {
min-width: 0;
position: relative;
width: 50%;
box-sizing: border-box;
}
.head {
padding: 25px 20px;
}
.body {
padding: 0 20px;
}
&.left{
flex-flow: row-reverse;
.body{
text-align: right;
}
margin: 0 0 50px;
.head{
text-align: left;
margin: 0;
padding: 0;
}
.body:after{
content: '';
position: absolute;
width: 12px;
height: calc(100% - 98px);
top: 98px;
right: 0;
background: url(/graphics/timeline-line.png) no-repeat right;
background-size: 2px 100%;
}
.head:after{
content: '';
position: absolute;
width: 12px;
height: 98px;
top: 0;
left: -12px;
background: url(/graphics/timeline-arrow-left.png) no-repeat;
}
}
&.right{
flex-flow: row;
.body{
margin: 0 0 40px;
padding: 0;
}
.body p{
text-align: left;
margin: 0 0 2px;
padding: 0;
}
.head{
text-align: right;
margin: 0 10px;
.timeline-record {
position: relative;
display: flex;
.head, .body {
position: relative;
width: 90%;
box-sizing: border-box;
}
.head {
padding: 5px 20px;
}
.body {
padding: 0 20px;
}
}
}
}
.timeline-end{
width: 50%;
margin: 0 auto;
text-align: center;
button.more{
position: relative;
top: -2px;
width: 100px;
height: 40px;
border: 2px solid black;
padding: 0 10px;
background: none;
font-size: 14pt;
&:hover{
background: gainsboro;
}
.body:after{
content: '';
position: absolute;
width: 100px;
height: calc(100% - 98px);
top: 98px;
left: -12px;
background: url(/graphics/timeline-line.png) no-repeat;
background-size: 2px 100%;
}
.head:after{
content: '';
position: absolute;
width: 12px;
height: 98px;
&:active{
top: 0;
left: calc(100% - 2px);
background: url(/graphics/timeline-arrow-right.png) no-repeat;
}
}
}
-140
View File
@@ -1,140 +0,0 @@
/**
* Created by tmshv on 22/11/14.
*/
var config = require("../config");
var db = require("../core/db");
var instagram = require("../core/instagram");
var express = require("express");
var Promise = require("promise");
var methodOverride = require("method-override");
var logger = require("morgan");
var cookieParser = require("cookie-parser");
var bodyParser = require("body-parser");
var Post = require("../schema/post");
db.init(config.db)
.then(function () {
server(config.port);
});
function server(port) {
var app = express();
app.use(logger("dev"));
app.use(cookieParser());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: true}));
app.use(methodOverride());
require("../routers/instagram")(app);
var Router = express.Router;
var instagram = require("../core/instagram");
var router = new Router();
router.route("/").get(function (req, res) {
if ("instagram_code" in req.cookies) {
var client = instagram.client(req.cookies["instagram_code"]);
instagramSandbox(client, res);
} else {
var ig = instagram.client();
var url = ig.get_authorization_url(config.instagram.redirect_uri, {scope: ["basic"], state: "hello"});
res.redirect(url);
}
});
app.use(router);
app.listen(port);
}
function instagramSandbox(ig, res) {
// //{"username":"mlazareffa","bio":"","website":"","profile_picture":"http://images.ak.instagram.com/profiles/anonymousUser.jpg","full_name":"","id":"1549382451"}
// //ig.user_search("mlazareffa", [], function(err, users, remaining, limit) {
// // console.log(err, users, remaining, limit);
// // res.json(users);
// //});
//
// // ig.user_media_recent("1549382451", [], function (err, medias, pagination, remaining, limit) {
// // console.log(err, medias, pagination, remaining, limit);
// // res.json(users);
// // });
//
// //ig.subscriptions(function(err, result, remaining, limit){
// // console.log(err, result, remaining, limit);
// // res.json(result);
// //});
//
// //ig.del_subscription({id: 14180526}, function (err, subscriptions, limit) {
// // console.log(err, subscriptions, limit);
// // res.json(subscriptions);
// //});
//
// ///* OPTIONS: { [verify_token] }
// // ig.add_tag_subscription("hello", "http://home.tmshv.ru:1337/instagram/tag/hello", [], function(err, result, remaining, limit){
// // console.log(err, result, remaining, limit);
// // res.json(result);
// //});
findByTag(ig, "shlb_hudozka", 10)
.catch(function (error) {
console.log(error);
})
.then(function (params) {
var list = params.medias;
var pagination = params.pagination;
var remaining = params.remaining;
var limit = params.limit;
var posts = list.map(function (gram) {
//var post = new Post();
var post = {};
post.id = gram.id;
post.author = gram.user["username"];
post.publishDate = new Date(parseInt(gram["created_time"]) * 1000);
post.data = gram;
post.body = "";
post.type = "instagram";
return post;
});
Promise.all(posts.map(function (post) {
return new Promise(function (resolve, reject) {
console.log('updating', post.id);
Post.update({id: post.id}, post, {upsert: true}, function (error, num) {
if (error) {
reject(error);
} else {
resolve();
}
});
});
}))
.catch(function (error) {
console.log(error);
})
.then(function () {
res.send("LOL");
});
//if (pagination.next) {
// pagination.next(mtr); // Will get second page results
//}
});
}
function findByTag(ig, tag, count) {
return new Promise(function (resolve, reject) {
ig.tag_media_recent(tag, {count: count}, function (err, medias, pagination, remaining, limit) {
if (err) {
reject(err);
} else {
resolve({
medias: medias,
pagination: pagination,
remaining: remaining,
limit: limit
});
}
});
});
}
+3 -1
View File
@@ -5,8 +5,10 @@
var config = require("../config");
var db = require("../core/db");
var server = require("../server");
var instagram = require("../instagram");
db.init(config.db)
db.init(config.db.uri)
//.then(instagram)
.then(function () {
server(config.port);
});
+4 -1
View File
@@ -24,6 +24,9 @@
"jquery": "~2.1.1",
"angular-route": "~1.3.3",
"angular-animate": "~1.3.3",
"angular": "~1.3.3"
"angular": "~1.3.3",
"angulartics": "~0.17.2",
"angular-spinner": "~0.6.1",
"socket.io-client": "~1.3.5"
}
}
+2 -2
View File
@@ -5,8 +5,8 @@
module.exports = function(app) {
app.factory("api", function ($http) {
var api = {};
var Endpoint = require("./feed");
api.feed = new Endpoint($http);
var Endpoint = require("./news");
api.news = new Endpoint($http);
return api;
});
-13
View File
@@ -1,13 +0,0 @@
/**
* Created by tmshv on 22/11/14.
*/
function APIFeed(http){
this.request = http;
}
APIFeed.prototype.post = function() {
return this.request.get("/api/feed");
};
module.exports = APIFeed;
+15
View File
@@ -0,0 +1,15 @@
/**
* Created by tmshv on 22/11/14.
*/
var query = require("../../utils/net").query;
function APIFeed(http){
this.request = http;
}
APIFeed.prototype.feed = function(count, portion) {
return this.request.get("/news?"+query([["count", count], ["portion", portion]]));
};
module.exports = APIFeed;
+36 -6
View File
@@ -2,31 +2,42 @@
* Created by tmshv on 04/11/14.
*/
var app = angular.module("hudozhka", ["ngRoute", "data.hudozhka"]);
var app = angular.module("hudozhka", [
"hudozhka.data",
"ngRoute",
"angulartics",
"angulartics.google.analytics",
"angularSpinner"
]);
app.config(function ($locationProvider, $routeProvider) {
$locationProvider.hashPrefix("!");
$locationProvider.html5Mode(true);
var routes = [
{
name: "/",
templateUrl: "/views/home.html",
controller: "HomePageController"
controller: "HomePageController",
title:"ДШХ Шлиссельбурга"
},
{
name: "/schedule",
templateUrl: "/views/schedule.html",
controller: "SchedulePageController"
controller: "SchedulePageController",
title:"Расписание"
},
{
name: "/team",
templateUrl: "/views/team.html",
controller: "TeamPageController"
controller: "TeamPageController",
title:"Преподаватели"
},
{
name: "/docs",
templateUrl: "/views/docs.html",
controller: "DocsPageController"
controller: "DocsPageController",
title: "Документы"
}
];
@@ -35,11 +46,30 @@ app.config(function ($locationProvider, $routeProvider) {
});
$routeProvider.otherwise({
redirectTo: "/"
templateUrl: "/404.html"
});
});
app.run(function($location, $rootScope, $http, config) {
$rootScope.$on("$routeChangeSuccess", function (event, current) {
$rootScope.title = current["$$route"].title;
});
$rootScope.contact = {
address: config.address,
telephone: config.telephone,
email: config.email
};
$rootScope.now = {
year: new Date().getFullYear()
};
$http.defaults.headers.common["Accept"] = "application/json";
});
require("./api/api")(app);
require("./services/io")(app);
require("./ui/menu")(app);
require("./ui/timeline")(app);
require("./filters/uppercase-first")(app);
+4 -2
View File
@@ -2,7 +2,7 @@
* Created by tmshv on 06/11/14.
*/
angular.module("data.hudozhka", [])
angular.module("hudozhka.data", [])
.service("team", function () {
return require("../models/team");
})
@@ -14,6 +14,8 @@ angular.module("data.hudozhka", [])
})
.service("config", function(){
return {
telephone: "8 (81362) 77-502"
telephone: "8 (81362) 76-312",
email: "hudozka@gmail.com",
address: "г. Шлиссельбург, ул. 18-го января, д. 3"
};
});
+24 -30
View File
@@ -1,36 +1,30 @@
var app = angular.module("document.hudozhka", ["ngRoute", "data.hudozhka"]);
var app = angular.module("hudozhka.document", [
"hudozhka.data",
"angulartics",
"angulartics.google.analytics"
]);
app.config(function ($locationProvider, $sceDelegateProvider, $routeProvider) {
$locationProvider.html5Mode(true);
//$routeProvider
// .when("/document/:doc", {
// controller: "DocumentPageController"
// })
// .otherwise({
// redirectTo: "/"
// });
$sceDelegateProvider.resourceUrlWhitelist([
"self",
"http://static.shburg.org/**",
"http://static.shlisselburg.org/**"
]);
app.factory("docname", function ($location) {
return function(){
var abs = $location.absUrl();
var doc_uri = /\/([\w-]+)$/.exec(abs);
if(doc_uri.length >= 2) {
return doc_uri[1];
}else{
return null;
}
}
});
//app.factory("document", function () {
// var document;
// return {
// init:function(doc) {
// document = doc;
// },
//
// document: document
// };
//});
app.controller("DocumentPageController", function ($scope) {
app.controller("DocumentController", function ($rootScope, $scope, docs, docname) {
$scope.pageClass = "page-document";
var n = docname();
if(n) {
var d = docs.doc(n);
$scope.document = d;
$rootScope.title = d.title;
}
});
require("./ui/pdf")(app);
require("./ui/doc-controller")(app);
require("./filters/uppercase-first")(app);
+28
View File
@@ -0,0 +1,28 @@
/**
* Created by tmshv on 06/11/14.
*/
angular.module("hudozhka.instagram", [])
.controller("InstagramController", function($scope, $http, $window){
//$scope.auth = function() {
// $http.get("/instagram/auth/url")
// .success(function (data) {
// $window.location.href = data.url;
// });
//};
$http.get("/instagram/user")
.error(function() {
})
.success(function (user) {
$scope.user = user;
});
$scope.invite = function() {
$http.get("/instagram/invite")
.success(function (data) {
$scope.inviteCode = data.code;
});
};
});
-1
View File
@@ -5,7 +5,6 @@
module.exports = function (app) {
app.controller("HomePageController", function ($scope, config) {
$scope.pageClass = "page-home";
$scope.telephone = config.telephone;
$(".fotorama").fotorama();
});
+11 -8
View File
@@ -2,20 +2,23 @@ var populate = require("../../utils/populate").populate;
const course = require("../../models/course");
module.exports = function (app) {
app.controller("ScheduleController", function ($scope, schedule, team) {
app.controller("ScheduleController", function ($scope, $http, schedule, team) {
var now = new Date();
var dates = getDates(now);
var sem = "late";
$scope.sem = [["early", "весеннего"], ["late", "осеннего"]].reduce(function (s, word) {
var sem = "autumn";
$scope.sem = [["spring", "весеннего"], ["autumn", "осеннего"]].reduce(function (s, word) {
if (word[0] === sem) return word[1];
});
$scope.year = 2014;
$scope.year = "2014-2015";
$scope.schedule = schedule($scope.year, sem, [
populate(team.short, "teacher"),
populate(course.name, "lesson")
]);
$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;
+11
View File
@@ -0,0 +1,11 @@
/**
* Created by tmshv on 15/03/15.
*/
module.exports = function (app) {
var socket = io();
app.service("io", function(){
return socket;
})
};
-52
View File
@@ -1,52 +0,0 @@
/**
* Created by tmshv on 24/11/14.
*/
module.exports = function (app) {
app.controller("DocumentController", function ($scope, $location, docs) {
$scope.showControls = false;
var doc_uri = $location.$$path.replace("/document/", "");
$scope.document = docs.doc(doc_uri);
$scope.document.currentPage = 0;
$scope.viewDocument = function () {
switch ($scope.document.viewer) {
case "img-sheet":
$scope.showControls = false;
return "/views/document-image.html";
default:
$scope.showControls = true;
return "/views/document-paper.html";
}
};
$scope.totalPages = $scope.document.url.length;
$scope.currentPage = 1;
$scope.prevPage = function () {
var i = $scope.currentPage - 1;
if (i > 0) {
$scope.currentPage = i;
$scope.document.currentPage = i - 1;
}
};
$scope.nextPage = function () {
var i = $scope.currentPage + 1;
if (i <= $scope.totalPages) {
$scope.currentPage = i;
$scope.document.currentPage = i - 1;
}
};
$scope.update = function () {
var i = $scope.currentPage;
if (i > 0 && i <= $scope.totalPages) {
$scope.currentPage = i;
$scope.document.currentPage = i - 1;
}
};
});
};
-148
View File
@@ -1,148 +0,0 @@
/**
* Created by tmshv on 24/11/14.
*/
module.exports = function (app) {
app.directive("pdf", function () {
return {
scope: {
document: "="
},
templateUrl: "/views/pdf.html",
link: function (scope, element, attrs) {
},
controller: function ($scope) {
var doc = $scope.document;
if (doc.extra && doc.extra.style) {
angular.element("head").append('<link href="' + doc.extra.style + '" rel="stylesheet">');
}
$scope.$watch(
function () {
return $scope.document.currentPage;
},
function (value) {
value = parseInt(value);
try{
$scope.pageURL = $scope.document.url[value];
}catch (error){
$scope.pageURL = "";
}
}
);
//const PAGES = [];
//var currentPageIndex = 0;
//var doc = new Document(location.pathname.replace(/\/\d+$/, ""));
//$(document).ready(function(){
// try{
// var hrefPage = /\/(\d+)$/.exec(location.href)[1];
// currentPageIndex = parseInt(hrefPage) - 1;
// }catch(error){
//
// }
//$("#buttonNext").click(function(event){
// loadNext();
//});
//
//$("#buttonPrev").click(function(event){
// loadPrevious();
//});
//
//$("#page-container .pf").each(function(index, elem){
// var url = $(elem).data("page-url");
// doc.pages.push(url);
//});
//
//$("#currentPage").attr("max", doc.pages.length);
//$("#totalPages").text(doc.pages.length);
//$("#currentPage").change(function(){
// var i = parseInt($(this).val()) - 1;
// if(i && doc.hasPage(i)){
// loadPage(i);
// }
//});
//
//$("#page-container").html("");
//loadPage(currentPageIndex);
//
//window.addEventListener("popstate", function(event){
// console.log("pops");
// console.log(event);
// var i = event.state;
// loadPage(i);
//});
//});
//function loadNext(){
// var i = currentPageIndex + 1;
// if(doc.hasPage(i)){
// loadPage(i);
// }else{
//
// }
//}
//
//function loadPrevious(){
// var i = currentPageIndex - 1;
// if(doc.hasPage(i)){
// loadPage(i);
// }else{
//
// }
//}
//
//function loadPage(index){
// if(doc.hasPage(index)){
// var url = doc.pages[index];
// // $.ajax(
// // url,
//
// // {
// // xhrFields: {
// // crossDomain: true,
// // withCredentials: true
// // },
//
// // success: function(data, status){
// // currentPageIndex = index;
// // $("#currentPage").val(doc.page(currentPageIndex));
// // $("#page-container").html(data);
//
// // var p = doc.page(currentPageIndex);
// // console.log("look at page ", p);
// // window.history.pushState(
// // currentPageIndex,
// // "State 2013 — " + p,
// // doc.getPageURL(p)
// // );
// // },
//
// // error: function(xhr, aaa, error){
// // console.log(error);
// // }
// // }
// // );
// $.get(url, function(data){
// currentPageIndex = index;
// $("#currentPage").val(doc.page(currentPageIndex));
// $("#page-container").html(data);
//
// var p = doc.page(currentPageIndex);
// console.log("look at page ", p);
// window.history.pushState(
// currentPageIndex,
// "State 2013 — " + p,
// doc.getPageURL(p)
// );
// });
// }
//}
}
};
});
};
+108 -14
View File
@@ -18,8 +18,32 @@ function personByInstagram(list, instagram){
}
}
function postText(post){
try{
return post.data.caption.text.replace(/#[\w_]+/, "")
}catch(error){
return "";
}
}
module.exports = function(app) {
app.directive("timeline", function (team) {
function toInstagram(post){
var author_id = personByInstagram(team.team, post.data.author);
var name = author_id ? team.short(author_id) : post.data.author;
return {
date: post.date,
image: post.data.image.standard_resolution.url,
url: post.data.url,
username: name,
//userpic: post.data.user.profile_picture,
text: post.body,
//text: postText(post),
type: post.type
};
}
return {
templateUrl: "/views/timeline.html",
scope: {
@@ -30,22 +54,92 @@ module.exports = function(app) {
return index % 2 === 1;
}
},
controller: function($scope, api){
api.feed.post()
.success(function (list) {
$scope.feed = list.map(function (post) {
var author_id = personByInstagram(team.team, post.data.user.username);
var name = author_id ? team.short(author_id) : post.data.user.username;
return {
date: post.publishDate,
image: post.data.images.standard_resolution.url,
url: post.data.link,
username: name,
userpic: post.data.user.profile_picture,
text: post.data.caption.text.replace(/#[\w_]+/, "")
};
controller: function($scope, $timeout, usSpinnerService, io, api){
var portion = 0;
var count = 10;
$scope.feed = [];
$scope.timelineUpdating = false;
usSpinnerService.stop("timelineMore");
//usSpinnerService.spin("timelineMore");
$scope.recordClass = function (i) {
return i['type'];
};
$scope.loadNext = function () {
$scope.timelineUpdating = true;
usSpinnerService.spin("timelineMore");
api.news.feed(count, portion)
.error(function(error) {
console.log(error);
})
.success(function (list) {
$scope.timelineUpdating = false;
usSpinnerService.stop("timelineMore");
//$timeout(function () {
//
//}, 5000);
var feed = list.map(function (post) {
if(post.type == "instagram") return toInstagram(post);
else return post;
});
portion++;
$scope.feed = $scope.feed.concat(feed);
});
};
$scope.loadNext();
io.on("post", function (params) {
var posts = params instanceof Array ? params : [params];
console.log("post", posts);
var feed = posts.map(function (post) {
if(post.type == "instagram") return toInstagram(post);
else return post;
});
$scope.$apply(function () {
$scope.feed = feed.concat($scope.feed);
});
});
}
};
});
app.directive("timelineRecord", function ($compile, $http, $sce, team) {
var templates = {
"post": ["/views/timeline-post.html", linkPost],
"instagram": ["/views/timeline-gram.html", linkGram]
};
function linkPost(scope, element, attrs) {
scope.message = $sce.trustAsHtml(scope.post.body);
}
function linkGram(scope, element, attrs) {
}
return {
restrict: "E",
scope: {
post:"=content"
},
link: function(scope, element, attrs){
var type = scope.post.type;
if(type in templates) {
$http.get(templates[type][0])
.success(function (tpl) {
element.html(tpl).show();
$compile(element.contents())(scope);
templates[type][1](scope, element, attrs);
});
}
}
};
});
+13 -11
View File
@@ -1,3 +1,4 @@
var fs = require("fs");
const MENU = require("./models/menu.json");
const team = require("./models/team");
@@ -5,7 +6,11 @@ const course = require("./models/course");
const document = require("./models/document");
const schedule = require("./models/schedule");
module.exports = {
var privateFile = process.env["PRIVATE"] || "private.json";
var privateData = JSON.parse(fs.readFileSync(privateFile, "utf-8"));
var config = {
defaultIndex: "/templates/index.html" || process.env["INDEX"],
port: process.env["PORT"] || 3000,
pub: "./",
data: {
@@ -17,14 +22,11 @@ module.exports = {
db: {
uri: "mongodb://localhost:27017/hudozka"
},
instagram:{
client_id: "f17901a26a5e4a5ca4544dd0eebe2a15",
client_secret: "ecce08509871427ab9f8f383318315fc",
redirect_uri: "http://72.tmshv.ru:1337/auth/instagram/callback"
},
tags: ["shlb_hudozka"]
}
};
module.exports = Object.keys(privateData)
.reduce(function (config, key) {
config[key] = privateData[key];
return config;
}, config);
+32 -8
View File
@@ -2,17 +2,41 @@
* Created by tmshv on 22/11/14.
*/
var mongoose = require("mongoose");
var Promise = require("promise");
var mongo = require("promised-mongo");
var ObjectId = mongo.ObjectId;
var client = null;
module.exports = {
init: function (options) {
return new Promise(function (resolve, reject) {
mongoose.connect(options.uri, function (error) {
if (error) return reject(error);
resolve();
});
init: function (uri) {
//noinspection JSUnresolvedFunction
return new Promise(function (resolve) {
client = mongo(uri);
resolve();
});
},
get db() {
return client;
},
c: function(name){
return client.collection(name);
},
id: function(i) {
if(typeof i === "string"){
return ObjectId(i);
}
else if(i instanceof ObjectId) {
return i;
}
else if(i instanceof Object) {
return "_id" in i ? ObjectId(i._id) : null;
}
return null;
}
};
-46
View File
@@ -1,46 +0,0 @@
/**
* Created by tmshv on 22/11/14.
*/
var config = require("../config");
var Promise = require("promise");
var auth_clients = {};
module.exports = {
client: function(param){
if(param in auth_clients) {
return auth_clients[param];
}else{
return createClient();
}
},
authorize: function(code){
return new Promise(function(resolve, reject){
var api = createClient();
api.authorize_user(code, config.instagram.redirect_uri, function (err, result) {
if (err) return reject(err);
else {
var token = result.access_token;
var c = createClient(token);
auth_clients[code] = c;
resolve(c);
}
});
});
}
};
function createClient(token) {
var api = require('instagram-node').instagram();
if (token) {
api.use({access_token: token});
} else {
api.use({
client_id: config.instagram.client_id,
client_secret: config.instagram.client_secret
});
}
return api;
}
+12 -6
View File
@@ -1,16 +1,22 @@
#!/bin/sh
tar cf ~/www-build.tar \
tarfile=build.tar.gz
tarpath=$TMPDIR$tarfile
env GZIP=-9 tar -czf $tarpath \
--disable-copyfile \
--exclude=node_modules \
--exclude=bower_components \
--exclude=.git \
--exclude=.idea \
--exclude=.DS_Store \
--exclude=deploy.sh \
--exclude=install.sh .
echo "build file: $tarpath"
ssh shburg.et "rm -rf art/*"
scp ~/www-build.tar shburg@37.139.6.120:~
scp $tarpath shburg@37.139.6.120:~
scp install.sh shburg@37.139.6.120:~
ssh shburg.et "./install.sh && rm ./install.sh"
rm ~/www-build.tar
echo "art.shburg.org deployment completed successfully"
ssh shburg.et "./install.sh"
rm $tarpath
echo "art.shlisselburg.org deployment completed successfully"
+25 -8
View File
@@ -1,19 +1,20 @@
var path = require("path");
var gulp = require("gulp");
var sass = require("gulp-sass");
var minifyCSS = require("gulp-minify-css");
var minify_css = require("gulp-minify-css");
var autoprefixer = require("gulp-autoprefixer");
var imageMin = require("gulp-imagemin");
var uglify = require("gulp-uglify");
var concat = require("gulp-concat");
var browserify = require("gulp-browserify");
var annotate = require("browserify-ngannotate");
gulp.task("sass", function () {
gulp.src("./assets/style/*.scss")
.pipe(sass())
.pipe(concat("style.css"))
.pipe(autoprefixer())
//.pipe(minifyCSS({processImport:false}))
.pipe(minify_css({processImport:false}))
.pipe(gulp.dest("public"));
});
@@ -21,24 +22,40 @@ gulp.task("copy", function(){
gulp.src("./assets/fonts/*")
.pipe(gulp.dest("./public/fonts"));
gulp.src("./assets/style/*.css")
.pipe(gulp.dest("./public/s"));
gulp.src("./assets/graphics/*")
.pipe(gulp.dest("./public/graphics"));
gulp.src("./3rdparty/*")
.pipe(gulp.dest("./public"));
});
gulp.task("compile", function(){
gulp.src("client/app.js")
.pipe(browserify())
.pipe(browserify({
transform: [annotate]
}))
.pipe(uglify())
.pipe(gulp.dest("public"));
gulp.src("client/document.js")
.pipe(browserify())
.pipe(browserify({
transform: [annotate]
}))
.pipe(uglify())
.pipe(gulp.dest("public"));
gulp.src("client/data.js")
.pipe(browserify())
.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"));
});
+37
View File
@@ -0,0 +1,37 @@
/**
* Created by tmshv on 12/03/15.
*/
var db = require("../core/db");
var co = require("co");
var instagram = require("./instagram");
var config = require("../config");
module.exports = function () {
return loadUsers()
.then(updateSubscription)
};
function loadUsers() {
return new Promise(function (resolve, reject) {
db.c("users").find({provider: "instagram"})
.toArray()
.then(function (users) {
users.forEach(function (u) {
return instagram.initUser(u);
});
return users;
})
.then(resolve);
});
}
function updateSubscription() {
var tags = config.instagram["tags"];
return tags.map(function (tag) {
var cb = config.instagram["tag_callback"];
return co(function *() {
return yield instagram.api.subscribe(tag, cb);
})
});
}
+172
View File
@@ -0,0 +1,172 @@
/**
* Created by tmshv on 22/11/14.
*/
var EventEmitter = require("events").EventEmitter;
var thunkify = require("thunkify");
var config = require("../config");
var db = require("../core/db");
var instagram = require("instagram-node");
function Instagram(options) {
this.client_id = options.client_id;
this.client_secret = options.client_secret;
this.redirect_uri = options.redirect_uri;
this.default_user = options.default_user;
this.clients = {};
this.users = {};
EventEmitter.call(this);
}
Instagram.prototype = Object.create(EventEmitter.prototype);
Instagram.prototype.authorizationURL = function (scope, state) {
var params = {};
params.scope = scope || ["basic"];
if (state) {
params.state = state;
}
var client = createClient();
return client["get_authorization_url"](this.redirect_uri, params);
};
Instagram.prototype.addClient = function *(code, params) {
var token = params.access_token;
var item = params.user;
item.code = code;
item.access_token = token;
item.provider = "instagram";
yield db.c("users").update({provider: "instagram", id: params.user.id}, item, {upsert: true});
return this.initUser(item);
};
Instagram.prototype.initUser = function (user) {
var token = user.access_token;
this.clients[user.code] = createClient(token);
this.users[user.code] = user;
return this;
};
Instagram.prototype.getUsers = function () {
var users = this.users;
return Object.keys(users)
.map(function (code) {
return users[code];
});
};
Instagram.prototype.update = function (body) {
this.emit("update", body);
};
Instagram.prototype.client = function (code) {
if (code && code in this.clients) {
return this.clients[code];
} else {
return createClient();
}
};
Instagram.prototype.user = function (code) {
if (code && code in this.users) {
return this.users[code];
} else {
return null;
}
};
Instagram.prototype.authorize = function *(code) {
var api = createClient();
var authorize = thunkify(api["authorize_user"]);
var result = yield authorize(code, this.redirect_uri);
if (result) {
yield this.addClient(code, result);
}
return result;
};
Instagram.prototype.getUser = function *() {
if (this.default_user) {
var du = yield db.c("users").findOne({username: this.default_user});
if (du) {
return du;
}
}
return yield db.c("users").findOne({provider: "instagram"});
};
Instagram.prototype.getUsers = function *() {
return yield db.c("users").find({provider: "instagram"}).toArray();
};
Instagram.prototype.api = {
subscriptions: function *() {
var ig = createClient();
var subs = thunkify(ig["subscriptions"]);
try {
var s = yield subs();
return s[0];
} catch (error) {
return null;
}
},
subscribe: function *(tag, callbackURL) {
var ig = createClient();
var sub = thunkify(ig["add_tag_subscription"]);
try {
var s = yield sub(tag, callbackURL);
return s[0];
} catch (error) {
return null;
}
},
unsubscribe: function *(id) {
var ig = createClient();
var sub = thunkify(ig["del_subscription"]);
try {
var s = yield sub({id: id});
return s[0];
} catch (error) {
return null;
}
},
tagMediaRecent: function *(client, tag, count) {
var tag_media_recent = thunkify(client["tag_media_recent"]);
try{
var result = yield tag_media_recent(tag, {count: count});
return {
medias: result[0],
pagination: result[1],
remaining: result[2],
limit: result[3]
}
}catch(error){
return null;
}
}
};
module.exports = new Instagram(config.instagram);
function createClient(token) {
var client = instagram.instagram({}, {});
if (token) {
client.use({access_token: token});
} else {
client.use({
client_id: config.instagram.client_id,
client_secret: config.instagram.client_secret
});
}
return client;
}
+16
View File
@@ -0,0 +1,16 @@
/**
* Created by tmshv on 14/03/15.
*/
var publisher = require("./publish");
module.exports = function (app) {
app.io.use(function *(next) {
publisher.on("post", function (post) {
console.log("IO POST", post);
app.io.emit("post", post);
});
yield* next;
});
};
+97
View File
@@ -0,0 +1,97 @@
/**
* Created by tmshv on 10/03/15.
*/
var co = require("co");
var util = require("util");
var EventEmitter = require("events").EventEmitter;
var instagram = require("./instagram");
var config = require("../config");
var db = require("../core/db");
function Publisher() {
EventEmitter.call(this);
var self = this;
instagram.on("update", function (data) {
var tag = config.instagram["tags"][0];
findInstagrams(tag)
.catch(function (error) {
console.log(error);
})
.then(function (posts) {
var ids = posts.map(function (gram) {
return gram.data.id;
});
return uploadInstagrams(posts)
.then(function () {
return db.c("posts").find({"data.id": {$in: ids}}).toArray();
});
})
.then(function (posts) {
self.emit("post", posts);
});
});
}
util.inherits(Publisher, EventEmitter);
module.exports = new Publisher();
function *fbt(client, tag) {
var param = yield instagram.api.tagMediaRecent(client, tag, 10);
return param.medias.map(toInstagram);
}
function toInstagram(gram) {
var post = {};
try {
post.body = gram.caption.text;
} catch (error) {
post.body = "";
}
post.type = "instagram";
post.tags = gram.tags;
post.date = new Date(parseInt(gram["created_time"]) * 1000);
post.data = {
id: gram.id,
author: gram.user["username"],
image: gram.images,
url: gram.link
};
return post;
}
function findInstagrams(tag){
return co(function *() {
var user = yield instagram.getUser();
if (user) {
var client = instagram.client(user.code);
var permitted_users = yield instagram.getUsers();
permitted_users = permitted_users.map(function (user) {
return user["username"];
});
var medias = yield fbt(client, tag);
//medias = medias.filter(function (gram) {
// return permitted_users.indexOf(gram.data.author) > -1;
//});
return medias;
}
});
}
function uploadInstagrams(list){
return Promise.all(
list.map(function (g) {
return db.c("posts").update({"data.id": g.data.id}, g, {upsert: true});
})
);
}
+162
View File
@@ -0,0 +1,162 @@
/**
* Created by tmshv on 22/11/14.
*/
var path = require("path");
var route = require("koa-route");
var router = require("../routes");
var instagram = require("../instagram/instagram");
module.exports = function (app) {
app.use(function *(next) {
var code = this.cookies.get("instagram_code");
if (code) {
var client = instagram.client(code);
var user = instagram.user(code);
if (client && user) {
this.instagram = {
client: client,
user: user
}
}
}
yield* next;
});
app.use(
route.get("/instagram", function *() {
var invite = this.cookies.get("invite_code") || this.query.code;
if(!this.instagram) {
if(invite == undefined){
this.body = "invite required";
this.status = 401;
}else if(invite == "LOL"){
this.cookies.set("invite_code", invite, {expires: expire()});
//todo: invalidate invite
yield router.index(
path.join(__dirname, "../templates/instagram.html")
);
}else{
this.body = "invite ist correct";
this.status = 401;
}
}else{
yield router.index(
path.join(__dirname, "../templates/instagram.html")
);
}
})
);
app.use(
route.get("/instagram/auth", function *() {
var invite = this.cookies.get("invite_code");
if(invite) {
var url = instagram.authorizationURL(null, "/instagram");
this.redirect(url);
}else{
this.status = 401;
this.body = "invite required";
}
})
);
app.use(
route.get("/instagram/user", function *() {
var code = this.cookies.get("instagram_code");
var user = instagram.user(code);
if(user) {
this.body = user;
}else{
this.status = 404;
}
})
);
app.use(
route.get("/instagram/auth/callback", function *() {
var state = this.query.state || "/";
var code = this.query.code;
var client = yield instagram.authorize(code);
if (client) {
this.cookies.set("instagram_code", code, {expires: expire()});
this.redirect(state);
} else {
this.status = 401;
this.redirect(state);
}
})
);
app.use(route.get("/instagram/subscription/list", function *() {
var result = yield instagram.api.subscriptions();
if(result) {
this.body = result;
}else{
this.status = 500;
}
}));
app.use(route.get("/instagram/subscription/add", function *() {
var tag = this.query.tag;
var cu = this.query.url;
var result = yield instagram.api.subscribe(tag, cu);
if(result) {
this.body = result;
}else{
this.status = 500;
}
}));
app.use(route.get("/instagram/subscription/delete", function *() {
var id = this.query.id;
var result = yield instagram.api.unsubscribe(id);
if(result) {
this.body = result;
}else{
this.status = 500;
}
}));
app.use(route.get("/instagram/callback/:rnd", function *() {
if(this.query["hub.mode"] == "subscribe"){
this.body = this.query["hub.challenge"];
}else{
this.status = 400;
}
}));
app.use(route.post("/instagram/callback/:rnd", function *(rnd) {
var sign = this.header["x-hub-signature"];
//console.log(this.headers);
var body = this.request.body;
//var hmac = crypto.createHmac("sha1", instagram.client_secret);
//hmac.update(body);
//var shasum = hmac.digest("hex");
//console.log("X-Hub-Signature", sign);
//console.log("Hmac", shasum);
//console.log();
//if(shasum.digest("hex") == sign) {
instagram.update(body);
//}
this.body = "";
}));
};
function expire(time){
return time || new Date(Date.now() + 1000 * 60 * 60 * 24 * 7);
}
+5 -4
View File
@@ -1,10 +1,11 @@
#!/bin/sh
gunzip build.tar.gz
tar xf build.tar -C ~/art
rm build.tar
cd ~/art
tar xvf ../www-build.tar
rm ../www-build.tar
npm install --production
node_modules/bower/bin/bower install
npm install --production --loglevel error
export NODE_ENV=production
export PORT=18010
-18
View File
@@ -1,18 +0,0 @@
const CONTENT_PATH = "http://hudozhka.tmshv.ru/files/";
const CONTENT_PATH = "/files/";
var fs = require("fs");
function gatherNotFoundCollection (dir) {
var list = fs.readdirSync(dir);
if(list){
list.forEach(function(i){
});
}
return [];
}
var config = require("./config").populate({
});
+13 -51
View File
@@ -2,85 +2,47 @@
{
"name": "statue-2013",
"title": "устав школы за 2013 год",
"path": "/document/statue-2013",
"url": "http://static.shburg.org/art/docs/hudozhka_statue-2013.pdf",
"preview": "http://static.shburg.org/art/graphics/statue-2013-preview.png",
"download": "http://static.shburg.org/art/docs/hudozhka_statue-2013.pdf",
"url": [
"http://static.shburg.org/art/html/hudozhka_statue-2013-1.page",
"http://static.shburg.org/art/html/hudozhka_statue-2013-2.page",
"http://static.shburg.org/art/html/hudozhka_statue-2013-3.page",
"http://static.shburg.org/art/html/hudozhka_statue-2013-4.page",
"http://static.shburg.org/art/html/hudozhka_statue-2013-5.page",
"http://static.shburg.org/art/html/hudozhka_statue-2013-6.page",
"http://static.shburg.org/art/html/hudozhka_statue-2013-7.page",
"http://static.shburg.org/art/html/hudozhka_statue-2013-8.page",
"http://static.shburg.org/art/html/hudozhka_statue-2013-9.page",
"http://static.shburg.org/art/html/hudozhka_statue-2013-10.page",
"http://static.shburg.org/art/html/hudozhka_statue-2013-11.page",
"http://static.shburg.org/art/html/hudozhka_statue-2013-12.page",
"http://static.shburg.org/art/html/hudozhka_statue-2013-13.page",
"http://static.shburg.org/art/html/hudozhka_statue-2013-14.page",
"http://static.shburg.org/art/html/hudozhka_statue-2013-15.page",
"http://static.shburg.org/art/html/hudozhka_statue-2013-16.page",
"http://static.shburg.org/art/html/hudozhka_statue-2013-17.page",
"http://static.shburg.org/art/html/hudozhka_statue-2013-18.page",
"http://static.shburg.org/art/html/hudozhka_statue-2013-19.page",
"http://static.shburg.org/art/html/hudozhka_statue-2013-20.page",
"http://static.shburg.org/art/html/hudozhka_statue-2013-21.page",
"http://static.shburg.org/art/html/hudozhka_statue-2013-22.page",
"http://static.shburg.org/art/html/hudozhka_statue-2013-23.page",
"http://static.shburg.org/art/html/hudozhka_statue-2013-24.page",
"http://static.shburg.org/art/html/hudozhka_statue-2013-25.page",
"http://static.shburg.org/art/html/hudozhka_statue-2013-26.page",
"http://static.shburg.org/art/html/hudozhka_statue-2013-27.page"
],
"extra": {
"style": ["http://static.shburg.org/art/docs/preview/hudozhka_statue-2013.css"]
},
"viewer": "pdf"
"files": ["http://static.shburg.org/art/docs/hudozhka_statue-2013.pdf"]
},
{
"name": "edu-license",
"title": "образовательная лицензия",
"path": "/document/edu-license",
"url": "/document/edu-license",
"preview": "http://static.shburg.org/art/graphics/license_edu-preview.png",
"url": [
"files": [
"http://static.shburg.org/art/docs/hudozhka_license_edu.jpg",
"http://static.shburg.org/art/docs/hudozhka_license_edu_back.jpg",
"http://static.shburg.org/art/docs/hudozhka_license_edu_attachment.jpg"
],
"viewer": "img-sheet"
]
},
{
"name": "gov-certificate",
"title": "свидетельство о государственной регистрации права",
"path": "/document/gov-certificate",
"url": "/document/gov-certificate",
"preview": "http://static.shburg.org/art/graphics/certificate_gov-preview.png",
"url": ["http://static.shburg.org/art/docs/hudozhka_certificate_gov.jpg"],
"viewer": "img-sheet"
"files": ["http://static.shburg.org/art/docs/hudozhka_certificate_gov.jpg"]
},
{
"name": "VAT",
"title": "ИНН",
"path": "/document/VAT",
"url": "/document/VAT",
"preview": "http://static.shburg.org/art/graphics/vatin-preview.png",
"url": ["http://static.shburg.org/art/docs/hudozhka_vatin.jpg"],
"viewer": "img-sheet"
"files": ["http://static.shburg.org/art/docs/hudozhka_vatin.jpg"]
},
{
"name": "EGRYL1",
"title": "свидетельство о внесении в «ЕГРЮЛ»",
"path": "/document/EGRYL1",
"url": "/document/EGRYL1",
"preview": "http://static.shburg.org/art/graphics/certificate_egryl1-preview.png",
"url": ["http://static.shburg.org/art/docs/hudozhka_certificate_egryl1.jpg"],
"viewer": "img-sheet"
"files": ["http://static.shburg.org/art/docs/hudozhka_certificate_egryl1.jpg"]
},
{
"name": "EGRYL2",
"title": "свидетельство о внесении в «ЕГРЮЛ»",
"path": "/document/EGRYL2",
"url": "/document/EGRYL2",
"preview": "http://static.shburg.org/art/graphics/certificate_egryl2-preview.png",
"url": ["http://static.shburg.org/art/docs/hudozhka_certificate_egryl2.jpg"],
"viewer": "img-sheet"
"files": ["http://static.shburg.org/art/docs/hudozhka_certificate_egryl2.jpg"]
}
]
-402
View File
@@ -1,402 +0,0 @@
[
{
"name": "1",
"monday": {
"lesson": "composition",
"teacher": "as-timasheva",
"time": [
"15:00 15:45",
"15:55 16:40"
]
},
"tuesday": {
"lesson": "painting",
"teacher": "od-gogoleva",
"time": [
"15:00 15:45",
"15:55 16:40"
]
},
"saturday": {
"lesson": "sculpting",
"teacher": "in-vturina",
"time": [
"10:00 10:45",
"10:55 11:40"
]
}
},
{
"name": "2",
"tuesday": {
"lesson": "painting",
"teacher": "od-gogoleva",
"time": [
"17:00 17:45",
"17:55 18:40"
]
},
"friday": {
"lesson": "sculpting",
"teacher": "in-vturina",
"time": [
"17:00 17:45",
"17:55 18:40"
]
},
"saturday": {
"lesson": "composition",
"teacher": "as-timasheva",
"time": [
"12:00 12:45",
"12:55 13:40"
]
}
},
{
"name": "3",
"thursday": {
"lesson": "painting",
"teacher": "od-gogoleva",
"time": [
"15:00 15:45",
"15:55 16:40"
]
},
"friday": {
"lesson": "sculpting",
"teacher": "in-vturina",
"time": [
"15:00 15:45",
"15:55 16:40"
]
},
"saturday": {
"lesson": "composition",
"teacher": "as-timasheva",
"time": [
"10:00 10:45",
"10:55 11:40"
]
}
},
{
"name": "4",
"monday": {
"lesson": "composition",
"teacher": "vv-voronova",
"time": [
"15:00 15:45",
"15:55 16:40"
]
},
"wednesday": {
"lesson": "painting",
"teacher": "od-gogoleva",
"time": [
"15:00 15:45",
"15:55 16:40"
]
},
"thursday": {
"lesson": "composition",
"teacher": "nv-andreeva",
"time": [
"15:00 15:45",
"15:55 16:40"
]
}
},
{
"name": "5",
"monday": {
"lesson": "composition",
"teacher": "vv-voronova",
"time": [
"17:00 17:45",
"17:55 18:40"
]
},
"wednesday": {
"lesson": "painting",
"teacher": "od-gogoleva",
"time": [
"17:00 17:45",
"17:55 18:40"
]
},
"thursday": {
"lesson": "composition",
"teacher": "nv-andreeva",
"time": [
"17:00 17:45",
"17:55 18:40"
]
}
},
{
"name": "6",
"wednesday": {
"lesson": "composition",
"teacher": "nv-andreeva",
"time": [
"15:00 15:45",
"15:55 16:40"
]
},
"thursday": {
"lesson": "painting",
"teacher": "od-gogoleva",
"time": [
"17:00 17:45",
"17:55 18:40"
]
},
"friday": {
"lesson": "composition",
"teacher": "vv-voronova",
"time": [
"15:00 15:45",
"15:55 16:40"
]
}
},
{
"name": "7",
"wednesday": {
"lesson": "history",
"teacher": "my-valkova",
"time": [
"17:00 17:45"
]
},
"thursday": {
"lesson": "painting",
"teacher": "va-sarzhin",
"time": [
"15:00 15:45",
"15:55 16:40"
]
},
"friday": {
"lesson": "drawing",
"teacher": "sa-latipova",
"time": [
"15:00 15:45",
"15:55 16:40"
]
},
"saturday": {
"lesson": "cg",
"teacher": "rk-timashev",
"time": [
"10:00 10:45",
"10:55 11:40"
]
}
},
{
"name": "8",
"wednesday": {
"lesson": "history",
"teacher": "my-valkova",
"time": [
"17:00 17:45"
]
},
"thursday": {
"lesson": "painting",
"teacher": "va-sarzhin",
"time": [
"17:00 17:45",
"17:55 18:40"
]
},
"friday": {
"lesson": "drawing",
"teacher": "sa-latipova",
"time": [
"17:00 17:45",
"17:55 18:40"
]
},
"saturday": {
"lesson": "cg",
"teacher": "rk-timashev",
"time": [
"12:00 12:45",
"12:55 13:40"
]
}
},
{
"name": "9",
"monday": {
"lesson": "drawing",
"teacher": "sa-latipova",
"time": [
"15:00 15:45",
"15:55 16:40"
]
},
"tuesday": {
"lesson": "painting",
"teacher": "va-sarzhin",
"time": [
"15:00 15:45",
"15:55 16:40"
]
},
"wednesday": {
"lesson": "history",
"teacher": "my-valkova",
"time": [
"18:00 18:45"
]
},
"friday": {
"lesson": "composition",
"teacher": "nv-andreeva",
"time": [
"15:00 15:45",
"15:55 16:40"
]
}
},
{
"name": "10",
"monday": {
"lesson": "drawing",
"teacher": "sa-latipova",
"time": [
"17:00 17:45",
"17:55 18:40"
]
},
"tuesday": {
"lesson": "painting",
"teacher": "va-sarzhin",
"time": [
"17:00 17:45",
"17:55 18:40"
]
},
"wednesday": {
"lesson": "history",
"teacher": "my-valkova",
"time": [
"18:00 18:45"
]
},
"friday": {
"lesson": "composition",
"teacher": "nv-andreeva",
"time": [
"17:00 17:45",
"17:55 18:40"
]
}
},
{
"name": "11",
"monday": {
"lesson": "painting",
"teacher": "va-sarzhin",
"time": [
"15:00 15:45",
"15:55 16:40"
]
},
"wednesday": {
"lesson": "drawing",
"teacher": "mg-timasheva",
"time": [
"15:00 15:45",
"15:55 16:40"
]
},
"thursday": {
"lesson": "history",
"teacher": "my-valkova",
"time": [
"17:00 17:45"
]
},
"friday": {
"lesson": "composition",
"teacher": "od-gogoleva",
"time": [
"15:00 15:45",
"15:55 16:40"
]
}
},
{
"name": "12",
"monday": {
"lesson": "painting",
"teacher": "va-sarzhin",
"time": [
"17:00 17:45",
"17:55 18:40"
]
},
"wednesday": {
"lesson": "drawing",
"teacher": "mg-timasheva",
"time": [
"17:00 17:45",
"17:55 18:40"
]
},
"thursday": {
"lesson": "history",
"teacher": "my-valkova",
"time": [
"17:00 17:45"
]
},
"friday": {
"lesson": "composition",
"teacher": "od-gogoleva",
"time": [
"17:00 17:45",
"17:55 18:40"
]
}
},
{
"name": "13",
"tuesday": {
"lesson": "drawing",
"teacher": "mg-timasheva",
"time": [
"17:00 17:45",
"17:55 18:40"
]
},
"wednesday": {
"lesson": "painting",
"teacher": "va-sarzhin",
"time": [
"17:00 17:45",
"17:55 18:40"
]
},
"thursday": {
"lesson": "history",
"teacher": "my-valkova",
"time": [
"18:00 18:45"
]
},
"friday": {
"lesson": "composition",
"teacher": "vv-voronova",
"time": [
"17:00 17:45",
"17:55 18:40"
]
}
}
]
-438
View File
@@ -1,438 +0,0 @@
[
{
"name": "1-1",
"tuesday": {
"lesson": "composition",
"teacher": "vv-voronova",
"time": [
"15:00 15:45",
"15:55 16:40"
]
},
"thursday": {
"lesson": "painting",
"teacher": "od-gogoleva",
"time": [
"15:00 15:45",
"15:55 16:40"
]
},
"saturday": {
"lesson": "sculpting",
"teacher": "in-vturina",
"time": [
"11:00 11:45",
"11:55 12:40"
]
}
},
{
"name": "1-2",
"tuesday": {
"lesson": "composition",
"teacher": "vv-voronova",
"time": [
"17:00 17:45",
"17:55 18:40"
]
},
"thursday": {
"lesson": "painting",
"teacher": "od-gogoleva",
"time": [
"17:00 17:45",
"17:55 18:40"
]
},
"saturday": {
"lesson": "sculpting",
"teacher": "in-vturina",
"time": [
"13:00 13:45",
"13:55 14:40"
]
}
},
{
"name": "1-3",
"monday": {
"lesson": "painting",
"teacher": "od-gogoleva",
"time": [
"15:00 15:45",
"15:55 16:40"
]
},
"friday": {
"lesson": "composition",
"teacher": "vv-voronova",
"time": [
"15:00 15:45",
"15:55 16:40"
]
},
"saturday": {
"lesson": "sculpting",
"teacher": "in-vturina",
"time": [
"15:00 15:45",
"15:55 16:40"
]
}
},
{
"name": "2-1",
"monday": {
"lesson": "composition",
"teacher": "nv-andreeva",
"time": [
"15:00 15:45",
"15:55 16:40"
]
},
"wednesday": {
"lesson": "painting",
"teacher": "od-gogoleva",
"time": [
"15:00 15:45",
"15:55 16:40"
]
},
"saturday": {
"lesson": "composition",
"teacher": "as-timasheva",
"time": [
"11:00 11:45",
"11:55 12:40"
]
}
},
{
"name": "2-2",
"monday": {
"lesson": "composition",
"teacher": "nv-andreeva",
"time": [
"17:00 17:45",
"17:55 18:40"
]
},
"wednesday": {
"lesson": "painting",
"teacher": "od-gogoleva",
"time": [
"17:00 17:45",
"17:55 18:40"
]
},
"saturday": {
"lesson": "composition",
"teacher": "as-timasheva",
"time": [
"13:00 13:45",
"13:55 14:40"
]
}
},
{
"name": "2-3",
"monday": {
"lesson": "painting",
"teacher": "od-gogoleva",
"time": [
"17:00 17:45",
"17:55 18:40"
]
},
"thursday": {
"lesson": "composition",
"teacher": "nv-andreeva",
"time": [
"15:00 15:45",
"15:55 16:40"
]
},
"friday": {
"lesson": "composition",
"teacher": "as-timasheva",
"time": [
"15:00 15:45",
"15:55 16:40"
]
}
},
{
"name": "3-1",
"monday": {
"lesson": "drawing",
"teacher": "sa-latipova",
"time": [
"15:00 15:45",
"15:55 16:40"
]
},
"tuesday": {
"lesson": "composition",
"teacher": "nv-andreeva",
"time": [
"15:00 15:45",
"15:55 16:40"
]
},
"wednesday": {
"lesson": "history",
"teacher": "my-valkova",
"time": [
"17:00 17:45",
""
]
},
"thursday": {
"lesson": "painting",
"teacher": "sa-latipova",
"time": [
"15:00 15:45",
"15:55 16:40"
]
},
"saturday": {
"lesson": "cg",
"teacher": "rk-timashev",
"time": [
"13:00 13:45",
"13:55 14:40"
]
}
},
{
"name": "3-2",
"monday": {
"lesson": "drawing",
"teacher": "sa-latipova",
"time": [
"17:00 17:45",
"17:55 18:40"
]
},
"tuesday": {
"lesson": "composition",
"teacher": "nv-andreeva",
"time": [
"17:00 17:45",
"17:55 18:40"
]
},
"wednesday": {
"lesson": "history",
"teacher": "my-valkova",
"time": [
"17:00 17:45",
""
]
},
"thursday": {
"lesson": "painting",
"teacher": "sa-latipova",
"time": [
"17:00 17:45",
"17:55 18:40"
]
},
"saturday": {
"lesson": "cg",
"teacher": "rk-timashev",
"time": [
"15:00 15:45",
"15:55 16:40"
]
}
},
{
"name": "3-3",
"wednesday": {
"lesson": "history",
"teacher": "my-valkova",
"time": [
"17:00 17:45",
""
]
},
"thursday": {
"lesson": "composition",
"teacher": "nv-andreeva",
"time": [
"17:00 17:45",
"17:55 18:40"
]
},
"friday": {
"lesson": "painting",
"teacher": "as-timasheva",
"time": [
"17:00 17:45",
"17:55 18:40"
]
},
"saturday": {
"lesson": "drawing",
"teacher": "as-timasheva",
"time": [
"15:00 15:45",
"15:55 16:40"
]
}
},
{
"name": "4-1",
"monday": {
"lesson": "composition",
"teacher": "vv-voronova",
"time": [
"15:00 15:45",
"15:55 16:40"
]
},
"tuesday": {
"lesson": "painting",
"teacher": "va-sarzhin",
"time": [
"15:00 15:45",
"15:55 16:40"
]
},
"wednesday": {
"lesson": "history",
"teacher": "my-valkova",
"time": [
"18:00 18:45",
""
]
},
"friday": {
"lesson": "drawing",
"teacher": "sa-latipova",
"time": [
"15:00 15:45",
"15:55 16:40"
]
}
},
{
"name": "4-2",
"monday": {
"lesson": "composition",
"teacher": "vv-voronova",
"time": [
"17:00 17:45",
"17:55 18:40"
]
},
"tuesday": {
"lesson": "painting",
"teacher": "va-sarzhin",
"time": [
"17:00 17:45",
"17:55 18:40"
]
},
"wednesday": {
"lesson": "history",
"teacher": "my-valkova",
"time": [
"18:00 18:45",
""
]
},
"friday": {
"lesson": "drawing",
"teacher": "sa-latipova",
"time": [
"17:00 17:45",
"17:55 18:40"
]
}
},
{
"name": "5-1",
"monday": {
"lesson": "painting",
"teacher": "va-sarzhin",
"time": [
"15:00 15:45",
"15:55 16:40"
]
},
"thursday": {
"lesson": "history",
"teacher": "my-valkova",
"time": [
"17:00 17:45",
""
]
}
},
{
"name": "5-2",
"monday": {
"lesson": "painting",
"teacher": "va-sarzhin",
"time": [
"17:00 17:45",
"17:55 18:40"
]
},
"tuesday": {
"lesson": "drawing",
"teacher": "mg-timasheva",
"time": [
"17:00 17:45",
"17:55 18:40"
]
},
"thursday": {
"lesson": "history",
"teacher": "my-valkova",
"time": [
"17:00 17:45",
""
]
}
},
{
"name": "6-1",
"wednesday": {
"lesson": "painting",
"teacher": "va-sarzhin",
"time": [
"17:00 17:45",
"17:55 18:40"
]
},
"thursday": {
"lesson": "drawing",
"teacher": "mg-timasheva",
"time": [
"16:00 17:45",
""
]
},
"friday": {
"lesson": "composition",
"teacher": "vv-voronova",
"time": [
"17:00 17:45",
"17:55 18:40"
]
}
},
{
"thursday": {
"lesson": "history",
"teacher": "my-valkova",
"time": [
"18:00 18:45",
""
]
}
}
]
+52 -64
View File
@@ -1,74 +1,62 @@
var pop = require("../utils/populate").pop;
const WEEK = ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday"];
const SCHEDULES = {
"2014-early": require("./schedule-2014-early.json"),
"2014-late": require("./schedule-2014-late.json")
module.exports = {
populate: populateSchedule
};
module.exports = function (year, name, pops) {
//var s = require(
// [year, name].reduce(function (r, v, i) {
// var n = "{i}".replace("i", i);
// return r.replace(n, v);
// }, "./schedule-{0}-{1}.json")
//);
function populateSchedule(s, pops) {
var days = function (group) {
var result = [];
var s = SCHEDULES[year + "-" + name];
return populateSchedule(s, pops);
};
WEEK.forEach(function (i) {
var lesson = group[i];
if (lesson) {
result.push(
pop(lesson)
.populate(time())
.populate(pops)
.result()
)
} else {
result.push(null);
}
});
return result;
};
function populateSchedule(s, pops){
var days = function (group) {
var result = [];
var time = function () {
return function (lesson) {
for (var i = 0; i < lesson.time.length; i++) {
lesson.time[i] = lesson.time[i].replace(" ", "—");
}
return lesson;
}
};
WEEK.forEach(function (i) {
var lesson = group[i];
if (lesson) {
result.push(
pop(lesson)
.populate(time())
.populate(pops)
.result()
)
} else {
result.push(null);
}
});
return result;
};
var mondayTime = function (group) {
var day;
for (var i = 0; i < WEEK.length; i++) {
if (group[WEEK[i]]) {
day = WEEK[i];
break;
}
}
if (day) {
return group[day].time[0].substr(0, 5);
} else {
return "00:00"
}
};
var time = function () {
return function (lesson) {
for (var i = 0; i < lesson.time.length; i++) {
lesson.time[i] = lesson.time[i].replace(" ", "—");
}
return lesson;
}
};
var mondayTime = function (group) {
var day;
for (var i = 0; i < WEEK.length; i++) {
if (group[WEEK[i]]) {
day = WEEK[i];
break;
}
}
if (day) {
return group[day].time[0].substr(0, 5);
} else {
return "00:00"
}
};
var result = [];
s.forEach(function (group) {
result.push({
name: group.name,
days: days(group),
time: mondayTime(group)
});
});
return result;
var result = [];
s.forEach(function (group) {
result.push({
name: group.name,
days: days(group),
time: mondayTime(group)
});
});
return result;
}
+16 -44
View File
@@ -5,58 +5,30 @@ server {
server_name art.shlisselburg.org;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
# try_files $uri $uri/ /index.html;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
proxy_pass http://hudozka;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_pass http://localhost:18010;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
}
error_log /var/log/nginx/hudozhka.error.log;
access_log /var/log/nginx/hudozhka.access.log;
# Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests
#location /RequestDenied {
# proxy_pass http://127.0.0.1:8080;
#}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
#error_page 500 502 503 504 /50x.html;
#location = /50x.html {
# root /usr/share/nginx/html;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# fastcgi_split_path_info ^(.+\.php)(/.+)$;
# # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
#
# # With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php5-fpm:
# fastcgi_pass unix:/var/run/php5-fpm.sock;
# fastcgi_index index.php;
# include fastcgi_params;
#}
}
server {
listen 80;
server_name hudozhka.shlisselburg.org
hudozka.shlisselburg.org
artschool.shlisselburg.org
art-school.shlisselburg.org
hudozhka.shburg.org
hudozka.shburg.org
artschool.shburg.org
art-school.shburg.org
;
server_name art.shburg.org;
return 301 $scheme://art.shlisselburg.org$request_uri;
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream hudozka {
server localhost:18010;
}
+20 -12
View File
@@ -1,9 +1,9 @@
{
"name": "app",
"name": "Hudozka",
"private": true,
"version": "2.0.0",
"version": "3.1.0",
"description": "",
"main": "main.js",
"main": "bin/www.js",
"scripts": {
"test": "mocha"
},
@@ -14,17 +14,25 @@
"author": "Roman Timashev",
"license": "ISC",
"dependencies": {
"body-parser": "^1.9.3",
"bower": "^1.3.12",
"cookie-parser": "^1.3.3",
"express": "^4.10.1",
"co": "^4.4.0",
"instagram-node": "^0.5.1",
"method-override": "^2.3.0",
"mongoose": "^3.8.19",
"morgan": "^1.5.0",
"promise": "^6.0.1"
"koa-bodyparser": "^1.4.1",
"koa-conditional-get": "^1.0.2",
"koa-etag": "^2.0.0",
"koa-helmet": "0.0.3",
"koa-logger": "^1.2.2",
"koa-prerender": "^1.0.3",
"koa-route": "^2.4.0",
"koa-static": "^1.4.9",
"koa-useragent": "0.0.5",
"koa.io": "0.0.3",
"mz": "^1.3.0",
"promised-mongo": "^0.11.1",
"thunkify": "^2.1.2"
},
"devDependencies": {
"bower": "^1.3.12",
"browserify-ngannotate": "^0.7.1",
"gulp": "^3.8.10",
"gulp-autoprefixer": "0.0.6",
"gulp-browserify": "^0.5.0",
@@ -32,7 +40,7 @@
"gulp-imagemin": "~0.1.5",
"gulp-minify-css": "~0.3.0",
"gulp-sass": "^1.2.2",
"gulp-uglify": "^0.2.1",
"gulp-uglify": "^1.1.0",
"mocha": "~1.17.1",
"should": "~3.1.2"
}
-118
View File
@@ -1,118 +0,0 @@
extends ../layout
block custom_head
link(rel="stylesheet", href="/s/docs.css")
block content
include ../menu
.main
for group in blocks
.docblock
if(group.type == 'documents')
//- h2 #{group.name}
for i in group.items
.doc
a(href='#{i.path}')
img(src='#{i.preview}')
span #{i.title}
//- .docblock
//- h2 Лицензии, свидетельства и уставы
//- .panel
//- .docs
//- .doc
//- img(src='/docs/preview/statue-2013.png')
//- a(href='/document/statue-2013') Устав школы в 2013 году
//- .doc
//- img(src='/docs/preview/license_edu.png')
//- a(href='/document/edu-license') Образовательная лицензия
//- .doc
//- img(src='/docs/preview/certificate_gov.png')
//- a(href='/document/gov_certificate') Свидетельство о государственной регистрации права
//- .doc
//- img(src='/docs/preview/vatin.png')
//- a(href='/document/VAT') ИНН
//- .doc
//- img(src='/docs/preview/certificate_egryl1.png')
//- a(href='/document/EGRYL1') Свидетельство о внесении в «ЕГРЮЛ»
//- .doc
//- img(src='/docs/preview/certificate_egryl2.png')
//- a(href='/document/EGRYL2') Свидетельство о внесении в «ЕГРЮЛ»
//- .docblock
//- h2 Грамоты
//- .panel
//- ul
//- li
//- a(href='').act.select ученикам
//- li
//- a(href='').act учителям
//- ul
//- li
//- a(href='').act 2014
//- li
//- a(href='').act.select 2013
//- li
//- a(href='').act 2012
//- li
//- a(href='').act 2011
//- li
//- a(href='').act 2010
//- li
//- a(href='').act 2009
//- li
//- a(href='').act 2008
//- li
//- a(href='').act 2007
//- .docs
//- .doc
//- img(src='/docs/temp/0002_600_0.jpg')
//- .doc
//- img(src='/docs/temp/gramota1296478114.jpg')
//- .doc
//- img(src='/docs/temp/Грамота_Буркун_И.Г.jpg')
//- .doc
//- img(src='/docs/temp/Грамота_ГребенникО.С.jpg')
//- .docblock
//- h2 Образовательные программы
//- .panel
//- .docs
//- .doc
//- img(src='/docs/temp/03_.JPG')
//- .docinfo
//- p
//- a(href='') Живопись
//- p 500 страниц
//- p
//- a(href='') Скачать пдф (5 mb)
//- .doc
//- img(src='/docs/temp/22.jpg')
//- .docinfo
//- p
//- a(href='') Рисунок
//- p 500 страниц
//- p
//- a(href='') Скачать пдф (5 mb)
//- .doc
//- img(src='/docs/temp/dokument.gif')
//- .docinfo
//- p
//- a(href='') Скульптура
//- p 500 страниц
//- p
//- a(href='') Скачать пдф (5 mb)
//- .doc
//- img(src='/docs/temp/license_cryptomodulc.jpg')
//- .docinfo
//- p
//- a(href='') ДПИ
//- p 500 страниц
//- p
//- a(href='') Скачать пдф (5 mb)
//- .doc
//- img(src='/docs/temp/1340870449_1283936456_dog_bez_pol.jpg')
//- .docinfo
//- p
//- a(href='') История искусств
//- p 500 страниц
//- p
//- a(href='') Скачать пдф (5 mb)
-15
View File
@@ -1,15 +0,0 @@
extends ../layout
block custom_head
link(rel="stylesheet", href="/s/document.css")
block menu
.menu
h1
span.bold ДХШ
span.norm Шлиссельбурга,
span.norm #{doc.name}
block content
.displaybox
iframe#doc(src="#{doc.download}")
-57
View File
@@ -1,57 +0,0 @@
extends ../layout
block custom_head
if doc.viewer == "default"
link(rel='stylesheet', href='/s/pdf.css')
link(rel='stylesheet', href='/s/document.css')
if doc.extra && doc.extra.style
for style in doc.extra.style
link(rel='stylesheet', href='#{style}')
if doc.viewer == "default"
script(src='http://code.jquery.com/jquery-2.1.0.min.js')
script(src='/c/document.js')
if doc.extra && doc.extra.script
for script in doc.extra.script
script(src='#{script}')
block content
.menu.opac
.panel
h1
span.bold ДХШ
span.norm Шлиссельбурга,
span.norm #{doc.title}
.panel.right
if doc.viewer == "default" && doc.url.length > 1
.controls
p.block
span Страница
input#currentPage(pattern='[0-9]{,3}')
| из
span#totalPages
p.block
button#buttonPrev ←
button#buttonNext →
if doc.download
p.block
a.download(href='#{doc.download}')
if doc.viewer == "default"
div(id='page-container')
for url in doc.url
//- p #{url}
.pf(data-page-url='#{url}')
//- img(src='#{url}')
//- //- for url in doc.url
//- //- .pf
//- //- //-
if doc.viewer == "img-sheet"
.doclist
for url in doc.url
img(src='#{url}')
-11
View File
@@ -1,11 +0,0 @@
doctype html
html
head
link(rel="stylesheet", href="/s/main.css")
link(rel="stylesheet", href="/fonts/stylesheet.css")
block custom_head
body
block content
include yandex.metrika.jade
-7
View File
@@ -1,7 +0,0 @@
extends ../layout
block custom_head
meta(name="google-site-verification", content="8BxOTw-Q02DS2KAdcGcnIMwiPZ58DVB18XpOfRibCcg")
block content
include ../menu
-10
View File
@@ -1,10 +0,0 @@
.menu
ul
each i in menu.items
li(class='#{i.class}')
if(i.url)
a(href='#{i.url}') #{i.text}
else
span #{i.text}
a.vk(href='#{menu.vkgroup}')
img(src='/img/icon.vk.png')
-46
View File
@@ -1,46 +0,0 @@
extends ../layout
block custom_head
link(rel='stylesheet', href='/s/animate.min.css')
link(rel='stylesheet', href='/s/schedule.css')
//- script(src='http://code.jquery.com/jquery-2.1.0.min.js')
script(src='/c/jquery-2.1.0.js')
script(src='/c/schedule.js')
block content
include ../menu
.schedule
p Расписание весеннего семестра 2014 года
//- ul
//- li
//- a(href='') 2012, осень
//- li
//- a(href='') 2013, весна
//- li
//- a(href='') 2013, осень
//- li.current 2014, весна
table
thead
- var days = ["Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота"];
th.group Гр.
for day in days
//- th.current.first
//- th.weekend
th
p.day #{day}
p.date
tbody
for group in groups
tr
td.group
p.name #{group.name}
p.time #{group.time}
for day in group.days
td
if day
p.lesson
a(href='') #{day.lesson}
p.teacher
a(href='') #{day.teacher}
for time in day.time
p.time #{time}
-19
View File
@@ -1,19 +0,0 @@
extends ../layout
block custom_head
link(rel="stylesheet", href="/s/team.css")
block content
img.main-picture(src='http://static.shburg.org/art/team/team.jpg')
include ../menu
.main
ul.team-list
for member in team
li.team-member
img(src='#{member.picture}')
.info
h3 #{member.firstName} #{member.middleName}
span #{member.lastName}
p #{member.position}
p #{member.status}
p #{member.edu}
-13
View File
@@ -1,13 +0,0 @@
//- //Yandex.Metrika informer
//- a(href='http://metrika.yandex.ru/stat/?id=24027460&from=informer', target='_blank', rel='nofollow')
//- img(src='//bs.yandex.ru/informer/24027460/3_1_FFFFFFFF_EFEFEFFF_0_pageviews', style='width: 88px; height: 31px; border: 0;', alt='Яндекс.Метрика', title='Яндекс.Метрика: данные за сегодня (просмотры, визиты и уникальные посетители)', onclick='try{Ya.Metrika.informer({i:this,id:24027460,lang:\'ru\'});return false}catch(e){}')
//- //Yandex.Metrika informer
// Yandex.Metrika counter
script
include yandex.metrika.js
noscript
div
img(src='//mc.yandex.ru/watch/24027460', style='position: absolute; left: -9999px;', alt='')
// Yandex.Metrika counter
-1
View File
@@ -1 +0,0 @@
(function (d, w, c) { (w[c] = w[c] || []).push(function() { try { w.yaCounter24027460 = new Ya.Metrika({id:24027460, webvisor:true, clickmap:true, trackLinks:true, accurateTrackBounce:true}); } catch(e) { } }); var n = d.getElementsByTagName("script")[0], s = d.createElement("script"), f = function () { n.parentNode.insertBefore(s, n); }; s.type = "text/javascript"; s.async = true; s.src = (d.location.protocol == "https:" ? "https:" : "http:") + "//mc.yandex.ru/metrika/watch.js"; if (w.opera == "[object Opera]") { d.addEventListener("DOMContentLoaded", f, false); } else { f(); } })(document, window, "yandex_metrika_callbacks");
-46
View File
@@ -1,46 +0,0 @@
var Router = require("express").Router;
var route = require("./route");
var document = require("../models/document");
var router = new Router();
module.exports = router.middleware;
router.get("/docs", function(req, res){
var url = "/docs";
res.render("docs/docs", {
menu: route.menu(url),
blocks: [
{
type: "documents",
name: "Лицензии, свидетельства и уставы",
items: document.cap(
document.doc(
["statue-2013", "edu-license", "gov-certificate", "VAT", "EGRYL1", "EGRYL2"]
)
)
}
]
});
});
router.get("/document/:doc/:page?", function(req, res){
var name = req.param("doc");
var doc = document.doc(name);
// doc = document.extra(doc, {
// "style": [
// "/s/pdf.css"
// ],
// "script": [
// "http://code.jquery.com/jquery-2.1.0.min.js",
// "/c/document.js"
// ]
// });
if(doc){
doc.startPage = req.param("page");
res.render("document/document", {doc: doc});
}else{
res.error(404);
}
});
-44
View File
@@ -1,44 +0,0 @@
/**
* Created by tmshv on 22/11/14.
*/
var Router = require("express").Router;
var instagram = require("./instagram");
module.exports = function (app) {
var router;
router = new Router();
router.route("/auth/instagram/callback")
.get(function (req, res) {
var api = instagram.client();
var code = req.query.code;
instagram.authorize(code)
.catch(function(error){
console.log(error.body);
res.status(500).send('');
})
.then(function (client) {
res.cookie("instagram_code", code);
res.redirect("/");
});
});
app.use(router);
//http://your-callback.com/url/?hub.mode=subscribe&hub.challenge=15f7d1a91c1f40f8a748fd134752feb3&hub.verify_token=myVerifyToken
router = new Router();
router.route("/instagram/tag/:tag")
.get(function (req, res) {
var hub_challenge = req.query["hub.challenge"];
//var hub_verify_token = req.query["hub.verify_token"];
console.log("real time get", req.param("tag"), hub_challenge);
res.send(hub_challenge);
})
.post(function (req, res) {
console.log("real time tag", req.param("tag"));
console.log(req.body);
res.send("");
});
app.use(router);
};
-45
View File
@@ -1,45 +0,0 @@
const config = require("../config")
function getMenu(){
return clone(config.data.menu);
}
function clone(obj){
if(obj == null || typeof(obj) != 'object')
return obj;
var temp = obj.constructor(); // changed
for(var key in obj)
temp[key] = clone(obj[key]);
return temp;
}
exports.menu = function(url){
var m = getMenu();
m.items.forEach(function(i){
if(i.url != url) i.class = "";
});
return m;
}
exports.team = function(processor) {
var list = [];
config.data.team.forEach(function(m){
if(processor){
processor(m);
}
list.push(m);
});
return list;
}
exports.nameProcessor = function(delimiter){
if(!delimiter) delimiter = /\s+/;
return function(member){
var nnn = member.name.split(delimiter);
member.firstName = nnn[0];
member.middleName = nnn[1];
member.lastName = nnn[2];
}
}
-20
View File
@@ -1,20 +0,0 @@
var Router = require("express").Router;
var route = require("./route");
// var router = Object.create(Router);
var router = new Router();
router.get("/team", function(req, res){
var url = "/team";
res.render("team/team", {
menu: route.menu(url),
team: route.team(route.nameProcessor())
});
});
router.get("/teachers/:name", function(req, res){
var name = req.param("name");
res.error(404);
});
module.exports = router;
+31
View File
@@ -0,0 +1,31 @@
/**
* Created by tmshv on 01/03/15.
*/
var route = require("koa-route");
var router = require("./");
module.exports = function (app) {
app.use(function *(next) {
yield next;
if (404 != this.status) return;
this.status = 404;
yield router.accepts({
"text/html": router.index(),
"text/plain": function *() {
this.type = "text/plain";
this.body = "Page not found";
},
"application/json": function *() {
this.type = "application/json";
this.body = {
message: "Not Found"
};
}
});
});
};
+42
View File
@@ -0,0 +1,42 @@
/**
* Created by tmshv on 01/03/15.
*/
var path = require("path");
var fs = require("mz/fs");
var config = require("../config");
function accepts(routes, def) {
return function *() {
var req = this.request;
var types = Object.keys(routes)
.filter(function (type) {
return req.accepts(type);
});
if (types.length) {
var type = types[0];
yield routes[type].apply(this, arguments);
} else if(def){
yield def;
}else{
this.status = 406;
}
};
}
function index(filename) {
if (!filename){
filename = path.join(__dirname, "..", config.defaultIndex);
}
return function *() {
this.type = "text/html";
this.body = fs.createReadStream(filename);
}
}
module.exports = {
index: index,
accepts: accepts
};
+92
View File
@@ -0,0 +1,92 @@
/**
* Created by tmshv on 22/11/14.
*/
var route = require("koa-route");
var router = require("./");
var db = require("../core/db");
module.exports = function (app) {
app.use(route.get("/news", router.accepts({
"text/html": function *() {
this.redirect("/");
},
"text/plain": function *() {
this.redirect("/");
},
"application/json": function *() {
var count = parseInt(this.query["count"]) || 10;
var portion = parseInt(this.query["portion"]) || 0;
var skip = portion * count;
var query = {};
if (this.query.type) query.type = this.query.type;
var pinned = [];
if(portion == 0) {
var now = new Date();
pinned = yield db.c("posts").find({until: {$gte: now}}).toArray()
.then(function (items) {
return items.sort(sortNewsByDate);
});
}
var pinned_ids = pinned.map(function (p) {
return p["_id"]+"";
});
var posts = yield db.c("posts").find(query)
.sort({date: -1})
.skip(skip)
.limit(count)
.toArray()
.then(function (items) {
return items.filter(function (i) {
var id = i["_id"]+"";
return pinned_ids.indexOf(id) < 0;
});
});
this.body = pinned.concat(posts);
//this.body = pinned_ids
}
})));
app.use(route.get("/news/pinned", router.accepts({
"text/html": function *() {
this.redirect("/");
},
"text/plain": function *() {
this.redirect("/");
},
"application/json": function *() {
var now = new Date();
var pinned = yield db.c("posts").find({until: {$gte: now}}).toArray()
.then(function (items) {
return items.sort(sortNewsByDate);
});
this.body = pinned;
}
})));
app.use(route.get("/news/:uri", router.accepts({
"text/html": router.index(),
"text/plain": router.index(),
"application/json": function *(uri) {
var item = yield db.c("posts").findOne({uri: uri});
if (item) {
this.body = item;
} else {
this.status = 404;
}
}
})));
};
function sortNewsByDate(i1, i2) {
var t1 = new Date(i1.date).getTime();
var t2 = new Date(i2.date).getTime();
if (t1 < t2) return 1;
if (t1 > t2) return -1;
return 0;
}
+47
View File
@@ -0,0 +1,47 @@
/**
* Created by tmshv on 22/11/14.
*/
var route = require("koa-route");
var router = require("./");
var db = require("../core/db");
var schedule = require("../models/schedule");
var populate = require("../utils/populate").populate;
const course = require("../models/course");
const team = require("../models/team");
module.exports = function (app) {
app.use(
route.get("/schedule/:period?/:semester?", router.accepts(
{
"text/html": router.index(),
"text/plain": router.index(),
"application/json": function *(period, semester) {
this.type = "application/json";
var doPopulate = this.query.populate || false;
var data = yield db.c("schedules").findOne({
period: period,
semester: semester
});
if(!data) {
this.status = 404;
return;
}
if(doPopulate) {
data.schedule = schedule.populate(data.schedule, [
populate(team.short, "teacher"),
populate(course.name, "lesson")
]);
}
this.body = data;
}
}
))
);
};
-20
View File
@@ -1,20 +0,0 @@
/**
* Created by tmshv on 22/11/14.
*/
var mongoose = require("mongoose");
var Schema = mongoose.Schema;
var ObjectId = Schema.Types.ObjectId;
var schema = new Schema({
id: {type: String, required: true, index: {unique: true}},
author: {type: String, default: []},
type: {type: String, enum: ["post", "instagram"]},
publishDate: Date,
body: String,
data: Object
}
);
var Post = mongoose.model("Post", schema, "posts");
module.exports = Post;
+68 -23
View File
@@ -1,34 +1,79 @@
var express = require("express");
var path = require("path");
var Post = require("./schema/post");
var Promise = require("promise");
var methodOverride = require("method-override");
var logger = require("morgan");
var cookieParser = require("cookie-parser");
var bodyParser = require("body-parser");
var koa = require("koa.io");
var route = require("koa-route");
var serve = require("koa-static");
var logger = require("koa-logger");
var conditional = require("koa-conditional-get");
var etag = require("koa-etag");
var prerender = require("koa-prerender");
var helmet = require("koa-helmet");
var bodyParser = require("koa-bodyparser");
var app = express();
app.use("/bower_components", express.static(path.join(__dirname, "bower_components")));
app.use("/views", express.static(path.join(__dirname, "views")));
app.use(express.static(path.join(__dirname, "public")));
var config = require("./config");
var routes = require("./routes");
app.use(logger("dev"));
app.use(cookieParser());
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: true}));
app.use(methodOverride());
var app = koa();
app.proxy = true;
require("./api/feed")(app);
require("./routers/instagram")(app);
app.use(bodyParser());
app.use(logger());
app.use(conditional());
app.use(etag());
app.use(prerender(config.prerender));
app.get("/document/*", function (req, res) {
res.sendFile(path.join(__dirname, "views/document.html"));
app.use(serve(path.join(__dirname, "public")));
app.use(serve(path.join(__dirname, "templates")));
app.use(helmet.defaults());
app.use(function *(next) {
var q = this.query;
this.query = Object.keys(q)
.reduce(function (q, key) {
var v = q[key];
if(v === "true"){
v = true;
}else if(v === "false"){
v = false;
}
q[key] = v;
return q;
}, q);
yield next;
});
app.get("*", function (req, res) {
res.sendFile(path.join(__dirname, "views/index.html"));
});
app.use(route.get("/", routes.index()));
app.use(route.get("/team", routes.index()));
app.use(route.get("/docs", routes.index()));
app.use(route.get("/document/:doc", routes.index(
path.join(__dirname, "templates/document.html")
)));
require("./routes/schedule")(app);
require("./routes/news")(app);
require("./routes/404")(app);
require("./instagram/router")(app);
require("./instagram/io")(app);
if (process.env["NODE_ENV"] === "development") {
app.use(route.get("/debug", function *() {
var out = {};
out.ip = this.ip;
out.host = this.host;
out.headers = this.headers;
out.protocol = this.protocol;
out.query = this.query;
out.url = this.url;
this.type = "application/json";
this.body = out;
}));
}
module.exports = function (port) {
app.listen(port);
+4
View File
@@ -0,0 +1,4 @@
<div class="error-404">
<h1>Страница не найдена.</h1>
<img src="http://static.shburg.org/art/graphics/skull.jpg" alt=""/>
</div>
+54
View File
@@ -0,0 +1,54 @@
<!DOCTYPE html>
<html ng-app="hudozhka.document">
<head>
<base href="/">
<link rel="stylesheet" href="/style.css">
<link rel="stylesheet" href="/fonts/stylesheet.css">
<meta name="google-site-verification" content="8BxOTw-Q02DS2KAdcGcnIMwiPZ58DVB18XpOfRibCcg">
<title ng-bind="title | uppercaseFirst"></title>
<script src="/bower_components/jquery/dist/jquery.min.js"></script>
<script src="/bower_components/angular/angular.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="data.js"></script>
<script src="document.js"></script>
<script>
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-60209057-1', 'auto');
// ga('send', 'pageview');
</script>
</head>
<body>
<div class="document-block" ng-controller="DocumentController">
<div class="menu transparent">
<div class="panel">
<h1>
<span class="bold">ДХШ</span>
<span class="norm">Шлиссельбурга</span> ,
<span class="norm">{{document.title}}</span>
</h1>
</div>
</div>
<div class="document doclist">
<img ng-src="{{url}}" alt="" ng-repeat="url in document.files"/>
</div>
</div>
</body>
</html>
+86
View File
@@ -0,0 +1,86 @@
<!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="menu" ng-controller="MenuController">
<ul>
<li ng-repeat="item in menu" class="{{item.color}}" ng-class="{selected:isCurrent(item)}">
<span ng-hide="isValid(item)">{{item.text}}</span>
<a href="{{item.url}}" ng-show="isValid(item)">{{item.text}}</a>
</li>
<!--<a href="{{vkgroup}}" class="vk"><img src="/graphics/icon.vk.png"></a>-->
</ul>
</div>
<div class="page {{pageClass}}" ng-view></div>
<footer>
<div class="footer-content">
<div class="info-block">
<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>
<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>
<div class="info-block">
<div>
<p>© 2014...{{now.year}}</p>
<p>Художественная школа Шлиссельбурга</p>
<p>Адрес: {{contact.address}}</p>
<p>Телефон: {{contact.telephone}}</p>
<p>Почта: <a href="mailto:{{contact.email}}">{{contact.email}}</a></p>
</div>
</div>
</div>
</footer>
</body>
</html>
+103
View File
@@ -0,0 +1,103 @@
<!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>
<script>
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-60209057-1', 'auto');
// ga('send', 'pageview');
</script>
</head>
<body>
<div class="menu" ng-controller="MenuController">
<ul>
<li ng-repeat="item in menu" class="{{item.color}}" ng-class="{selected:isCurrent(item)}">
<span ng-hide="isValid(item)">{{item.text}}</span>
<a href="{{item.url}}" ng-show="isValid(item)">{{item.text}}</a>
</li>
<!--<a href="{{vkgroup}}" class="vk"><img src="/graphics/icon.vk.png"></a>-->
</ul>
</div>
<div class="page {{pageClass}}" ng-view></div>
<footer>
<div class="footer-content">
<div class="info-block">
<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>
<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>
<div class="info-block">
<div>
<p>© 2014...{{now.year}}</p>
<p>Художественная школа Шлиссельбурга</p>
<p>Адрес: {{contact.address}}</p>
<p>Телефон: {{contact.telephone}}</p>
<p>Почта: <a href="mailto:{{contact.email}}">{{contact.email}}</a></p>
</div>
</div>
</div>
</footer>
</body>
</html>
+24
View File
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html ng-app="hudozhka.instagram">
<head>
<base href="/">
<meta name="fragment" content="!">
<meta name="viewport" content="width=device-width, maximum-scale=1.0" />
<title ng-bind="title">ДШХ Шлиссельбурга</title>
<link rel="stylesheet" href="/style.css">
<script src="/bower_components/jquery/dist/jquery.min.js"></script>
<script src="/bower_components/angular/angular.min.js"></script>
<script src="/instagram.js"></script>
</head>
<body ng-controller="InstagramController">
<div class="controls">
<a href="/instagram/auth" ng-show="!user">Instagram</a>
<a href="//instagram.com/{{user.username}}" ng-show="user">{{user.full_name}}</a>
<button ng-click="invite()">Invite</button>
{{inviteCode}}
</div>
</body>
</html>
@@ -1,7 +1,7 @@
<div class="main" ng-controller="DocumentsController">
<div class="docblock"><h2>Лицензии, свидетельства и уставы</h2>
<div class="doc" ng-repeat="doc in documents">
<a href="{{doc.path}}" target="_blank">
<a href="{{doc.url}}" target="_blank">
<img ng-src="{{doc.preview}}">
<span>{{doc.title | uppercaseFirst}}</span>
</a>
+38
View File
@@ -0,0 +1,38 @@
<div class="main-block">
<div>
<!--&lt;!&ndash;<a href="tel://{{telephone}}"></a>&ndash;&gt;-->
<span class="telephone">{{contact.telephone}}</span>
<!--&lt;!&ndash;<ul class="submenu">&ndash;&gt;-->
<!--&lt;!&ndash;<li><a href="/team#director">директор</a><p>М. Г. Тимашева</p></li>&ndash;&gt;-->
<!--&lt;!&ndash;<li><a href="/enter">поступление</a></li>&ndash;&gt;-->
<!--&lt;!&ndash;<li><a href="/contacts">контактная информация</a></li>&ndash;&gt;-->
<!--&lt;!&ndash;<li><a href="/awards">награды</a></li>&ndash;&gt;-->
<!--&lt;!&ndash;</ul>&ndash;&gt;-->
</div>
<h1>Шлиссельбургская детская художественная&nbsp;школа</h1>
</div>
<div class="tape-block">
<div class="tape-block-content">
<div class="tape tape-tl"></div>
<div class="tape tape-tr"></div>
<div class="tape tape-bl"></div>
<div class="tape tape-br"></div>
<div class="fotorama"
data-transition="crossfade"
data-autoplay="6000"
data-arrows="false"
data-width="100%"
data-fit="cover"
data-loop="true">
<img src="http://static.shburg.org/art/img/cat1.jpg" alt="">
<img src="http://static.shburg.org/art/img/cat2.jpg" alt="">
<img src="http://static.shburg.org/art/img/cat3.jpg" alt="">
</div>
</div>
</div>
<timeline></timeline>
+61
View File
@@ -0,0 +1,61 @@
<div class="schedule" ng-controller="ScheduleController">
<p> Расписание {{sem}} семестра {{year}} года</p>
<div class="schedule-block">
<table>
<thead class="">
<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 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>
File renamed without changes.
+15
View File
@@ -0,0 +1,15 @@
<div class="head">
<div class="user">
<img ng-src="{{post.userpic}}" alt=""/>
<span>{{post.username}}</span>
</div>
<p class="date">{{post.date | date : "dd.MM.yyyy"}}</p>
</div>
<div class="body">
<!--<h2>Рисунок</h2>-->
<p>{{post.text}}</p>
<a href="{{post.url}}" target="_blank">
<img ng-src="{{post.image}}" alt="">
</a>
</div>
+9
View File
@@ -0,0 +1,9 @@
<div class="head">
<a name="{{post.uri}}"></a>
</div>
<div class="body">
<div><p class="date"><a href="#{{post.uri}}">{{post.date | date : "dd.MM.yyyy"}}</a></p></div>
<div class="message" ng-bind-html="message"></div>
</div>
+16
View File
@@ -0,0 +1,16 @@
<div class="timeline">
<timeline-record class="timeline-record {{recordClass(post)}}"
content="post"
ng-repeat="post in feed track by $index"
ng-class="{left: isEven($index), right: !isEven($index)}">
</timeline-record>
<div class="timeline-end">
<button class="more"
ng-click="loadNext()"
ng-disabled="timelineUpdating">
<span us-spinner="{radius:5, width:2, length: 4}" spinner-key="timelineMore"></span>
<span ng-hide="timelineUpdating">Ещё</span>
</button>
</div>
</div>
+17
View File
@@ -0,0 +1,17 @@
/**
* Created by tmshv on 13/03/15.
*/
var co = require("co");
var should = require("should");
var instagram = require("../instagram/instagram");
var db = require("../core/db");
var config = require("../config");
describe("Instagram", function () {
describe("getUser()", function () {
it("should return default user if exists", function () {
});
});
});
+25
View File
@@ -0,0 +1,25 @@
/**
* Created by tmshv on 08/03/15.
*/
var should = require("should");
describe("utils", function () {
describe("net.js", function () {
describe("query", function () {
var query = require("../utils/net").query;
var sample = [["count", 10], ["portion", 5], ["hello", "lol"]];
it("should combine query params", function () {
var params = query(sample);
params.should.be.equal("count=10&portion=5&hello=lol");
});
it("should return string", function () {
var params = query(sample);
params.should.be.type("string");
});
});
});
});
+15
View File
@@ -0,0 +1,15 @@
/**
* Created by tmshv on 08/03/15.
*/
module.exports = {
query: function(list){
var params = list.reduce(function (query, param) {
var q = param[0] + "=" + param[1];
query.push(q);
return query;
}, [])
.join("&");
return params
}
};
-1
View File
@@ -1 +0,0 @@
<img ng-src="{{url}}" alt="" ng-repeat="url in document.url"/>
-1
View File
@@ -1 +0,0 @@
<pdf document="document"></pdf>
-87
View File
@@ -1,87 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<base href="/document">
<link rel="stylesheet" href="/style.css">
<link rel="stylesheet" href="/s/animate.min.css">
<link rel="stylesheet" href="/fonts/stylesheet.css">
<meta name="google-site-verification" content="8BxOTw-Q02DS2KAdcGcnIMwiPZ58DVB18XpOfRibCcg">
<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="data.js"></script>
<script src="document.js"></script>
</head>
<body ng-app="document.hudozhka" ng-controller="DocumentPageController">
<div class="document-block" ng-controller="DocumentController">
<div class="menu transparent">
<div class="panel">
<h1>
<span class="bold">ДХШ</span>
<span class="norm">Шлиссельбурга</span> ,
<span class="norm">{{document.title}}</span>
</h1>
</div>
<div class="panel right">
<div class="controls" ng-show="showControls">
<p class="block">
<span>Страница</span>
<input ng-model="currentPage" ng-change="update()" type="text" pattern="[0-9]{,3}">
из
<span>{{totalPages}}</span>
</p>
<p class="block">
<button ng-click="prevPage()">←</button>
<button ng-click="nextPage()">→</button>
</p>
<p class="block">
<a class="download" href="{{document.download}}"></a>
</p>
</div>
</div>
</div>
<div class="document">
<div class="page {{pageClass}}" ng-include="viewDocument()"></div>
</div>
</div>
<!-- Yandex.Metrika counter -->
<script>(function (d, w, c) {
(w[c] = w[c] || []).push(function () {
try {
w.yaCounter24027460 = new Ya.Metrika({
id: 24027460,
webvisor: true,
clickmap: true,
trackLinks: true,
accurateTrackBounce: true
});
} catch (e) {
}
});
var n = d.getElementsByTagName("script")[0], s = d.createElement("script"), f = function () {
n.parentNode.insertBefore(s, n);
};
s.type = "text/javascript";
s.async = true;
s.src = (d.location.protocol == "https:" ? "https:" : "http:") + "//mc.yandex.ru/metrika/watch.js";
if (w.opera == "[object Opera]") {
d.addEventListener("DOMContentLoaded", f, false);
} else {
f();
}
})(document, window, "yandex_metrika_callbacks");</script>
<noscript>
<div><img src="//mc.yandex.ru/watch/24027460" style="position: absolute; left: -9999px;" alt=""></div>
</noscript>
<!-- Yandex.Metrika counter -->
</body>
</html>
-38
View File
@@ -1,38 +0,0 @@
<div>
<div class="main">
<div class="block">
<span class="telephone">{{telephone}}</span>
<!--<ul class="submenu">-->
<!--<li><a href="/team#director">директор</a><p>М. Г. Тимашева</p></li>-->
<!--<li><a href="/enter">поступление</a></li>-->
<!--<li><a href="/contacts">контактная информация</a></li>-->
<!--<li><a href="/awards">награды</a></li>-->
<!--</ul>-->
</div>
<h1>«Художественная школа <strong>Шлиссельбурга</strong>»</h1>
</div>
<div class="tape-block">
<div class="tape-block-content">
<div class="tape tape-tl"></div>
<div class="tape tape-tr"></div>
<div class="tape tape-bl"></div>
<div class="tape tape-br"></div>
<div class="fotorama"
data-transition="crossfade"
data-autoplay="6000"
data-arrows="false"
data-width="100%"
data-fit="cover"
data-loop="true">
<img src="http://static.shlisselburg.org/art/graphics/sample2.jpg" alt="">
<img src="http://static.shlisselburg.org/art/graphics/sample4.jpg" alt="">
<img src="http://static.shlisselburg.org/art/graphics/sample5.jpg" alt="">
</div>
</div>
</div>
<timeline></timeline>
</div>
-99
View File
@@ -1,99 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<base href="/">
<link rel="stylesheet" href="/style.css">
<link rel="stylesheet" href="/s/animate.min.css">
<link rel="stylesheet" href="/fonts/stylesheet.css">
<meta name="google-site-verification" content="8BxOTw-Q02DS2KAdcGcnIMwiPZ58DVB18XpOfRibCcg">
<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>
<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 ng-app="hudozhka">
<div class="menu" ng-controller="MenuController">
<ul>
<li ng-repeat="item in menu" class="{{item.color}}" ng-class="{selected:isCurrent(item)}">
<span ng-hide="isValid(item)">{{item.text}}</span>
<a href="{{item.url}}" ng-show="isValid(item)">{{item.text}}</a>
</li>
<a href="{{vkgroup}}" class="vk"><img src="/graphics/icon.vk.png"></a>
</ul>
</div>
<div class="page {{pageClass}}" ng-view></div>
<footer>
<div class="info-block">
<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>
<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>
<div class="info-block">
<p>Художественная школа Шлиссельбурга, 2014 год</p>
</div>
</footer>
<!-- Yandex.Metrika counter -->
<script>(function (d, w, c) {
(w[c] = w[c] || []).push(function () {
try {
w.yaCounter24027460 = new Ya.Metrika({
id: 24027460,
webvisor: true,
clickmap: true,
trackLinks: true,
accurateTrackBounce: true
});
} catch (e) {
}
});
var n = d.getElementsByTagName("script")[0], s = d.createElement("script"), f = function () {
n.parentNode.insertBefore(s, n);
};
s.type = "text/javascript";
s.async = true;
s.src = (d.location.protocol == "https:" ? "https:" : "http:") + "//mc.yandex.ru/metrika/watch.js";
if (w.opera == "[object Opera]") {
d.addEventListener("DOMContentLoaded", f, false);
} else {
f();
}
})(document, window, "yandex_metrika_callbacks");</script>
<noscript>
<div><img src="//mc.yandex.ru/watch/24027460" style="position: absolute; left: -9999px;" alt=""></div>
</noscript>
<!-- Yandex.Metrika counter -->
</body>
</html>
-3
View File
@@ -1,3 +0,0 @@
<div id="page-container" ng-include="pageURL">
</div>
-49
View File
@@ -1,49 +0,0 @@
<div class="schedule" ng-controller="ScheduleController">
<p> Расписание {{sem}} семестра {{year}} года</p>
<table>
<thead class="">
<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 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>
-22
View File
@@ -1,22 +0,0 @@
<div class="timeline">
<div class="post"
ng-repeat="post in feed"
ng-class="{left: isEven($index), right: !isEven($index)}">
<div class="head">
<div class="user">
<img ng-src="{{post.userpic}}" alt=""/>
<span>{{post.username}}</span>
</div>
<p class="date">{{post.date | date : "dd.MM.yyyy"}}</p>
</div>
<div class="body">
<!--<h2>Рисунок</h2>-->
<p>{{post.text}}</p>
<a href="{{post.url}}" target="_blank">
<img ng-src="{{post.image}}" alt="">
</a>
</div>
</div>
</div>