- separate document page
This commit is contained in:
1 parent
900f71b066
commit
7b6559e57d
6 files changed
-333
No files matched your search
@@ -65,7 +65,6 @@ gulp.task("copy", function () {
|
||||
gulp.task('compile', function () {
|
||||
gulp.src([
|
||||
'./src/client/app.js',
|
||||
'./src/client/document.js',
|
||||
'./src/client/instagram.js'
|
||||
])
|
||||
.pipe(named())
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
import UppercaseFirst from './filters/UppercaseFirst';
|
||||
|
||||
var app = angular.module("hudozhka.document", [
|
||||
"hudozhka.data",
|
||||
"angulartics",
|
||||
"angulartics.google.analytics"
|
||||
]);
|
||||
|
||||
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.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;
|
||||
}
|
||||
});
|
||||
|
||||
UppercaseFirst(app);
|
||||
@@ -1,115 +0,0 @@
|
||||
const DOCS = [
|
||||
{
|
||||
"name": "statue-2013",
|
||||
"title": "устав школы за 2013 год",
|
||||
"url": "https://static.shburg.org/art/docs/hudozhka_statue-2013.pdf",
|
||||
"preview": "https://static.shburg.org/art/graphics/statue-2013-preview.png",
|
||||
"files": ["https://static.shburg.org/art/docs/hudozhka_statue-2013.pdf"]
|
||||
},
|
||||
{
|
||||
"name": "edu-license",
|
||||
"title": "образовательная лицензия",
|
||||
"url": "/document/edu-license",
|
||||
"preview": "https://static.shburg.org/art/graphics/license_edu-preview.png",
|
||||
"files": [
|
||||
"https://static.shburg.org/art/docs/hudozhka_license_edu.jpg",
|
||||
"https://static.shburg.org/art/docs/hudozhka_license_edu_back.jpg",
|
||||
"https://static.shburg.org/art/docs/hudozhka_license_edu_attachment.jpg"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "gov-certificate",
|
||||
"title": "свидетельство о государственной регистрации права",
|
||||
"url": "/document/gov-certificate",
|
||||
"preview": "https://static.shburg.org/art/graphics/certificate_gov-preview.png",
|
||||
"files": ["https://static.shburg.org/art/docs/hudozhka_certificate_gov.jpg"]
|
||||
},
|
||||
{
|
||||
"name": "VAT",
|
||||
"title": "ИНН",
|
||||
"url": "/document/VAT",
|
||||
"preview": "https://static.shburg.org/art/graphics/vatin-preview.png",
|
||||
"files": ["https://static.shburg.org/art/docs/hudozhka_vatin.jpg"]
|
||||
},
|
||||
{
|
||||
"name": "EGRYL1",
|
||||
"title": "свидетельство о внесении в «ЕГРЮЛ»",
|
||||
"url": "/document/EGRYL1",
|
||||
"preview": "https://static.shburg.org/art/graphics/certificate_egryl1-preview.png",
|
||||
"files": ["https://static.shburg.org/art/docs/hudozhka_certificate_egryl1.jpg"]
|
||||
},
|
||||
{
|
||||
"name": "EGRYL2",
|
||||
"title": "свидетельство о внесении в «ЕГРЮЛ»",
|
||||
"url": "/document/EGRYL2",
|
||||
"preview": "https://static.shburg.org/art/graphics/certificate_egryl2-preview.png",
|
||||
"files": ["https://static.shburg.org/art/docs/hudozhka_certificate_egryl2.jpg"]
|
||||
}
|
||||
];
|
||||
|
||||
exports.docs = DOCS;
|
||||
exports.doc = getDocByName;
|
||||
exports.cap = makeCap;
|
||||
// exports.extra = populateExtra;
|
||||
|
||||
function getDocByName(name){
|
||||
if(name && typeof name == "string"){
|
||||
for(var i=0; i<DOCS.length; i++){
|
||||
var doc = DOCS[i];
|
||||
if(doc.name == name){
|
||||
return clone(doc);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}else if(name && name instanceof Array){
|
||||
var docs = [];
|
||||
name.forEach(function(i){
|
||||
var d = getDocByName(i);
|
||||
if(d){
|
||||
docs.push(d);
|
||||
}
|
||||
});
|
||||
return docs;
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* Capitalize first letter of document name
|
||||
* Process doc object or array of objects
|
||||
* @param {Object | Array} doc document object or array of document objects
|
||||
* @return {[type]} document object or array of document objects with capitalized first letter of document name
|
||||
*/
|
||||
function makeCap(doc){
|
||||
if(doc instanceof Array){
|
||||
for(var i=0; i<doc.length; i++){
|
||||
doc[i] = makeCap(doc[i]);
|
||||
}
|
||||
}else{
|
||||
var n = doc.name;
|
||||
doc.name = n.charAt(0).toUpperCase() + n.substring(1);
|
||||
}
|
||||
|
||||
return doc;
|
||||
}
|
||||
|
||||
// function populateExtra(doc, extra){
|
||||
// if(!doc.extra) doc.extra = {};
|
||||
// for(var i in extra){
|
||||
// if(!doc.extra[i]) doc.extra[i] = [];
|
||||
// doc.extra[i] = doc.extra[i].concat(extra[i]);
|
||||
// }
|
||||
// return doc;
|
||||
// }
|
||||
@@ -1,130 +0,0 @@
|
||||
.document-block {
|
||||
h1{
|
||||
font-size: 14pt;
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
.menu{
|
||||
position: fixed;
|
||||
background-color: white;
|
||||
box-shadow: 0 1px 5px 0 rgba(0, 0, 0, 0.5);
|
||||
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
&.transparent{
|
||||
opacity: 0.95;
|
||||
}
|
||||
}
|
||||
|
||||
.controls {
|
||||
input {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
margin: 0 2px;
|
||||
text-align: center;
|
||||
font-size: .9em;
|
||||
}
|
||||
|
||||
input:focus {
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
button {
|
||||
height: 30px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid #666;
|
||||
background-color: white;
|
||||
font-size: 1.25em;
|
||||
line-height: 0;
|
||||
text-align: center;
|
||||
outline: none;
|
||||
|
||||
&:hover {
|
||||
border-color: #4d62d9;
|
||||
color: #4d62d9;
|
||||
}
|
||||
|
||||
&:active {
|
||||
border-color: #3d4fb2;
|
||||
color: #3d4fb2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.controls .block {
|
||||
display: inline-block;
|
||||
margin: 0 5px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
a.download {
|
||||
height:30px;
|
||||
width: 23px;
|
||||
vertical-align: middle;
|
||||
padding: 0 8px;
|
||||
display: inline-block;
|
||||
background: url(/graphics/download.png) no-repeat 50%;
|
||||
border-radius: 6px;
|
||||
border: 1px solid #666;
|
||||
|
||||
&:hover{
|
||||
border-color: #4d62d9;
|
||||
}
|
||||
|
||||
&:active {
|
||||
border-color: #3d4fb2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.document {
|
||||
padding-top: 50px;
|
||||
|
||||
.page {
|
||||
img {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.norm {
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.bold {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
#page-container {
|
||||
background-color: #c3bfa3;
|
||||
transition: left 500ms;
|
||||
}
|
||||
|
||||
.pf {
|
||||
margin: 60px auto 20px;
|
||||
/* box-shadow: 1px 1px 3px 1px #333;*/
|
||||
box-shadow: 0 1px 4px 0px rgba(0, 0, 0, 0.9);
|
||||
border-collapse: separate;
|
||||
}
|
||||
|
||||
iframe {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.doclist {
|
||||
padding-top: 70px;
|
||||
img {
|
||||
max-width: 90%;
|
||||
height: auto;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
display: block;
|
||||
margin-bottom: 50px;
|
||||
-webkit-box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.2);
|
||||
box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,6 @@
|
||||
@import "page-animation";
|
||||
|
||||
@import "documents";
|
||||
@import "document";
|
||||
@import "album";
|
||||
@import "schedule-selector";
|
||||
@import "schedule-mobile";
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
<!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>
|
||||
Reference in new issue
Block a user