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.
Files changed (118) hide show
  1. data/VERSION +1 -0
  2. data/bin/{ralbum.rb → ralbum} +1 -1
  3. data/example/example.sh +2 -1
  4. data/example/test_jalbum_phototree/jalbum-settings.jap +321 -0
  5. data/example/test_jalbum_phototree/src/albumfiles.txt +9 -0
  6. data/example/test_jalbum_phototree/src/comments.properties +0 -0
  7. data/example/test_jalbum_phototree/src/flowers/albumfiles.txt +14 -0
  8. data/example/test_jalbum_phototree/src/meta.properties +2 -0
  9. data/example/{test_phototree → test_rubyphoto_phototree}/album.xml +0 -0
  10. data/example/test_rubyphoto_phototree/flowers/IMG_1469.wt.jpg +0 -0
  11. data/example/test_rubyphoto_phototree/flowers/IMG_2291.jpg +0 -0
  12. data/example/test_rubyphoto_phototree/flowers/IMG_2598.jpg +0 -0
  13. data/example/test_rubyphoto_phototree/flowers/IMG_3068.jpg +0 -0
  14. data/example/test_rubyphoto_phototree/flowers/IMG_3323.jpg +0 -0
  15. data/example/test_rubyphoto_phototree/flowers/IMG_3348.jpg +0 -0
  16. data/example/{test_phototree → test_rubyphoto_phototree}/r_photo01.jpg +0 -0
  17. data/example/{test_phototree → test_rubyphoto_phototree}/r_photo01.jpg.xml +0 -0
  18. data/example/{test_phototree/catalog_data → test_rubyphoto_phototree/ralbum}/md5_to_key.yaml +0 -0
  19. data/example/{test_phototree/catalog_data → test_rubyphoto_phototree/ralbum}/md5_to_key.yaml.test +0 -0
  20. data/example/{test_phototree/catalog_data → test_rubyphoto_phototree/ralbum}/project.xml +206 -3
  21. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum01/album.xml +0 -0
  22. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum01/subalbum01_photo01.jpg +0 -0
  23. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum01/subalbum01_photo01.jpg.xml +0 -0
  24. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum01/subalbum01_photo02.jpg +0 -0
  25. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum01/subalbum01_photo02.jpg.xml +0 -0
  26. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum01/subalbum01_photo03.jpg +0 -0
  27. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum01/subalbum01_photo03.jpg.xml +0 -0
  28. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum01/subalbum01_photo04.jpg +0 -0
  29. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum01/subalbum01_photo04.jpg.xml +0 -0
  30. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/album.xml +0 -0
  31. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo01.jpg +0 -0
  32. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo01.jpg.xml +0 -0
  33. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo02.jpg +0 -0
  34. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo02.jpg.xml +0 -0
  35. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo03.jpg +0 -0
  36. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo03.jpg.xml +0 -0
  37. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo04.jpg +0 -0
  38. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo04.jpg.xml +0 -0
  39. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo05.jpg +0 -0
  40. data/example/{test_phototree → test_rubyphoto_phototree}/subalbum02/subalbum02_photo05.jpg.xml +0 -0
  41. data/lib/ralbum.rb +9 -5
  42. data/lib/ralbum/album_tree/album.rb +74 -0
  43. data/lib/ralbum/album_tree/generate_album_tree_node_visitor.rb +73 -0
  44. data/lib/ralbum/album_tree/image_file.rb +88 -0
  45. data/lib/ralbum/{image_pool.rb → album_tree/image_pool.rb} +16 -4
  46. data/lib/ralbum/catalog.rb +7 -7
  47. data/lib/ralbum/cli/cli_ralbum.rb +66 -25
  48. data/lib/ralbum/image_strategies/copy_image_strategy.rb +16 -0
  49. data/lib/ralbum/image_strategies/linked_image_strategy.rb +18 -0
  50. data/lib/ralbum/image_strategies/scaled_image_strategy.rb +52 -0
  51. data/lib/ralbum/image_strategies/sepia_scaled_image_strategy.rb +50 -0
  52. data/lib/{ralbum-common → ralbum}/object_with_properties.rb +0 -0
  53. data/lib/{ralbum-common → ralbum}/object_with_validation.rb +0 -0
  54. data/lib/ralbum/photo_tree/jalbum_photo_tree.rb +83 -0
  55. data/lib/ralbum/photo_tree/photo_file.rb +149 -0
  56. data/lib/ralbum/photo_tree/photo_tree_item.rb +68 -0
  57. data/lib/ralbum/{photo_tree_node.rb → photo_tree/photo_tree_node.rb} +16 -13
  58. data/lib/ralbum/{photo_tree_builder.rb → photo_tree/rubyphoto_photo_tree.rb} +64 -46
  59. data/lib/ralbum/project.rb +48 -12
  60. data/lib/ralbum/skin.rb +34 -27
  61. data/lib/ralbum/skin_engine.rb +32 -17
  62. data/lib/ralbum/skin_engines/erb_skin_engine.rb +2 -5
  63. data/lib/ralbum/skin_engines/kwartz_skin_engine.rb +6 -9
  64. data/lib/ralbum/skin_manager.rb +11 -2
  65. data/lib/ralbum/skins/cgi/cgi_skin.rb +21 -23
  66. data/lib/ralbum/skins/cgi/res/model.rb +30 -32
  67. data/lib/ralbum/skins/gfold/inc/menu_bottom.html +53 -53
  68. data/lib/ralbum/skins/gfold/inc/menu_top.html +71 -71
  69. data/lib/ralbum/skins/gfold/inc/page_footer.html +28 -28
  70. data/lib/ralbum/skins/gfold/out/album_page.rb +316 -316
  71. data/lib/ralbum/skins/gfold/out/image_page.rb +231 -231
  72. data/lib/ralbum/skins/gfold/out/tree_page.rb +96 -96
  73. data/lib/ralbum/skins/gfold/res/prototype.js +3277 -3277
  74. data/lib/ralbum/skins/gfold/template/album_page.html +161 -161
  75. data/lib/ralbum/skins/gfold/template/album_page.plogic +127 -127
  76. data/lib/ralbum/skins/gfold/template/image_page.html +91 -91
  77. data/lib/ralbum/skins/gfold/template/image_page.plogic +70 -70
  78. data/lib/ralbum/skins/gfold/template/tree_page.html +79 -79
  79. data/lib/ralbum/skins/gfold/template/tree_page.plogic +45 -45
  80. data/lib/ralbum/skins/js/out/album_page.rb +2 -2
  81. data/lib/ralbum/skins/js/out/tree_page.rb +18 -17
  82. data/lib/ralbum/skins/js/template/album_page.html +2 -2
  83. data/lib/ralbum/skins/js/template/tree_page.html +1 -1
  84. data/lib/ralbum/skins/test_erb/template/album_page.rhtml +22 -0
  85. data/lib/ralbum/skins/test_erb/template/image_page.rhtml +44 -0
  86. data/lib/ralbum/tasks/compile_skins.rb +8 -0
  87. data/test/ralbum/cli/tc_cli_ralbum.rb +35 -0
  88. data/test/ralbum/image_strategies/tc_scaled_image_strategy.rb +18 -0
  89. data/test/ralbum/image_strategies/tc_sepia_scaled_image_strategy.rb +18 -0
  90. data/test/ralbum/photo_tree/tc_jalbum_photo_tree.rb +39 -0
  91. data/test/ralbum/photo_tree/tc_photo_file.rb +13 -0
  92. data/test/ralbum/{tc_01_photo_tree.rb → photo_tree/tc_photo_tree.rb} +10 -12
  93. data/test/ralbum/photo_tree/tc_rubyalbum_photo_tree.rb +20 -0
  94. data/test/ralbum/tc_album.rb +55 -0
  95. data/test/ralbum/tc_catalog.rb +8 -4
  96. data/test/ralbum/tc_image_pool.rb +37 -0
  97. data/test/ralbum/{tc_05_kwartz_skin_engine.rb → tc_kwartz_skin_engine.rb} +1 -1
  98. data/test/ralbum/{tc_04_skin_manager.rb → tc_skin_manager.rb} +8 -3
  99. data/test/ralbum/test_helper.rb +16 -1
  100. data/test_data/ralbum/test_data/is_test/dummy.txt +0 -0
  101. metadata +78 -81
  102. data/bin/ralbum-JPG2jpg.rb +0 -90
  103. data/bin/ralbum-compile_skins.rb +0 -18
  104. data/bin/ralbum-myconv.rb +0 -81
  105. data/bin/ralbum-readexif.rb +0 -18
  106. data/bin/ralbum-reorder.rb +0 -200
  107. data/lib/ralbum/album.rb +0 -66
  108. data/lib/ralbum/generate_album_tree_node_visitor.rb +0 -60
  109. data/lib/ralbum/image_file.rb +0 -81
  110. data/lib/ralbum/image_strategy.rb +0 -143
  111. data/lib/ralbum/photo_tree_item.rb +0 -89
  112. data/test/ralbum/cli/test_cli_ralbum.rb +0 -13
  113. data/test/ralbum/tc_02_photo_tree_builder.rb +0 -20
  114. data/test/ralbum/tc_03_album.rb +0 -42
  115. data/test/ralbum/tc_06_image_strategy.rb +0 -21
  116. data/test/test_ralbum.rb +0 -14
  117. data/test_data/ralbum/test_data/is_test/r_photo01_scaled.jpg +0 -0
  118. data/test_data/ralbum/test_data/is_test/r_photo01_sepia_scaled.jpg +0 -0
@@ -1,231 +1,231 @@
1
- module View
2
-
3
- (@@proc_table ||= {})['image_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(@image.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 << ("#{@image.relroot}res/style1.css").to_s; _buf << "\" media=\"screen\" title=\"style1\"/>
14
- <link rel=\"alternate stylesheet\" type=\"text/css\" href=\""; _buf << ("#{@image.relroot}res/style2.css").to_s; _buf << "\" media=\"screen\" title=\"style2\"/>
15
- <script type=\"text/javascript\" src=\""; _buf << ("#{@image.relroot}res/prototype.js").to_s; _buf << "\"></script>
16
- <script type=\"text/javascript\" src=\""; _buf << ("#{@image.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=\"maintable\" align=\"center\"
102
- border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
103
-
104
- <!-- Breadcrumbs or Trail -->
105
- <tr>
106
- <td class=\"album_breadcrumbs\">\n";
107
- item_ctr = 0
108
- for item in @image.breadcrumbs
109
- item_ctr += 1
110
- if item_ctr > 1
111
- _buf << " <span class=\"album_treepathdots\">::</span>\n";
112
- end
113
- item_path = item[:path] # retrieve path and
114
- item_title = item[:title] # title from a hash
115
- if item_path.nil? # if path is null then
116
- _buf << (item_title).to_s; else
117
- _buf << " <a class=\"album_treepath\" href=\""; _buf << ERB::Util.h(@image.relroot + item_path); _buf << "\">\n";
118
- _buf << (item_title).to_s; _buf << " </a>\n";
119
- end
120
- end
121
- _buf << " </td>
122
- <td class=\"album_breadcrumbs\" align=\"right\">
123
- "; _buf << ERB::Util.h(@image.name); _buf << "
124
- </td>
125
- </tr>
126
-
127
- <!-- description + navigation buttons -->
128
- <tr>
129
- <td>
130
- "; _buf << ERB::Util.h(@image.description); _buf << "
131
- </td>
132
- <td align=\"right\" valign=\"top\" width=\"30%\" nowrap=\"nowrap\">
133
-
134
- <span id=\"nav_buttons\">
135
- <a href=\""; _buf << ERB::Util.h(@image.relroot_with_prefix); _buf << "index.html\" title=\"Up to top\"><img
136
- src=\""; _buf << ("#{@image.relroot}res/top.gif").to_s; _buf << "\" border=\"0\" alt=\"Top\"/></a>
137
- &nbsp;
138
- <a title=\"Up to album\" href=\"index.html\"><img
139
- src=\""; _buf << ("#{@image.relroot}res/up.gif").to_s; _buf << "\" border=\"0\" alt=\"Up\"/></a>
140
- &nbsp;&nbsp;&nbsp;\n";
141
- if @image.prev_pageurl!=nil then
142
- _buf << " <a title=\"Prev photo\" href=\""; _buf << ERB::Util.h(@image.prev_pageurl); _buf << "\"><img
143
- src=\""; _buf << ("#{@image.relroot}res/left.gif").to_s; _buf << "\" border=\"0\" alt=\"Prev\"/></a>\n";
144
- end
145
- if @image.next_pageurl!=nil then
146
- _buf << " <a title=\"Next photo\" href=\""; _buf << ERB::Util.h(@image.next_pageurl); _buf << "\"><img
147
- src=\""; _buf << ("#{@image.relroot}res/right.gif").to_s; _buf << "\" border=\"0\" alt=\"Next\"/></a>\n";
148
- end
149
- _buf << " </span>
150
-
151
- </td>
152
- </tr>
153
-
154
- <!-- image -->
155
- <tr>
156
- <td colspan=\"2\" align=\"center\">
157
- <a href=\""; _buf << ERB::Util.h(@image.relroot + @image.url); _buf << "\"><img border=\"0\"
158
- src=\""; _buf << ("#{@image.relroot + @image.url}").to_s; _buf << "\"
159
- alt=\"Giovanni Ferro - "; _buf << ERB::Util.h(@image.name); _buf << "\"/></a>
160
- </td>
161
- </tr>
162
-
163
- <!-- image footer -->
164
- <tr>
165
- <td colspan=\"2\">
166
- <table width=\"100%\">
167
- <tr>
168
- <td align=\"left\" class=\"small\">
169
- "; _buf << ERB::Util.h(@image.size); _buf << "K&nbsp;JPEG image,&nbsp;
170
- "; _buf << ERB::Util.h(@image.width); _buf << "X"; _buf << ERB::Util.h(@image.height); _buf << "&nbsp;pixels
171
- </td>
172
- <td align=\"right\">
173
- <span id=\"nav_buttons\">
174
- <a href=\""; _buf << ERB::Util.h(@image.relroot_with_prefix); _buf << "index.html\" title=\"Up to top\"><img
175
- src=\""; _buf << ("#{@image.relroot}res/top.gif").to_s; _buf << "\" border=\"0\" alt=\"Top\"/></a>
176
- &nbsp;
177
- <a title=\"Up to album\" href=\"index.html\"><img
178
- src=\""; _buf << ("#{@image.relroot}res/up.gif").to_s; _buf << "\" border=\"0\" alt=\"Up\"/></a>
179
- &nbsp;&nbsp;&nbsp;\n";
180
- if @image.prev_pageurl!=nil then
181
- _buf << " <a title=\"Prev photo\" href=\""; _buf << ERB::Util.h(@image.prev_pageurl); _buf << "\"><img
182
- src=\""; _buf << ("#{@image.relroot}res/left.gif").to_s; _buf << "\" border=\"0\" alt=\"Prev\"/></a>\n";
183
- end
184
- if @image.next_pageurl!=nil then
185
- _buf << " <a title=\"Next photo\" href=\""; _buf << ERB::Util.h(@image.next_pageurl); _buf << "\"><img
186
- src=\""; _buf << ("#{@image.relroot}res/right.gif").to_s; _buf << "\" border=\"0\" alt=\"Next\"/></a>\n";
187
- end
188
- _buf << " </span>
189
- </td>
190
- </tr>
191
- </table>
192
- </td>
193
- </tr>
194
-
195
- </table>
196
-
197
- <div id=\"footer\">
198
- <div class=\"left\">
199
- Copyright &copy; 2002-2004, <b>Giovanni Ferro</b>
200
- </div>
201
-
202
- <div class=\"right\">
203
- <a href=\"http://validator.w3.org/check?uri=referer\"><img
204
- style=\"border:0;\" src=\""; _buf << ("#{@image.relroot}res/valid-xhtml.png").to_s; _buf << "\"
205
- alt=\"Valid XHTML\"/></a>
206
- &nbsp; &nbsp;
207
- <a href=\"http://jigsaw.w3.org/css-validator/check/referer/\"><img
208
- style=\"border:0;\" src=\""; _buf << ("#{@image.relroot}res/valid-css.png").to_s; _buf << "\"
209
- alt=\"Valid CSS\"/></a>
210
- </div>
211
- </div>
212
-
213
- </body>
214
- </html>
215
-
216
- \n";
217
- ; _buf
218
- end#proc
219
-
220
- module_function
221
- def expand_image_page(context={})
222
- if context.is_a?(Hash)
223
- hash = context
224
- context = Object.new
225
- hash.each { |key, val| context.instance_variable_set("@#{key}", val) }
226
- end
227
- proc_obj = @@proc_table['image_page']
228
- context.instance_eval(&proc_obj)
229
- end
230
-
231
- end
1
+ module View
2
+
3
+ (@@proc_table ||= {})['image_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(@image.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 << ("#{@image.relroot}res/style1.css").to_s; _buf << "\" media=\"screen\" title=\"style1\"/>
14
+ <link rel=\"alternate stylesheet\" type=\"text/css\" href=\""; _buf << ("#{@image.relroot}res/style2.css").to_s; _buf << "\" media=\"screen\" title=\"style2\"/>
15
+ <script type=\"text/javascript\" src=\""; _buf << ("#{@image.relroot}res/prototype.js").to_s; _buf << "\"></script>
16
+ <script type=\"text/javascript\" src=\""; _buf << ("#{@image.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=\"maintable\" align=\"center\"
102
+ border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
103
+
104
+ <!-- Breadcrumbs or Trail -->
105
+ <tr>
106
+ <td class=\"album_breadcrumbs\">\n";
107
+ item_ctr = 0
108
+ for item in @image.breadcrumbs
109
+ item_ctr += 1
110
+ if item_ctr > 1
111
+ _buf << " <span class=\"album_treepathdots\">::</span>\n";
112
+ end
113
+ item_path = item[:path] # retrieve path and
114
+ item_title = item[:title] # title from a hash
115
+ if item_path.nil? # if path is null then
116
+ _buf << (item_title).to_s; else
117
+ _buf << " <a class=\"album_treepath\" href=\""; _buf << ERB::Util.h(@image.relroot + item_path); _buf << "\">\n";
118
+ _buf << (item_title).to_s; _buf << " </a>\n";
119
+ end
120
+ end
121
+ _buf << " </td>
122
+ <td class=\"album_breadcrumbs\" align=\"right\">
123
+ "; _buf << ERB::Util.h(@image.name); _buf << "
124
+ </td>
125
+ </tr>
126
+
127
+ <!-- description + navigation buttons -->
128
+ <tr>
129
+ <td>
130
+ "; _buf << ERB::Util.h(@image.description); _buf << "
131
+ </td>
132
+ <td align=\"right\" valign=\"top\" width=\"30%\" nowrap=\"nowrap\">
133
+
134
+ <span id=\"nav_buttons\">
135
+ <a href=\""; _buf << ERB::Util.h(@image.relroot_with_prefix); _buf << "index.html\" title=\"Up to top\"><img
136
+ src=\""; _buf << ("#{@image.relroot}res/top.gif").to_s; _buf << "\" border=\"0\" alt=\"Top\"/></a>
137
+ &nbsp;
138
+ <a title=\"Up to album\" href=\"index.html\"><img
139
+ src=\""; _buf << ("#{@image.relroot}res/up.gif").to_s; _buf << "\" border=\"0\" alt=\"Up\"/></a>
140
+ &nbsp;&nbsp;&nbsp;\n";
141
+ if @image.prev_page_url!=nil then
142
+ _buf << " <a title=\"Prev photo\" href=\""; _buf << ERB::Util.h(@image.prev_page_url); _buf << "\"><img
143
+ src=\""; _buf << ("#{@image.relroot}res/left.gif").to_s; _buf << "\" border=\"0\" alt=\"Prev\"/></a>\n";
144
+ end
145
+ if @image.next_page_url!=nil then
146
+ _buf << " <a title=\"Next photo\" href=\""; _buf << ERB::Util.h(@image.next_page_url); _buf << "\"><img
147
+ src=\""; _buf << ("#{@image.relroot}res/right.gif").to_s; _buf << "\" border=\"0\" alt=\"Next\"/></a>\n";
148
+ end
149
+ _buf << " </span>
150
+
151
+ </td>
152
+ </tr>
153
+
154
+ <!-- image -->
155
+ <tr>
156
+ <td colspan=\"2\" align=\"center\">
157
+ <a href=\""; _buf << ERB::Util.h(@image.relroot + @image.src_url); _buf << "\"><img border=\"0\"
158
+ src=\""; _buf << ("#{@image.relroot + @image.page_url}").to_s; _buf << "\"
159
+ alt=\"Giovanni Ferro - "; _buf << ERB::Util.h(@image.name); _buf << "\"/></a>
160
+ </td>
161
+ </tr>
162
+
163
+ <!-- image footer -->
164
+ <tr>
165
+ <td colspan=\"2\">
166
+ <table width=\"100%\">
167
+ <tr>
168
+ <td align=\"left\" class=\"small\">
169
+ "; _buf << ERB::Util.h(@image.size); _buf << "K&nbsp;JPEG image,&nbsp;
170
+ "; _buf << ERB::Util.h(@image.width); _buf << "X"; _buf << ERB::Util.h(@image.height); _buf << "&nbsp;pixels
171
+ </td>
172
+ <td align=\"right\">
173
+ <span id=\"nav_buttons\">
174
+ <a href=\""; _buf << ERB::Util.h(@image.relroot_with_prefix); _buf << "index.html\" title=\"Up to top\"><img
175
+ src=\""; _buf << ("#{@image.relroot}res/top.gif").to_s; _buf << "\" border=\"0\" alt=\"Top\"/></a>
176
+ &nbsp;
177
+ <a title=\"Up to album\" href=\"index.html\"><img
178
+ src=\""; _buf << ("#{@image.relroot}res/up.gif").to_s; _buf << "\" border=\"0\" alt=\"Up\"/></a>
179
+ &nbsp;&nbsp;&nbsp;\n";
180
+ if @image.prev_page_url!=nil then
181
+ _buf << " <a title=\"Prev photo\" href=\""; _buf << ERB::Util.h(@image.prev_page_url); _buf << "\"><img
182
+ src=\""; _buf << ("#{@image.relroot}res/left.gif").to_s; _buf << "\" border=\"0\" alt=\"Prev\"/></a>\n";
183
+ end
184
+ if @image.next_page_url!=nil then
185
+ _buf << " <a title=\"Next photo\" href=\""; _buf << ERB::Util.h(@image.next_page_url); _buf << "\"><img
186
+ src=\""; _buf << ("#{@image.relroot}res/right.gif").to_s; _buf << "\" border=\"0\" alt=\"Next\"/></a>\n";
187
+ end
188
+ _buf << " </span>
189
+ </td>
190
+ </tr>
191
+ </table>
192
+ </td>
193
+ </tr>
194
+
195
+ </table>
196
+
197
+ <div id=\"footer\">
198
+ <div class=\"left\">
199
+ Copyright &copy; 2002-2004, <b>Giovanni Ferro</b>
200
+ </div>
201
+
202
+ <div class=\"right\">
203
+ <a href=\"http://validator.w3.org/check?uri=referer\"><img
204
+ style=\"border:0;\" src=\""; _buf << ("#{@image.relroot}res/valid-xhtml.png").to_s; _buf << "\"
205
+ alt=\"Valid XHTML\"/></a>
206
+ &nbsp; &nbsp;
207
+ <a href=\"http://jigsaw.w3.org/css-validator/check/referer/\"><img
208
+ style=\"border:0;\" src=\""; _buf << ("#{@image.relroot}res/valid-css.png").to_s; _buf << "\"
209
+ alt=\"Valid CSS\"/></a>
210
+ </div>
211
+ </div>
212
+
213
+ </body>
214
+ </html>
215
+
216
+ \n";
217
+ ; _buf
218
+ end#proc
219
+
220
+ module_function
221
+ def expand_image_page(context={})
222
+ if context.is_a?(Hash)
223
+ hash = context
224
+ context = Object.new
225
+ hash.each { |key, val| context.instance_variable_set("@#{key}", val) }
226
+ end
227
+ proc_obj = @@proc_table['image_page']
228
+ context.instance_eval(&proc_obj)
229
+ end
230
+
231
+ end