table-based galleries

This commit is contained in:
2014-08-30 19:27:38 +02:00
parent 597d710ba9
commit a4142aa3f3
2 changed files with 104 additions and 4 deletions

View File

@@ -42,17 +42,67 @@
<table class="gallery_table">
<tr>
{% for image in article.galleryimages %}
<td>
<table class="layout">
<tr class="layout">
<td class="layout" colspan="2">&nbsp;
{% if article.gallerycaptions.get(image) %}
<td><a class="{{ article.album }} cboxElement" href="{{ SITEURL }}/images/gallery/{{ article.album }}/{{ image }}" title="{{ article.gallerycaptions.get(image) }}"><img src="{{ SITEURL }}/images/thumbs/{{ article.album }}/{{ image }}"></a><br />{{ article.gallerycaptions.get(image) }}</td>
{% else %}
<td><a class="{{ article.album }} cboxElement" href="{{ SITEURL }}/images/gallery/{{ article.album }}/{{ image }}"><img src="{{ SITEURL }}/images/thumbs/{{ article.album }}/{{ image }}"></a></td>
<strong>{{ article.gallerycaptions.get(image) }}</strong>
{% endif %}
</td>
</tr>
<tr class="layout">
<td class="layout">
<a class="{{ article.album }} cboxElement" href="{{ SITEURL }}/images/gallery/{{ article.album }}/{{ image }}"
{% if article.gallerycaptions.get(image) %}title="{{ article.gallerycaptions.get(image) }}"{% endif %}>
<img src="{{ SITEURL }}/images/thumbs/{{ article.album }}/{{ image }}">
</a>
</td>
</tr>
<tr class="layout">
{% if article.galleryexif and article.galleryexif.get(image) %}
<td class="layout">
<table class="exif_info">
{% if article.galleryexif.get(image).get("Model") %}
<tr><th colspan="4">{{article.galleryexif.get(image).get("Model")}}</th></tr>
{% endif %}
{% if article.galleryexif.get(image).get("LensModel") %}
<tr><th colspan="4">{{article.galleryexif.get(image).get("LensModel")}}</th></tr>
{% endif %}
<tr>
{% if article.galleryexif.get(image).get("ISOSpeedRatings") %}
<td>{{article.galleryexif.get(image).get("ISOSpeedRatings")}}</td>
{% endif %}
{% if article.galleryexif.get(image).get("FocalLength") %}
<td>{{article.galleryexif.get(image).get("FocalLength")}}mm</td>
{% endif %}
{% if article.galleryexif.get(image).get("FNumber") %}
<td>f/{{article.galleryexif.get(image).get("FNumber")}}</td>
{% endif %}
{% if article.galleryexif.get(image).get("ExposureTime") %}
<td>{{article.galleryexif.get(image).get("ExposureTime")}}</td>
{% endif %}
</tr>
</table>
</td>
{% endif %}
</tr>
{% if article.gallerycomments.get(image) %}
<tr>
<td colspan="2">{{ article.gallerycomments.get(image) }}</td>
</tr>
{% endif %}
</table>
</td>
{% if (loop.index % GALLERY_IMG_PER_ROW) == 0 %}
</tr>
<tr>
{% endif %}
{% endfor %}
</tr>
{% if (article.galleryimages.__len__() % GALLERY_IMG_PER_ROW) != 0 %}
<td colspan="{{GALLERY_IMG_PER_ROW - (article.galleryimages.__len__() % GALLERY_IMG_PER_ROW)}}" />
{% endif %}
</tr>
</table>
{% endif %}
</div>

View File

@@ -0,0 +1,50 @@
{% extends "base.html" %}
{% block title %}{{ page.title }} - {{ SITENAME }}{% endblock %}
{% block breadcrumbs %}
{% if DISPLAY_BREADCRUMBS %}
<ol class="breadcrumb">
<li><a href="{{ SITEURL }}" title="{{ SITENAME }}"><i class="fa fa-home fa-lg"></i></a></li>
<li class="active">{{ page.title }}</li>
</ol>
{% endif %}
{% endblock %}
{% block content %}
<section id="content" class="body">
<h1 class="entry-title">{{ page.title }}</h1>
{% import 'includes/translations.html' as translations with context %}
{{ translations.translations_for(page) }}
{% if PDF_PROCESSOR %}
<a href="{{ SITEURL }}/pdf/{{ page.slug }}.pdf">
get the pdf
</a>
{% endif %}
<div class="entry-content">
{% for album, images in page.gallery.iteritems() %}
<h2><a name="{{ album }}">{{ album }}</a></h2>
<table class="gallery_table">
<tr>
{% for image in images %}
<td><a class="{{ album }} cboxElement" href="{{ SITEURL }}/images/gallery/{{ album }}/{{ image }}"><img src="{{ SITEURL }}/images/thumbs/{{ album }}/{{ image }}"></a></td>
{% if (loop.index % GALLERY_IMG_PER_ROW) == 0 %}
</tr>
<tr>
{% endif %}
{% endfor %}
</tr>
</table>
<!--
<ul>
{% for image in images %}
<li><a class="{{ album }} cboxElement" href="{{ SITEURL }}/images/gallery/{{album}}/{{ image }}" title="{{ image }}"><img src="{{ SITEURL }}/images/thumbs/{{album}}/{{ image }}"></a></li>
{% endfor %}
</ul> -->
{% endfor %}
</div>
</section>
{% endblock %}