gf-ralbum 0.0.2 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -0
- data/bin/{ralbum.rb → ralbum} +1 -1
- data/example/example.sh +2 -1
- data/example/test_jalbum_phototree/jalbum-settings.jap +321 -0
- data/example/test_jalbum_phototree/src/albumfiles.txt +9 -0
- data/example/test_jalbum_phototree/src/comments.properties +0 -0
- data/example/test_jalbum_phototree/src/flowers/albumfiles.txt +14 -0
- data/example/test_jalbum_phototree/src/meta.properties +2 -0
- data/example/{test_phototree → test_rubyphoto_phototree}/album.xml +0 -0
- data/example/test_rubyphoto_phototree/flowers/IMG_1469.wt.jpg +0 -0
- data/example/test_rubyphoto_phototree/flowers/IMG_2291.jpg +0 -0
- data/example/test_rubyphoto_phototree/flowers/IMG_2598.jpg +0 -0
- data/example/test_rubyphoto_phototree/flowers/IMG_3068.jpg +0 -0
- data/example/test_rubyphoto_phototree/flowers/IMG_3323.jpg +0 -0
- data/example/test_rubyphoto_phototree/flowers/IMG_3348.jpg +0 -0
- data/example/{test_phototree → test_rubyphoto_phototree}/r_photo01.jpg +0 -0
- data/example/{test_phototree → test_rubyphoto_phototree}/r_photo01.jpg.xml +0 -0
- data/example/{test_phototree/catalog_data → test_rubyphoto_phototree/ralbum}/md5_to_key.yaml +0 -0
- data/example/{test_phototree/catalog_data → test_rubyphoto_phototree/ralbum}/md5_to_key.yaml.test +0 -0
- data/example/{test_phototree/catalog_data → test_rubyphoto_phototree/ralbum}/project.xml +206 -3
- data/example/{test_phototree → test_rubyphoto_phototree}/subalbum01/album.xml +0 -0
- data/example/{test_phototree → test_rubyphoto_phototree}/subalbum01/subalbum01_photo01.jpg +0 -0
- data/example/{test_phototree → test_rubyphoto_phototree}/subalbum01/subalbum01_photo01.jpg.xml +0 -0
- data/example/{test_phototree → test_rubyphoto_phototree}/subalbum01/subalbum01_photo02.jpg +0 -0
- data/example/{test_phototree → test_rubyphoto_phototree}/subalbum01/subalbum01_photo02.jpg.xml +0 -0
- data/example/{test_phototree → test_rubyphoto_phototree}/subalbum01/subalbum01_photo03.jpg +0 -0
- data/example/{test_phototree → test_rubyphoto_phototree}/subalbum01/subalbum01_photo03.jpg.xml +0 -0
- data/example/{test_phototree → test_rubyphoto_phototree}/subalbum01/subalbum01_photo04.jpg +0 -0
- data/example/{test_phototree → test_rubyphoto_phototree}/subalbum01/subalbum01_photo04.jpg.xml +0 -0
- data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/album.xml +0 -0
- data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo01.jpg +0 -0
- data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo01.jpg.xml +0 -0
- data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo02.jpg +0 -0
- data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo02.jpg.xml +0 -0
- data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo03.jpg +0 -0
- data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo03.jpg.xml +0 -0
- data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo04.jpg +0 -0
- data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo04.jpg.xml +0 -0
- data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo05.jpg +0 -0
- data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo05.jpg.xml +0 -0
- data/lib/ralbum.rb +9 -5
- data/lib/ralbum/album_tree/album.rb +74 -0
- data/lib/ralbum/album_tree/generate_album_tree_node_visitor.rb +73 -0
- data/lib/ralbum/album_tree/image_file.rb +88 -0
- data/lib/ralbum/{image_pool.rb → album_tree/image_pool.rb} +16 -4
- data/lib/ralbum/catalog.rb +7 -7
- data/lib/ralbum/cli/cli_ralbum.rb +66 -25
- data/lib/ralbum/image_strategies/copy_image_strategy.rb +16 -0
- data/lib/ralbum/image_strategies/linked_image_strategy.rb +18 -0
- data/lib/ralbum/image_strategies/scaled_image_strategy.rb +52 -0
- data/lib/ralbum/image_strategies/sepia_scaled_image_strategy.rb +50 -0
- data/lib/{ralbum-common → ralbum}/object_with_properties.rb +0 -0
- data/lib/{ralbum-common → ralbum}/object_with_validation.rb +0 -0
- data/lib/ralbum/photo_tree/jalbum_photo_tree.rb +83 -0
- data/lib/ralbum/photo_tree/photo_file.rb +149 -0
- data/lib/ralbum/photo_tree/photo_tree_item.rb +68 -0
- data/lib/ralbum/{photo_tree_node.rb → photo_tree/photo_tree_node.rb} +16 -13
- data/lib/ralbum/{photo_tree_builder.rb → photo_tree/rubyphoto_photo_tree.rb} +64 -46
- data/lib/ralbum/project.rb +48 -12
- data/lib/ralbum/skin.rb +34 -27
- data/lib/ralbum/skin_engine.rb +32 -17
- data/lib/ralbum/skin_engines/erb_skin_engine.rb +2 -5
- data/lib/ralbum/skin_engines/kwartz_skin_engine.rb +6 -9
- data/lib/ralbum/skin_manager.rb +11 -2
- data/lib/ralbum/skins/cgi/cgi_skin.rb +21 -23
- data/lib/ralbum/skins/cgi/res/model.rb +30 -32
- data/lib/ralbum/skins/gfold/inc/menu_bottom.html +53 -53
- data/lib/ralbum/skins/gfold/inc/menu_top.html +71 -71
- data/lib/ralbum/skins/gfold/inc/page_footer.html +28 -28
- data/lib/ralbum/skins/gfold/out/album_page.rb +316 -316
- data/lib/ralbum/skins/gfold/out/image_page.rb +231 -231
- data/lib/ralbum/skins/gfold/out/tree_page.rb +96 -96
- data/lib/ralbum/skins/gfold/res/prototype.js +3277 -3277
- data/lib/ralbum/skins/gfold/template/album_page.html +161 -161
- data/lib/ralbum/skins/gfold/template/album_page.plogic +127 -127
- data/lib/ralbum/skins/gfold/template/image_page.html +91 -91
- data/lib/ralbum/skins/gfold/template/image_page.plogic +70 -70
- data/lib/ralbum/skins/gfold/template/tree_page.html +79 -79
- data/lib/ralbum/skins/gfold/template/tree_page.plogic +45 -45
- data/lib/ralbum/skins/js/out/album_page.rb +2 -2
- data/lib/ralbum/skins/js/out/tree_page.rb +18 -17
- data/lib/ralbum/skins/js/template/album_page.html +2 -2
- data/lib/ralbum/skins/js/template/tree_page.html +1 -1
- data/lib/ralbum/skins/test_erb/template/album_page.rhtml +22 -0
- data/lib/ralbum/skins/test_erb/template/image_page.rhtml +44 -0
- data/lib/ralbum/tasks/compile_skins.rb +8 -0
- data/test/ralbum/cli/tc_cli_ralbum.rb +35 -0
- data/test/ralbum/image_strategies/tc_scaled_image_strategy.rb +18 -0
- data/test/ralbum/image_strategies/tc_sepia_scaled_image_strategy.rb +18 -0
- data/test/ralbum/photo_tree/tc_jalbum_photo_tree.rb +39 -0
- data/test/ralbum/photo_tree/tc_photo_file.rb +13 -0
- data/test/ralbum/{tc_01_photo_tree.rb → photo_tree/tc_photo_tree.rb} +10 -12
- data/test/ralbum/photo_tree/tc_rubyalbum_photo_tree.rb +20 -0
- data/test/ralbum/tc_album.rb +55 -0
- data/test/ralbum/tc_catalog.rb +8 -4
- data/test/ralbum/tc_image_pool.rb +37 -0
- data/test/ralbum/{tc_05_kwartz_skin_engine.rb → tc_kwartz_skin_engine.rb} +1 -1
- data/test/ralbum/{tc_04_skin_manager.rb → tc_skin_manager.rb} +8 -3
- data/test/ralbum/test_helper.rb +16 -1
- data/test_data/ralbum/test_data/is_test/dummy.txt +0 -0
- metadata +78 -81
- data/bin/ralbum-JPG2jpg.rb +0 -90
- data/bin/ralbum-compile_skins.rb +0 -18
- data/bin/ralbum-myconv.rb +0 -81
- data/bin/ralbum-readexif.rb +0 -18
- data/bin/ralbum-reorder.rb +0 -200
- data/lib/ralbum/album.rb +0 -66
- data/lib/ralbum/generate_album_tree_node_visitor.rb +0 -60
- data/lib/ralbum/image_file.rb +0 -81
- data/lib/ralbum/image_strategy.rb +0 -143
- data/lib/ralbum/photo_tree_item.rb +0 -89
- data/test/ralbum/cli/test_cli_ralbum.rb +0 -13
- data/test/ralbum/tc_02_photo_tree_builder.rb +0 -20
- data/test/ralbum/tc_03_album.rb +0 -42
- data/test/ralbum/tc_06_image_strategy.rb +0 -21
- data/test/test_ralbum.rb +0 -14
- data/test_data/ralbum/test_data/is_test/r_photo01_scaled.jpg +0 -0
- data/test_data/ralbum/test_data/is_test/r_photo01_sepia_scaled.jpg +0 -0
@@ -1,71 +1,71 @@
|
|
1
|
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2
|
-
<html kw:d="set pagename='albums'">
|
3
|
-
<head kw:d="set language=nil">
|
4
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
|
5
|
-
<title>Giovanni Ferro - @{@album.name}@</title>
|
6
|
-
<meta name="description" content="Giovanni Ferro photos"/>
|
7
|
-
<meta name="keywords" content="Giovanni Ferro,photo,pictures,digital photography"/>
|
8
|
-
<link rel="stylesheet" type="text/css" href="../res/style1.css" media="screen" title="style1"/>
|
9
|
-
<link rel="alternate stylesheet" type="text/css" href="../res/style2.css" media="screen" title="style2"/>
|
10
|
-
<script type="text/javascript" src="../res/prototype.js"></script>
|
11
|
-
<script type="text/javascript" src="../res/styleswitcher.js"></script>
|
12
|
-
</head>
|
13
|
-
<body>
|
14
|
-
|
15
|
-
|
16
|
-
<table id="mark:menu_top" align="center" summary="" width="100%">
|
17
|
-
<tr>
|
18
|
-
<td align="center">
|
19
|
-
|
20
|
-
<span class="menusel" kw:d="if pagename=='index'">Home</span>
|
21
|
-
<a class="menu" href="/index.html" kw:d="if pagename!='index'">Home</a>
|
22
|
-
|
|
23
|
-
<span class="menusel" kw:d="if:pagename=='albums'">Albums</span>
|
24
|
-
<a class="menu" href="/albums/html/" kw:d="if pagename!='albums'">Albums</a>
|
25
|
-
|
|
26
|
-
<!--
|
27
|
-
<span class="menusel" id="if:pagename=='projects'">Projects</span>
|
28
|
-
<a class="menu" href="/projects.html" id="if:pagename!='projects'">Projects</a>
|
29
|
-
|
|
30
|
-
-->
|
31
|
-
<span class="menusel" kw:d="if pagename=='guestbook'">Guestbook</span>
|
32
|
-
<a class="menu" href="/guestbook/gb.cgi?act=view" kw:d="if pagename!='guestbook'">
|
33
|
-
Guestbook
|
34
|
-
</a>
|
35
|
-
|
|
36
|
-
<span class="menusel" kw:d="if pagename=='cv'">Curriculum</span>
|
37
|
-
<a class="menu" href="/cv_it.html" kw:d="if:pagename!='cv'">Curriculum</a>
|
38
|
-
|
|
39
|
-
<span class="menusel" kw:d="if pagename=='contactme'">Contact Me</span>
|
40
|
-
<a class="menu" href="/contactme/contactme.cgi" kw:d="if pagename!='contactme'">Contact Me</a>
|
41
|
-
|
42
|
-
-
|
43
|
-
|
44
|
-
<span class="menutext"> style: </span>
|
45
|
-
<a class="menu" href="#" onclick="javascript: as.enable('style1');return false;">1</a>
|
46
|
-
<span class="menutext"> | </span>
|
47
|
-
<a class="menu" href="#" onclick="javascript: as.enable('style2'); return false;">2</a>
|
48
|
-
|
49
|
-
<!--
|
50
|
-
<script language="javascript" type="text/javascript">
|
51
|
-
writemenu();
|
52
|
-
</script>
|
53
|
-
-->
|
54
|
-
|
55
|
-
<span kw:d="if not language.nil?">
|
56
|
-
-
|
57
|
-
<span class="menutext"> lang: </span>
|
58
|
-
<span class="menusel" kw:d="if language=='it'">it</span>
|
59
|
-
<a class="menu" href="@{pagename}@_it.html" kw:d="if language!='it'">it</a>
|
60
|
-
|
|
61
|
-
<span class="menusel" kw:d="if language=='en'">en</span>
|
62
|
-
<a class="menu" href="@{pagename}@_en.html" kw:d="if language!='en'">en</a>
|
63
|
-
</span>
|
64
|
-
|
65
|
-
</td>
|
66
|
-
</tr>
|
67
|
-
</table>
|
68
|
-
|
69
|
-
</body>
|
70
|
-
</html>
|
71
|
-
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
2
|
+
<html kw:d="set pagename='albums'">
|
3
|
+
<head kw:d="set language=nil">
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
|
5
|
+
<title>Giovanni Ferro - @{@album.name}@</title>
|
6
|
+
<meta name="description" content="Giovanni Ferro photos"/>
|
7
|
+
<meta name="keywords" content="Giovanni Ferro,photo,pictures,digital photography"/>
|
8
|
+
<link rel="stylesheet" type="text/css" href="../res/style1.css" media="screen" title="style1"/>
|
9
|
+
<link rel="alternate stylesheet" type="text/css" href="../res/style2.css" media="screen" title="style2"/>
|
10
|
+
<script type="text/javascript" src="../res/prototype.js"></script>
|
11
|
+
<script type="text/javascript" src="../res/styleswitcher.js"></script>
|
12
|
+
</head>
|
13
|
+
<body>
|
14
|
+
|
15
|
+
|
16
|
+
<table id="mark:menu_top" align="center" summary="" width="100%">
|
17
|
+
<tr>
|
18
|
+
<td align="center">
|
19
|
+
|
20
|
+
<span class="menusel" kw:d="if pagename=='index'">Home</span>
|
21
|
+
<a class="menu" href="/index.html" kw:d="if pagename!='index'">Home</a>
|
22
|
+
|
|
23
|
+
<span class="menusel" kw:d="if:pagename=='albums'">Albums</span>
|
24
|
+
<a class="menu" href="/albums/html/" kw:d="if pagename!='albums'">Albums</a>
|
25
|
+
|
|
26
|
+
<!--
|
27
|
+
<span class="menusel" id="if:pagename=='projects'">Projects</span>
|
28
|
+
<a class="menu" href="/projects.html" id="if:pagename!='projects'">Projects</a>
|
29
|
+
|
|
30
|
+
-->
|
31
|
+
<span class="menusel" kw:d="if pagename=='guestbook'">Guestbook</span>
|
32
|
+
<a class="menu" href="/guestbook/gb.cgi?act=view" kw:d="if pagename!='guestbook'">
|
33
|
+
Guestbook
|
34
|
+
</a>
|
35
|
+
|
|
36
|
+
<span class="menusel" kw:d="if pagename=='cv'">Curriculum</span>
|
37
|
+
<a class="menu" href="/cv_it.html" kw:d="if:pagename!='cv'">Curriculum</a>
|
38
|
+
|
|
39
|
+
<span class="menusel" kw:d="if pagename=='contactme'">Contact Me</span>
|
40
|
+
<a class="menu" href="/contactme/contactme.cgi" kw:d="if pagename!='contactme'">Contact Me</a>
|
41
|
+
|
42
|
+
-
|
43
|
+
|
44
|
+
<span class="menutext"> style: </span>
|
45
|
+
<a class="menu" href="#" onclick="javascript: as.enable('style1');return false;">1</a>
|
46
|
+
<span class="menutext"> | </span>
|
47
|
+
<a class="menu" href="#" onclick="javascript: as.enable('style2'); return false;">2</a>
|
48
|
+
|
49
|
+
<!--
|
50
|
+
<script language="javascript" type="text/javascript">
|
51
|
+
writemenu();
|
52
|
+
</script>
|
53
|
+
-->
|
54
|
+
|
55
|
+
<span kw:d="if not language.nil?">
|
56
|
+
-
|
57
|
+
<span class="menutext"> lang: </span>
|
58
|
+
<span class="menusel" kw:d="if language=='it'">it</span>
|
59
|
+
<a class="menu" href="@{pagename}@_it.html" kw:d="if language!='it'">it</a>
|
60
|
+
|
|
61
|
+
<span class="menusel" kw:d="if language=='en'">en</span>
|
62
|
+
<a class="menu" href="@{pagename}@_en.html" kw:d="if language!='en'">en</a>
|
63
|
+
</span>
|
64
|
+
|
65
|
+
</td>
|
66
|
+
</tr>
|
67
|
+
</table>
|
68
|
+
|
69
|
+
</body>
|
70
|
+
</html>
|
71
|
+
|
@@ -1,28 +1,28 @@
|
|
1
|
-
<div id="footer" kw:d="id: page_footer">
|
2
|
-
<div class="left">
|
3
|
-
Copyright © 2002-2004, <b>Giovanni Ferro</b>
|
4
|
-
</div>
|
5
|
-
|
6
|
-
<div class="right">
|
7
|
-
<a href="http://validator.w3.org/check?uri=referer"><img
|
8
|
-
kw:d="mark:valid_xhtml_png"
|
9
|
-
style="border:0;" src="../res/valid-xhtml.png"
|
10
|
-
alt="Valid XHTML"/></a>
|
11
|
-
|
12
|
-
<a href="http://jigsaw.w3.org/css-validator/check/referer/"><img
|
13
|
-
kw:d="mark:valid_css_png"
|
14
|
-
style="border:0;" src="../res/valid-css.png"
|
15
|
-
alt="Valid CSS"/></a>
|
16
|
-
</div>
|
17
|
-
</div>
|
18
|
-
|
19
|
-
<script type="text/javascript">
|
20
|
-
<!--
|
21
|
-
document.write('<img src="/axs/ax.pl?trans.gif&ref=');
|
22
|
-
document.write(document.referrer);
|
23
|
-
document.write('" height="1" width="1" alt="" />');
|
24
|
-
// -->
|
25
|
-
</script>
|
26
|
-
<noscript>
|
27
|
-
<img src="/axs/ax.pl?trans.gif" height="1" width="1" alt="" />
|
28
|
-
</noscript>
|
1
|
+
<div id="footer" kw:d="id: page_footer">
|
2
|
+
<div class="left">
|
3
|
+
Copyright © 2002-2004, <b>Giovanni Ferro</b>
|
4
|
+
</div>
|
5
|
+
|
6
|
+
<div class="right">
|
7
|
+
<a href="http://validator.w3.org/check?uri=referer"><img
|
8
|
+
kw:d="mark:valid_xhtml_png"
|
9
|
+
style="border:0;" src="../res/valid-xhtml.png"
|
10
|
+
alt="Valid XHTML"/></a>
|
11
|
+
|
12
|
+
<a href="http://jigsaw.w3.org/css-validator/check/referer/"><img
|
13
|
+
kw:d="mark:valid_css_png"
|
14
|
+
style="border:0;" src="../res/valid-css.png"
|
15
|
+
alt="Valid CSS"/></a>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
<script type="text/javascript">
|
20
|
+
<!--
|
21
|
+
document.write('<img src="/axs/ax.pl?trans.gif&ref=');
|
22
|
+
document.write(document.referrer);
|
23
|
+
document.write('" height="1" width="1" alt="" />');
|
24
|
+
// -->
|
25
|
+
</script>
|
26
|
+
<noscript>
|
27
|
+
<img src="/axs/ax.pl?trans.gif" height="1" width="1" alt="" />
|
28
|
+
</noscript>
|
@@ -1,316 +1,316 @@
|
|
1
|
-
module View
|
2
|
-
|
3
|
-
(@@proc_table ||= {})['album_page'] = proc do
|
4
|
-
_buf = ""; _buf << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
|
5
|
-
pagename='albums'
|
6
|
-
_buf << "<html>\n";
|
7
|
-
language=nil
|
8
|
-
_buf << "<head>
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
</head>
|
18
|
-
<body>
|
19
|
-
|
20
|
-
<table align=\"center\" summary=\"\" width=\"100%\">
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
if pagename=='index' then
|
25
|
-
_buf << "
|
26
|
-
end
|
27
|
-
if pagename!='index' then
|
28
|
-
_buf << "
|
29
|
-
end
|
30
|
-
_buf << "
|
31
|
-
if pagename=='albums' then
|
32
|
-
_buf << "
|
33
|
-
end
|
34
|
-
if pagename!='albums' then
|
35
|
-
_buf << "
|
36
|
-
end
|
37
|
-
_buf << "
|
38
|
-
|
39
|
-
<span class=\"menusel\" id=\"if:pagename=='projects'\">Projects</span>
|
40
|
-
<a class=\"menu\" href=\"/projects.html\" id=\"if:pagename!='projects'\">Projects</a>
|
41
|
-
|
|
42
|
-
-->\n";
|
43
|
-
if pagename=='guestbook' then
|
44
|
-
_buf << "
|
45
|
-
end
|
46
|
-
if pagename!='guestbook' then
|
47
|
-
_buf << "
|
48
|
-
|
49
|
-
|
50
|
-
end
|
51
|
-
_buf << "
|
52
|
-
if pagename=='cv' then
|
53
|
-
_buf << "
|
54
|
-
end
|
55
|
-
if pagename!='cv' then
|
56
|
-
_buf << "
|
57
|
-
end
|
58
|
-
_buf << "
|
59
|
-
if pagename=='contactme' then
|
60
|
-
_buf << "
|
61
|
-
end
|
62
|
-
if pagename!='contactme' then
|
63
|
-
_buf << "
|
64
|
-
end
|
65
|
-
_buf << "
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
<script language=\"javascript\" type=\"text/javascript\">
|
75
|
-
writemenu();
|
76
|
-
</script>
|
77
|
-
-->
|
78
|
-
|
79
|
-
if not language.nil? then
|
80
|
-
_buf << "
|
81
|
-
|
82
|
-
if language=='it' then
|
83
|
-
_buf << "
|
84
|
-
end
|
85
|
-
if language!='it' then
|
86
|
-
_buf << "
|
87
|
-
end
|
88
|
-
_buf << "
|
89
|
-
if language=='en' then
|
90
|
-
_buf << "
|
91
|
-
end
|
92
|
-
if language!='en' then
|
93
|
-
_buf << "
|
94
|
-
end
|
95
|
-
end
|
96
|
-
_buf << "
|
97
|
-
|
98
|
-
|
99
|
-
</table>
|
100
|
-
|
101
|
-
<table class=\"album_maintable\" align=\"center\"
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
item_ctr = 0
|
113
|
-
for item in @album.breadcrumbs
|
114
|
-
item_ctr += 1
|
115
|
-
if item_ctr > 1
|
116
|
-
_buf << "
|
117
|
-
end
|
118
|
-
item_path = item[:path] # retrieve path and
|
119
|
-
item_title = item[:title] # title from a hash
|
120
|
-
if item_path.nil? # if path is null then
|
121
|
-
_buf << (item_title).to_s; else
|
122
|
-
_buf << "
|
123
|
-
|
124
|
-
_buf << (item_title).to_s; _buf << "
|
125
|
-
end
|
126
|
-
end
|
127
|
-
_buf << "
|
128
|
-
|
129
|
-
|
130
|
-
if @album.
|
131
|
-
_buf << "
|
132
|
-
end
|
133
|
-
_buf << "
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
\n";
|
141
|
-
if not @album.root? then
|
142
|
-
_buf << "
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
end
|
151
|
-
_buf << "
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
if @album.leaves.length>0 then
|
160
|
-
_buf << "
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
end
|
173
|
-
_buf << "
|
174
|
-
|
175
|
-
if @album.leaves.length>0 then
|
176
|
-
_buf << "
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
start_pos = 1
|
181
|
-
while start_pos <= @album.leaves.length
|
182
|
-
idx = start_pos
|
183
|
-
_buf << "
|
184
|
-
|
185
|
-
while idx <= @album.leaves.length && idx % 7 != 0
|
186
|
-
photo = @album.leaves[ idx-1 ]
|
187
|
-
_buf << "
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
idx += 1
|
196
|
-
end
|
197
|
-
_buf << "
|
198
|
-
idx = start_pos
|
199
|
-
_buf << "
|
200
|
-
while idx <= @album.leaves.length && idx % 7 != 0
|
201
|
-
photo = @album.leaves[ idx-1 ]
|
202
|
-
_buf << "
|
203
|
-
|
204
|
-
|
205
|
-
idx += 1
|
206
|
-
end
|
207
|
-
_buf << "
|
208
|
-
start_pos += 7
|
209
|
-
end
|
210
|
-
_buf << "
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
end
|
215
|
-
_buf << "
|
216
|
-
|
217
|
-
if @album.
|
218
|
-
_buf << "
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
end
|
231
|
-
_buf << "
|
232
|
-
|
233
|
-
if @album.
|
234
|
-
_buf << "
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
\n";
|
240
|
-
col = 1
|
241
|
-
for subalbum in @album.
|
242
|
-
if col == 1
|
243
|
-
_buf << "
|
244
|
-
end
|
245
|
-
|
246
|
-
_buf << "
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
if subalbum.
|
259
|
-
_buf << "
|
260
|
-
end
|
261
|
-
_buf << "
|
262
|
-
|
263
|
-
|
264
|
-
\n";
|
265
|
-
col += 1
|
266
|
-
if col == 3
|
267
|
-
col = 1
|
268
|
-
_buf << "
|
269
|
-
end
|
270
|
-
end
|
271
|
-
if col != 1
|
272
|
-
_buf << "
|
273
|
-
end
|
274
|
-
_buf << "
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
end
|
280
|
-
_buf << "
|
281
|
-
</table>
|
282
|
-
|
283
|
-
<div id=\"footer\">
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
</div>
|
298
|
-
|
299
|
-
</body>
|
300
|
-
</html>
|
301
|
-
\n";
|
302
|
-
; _buf
|
303
|
-
end#proc
|
304
|
-
|
305
|
-
module_function
|
306
|
-
def expand_album_page(context={})
|
307
|
-
if context.is_a?(Hash)
|
308
|
-
hash = context
|
309
|
-
context = Object.new
|
310
|
-
hash.each { |key, val| context.instance_variable_set("@#{key}", val) }
|
311
|
-
end
|
312
|
-
proc_obj = @@proc_table['album_page']
|
313
|
-
context.instance_eval(&proc_obj)
|
314
|
-
end
|
315
|
-
|
316
|
-
end
|
1
|
+
module View
|
2
|
+
|
3
|
+
(@@proc_table ||= {})['album_page'] = proc do
|
4
|
+
_buf = ""; _buf << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
|
5
|
+
pagename='albums'
|
6
|
+
_buf << "<html>\n";
|
7
|
+
language=nil
|
8
|
+
_buf << " <head>
|
9
|
+
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"/>
|
10
|
+
<title>Giovanni Ferro - "; _buf << ERB::Util.h(@album.name); _buf << "</title>
|
11
|
+
<meta name=\"description\" content=\"Giovanni Ferro photos\"/>
|
12
|
+
<meta name=\"keywords\" content=\"Giovanni Ferro,photo,pictures,digital photography\"/>
|
13
|
+
<link rel=\"stylesheet\" type=\"text/css\" href=\""; _buf << ("#{@album.relroot}res/style1.css").to_s; _buf << "\" media=\"screen\" title=\"style1\"/>
|
14
|
+
<link rel=\"alternate stylesheet\" type=\"text/css\" href=\""; _buf << ("#{@album.relroot}res/style2.css").to_s; _buf << "\" media=\"screen\" title=\"style2\"/>
|
15
|
+
<script type=\"text/javascript\" src=\""; _buf << ("#{@album.relroot}res/prototype.js").to_s; _buf << "\"></script>
|
16
|
+
<script type=\"text/javascript\" src=\""; _buf << ("#{@album.relroot}res/styleswitcher.js").to_s; _buf << "\"></script>
|
17
|
+
</head>
|
18
|
+
<body>
|
19
|
+
|
20
|
+
<table align=\"center\" summary=\"\" width=\"100%\">
|
21
|
+
<tr>
|
22
|
+
<td align=\"center\">
|
23
|
+
\n";
|
24
|
+
if pagename=='index' then
|
25
|
+
_buf << " <span class=\"menusel\">Home</span>\n";
|
26
|
+
end
|
27
|
+
if pagename!='index' then
|
28
|
+
_buf << " <a class=\"menu\" href=\"/index.html\">Home</a>\n";
|
29
|
+
end
|
30
|
+
_buf << " |\n";
|
31
|
+
if pagename=='albums' then
|
32
|
+
_buf << " <span class=\"menusel\">Albums</span>\n";
|
33
|
+
end
|
34
|
+
if pagename!='albums' then
|
35
|
+
_buf << " <a class=\"menu\" href=\"/albums/html/\">Albums</a>\n";
|
36
|
+
end
|
37
|
+
_buf << " |
|
38
|
+
<!--
|
39
|
+
<span class=\"menusel\" id=\"if:pagename=='projects'\">Projects</span>
|
40
|
+
<a class=\"menu\" href=\"/projects.html\" id=\"if:pagename!='projects'\">Projects</a>
|
41
|
+
|
|
42
|
+
-->\n";
|
43
|
+
if pagename=='guestbook' then
|
44
|
+
_buf << " <span class=\"menusel\">Guestbook</span>\n";
|
45
|
+
end
|
46
|
+
if pagename!='guestbook' then
|
47
|
+
_buf << " <a class=\"menu\" href=\"/guestbook/gb.cgi?act=view\">
|
48
|
+
Guestbook
|
49
|
+
</a>\n";
|
50
|
+
end
|
51
|
+
_buf << " |\n";
|
52
|
+
if pagename=='cv' then
|
53
|
+
_buf << " <span class=\"menusel\">Curriculum</span>\n";
|
54
|
+
end
|
55
|
+
if pagename!='cv' then
|
56
|
+
_buf << " <a class=\"menu\" href=\"/cv_it.html\">Curriculum</a>\n";
|
57
|
+
end
|
58
|
+
_buf << " |\n";
|
59
|
+
if pagename=='contactme' then
|
60
|
+
_buf << " <span class=\"menusel\">Contact Me</span>\n";
|
61
|
+
end
|
62
|
+
if pagename!='contactme' then
|
63
|
+
_buf << " <a class=\"menu\" href=\"/contactme/contactme.cgi\">Contact Me</a>\n";
|
64
|
+
end
|
65
|
+
_buf << "
|
66
|
+
-
|
67
|
+
|
68
|
+
<span class=\"menutext\"> style: </span>
|
69
|
+
<a class=\"menu\" href=\"#\" onclick=\"javascript: as.enable('style1');return false;\">1</a>
|
70
|
+
<span class=\"menutext\"> | </span>
|
71
|
+
<a class=\"menu\" href=\"#\" onclick=\"javascript: as.enable('style2'); return false;\">2</a>
|
72
|
+
|
73
|
+
<!--
|
74
|
+
<script language=\"javascript\" type=\"text/javascript\">
|
75
|
+
writemenu();
|
76
|
+
</script>
|
77
|
+
-->
|
78
|
+
\n";
|
79
|
+
if not language.nil? then
|
80
|
+
_buf << " -
|
81
|
+
<span class=\"menutext\"> lang: </span>\n";
|
82
|
+
if language=='it' then
|
83
|
+
_buf << " <span class=\"menusel\">it</span>\n";
|
84
|
+
end
|
85
|
+
if language!='it' then
|
86
|
+
_buf << " <a class=\"menu\" href=\""; _buf << ERB::Util.h(pagename); _buf << "_it.html\">it</a>\n";
|
87
|
+
end
|
88
|
+
_buf << " |\n";
|
89
|
+
if language=='en' then
|
90
|
+
_buf << " <span class=\"menusel\">en</span>\n";
|
91
|
+
end
|
92
|
+
if language!='en' then
|
93
|
+
_buf << " <a class=\"menu\" href=\""; _buf << ERB::Util.h(pagename); _buf << "_en.html\">en</a>\n";
|
94
|
+
end
|
95
|
+
end
|
96
|
+
_buf << "
|
97
|
+
</td>
|
98
|
+
</tr>
|
99
|
+
</table>
|
100
|
+
|
101
|
+
<table class=\"album_maintable\" align=\"center\"
|
102
|
+
border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
|
103
|
+
<tr>
|
104
|
+
<td>
|
105
|
+
|
106
|
+
<!-- begin header table -->
|
107
|
+
<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"3\">
|
108
|
+
|
109
|
+
<!-- breadcrumbs or Trail -->
|
110
|
+
<tr>
|
111
|
+
<td class=\"album_breadcrumbs\" align=\"left\">\n";
|
112
|
+
item_ctr = 0
|
113
|
+
for item in @album.breadcrumbs
|
114
|
+
item_ctr += 1
|
115
|
+
if item_ctr > 1
|
116
|
+
_buf << " <span class=\"album_treepathdots\">::</span>\n";
|
117
|
+
end
|
118
|
+
item_path = item[:path] # retrieve path and
|
119
|
+
item_title = item[:title] # title from a hash
|
120
|
+
if item_path.nil? # if path is null then
|
121
|
+
_buf << (item_title).to_s; else
|
122
|
+
_buf << " <a class=\"album_treepath\"
|
123
|
+
href=\""; _buf << ERB::Util.h(@album.relroot + item_path); _buf << "\">\n";
|
124
|
+
_buf << (item_title).to_s; _buf << " </a>\n";
|
125
|
+
end
|
126
|
+
end
|
127
|
+
_buf << " </td>
|
128
|
+
<td class=\"album_breadcrumbs\" align=\"right\" nowrap=\"nowrap\">
|
129
|
+
"; _buf << ERB::Util.h(@album.nr_leaves); _buf << " "; _buf << ERB::Util.h(@resource.photos); _buf << "\n";
|
130
|
+
if @album.nr_children>0 then
|
131
|
+
_buf << " "; _buf << ERB::Util.h(@album.nr_children); _buf << " sub-albums\n";
|
132
|
+
end
|
133
|
+
_buf << " </td>
|
134
|
+
</tr>
|
135
|
+
|
136
|
+
<tr>
|
137
|
+
<td width=\"80%\" align=\"left\">
|
138
|
+
"; _buf << ERB::Util.h(@album.description); _buf << "
|
139
|
+
</td>
|
140
|
+
\n";
|
141
|
+
if not @album.root? then
|
142
|
+
_buf << " <td width=\"20%\" align=\"right\">
|
143
|
+
<a href=\""; _buf << ERB::Util.h(@album.relroot_with_prefix); _buf << "index.html\" title=\"Up to top\"><img
|
144
|
+
src=\""; _buf << ("#{@album.relroot}res/top.gif").to_s; _buf << "\" border=\"0\" alt=\"Top\"/></a>
|
145
|
+
|
146
|
+
<a title=\"Up to album\" href=\"../index.html\"><img
|
147
|
+
src=\""; _buf << ("#{@album.relroot}res/up.gif").to_s; _buf << "\" border=\"0\" alt=\"Up\"/></a>
|
148
|
+
|
149
|
+
</td>\n";
|
150
|
+
end
|
151
|
+
_buf << "
|
152
|
+
</tr>
|
153
|
+
</table>
|
154
|
+
<!-- End header table -->
|
155
|
+
</td>
|
156
|
+
</tr>
|
157
|
+
|
158
|
+
<!-- thumbnails header table -->\n";
|
159
|
+
if @album.leaves.length>0 then
|
160
|
+
_buf << " <tr>
|
161
|
+
<td>
|
162
|
+
<!-- begin thumbnails header table -->
|
163
|
+
<table width=\"100%\"
|
164
|
+
border=\"0\" cellspacing=\"0\" cellpadding=\"3\">
|
165
|
+
<tr>
|
166
|
+
<td class=\"album_section\" align=\"left\">"; _buf << ERB::Util.h(@resource.thumbnails); _buf << "</td>
|
167
|
+
</tr>
|
168
|
+
</table>
|
169
|
+
<!-- end thumbnails header table -->
|
170
|
+
</td>
|
171
|
+
</tr>\n";
|
172
|
+
end
|
173
|
+
_buf << "
|
174
|
+
<!-- thumbnails body -->\n";
|
175
|
+
if @album.leaves.length>0 then
|
176
|
+
_buf << " <tr>
|
177
|
+
<td align=\"center\">
|
178
|
+
<!-- begin thumbnail table -->
|
179
|
+
<table class=\"album_thumbnails_table\">\n";
|
180
|
+
start_pos = 1
|
181
|
+
while start_pos <= @album.leaves.length
|
182
|
+
idx = start_pos
|
183
|
+
_buf << " <tr
|
184
|
+
class=\"album_thumbnail_image_row\">\n";
|
185
|
+
while idx <= @album.leaves.length && idx % 7 != 0
|
186
|
+
photo = @album.leaves[ idx-1 ]
|
187
|
+
_buf << " <td
|
188
|
+
class=\"album_thumbnail_image\">
|
189
|
+
<a href=\""; _buf << ERB::Util.h(photo.default_image_file.page_url); _buf << "\"
|
190
|
+
title=\""; _buf << ERB::Util.h(photo.name); _buf << "\"><img
|
191
|
+
src=\""; _buf << ("#{@album.relroot + photo.thumb.page_url}").to_s; _buf << "\"
|
192
|
+
alt=\"Giovanni Ferro - "; _buf << ERB::Util.h(photo.name); _buf << "\"
|
193
|
+
border=\"0\"/></a>
|
194
|
+
</td>\n";
|
195
|
+
idx += 1
|
196
|
+
end
|
197
|
+
_buf << " </tr>\n";
|
198
|
+
idx = start_pos
|
199
|
+
_buf << " <tr class=\"album_thumbnail_title_row\">\n";
|
200
|
+
while idx <= @album.leaves.length && idx % 7 != 0
|
201
|
+
photo = @album.leaves[ idx-1 ]
|
202
|
+
_buf << " <td class=\"album_thumbnail_title\">
|
203
|
+
"; _buf << ERB::Util.h(photo.name); _buf << "
|
204
|
+
</td>\n";
|
205
|
+
idx += 1
|
206
|
+
end
|
207
|
+
_buf << " </tr>\n";
|
208
|
+
start_pos += 7
|
209
|
+
end
|
210
|
+
_buf << " </table>
|
211
|
+
<!-- end thumbnail table -->
|
212
|
+
</td>
|
213
|
+
</tr>\n";
|
214
|
+
end
|
215
|
+
_buf << "
|
216
|
+
<!-- subalbums header -->\n";
|
217
|
+
if @album.children.length>0 then
|
218
|
+
_buf << " <tr>
|
219
|
+
<td>
|
220
|
+
<!-- begin subalbums header table -->
|
221
|
+
<table width=\"100%\"
|
222
|
+
border=\"0\" cellspacing=\"0\" cellpadding=\"3\">
|
223
|
+
<tr>
|
224
|
+
<td class=\"album_section\" align=\"left\">"; _buf << ERB::Util.h(@resource.subalbums); _buf << "</td>
|
225
|
+
</tr>
|
226
|
+
</table>
|
227
|
+
<!-- end header table -->
|
228
|
+
</td>
|
229
|
+
</tr>\n";
|
230
|
+
end
|
231
|
+
_buf << "
|
232
|
+
<!-- sub-albums body -->\n";
|
233
|
+
if @album.children.length>0 then
|
234
|
+
_buf << " <tr>
|
235
|
+
<td>
|
236
|
+
<!-- begin sub-album table -->
|
237
|
+
<table width=\"100%\"
|
238
|
+
border=\"0\" cellspacing=\"5\" cellpadding=\"2\">
|
239
|
+
\n";
|
240
|
+
col = 1
|
241
|
+
for subalbum in @album.children
|
242
|
+
if col == 1
|
243
|
+
_buf << " <tr>\n";
|
244
|
+
end
|
245
|
+
|
246
|
+
_buf << "
|
247
|
+
<td class=\"album_subalbum_image\">
|
248
|
+
<a href=\""; _buf << ERB::Util.h(subalbum.page_url); _buf << "\"
|
249
|
+
title=\""; _buf << ERB::Util.h(subalbum.name); _buf << "\"><img
|
250
|
+
src=\""; _buf << ("#{@album.relroot + subalbum.default_image_pool.thumb.page_url}").to_s; _buf << "\"
|
251
|
+
alt=\""; _buf << ERB::Util.h(subalbum.default_image_pool.name); _buf << "\"
|
252
|
+
border=\"1\"/></a>
|
253
|
+
</td>
|
254
|
+
<td>
|
255
|
+
<a href=\""; _buf << ERB::Util.h(subalbum.page_url); _buf << "\">"; _buf << ERB::Util.h(subalbum.name); _buf << "</a>
|
256
|
+
<br/>
|
257
|
+
"; _buf << ERB::Util.h(subalbum.nr_leaves); _buf << " photos\n";
|
258
|
+
if subalbum.nr_children>0 then
|
259
|
+
_buf << " , "; _buf << ERB::Util.h(subalbum.nr_children); _buf << " sub-albums\n";
|
260
|
+
end
|
261
|
+
_buf << " <br/>
|
262
|
+
"; _buf << ERB::Util.h(subalbum.description); _buf << "
|
263
|
+
</td>
|
264
|
+
\n";
|
265
|
+
col += 1
|
266
|
+
if col == 3
|
267
|
+
col = 1
|
268
|
+
_buf << " </tr>\n";
|
269
|
+
end
|
270
|
+
end
|
271
|
+
if col != 1
|
272
|
+
_buf << " </tr>\n";
|
273
|
+
end
|
274
|
+
_buf << "
|
275
|
+
</table>
|
276
|
+
<!-- end sub-album table -->
|
277
|
+
</td>
|
278
|
+
</tr>\n";
|
279
|
+
end
|
280
|
+
_buf << "
|
281
|
+
</table>
|
282
|
+
|
283
|
+
<div id=\"footer\">
|
284
|
+
<div class=\"left\">
|
285
|
+
Copyright © 2002-2004, <b>Giovanni Ferro</b>
|
286
|
+
</div>
|
287
|
+
|
288
|
+
<div class=\"right\">
|
289
|
+
<a href=\"http://validator.w3.org/check?uri=referer\"><img
|
290
|
+
style=\"border:0;\" src=\""; _buf << ("#{@album.relroot}res/valid-xhtml.png").to_s; _buf << "\"
|
291
|
+
alt=\"Valid XHTML\"/></a>
|
292
|
+
|
293
|
+
<a href=\"http://jigsaw.w3.org/css-validator/check/referer/\"><img
|
294
|
+
style=\"border:0;\" src=\""; _buf << ("#{@album.relroot}res/valid-css.png").to_s; _buf << "\"
|
295
|
+
alt=\"Valid CSS\"/></a>
|
296
|
+
</div>
|
297
|
+
</div>
|
298
|
+
|
299
|
+
</body>
|
300
|
+
</html>
|
301
|
+
\n";
|
302
|
+
; _buf
|
303
|
+
end#proc
|
304
|
+
|
305
|
+
module_function
|
306
|
+
def expand_album_page(context={})
|
307
|
+
if context.is_a?(Hash)
|
308
|
+
hash = context
|
309
|
+
context = Object.new
|
310
|
+
hash.each { |key, val| context.instance_variable_set("@#{key}", val) }
|
311
|
+
end
|
312
|
+
proc_obj = @@proc_table['album_page']
|
313
|
+
context.instance_eval(&proc_obj)
|
314
|
+
end
|
315
|
+
|
316
|
+
end
|