summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2008-08-10 17:21:59 +0200
committerTomas Bzatek <tbzatek@users.sourceforge.net>2008-08-10 17:21:59 +0200
commitd37bcc1685bf3e9c1583959ef3e96f59beb055d0 (patch)
tree925c5769269473e6a031f2ecd324aa6af1c712a0
parente291c5c25b81c9e944523227ea55f7f96e2472ca (diff)
downloadcataract-d37bcc1685bf3e9c1583959ef3e96f59beb055d0.tar.xz
Support for footnotes
-rw-r--r--generators.c6
-rw-r--r--items.c3
-rw-r--r--items.h1
-rw-r--r--sample/src/CIAF_1/index.xml4
-rw-r--r--sample/src/index.xml4
-rw-r--r--templates/template-album.tmpl7
-rw-r--r--templates/template-index.tmpl6
7 files changed, 28 insertions, 3 deletions
diff --git a/generators.c b/generators.c
index 3411b8f..654e01a 100644
--- a/generators.c
+++ b/generators.c
@@ -315,6 +315,12 @@ write_html_album (TGallerySetup *setup,
str_replace (&b, "<!-- $(DESCRIPTION) -->", s1, NULL);
g_free (s1);
}
+ if (strstr (b, "<!-- $(FOOTNOTE) -->") && items->footnote) {
+ s1 = g_strdup (items->footnote);
+ fix_entities (&s1);
+ str_replace (&b, "<!-- $(FOOTNOTE) -->", s1, NULL);
+ g_free (s1);
+ }
if (strstr (b, "<!-- $(FOOTER) -->") && setup->footer) {
s1 = g_strdup (setup->footer);
fix_entities (&s1);
diff --git a/items.c b/items.c
index 77f051f..527a5c4 100644
--- a/items.c
+++ b/items.c
@@ -73,6 +73,7 @@ parse_album_xml (const char *filename, TAlbum *index)
index->ID = xml_file_get_node_value (xml, "/gallery/general/ID/text()");
index->title = xml_file_get_node_value (xml, "/gallery/general/title/text()");
index->desc = xml_file_get_node_value (xml, "/gallery/general/description/text()");
+ index->footnote = xml_file_get_node_value (xml, "/gallery/general/footnote/text()");
index->quality = xml_file_get_node_attribute_long (xml, "/gallery/general/images", "quality", -1);
index->landscape_width = xml_file_get_node_attribute_long (xml, "/gallery/general/images", "landscape_w", 0);
@@ -162,6 +163,8 @@ free_album_data (TAlbum *album)
free (album->title);
if (album->desc)
free (album->desc);
+ if (album->footnote)
+ free (album->footnote);
if (album->base_dir)
free (album->base_dir);
if (album->border_style)
diff --git a/items.h b/items.h
index c6143ca..b3ebf39 100644
--- a/items.h
+++ b/items.h
@@ -32,6 +32,7 @@ typedef struct {
char *ID;
char *title;
char *desc;
+ char *footnote;
GPtrArray *items;
char *base_dir;
void *parent_index; // pointer to the parent TAlbum structure
diff --git a/sample/src/CIAF_1/index.xml b/sample/src/CIAF_1/index.xml
index ed374a0..9fc7d6e 100644
--- a/sample/src/CIAF_1/index.xml
+++ b/sample/src/CIAF_1/index.xml
@@ -9,6 +9,10 @@
<br/><br/>
This album sets border style "border_none" for preview images.
]]></description>
+ <footnote> <![CDATA[
+ This is footnote in album view.
+ ]]>
+ </footnote>
<!-- you can override global settings in each album: -->
<images quality="60" landscape_w="640" landscape_h="480" portrait_w="480" portrait_h="640" />
diff --git a/sample/src/index.xml b/sample/src/index.xml
index ba88e57..0e143d2 100644
--- a/sample/src/index.xml
+++ b/sample/src/index.xml
@@ -11,6 +11,10 @@
Just be aware to be XHTML compliant (at least use lowercase tags).
]]>
</description>
+ <footnote> <![CDATA[
+ This is footnote, text after item list.
+ ]]>
+ </footnote>
</general>
<items>
diff --git a/templates/template-album.tmpl b/templates/template-album.tmpl
index e8eb115..a367706 100644
--- a/templates/template-album.tmpl
+++ b/templates/template-album.tmpl
@@ -60,7 +60,12 @@
<!-- Dirty hack to add free space at the bottom of the page -->
-<div style="display: block; float: left; height: 290px;"></div>
+<div style="display: block; float: left; height: 240px;"></div>
+
+<!-- ## Footnote -->
+<div class="desc" style="clear: both;">
+<div class="desc_date"><!-- $(FOOTNOTE) --></div>
+</div>
<!-- ## Footer -->
<!-- $(FOOTER) -->
diff --git a/templates/template-index.tmpl b/templates/template-index.tmpl
index 2f941a2..40a0a5b 100644
--- a/templates/template-index.tmpl
+++ b/templates/template-index.tmpl
@@ -62,8 +62,10 @@
<!-- $(END_IMG_LIST) -->
</div>
-<!-- Dirty hack to add free space at the bottom of the page -->
-<div style="display: block; float: left; height: 390px;"></div>
+<!-- ## Footnote -->
+<div class="desc" style="clear: both;">
+<div class="desc_date"><!-- $(FOOTNOTE) --></div>
+</div>
<!-- ## Footer -->
<!-- $(FOOTER) -->