From 66c34c39d75d73159fe82c1d07961e0505fc8d6c Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 20 Feb 2022 10:47:50 +0000 Subject: refactor templates --- share/templates/default/footer.tmpl | 13 ++++++--- share/templates/default/header-first-add.tmpl | 3 --- share/templates/default/header.tmpl | 38 +++++++++++++-------------- share/templates/default/index-preview.tmpl | 6 ----- share/templates/default/next.tmpl | 5 ++-- share/templates/default/prev.tmpl | 7 +++-- share/templates/default/redirect.tmpl | 2 +- share/templates/default/view.tmpl | 30 +++++++++++---------- src/photoalbum.sh | 4 +-- 9 files changed, 50 insertions(+), 58 deletions(-) delete mode 100644 share/templates/default/header-first-add.tmpl delete mode 100644 share/templates/default/index-preview.tmpl diff --git a/share/templates/default/footer.tmpl b/share/templates/default/footer.tmpl index 18af2b5..b3ce543 100644 --- a/share/templates/default/footer.tmpl +++ b/share/templates/default/footer.tmpl @@ -1,16 +1,21 @@ cat < -
+ +END + +cat < END if [ "${TARBALL_INCLUDE}" = 'yes' ]; then cat <here

+ Download all photos in original size here

END fi cat < + END diff --git a/share/templates/default/header-first-add.tmpl b/share/templates/default/header-first-add.tmpl deleted file mode 100644 index 436c4e9..0000000 --- a/share/templates/default/header-first-add.tmpl +++ /dev/null @@ -1,3 +0,0 @@ -cat < -END diff --git a/share/templates/default/header.tmpl b/share/templates/default/header.tmpl index b25143b..564d547 100644 --- a/share/templates/default/header.tmpl +++ b/share/templates/default/header.tmpl @@ -1,28 +1,26 @@ if [ "${is_subalbum}" = yes ]; then - GOTO_OVERVIEW="

Go to Album overview" + GOTO_OVERVIEW="Go to Album overview" fi + cat < -${TITLE} - + ${TITLE} + + -${TITLE} ${GOTO_OVERVIEW} -
+

${TITLE}

+

${GOTO_OVERVIEW}

+
END diff --git a/share/templates/default/index-preview.tmpl b/share/templates/default/index-preview.tmpl deleted file mode 100644 index a4cc0a4..0000000 --- a/share/templates/default/index-preview.tmpl +++ /dev/null @@ -1,6 +0,0 @@ -cat <Album ${album} (${description}) - - - -END diff --git a/share/templates/default/next.tmpl b/share/templates/default/next.tmpl index e36d185..a4165dc 100644 --- a/share/templates/default/next.tmpl +++ b/share/templates/default/next.tmpl @@ -1,6 +1,5 @@ cat < - +

END diff --git a/share/templates/default/prev.tmpl b/share/templates/default/prev.tmpl index 528806a..98dd874 100644 --- a/share/templates/default/prev.tmpl +++ b/share/templates/default/prev.tmpl @@ -1,6 +1,5 @@ cat < - Previous ${MAXPREVIEWS} pictures of current Album -
-

+

+ Previous ${MAXPREVIEWS} pictures of current Album +

END diff --git a/share/templates/default/redirect.tmpl b/share/templates/default/redirect.tmpl index aaf95c9..21afa69 100644 --- a/share/templates/default/redirect.tmpl +++ b/share/templates/default/redirect.tmpl @@ -1,7 +1,7 @@ cat < - + diff --git a/share/templates/default/view.tmpl b/share/templates/default/view.tmpl index 8894a76..8a64035 100644 --- a/share/templates/default/view.tmpl +++ b/share/templates/default/view.tmpl @@ -1,21 +1,23 @@ cat <<<< -Thumbnails ->>> -
-
+

+ <<< + Thumbnails + >>> +

+ - + -
-
-Direct link + +

+ Direct link +

END + if [ "${ORIGINAL_BASEPATH}x" != x ]; then -cat <Original + cat < + Original +

END fi -cat <${photo} -END diff --git a/src/photoalbum.sh b/src/photoalbum.sh index 331cf32..ebaaf71 100755 --- a/src/photoalbum.sh +++ b/src/photoalbum.sh @@ -82,7 +82,6 @@ albumhtml () { declare name="page-$num" template header "$name.html" - template header-first-add "$name.html" cd "$DIST_DIR/$photos_dir" && find ./ -type f | sort | sed 's;^\./;;' | while read -r photo; do @@ -160,7 +159,6 @@ albumindexhtml () { declare backhref='..' template 'header' 'index.html' - template 'header-first-add' 'index.html' for dir in ${dirs[*]}; do declare basename="$(basename "$dir")" @@ -177,7 +175,7 @@ albumindexhtml () { declare s='' [ $pages -gt 1 ] && s='s' export description="$pictures pictures / $pages page$s" - template 'index-preview' 'index.html' + template 'index.html' done template 'footer' 'index.html' -- cgit v1.2.3