Skip to content

Commit 875bd9f

Browse files
committed
fotorama add, popup add
1 parent 57840c1 commit 875bd9f

File tree

21 files changed

+346
-26
lines changed

21 files changed

+346
-26
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pyramid_pages",
3-
"version": "0.0.4",
3+
"version": "0.0.1",
44
"homepage": "https://github.com/ITCase/pyramid_pages",
55
"authors": [
66
"ITCase <info@itcase.pro>"

example/.bowerrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "strict-ssl": false, "https-proxy": "" }

example/bower.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "pyramid_pages",
3+
"version": "0.0.1",
4+
"homepage": "https://github.com/ITCase/pyramid_sacrud_pages",
5+
"authors": [
6+
"Arkadiy Zamaraev <arkadiy@bk.ru>"
7+
],
8+
"license": "MIT",
9+
"ignore": [
10+
"**/.*",
11+
"node_modules",
12+
"bower_components",
13+
"test",
14+
"tests"
15+
],
16+
"dependencies": {
17+
"fotorama": "~4.6.4"
18+
},
19+
"overrides": {
20+
"fotorama": {
21+
"main": [
22+
"fotorama.css",
23+
"fotorama.js",
24+
"fotorama.png",
25+
"fotorama@2x.png"
26+
]
27+
}
28+
}
29+
}

example/gulpfile.js

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
'use strict';
2+
3+
var gulp = require('gulp'),
4+
plugins = require('gulp-load-plugins')({ pattern: ['gulp-*', 'gulp.*'] });
5+
6+
var map = require('vinyl-map'),
7+
mainBowerFiles = require('main-bower-files');
8+
9+
var CSS_PATH = './static/css/',
10+
JS_PATH = './static/js/',
11+
IMG_PATH = './static/img/';
12+
13+
14+
gulp.task('bower-js', function() {
15+
return gulp.src(mainBowerFiles({ filter: (/.*\.(js|map)$/i) }),
16+
{ base: 'bower_components' })
17+
.pipe(plugins.rename(function (path) {
18+
path.dirname = path.dirname.slice(0, path.dirname.indexOf('/') + 1);
19+
}))
20+
.pipe(gulp.dest(JS_PATH + 'vendor/'))
21+
.pipe(map(function(code, filename) {
22+
plugins.util.log('Bower JS ' +
23+
plugins.util.colors.green(filename));
24+
}));
25+
});
26+
27+
28+
gulp.task('bower-css', function() {
29+
return gulp.src(mainBowerFiles({ filter: (/.*\.(css)$/i) }),
30+
{ base: 'bower_components' })
31+
.pipe(plugins.rename(function (path) {
32+
path.dirname = path.dirname.slice(0, path.dirname.indexOf('/') + 1);
33+
}))
34+
.pipe(gulp.dest(CSS_PATH + 'vendor/'))
35+
.pipe(map(function(code, filename) {
36+
plugins.util.log('Bower CSS ' +
37+
plugins.util.colors.green(filename));
38+
}));
39+
});
40+
41+
42+
gulp.task('bower-img', function() {
43+
return gulp.src(mainBowerFiles({ filter: (/.*\.(png|jpg|gif)$/i) }),
44+
{ base: 'bower_components' })
45+
.pipe(plugins.rename(function (path) {
46+
path.dirname = path.dirname.slice(0, path.dirname.indexOf('/') + 1);
47+
}))
48+
.pipe(gulp.dest(IMG_PATH))
49+
.pipe(map(function(code, filename) {
50+
plugins.util.log('Bower Images ' +
51+
plugins.util.colors.green(filename));
52+
}));
53+
});
54+
55+
56+
gulp.task('bower', ['bower-js', 'bower-css', 'bower-img']);

example/package.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "pyramid_pages",
3+
"title": "Pyramid Pages",
4+
"description": "pyramid_pages provides a collections of pages to your Pyramid application. This is very similar to django.contrib.flatpages but with a tree structure and traversal algorithm in URL dispath.",
5+
"version": "0.0.1",
6+
"homepage": "https://github.com/ITCase/pyramid_pages",
7+
"author": {
8+
"name": "ITCase",
9+
"email": "info@itcase.pro"
10+
},
11+
"repository": {
12+
"type": "git",
13+
"url": "git@github.com:ITCase/pyramid_pages.git"
14+
},
15+
"bugs": "https://github.com/ITCase/pyramid_pages/issues",
16+
"licenses": [
17+
{
18+
"type": "MIT",
19+
"url": "http://opensource.org/licenses/MIT"
20+
}
21+
],
22+
"engines": {
23+
"node": ">= 0.8.0"
24+
},
25+
"devDependencies": {
26+
"gulp": "^3.8.11",
27+
"gulp-rename": "^1.2.2",
28+
"gulp-util": "^3.0.5",
29+
"main-bower-files": "^2.8.0",
30+
"vinyl-map": "^1.0.1"
31+
}
32+
}

example/static/css/vendor/fotorama.css

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/static/img/fotorama.png

3.15 KB
Loading

example/static/img/fotorama@2x.png

7.15 KB
Loading

example/static/js/vendor/fotorama.js

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/templates/gallery/index.jinja2

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,29 @@
11
{% extends 'pyramid_pages/base.jinja2' %}
22

33
{% block content %}
4+
<link href="http://cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.4/fotorama.css" rel="stylesheet">
5+
<script src="http://cdnjs.cloudflare.com/ajax/libs/fotorama/4.6.4/fotorama.js"></script>
46
{{ super() }}
7+
8+
<div class="popup">
9+
<div class="popup-background">&nbsp;</div>
10+
<div class="popup-inner">
11+
<div class="popup-inner__ie">
12+
<div class="popup-inner__content">
13+
<a href="#" class="popup-inner__content-link">
14+
<span class="popup-inner__content-link-text">close</span>
15+
</a>
16+
<div class="popup-inner__content-gallery fotorama" data-auto="false">&nbsp;</div>
17+
</div>
18+
</div>
19+
</div>
20+
</div>
21+
522
<div class="gallery">
623
<div class="gallery-list">
724
{% for photo in context.node.photos %}
825
<div class="gallery-list__item">
9-
<a href="{{ photo.path }}" class="gallery-list__item-link" target="_blank">
26+
<a href="{{ photo.path }}" class="gallery-list__item-link" data-fotorama-image-id="{{ loop.index }}">
1027
<img class="gallery-list__item-image" src="{{ photo.path }}" />
1128
</a>
1229
</div>

0 commit comments

Comments
 (0)