PUBLICERAD - Några fixar och nya texter

This commit is contained in:
Thomas Lovén 2017-03-18 17:04:03 +01:00
parent ed7c8f1bda
commit c6a1a3d492
10 changed files with 15 additions and 7 deletions

View File

@ -12,7 +12,7 @@ app = Flask(__name__)
Bootstrap(app)
Markdown(app)
pages = 'sidor/'
pages = os.path.dirname(os.path.realpath(__file__)) + '/sidor/'
categories = []
photos = []
@ -24,6 +24,7 @@ for x in os.walk(pages):
num = len([x for x in x[2] if x.endswith(('.jpg','.JPG'))])
for i in range(num):
photos.append({'category': cat, 'num': i})
categories = sorted(categories)
@app.route('/randimg')
def randimg():
@ -45,7 +46,7 @@ def thumbnails(category, num=0):
catdir = pages + '/' + category
thumbdir = catdir + '/thumbnails'
if not os.path.isfile('%s/%d.jpg' % (thumbdir, num)):
images = [x for x in next(os.walk(catdir))[2] if x.endswith('.jpg')]
images = sorted([x for x in next(os.walk(catdir))[2] if x.endswith('.jpg')])
if not os.path.exists(thumbdir):
os.makedirs(thumbdir)
imgin = '%s/%s' % (catdir, images[num])
@ -58,7 +59,7 @@ def slides(category, num=0):
catdir = pages + '/' + category
thumbdir = catdir + '/slides'
if not os.path.isfile('%s/%d.jpg' % (thumbdir, num)):
images = [x for x in next(os.walk(catdir))[2] if x.endswith('.jpg')]
images = sorted([x for x in next(os.walk(catdir))[2] if x.endswith('.jpg')])
imgin = '%s/%s' % (catdir, images[num])
imgout = '%s/%d.jpg' % (thumbdir, num)
if not os.path.exists(thumbdir):
@ -70,7 +71,7 @@ def slides(category, num=0):
@app.route('/<category>/<int:num>.jpg')
def cat_photo(category, num):
directory = pages + '/' + category
images = [x for x in next(os.walk(directory))[2] if x.endswith('.jpg')]
images = sorted([x for x in next(os.walk(directory))[2] if x.endswith('.jpg')])
try:
return send_from_directory(directory, images[num]);
except IndexError:

BIN
sidor/Kuvertbody Linjer/.DS_Store vendored Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 764 KiB

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -5,3 +5,9 @@ Visst är varje barn en liten superhjälte?
Denna kuvertbody sys i st62-80 med rosa, blå eller beige bas. Samtliga varianter har vitt tryck och vita kantband. Ärmarna avslutas med kontrasterande dekorsömmar vid handleden.
###250kr
&nbsp;
####**Nystartserbjudande!**
####Beställ denna fina body för bara 200 kr (ord pris 250kr) innan påsk.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

View File

@ -2,6 +2,7 @@
rm -r /Users/thomas/code/designbyloven/sidor/**/slides
rm -r /Users/thomas/code/designbyloven/sidor/**/thumbnails
rm **/.DS_Store
touch /Users/thomas/code/designbyloven/designbyloven.py
exit 0

View File

@ -7,6 +7,6 @@ Visningsexemplar sys i samma storlek som en av mina flickor (fn st62 och st86).
Samtliga tyger har tvättats parfymfritt, utan sköljmedel, innan sömnad.
(Obs! Gäller ej förkläden.)
**Nystartserbjudande!** Köp vår fina [Supermanbody](/Supermanbody/) för bara 200 kr (ord pris 250kr) om du beställer innan påsk. Bodyn sys i st 62-80 med rosa, blå eller beige bas.
**Nystartserbjudande!** Köp vår fina [Supermanbody](/Kuvertbody Superman/) för bara 200 kr (ord pris 250kr) om du beställer innan påsk. Bodyn sys i st 62-80 med rosa, blå eller beige bas.
Vi finns även på FaceBook, gilla för att få uppdateringar i din telefon eller surfplatta!

View File

@ -26,8 +26,8 @@
{% for cat in categories %}
<div class="col-xs-6 col-md-3">
<div class="thumbnail">
<div class="caption">
<a href="{{ url_for('category', category=cat) }}"><h3>{{cat}}</h3></a>
<div class="caption" style="padding: 0;">
<div class="text-center"><a href="{{ url_for('category', category=cat) }}"><h3>{{cat}}</h3></a></div>
</div>
<a href="{{ url_for('category', category=cat) }}"><img src="{{ url_for('thumbnails', category=cat) }}" class="img-responsive"></a>
</div>