fix layout fet
This commit is contained in:
@@ -1,25 +0,0 @@
|
|||||||
[uwsgi]
|
|
||||||
# User and group www-data on debian
|
|
||||||
uid = 33
|
|
||||||
gid = 33
|
|
||||||
master = true
|
|
||||||
# No. of processes can be increased
|
|
||||||
processes = 9
|
|
||||||
chown-socket =www-data:www-data
|
|
||||||
virtualenv = /opt/venv
|
|
||||||
pythonpath = /srv/flask-fet-fotos/
|
|
||||||
#pidfile = /srv/simple_sample_flat_index/uwsgi.pid
|
|
||||||
#socket = /srv/simple_sample_flat_index/uwsgi.sock
|
|
||||||
pidfile=/var/run/fet_fotos.pid
|
|
||||||
socket = /var/run/fet_fotos.sock
|
|
||||||
chmod-socket = 666
|
|
||||||
module = foto_gallery
|
|
||||||
callable= app
|
|
||||||
wsgi-file = run.py
|
|
||||||
logdate = true
|
|
||||||
|
|
||||||
loglevel = debug
|
|
||||||
gevent = 100
|
|
||||||
vacuum=true
|
|
||||||
plugins=python3,logfile
|
|
||||||
py-autoreload=2
|
|
||||||
25
blueimp/.github/workflows/nodejs.yml
vendored
Normal file
25
blueimp/.github/workflows/nodejs.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
name: Node CI
|
||||||
|
|
||||||
|
on: [push, pull_request]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
node-version: [8.x, 10.x, 12.x]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node-version }}
|
||||||
|
- name: npm install, build, and test
|
||||||
|
run: |
|
||||||
|
npm install
|
||||||
|
npm run build --if-present
|
||||||
|
npm test
|
||||||
|
env:
|
||||||
|
CI: true
|
||||||
1
blueimp/.gitignore
vendored
Normal file
1
blueimp/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
node_modules
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
pages_root: 'data_sample'
|
|
||||||
static_root: 'static'
|
|
||||||
default_template: 'page.html'
|
|
||||||
url_prefix: "/stuff"
|
|
||||||
FLATPAGES_EXTENSION: ".md"
|
|
||||||
FLATPAGES_AUTO_RELOAD: True
|
|
||||||
BIN
data/ghg/group-young-people-posing-photo_52683-18823.jpg
Normal file
BIN
data/ghg/group-young-people-posing-photo_52683-18823.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 71 KiB |
@@ -0,0 +1,4 @@
|
|||||||
|
title: ghg Title
|
||||||
|
author: andis
|
||||||
|
|
||||||
|
Asdf Asdf
|
||||||
BIN
data/ghg/worried-concept-illustration_114360-3481.jpg
Normal file
BIN
data/ghg/worried-concept-illustration_114360-3481.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 58 KiB |
@@ -15,8 +15,8 @@ import re
|
|||||||
from PIL import Image, ExifTags, ImageOps
|
from PIL import Image, ExifTags, ImageOps
|
||||||
from functools import partial
|
from functools import partial
|
||||||
from flask_csp.csp import csp_header, csp_default
|
from flask_csp.csp import csp_header, csp_default
|
||||||
|
import slugify
|
||||||
|
|
||||||
#cfg = Config("./config.cfg")
|
|
||||||
import environ
|
import environ
|
||||||
env = environ.Env(
|
env = environ.Env(
|
||||||
# set casting, default value
|
# set casting, default value
|
||||||
@@ -45,11 +45,16 @@ app.logger.setLevel(logging.DEBUG)
|
|||||||
# Initialize FlatPages Index
|
# Initialize FlatPages Index
|
||||||
|
|
||||||
flatpages = FlatPagesIndex(app)
|
flatpages = FlatPagesIndex(app)
|
||||||
flatpages_index.Links.endpoint="intern.post"
|
|
||||||
flatpages_index.Links.image_url=lambda s,x: url_for(s.endpoint,name=x)
|
|
||||||
|
|
||||||
flatpages_index.Links.thumb_url=lambda s,x: url_for("intern.thumb",size=128,name=x)
|
flatpages_index.Links.thumb_url=lambda s,x: url_for("intern.thumb",size=128,name=x)
|
||||||
flatpages_index.Links.image_url=lambda s,x: url_for("intern.post",name=x)
|
flatpages_index.Links.image_url=lambda s,x: url_for("intern.post",name=x)
|
||||||
flatpages_index.Page.page_defaults={"type":"gallery", "template":"gallery.html"}
|
flatpages_index.Page.page_defaults={"type":"gallery", "template":"gallery.html"}
|
||||||
|
|
||||||
|
flatpages.cfg("url", lambda s,x: url_for("intern.post",name=x))
|
||||||
|
flatpages.cfg("thumb_url", lambda s,x: url_for("intern.thumb",size=512,name=x))
|
||||||
|
|
||||||
flatpages.get('index')
|
flatpages.get('index')
|
||||||
|
|
||||||
app.logger.info('Initialize FET Foto Gallery App')
|
app.logger.info('Initialize FET Foto Gallery App')
|
||||||
@@ -57,17 +62,25 @@ app.logger.info('flatpages loaded %d pages' % len(flatpages._pages))
|
|||||||
app.logger.info("Data directory is: %s" % flatpages.root)
|
app.logger.info("Data directory is: %s" % flatpages.root)
|
||||||
|
|
||||||
|
|
||||||
#csp_d=csp_default()
|
|
||||||
#csp_d.update({'default-src':"'self' 'unsafe-inline'", 'script-src': "'unsafe-inline' 'self'"})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
freezer = Freezer(app)
|
freezer = Freezer(app)
|
||||||
|
|
||||||
|
|
||||||
page_blueprint = Blueprint('intern', __name__)
|
page_blueprint = Blueprint('intern', __name__)
|
||||||
api_blueprint = Blueprint('api', __name__)
|
api_blueprint = Blueprint('api', __name__)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@app.template_filter()
|
||||||
|
def thumbimage(post):
|
||||||
|
if post.thumb_url:
|
||||||
|
return post.thumb_url
|
||||||
|
elif len(post.images)>0:
|
||||||
|
return post.images[0]
|
||||||
|
|
||||||
|
@app.template_filter()
|
||||||
|
def slug(string):
|
||||||
|
return slugify.slugify(string)
|
||||||
|
|
||||||
@page_blueprint.route('/thumb<int:size>/<path:name>')
|
@page_blueprint.route('/thumb<int:size>/<path:name>')
|
||||||
def thumb(size=64,name=''):
|
def thumb(size=64,name=''):
|
||||||
if not size in [32,64,128,256,512]:
|
if not size in [32,64,128,256,512]:
|
||||||
@@ -150,6 +163,8 @@ def postjson(name='index'):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
app.register_blueprint(page_blueprint, url_prefix=app.config["url_prefix"],static_folder='static')
|
app.register_blueprint(page_blueprint, url_prefix=app.config["url_prefix"],static_folder='static')
|
||||||
app.register_blueprint(api_blueprint, url_prefix="/api/"+app.config["url_prefix"],static_folder='static')
|
app.register_blueprint(api_blueprint, url_prefix="/api/"+app.config["url_prefix"],static_folder='static')
|
||||||
app.add_url_rule('%s/<path:name>' % app.config["url_prefix"],'page', post)
|
app.add_url_rule('%s/<path:name>' % app.config["url_prefix"],'page', post)
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>{{post.title}}</h1>
|
<h1>{{post.title}}</h1>
|
||||||
<small> von {{post.author}} </small>
|
<a href="/members/member/{{post.author}}"><small> von {{post.author}} </small>
|
||||||
{{post.html | safe}}
|
{{post.html | safe}}
|
||||||
|
|
||||||
{% if post.links.images |length > 0 %}
|
{% if post.links.images |length > 0 %}
|
||||||
|
|||||||
@@ -24,13 +24,13 @@
|
|||||||
|
|
||||||
<div class="top-bar" id="main-menu">
|
<div class="top-bar" id="main-menu">
|
||||||
<div class="top-bar-left"><a href="/">
|
<div class="top-bar-left"><a href="/">
|
||||||
<img style="height:40px; width:40px" src="/assets/img/logo2014_64.png"/></a>
|
<img style="height:40px; width:40px" src="/fotos/img/logo2014_64.png"/></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="top-bar-right">
|
<div class="top-bar-right">
|
||||||
<ul class="menu vertical medium-horizontal expanded medium-text-center">
|
<ul class="menu vertical medium-horizontal expanded medium-text-center">
|
||||||
<li class=""><a href="/">Home</a> </li>
|
<li class=""><a href="/">Home</a> </li>
|
||||||
<li class=""><a href="/">Aktuelles</a> </li>
|
<li class=""><a href="/">Aktuelles</a> </li>
|
||||||
<li class=""><a href="#">Info</a> </li>
|
<li class=""><a href="/fotos">Fotos</a> </li>
|
||||||
<li class=""><a href="#">Team</a>
|
<li class=""><a href="#">Team</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@@ -6,3 +6,4 @@ Pillow
|
|||||||
wheel
|
wheel
|
||||||
flask_csp
|
flask_csp
|
||||||
git+https://github.com/andreassteph/flatpages_index.git
|
git+https://github.com/andreassteph/flatpages_index.git
|
||||||
|
python-slugify
|
||||||
|
|||||||
2
run.py
2
run.py
@@ -5,5 +5,5 @@ if __name__ == "__main__":
|
|||||||
if len(sys.argv) > 1 and sys.argv[1] == "build":
|
if len(sys.argv) > 1 and sys.argv[1] == "build":
|
||||||
freezer.freeze()
|
freezer.freeze()
|
||||||
else:
|
else:
|
||||||
app.run(host='0.0.0.0',port=4444, debug=True)
|
app.run(host='0.0.0.0',port=8002, debug=True)
|
||||||
|
|
||||||
|
|||||||
1
static/img
Symbolic link
1
static/img
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
design/static/img
|
||||||
@@ -9,6 +9,30 @@ $(
|
|||||||
link = target.src ? target.parentNode : target,
|
link = target.src ? target.parentNode : target,
|
||||||
options = { index: link, event: event },
|
options = { index: link, event: event },
|
||||||
links = this.getElementsByTagName('a')
|
links = this.getElementsByTagName('a')
|
||||||
blueimp.Gallery(links, options)
|
options['onslide']=function(index,slide) {
|
||||||
|
console.log(index)
|
||||||
|
console.log($(`#links a:nth-child(${index})`).attr('id'))
|
||||||
|
history.replaceState(null,null,'#'+$(`#links a:nth-child(${index+1})`).attr('id'))
|
||||||
}
|
}
|
||||||
|
options['onclose']=function(){
|
||||||
|
history.pushState(null,null,'#')
|
||||||
|
}
|
||||||
|
blueimp.gallery=blueimp.Gallery(links, options)
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
window.onpopstate = function(){
|
||||||
|
console.log(`popped state ${$(location).attr('hash')}`)
|
||||||
|
if($(location).attr('hash')=="") {
|
||||||
|
blueimp.gallery.close()
|
||||||
|
}else {
|
||||||
|
$($(location).attr('hash')).trigger('click');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
console.log($(location).attr('hash').substr(1))
|
||||||
|
$($(location).attr('hash')).trigger('click');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user