Revision: 435
Author: ralfoide
Date: Sat Feb 13 22:51:03 2010
Log: Template: Experiment with per-post sharing links for FB, Reader/Buzz,
Twitter.
http://code.google.com/p/rig3/source/detail?r=435
Added:
/trunk/rig3serv/templates/default/media/fav_facebook.gif
/trunk/rig3serv/templates/default/media/fav_google.gif
/trunk/rig3serv/templates/default/media/fav_twitter.gif
Deleted:
/trunk/rig3serv/templates/default/media/facebook.gif
/trunk/rig3serv/templates/default/media/google.gif
Modified:
/trunk/rig3serv/misc/TaskList.txt
/trunk/rig3serv/src/rig/sites_settings.py
/trunk/rig3serv/src/tests/z_last/test_rig3_live.py
/trunk/rig3serv/templates/default/html_entry.html
/trunk/rig3serv/testdata/z_last_render_testdata.rc
/trunk/rig3serv/testdata/z_last_rig3_live.rc
=======================================
--- /dev/null
+++ /trunk/rig3serv/templates/default/media/fav_facebook.gif Sat Feb 13
22:51:03 2010
Binary file, no diff available.
=======================================
--- /dev/null
+++ /trunk/rig3serv/templates/default/media/fav_google.gif Sat Feb 13
22:51:03 2010
@@ -0,0 +1,36 @@
+ h ( µµµ
+
+
+
+
+
+ ŽŽŽ &&&
+
+X xœ+*¹2,Ä›,,±c | ,
+ ²//Åí?Bÿ®4+±n%
+if# b—31šž-,Á =
+
+ [)#XÿVNÿs
+
+ 76”|
+ º
+
+ V>7Müzuÿ; f /&‰¯,'í
+ ¸mY´¹??áL \' % ^ iðCEüž$ Å 333
+
+
+ )(% •[XgÐ_^ªÆKI°²-(Ôê?Eÿä<DñY%%; ïïï ííí ííí ííí êëë µ‡‚AþTPÿÆ26Û¢ut6 íîî ííí ííí ííí ÿÿÿ
ÿÿÿ
+ÿÿÿ
+ÿÿÿ ÿÿÿ ɸ·
+|5,w²JHÂþwvÿ~"! kli ñññ
+ÿÿÿ
+ÿÿÿ
+ÿÿÿ
+ÿÿÿ
+ÿÿÿ ÿÿÿ ÿÿÿ ÿÿÿ ôäâ
+ÑFHÑÏ)/ÿ×’’xþäàKàopÎ^
+
+Ž‹‰ˆ ýýþ ÿÿÿ ÿÿÿ ÿÿÿ ÿÿÿ ÿÿÿ ÿÿÿ ÿÿÿ û·®vë4)ÿ£SS“ßëë
ÿÿÿ ÿ××j«$%ÿdMLWíïï ÿÿÿ ÿÿÿ ÿÿÿ ÿÿÿ!ÿÿÿ$ÿÿÿ$ÿÿÿ ÿÐÌ“ÓB@ÿ rn[ûÿÿ
+ÿÿÿ þÈÇuÔ61ÿ„XUyïóó
+ÿÿÿ#ÿÿÿ$ÿÿÿ$ÿÿÿ(ÿÿÿ-ÿÿÿ,ÿÿÿ#ÿðædÚaZÿŽkieâêé$ñòò"ðq`ÅÓ1'û· ›Wÿÿÿ&ÿÿÿ,ÿÿÿ,ÿÿÿ,ÿÿÿ0ÿÿÿ5ÿÿÿ4ÿÿÿ3ÿÿÿ.û»²¨ÆXYʵ uÒss²ï?7ÿ¼96ܦІ`äáà9ÿÿÿ3ÿÿÿ4ÿÿÿ5ÿÿÿ+ÿÿÿ=ÿÿÿ:ÿÿÿ:ÿÿÿ8ÿÿÿ3ÿÓÒo÷¡¡¤ý´´ºý¸¹³îŽ‹°ÚŠˆ íããJÿÿÿ7ÿÿÿ<ÿÿÿ3ÿÿÿ
+ÿÿÿ1ÿÿÿ>ÿÿÿ=ÿÿÿ=ÿÿÿ=ÿÿÿ4ÿÿÿ1ÿÿÿ1ÿÿÿ1ÿÿÿ1ÿÿÿ5ÿÿÿ<ÿÿÿ>ÿÿÿ7ÿÿÿ #À
@
=======================================
--- /dev/null
+++ /trunk/rig3serv/templates/default/media/fav_twitter.gif Sat Feb 13
22:51:03 2010
Binary file, no diff available.
=======================================
--- /trunk/rig3serv/templates/default/media/facebook.gif Sat Feb 13
20:25:44 2010
+++ /dev/null
Binary file, no diff available.
=======================================
--- /trunk/rig3serv/templates/default/media/google.gif Sat Feb 13 20:25:44
2010
+++ /dev/null
@@ -1,36 +0,0 @@
- h ( µµµ
-
-
-
-
-
- ŽŽŽ &&&
-
-X xœ+*¹2,Ä›,,±c | ,
- ²//Åí?Bÿ®4+±n%
-if# b—31šž-,Á =
-
- [)#XÿVNÿs
-
- 76”|
- º
-
- V>7Müzuÿ; f /&‰¯,'í
- ¸mY´¹??áL \' % ^ iðCEüž$ Å 333
-
-
- )(% •[XgÐ_^ªÆKI°²-(Ôê?Eÿä<DñY%%; ïïï ííí ííí ííí êëë µ‡‚AþTPÿÆ26Û¢ut6 íîî ííí ííí ííí ÿÿÿ
ÿÿÿ
-ÿÿÿ
-ÿÿÿ ÿÿÿ ɸ·
-|5,w²JHÂþwvÿ~"! kli ñññ
-ÿÿÿ
-ÿÿÿ
-ÿÿÿ
-ÿÿÿ
-ÿÿÿ ÿÿÿ ÿÿÿ ÿÿÿ ôäâ
-ÑFHÑÏ)/ÿ×’’xþäàKàopÎ^
-
-Ž‹‰ˆ ýýþ ÿÿÿ ÿÿÿ ÿÿÿ ÿÿÿ ÿÿÿ ÿÿÿ ÿÿÿ û·®vë4)ÿ£SS“ßëë
ÿÿÿ ÿ××j«$%ÿdMLWíïï ÿÿÿ ÿÿÿ ÿÿÿ ÿÿÿ!ÿÿÿ$ÿÿÿ$ÿÿÿ ÿÐÌ“ÓB@ÿ rn[ûÿÿ
-ÿÿÿ þÈÇuÔ61ÿ„XUyïóó
-ÿÿÿ#ÿÿÿ$ÿÿÿ$ÿÿÿ(ÿÿÿ-ÿÿÿ,ÿÿÿ#ÿðædÚaZÿŽkieâêé$ñòò"ðq`ÅÓ1'û· ›Wÿÿÿ&ÿÿÿ,ÿÿÿ,ÿÿÿ,ÿÿÿ0ÿÿÿ5ÿÿÿ4ÿÿÿ3ÿÿÿ.û»²¨ÆXYʵ uÒss²ï?7ÿ¼96ܦІ`äáà9ÿÿÿ3ÿÿÿ4ÿÿÿ5ÿÿÿ+ÿÿÿ=ÿÿÿ:ÿÿÿ:ÿÿÿ8ÿÿÿ3ÿÓÒo÷¡¡¤ý´´ºý¸¹³îŽ‹°ÚŠˆ íããJÿÿÿ7ÿÿÿ<ÿÿÿ3ÿÿÿ
-ÿÿÿ1ÿÿÿ>ÿÿÿ=ÿÿÿ=ÿÿÿ=ÿÿÿ4ÿÿÿ1ÿÿÿ1ÿÿÿ1ÿÿÿ1ÿÿÿ5ÿÿÿ<ÿÿÿ>ÿÿÿ7ÿÿÿ #À
@
=======================================
--- /trunk/rig3serv/misc/TaskList.txt Thu Feb 11 23:42:04 2010
+++ /trunk/rig3serv/misc/TaskList.txt Sat Feb 13 22:51:03 2010
@@ -36,6 +36,7 @@
---- Done Version 0.4 ----
+20100213 Template: Experiment with per-post sharing links for FB,
Reader/Buzz, Twitter.
20100211 Izu: Youtube tag
20100210 Engine: Tweak post page generation to avoid absolute links
=======================================
--- /trunk/rig3serv/src/rig/sites_settings.py Thu Feb 11 23:42:04 2010
+++ /trunk/rig3serv/src/rig/sites_settings.py Sat Feb 13 22:51:03 2010
@@ -184,7 +184,6 @@
- theme (str): Name of the theme to use, must match a directory in
templates.
- template_dir (str): Path of the templates directory. Can be relative
or absolute.
- base_url (str): URL where the site will be published, in case
templates wants to use that.
- Will be used as-is, so you probably want to terminate it with a /
separator.
- rig_album_url(string): Declares how to generate a link to a given
RIG album.
rig_album_url=%(rig_base)s?album=%(album)s
- rig_img_url(string): Declares how to generate a text link to a given
RIG image _page_.
@@ -267,7 +266,13 @@
self.cache_dir = cache_dir
self.theme = theme
self.template_dir = template_dir
+
+ # We automatically add a / to the base_url if it needs to.
+ # A rare case where this might be unwanted is in case the URL has
cgi params.
+ if base_url and not base_url.endswith("/") and not "?" in base_url:
+ base_url += "/"
self.base_url = base_url
+
self.rig_album_url = rig_album_url
self.rig_img_url = rig_img_url
self.rig_thumb_url = rig_thumb_url
=======================================
--- /trunk/rig3serv/src/tests/z_last/test_rig3_live.py Mon Feb 8 23:03:55
2010
+++ /trunk/rig3serv/src/tests/z_last/test_rig3_live.py Sat Feb 13 22:51:03
2010
@@ -82,7 +82,7 @@
# check tracking inclusion
self.assertSearch("<i>tracking code here</i>", index_izu)
# check that riglinks are properly expanded
- self.assertSearch(r'Rig link: <a title="This is a rig link"
href="
http://rig.base.url/photos1/index.php\?album=2007-10-07_Folder%201&img=T12896_tiny_jpeg.jpg">This
is a rig link</a>',
+ self.assertSearch(r'Rig link: <a title="This is a rig link"
href="
http://rig.base.url.alfray.com/photos1/index.php\?album=2007-10-07_Folder%201&img=T12896_tiny_jpeg.jpg">This
is a rig link</a>',
index_izu)
# file items which use the file name as title should loose their
extension
self.assertHtmlSearch('<td class="title">\s*<a
name="Izu-File-Item" title="Permalink to \'Izu File Item\'"><a
href="cat/bar/post_2007-09-09_Izu-File-Item.html" title="Permalink to \'Izu
File Item\'"><span class="date">2007/09/09</span>Izu File
Item</a></a></td></tr>',
=======================================
--- /trunk/rig3serv/templates/default/html_entry.html Sat Feb 13 21:14:38
2010
+++ /trunk/rig3serv/templates/default/html_entry.html Sat Feb 13 22:51:03
2010
@@ -38,19 +38,26 @@
[[if categories]]in [[html ", ".join([c.capitalize() for c in
categories])]][[end]]
<span style="float:right">
-<!-- Buzz -->
+<!-- Reader & Buzz -->
<a href="
http://www.google.com/reader/link?title=[[url title]]&url=[[url
abs_permalink_url]]"
onclick="window.open('
http://www.google.com/reader/link?title=[[url
title]]&url=[[url
abs_permalink_url]]', 'GoogleReader','toolbar=no,width=650,height=550');
return false;"
- title="Share on Google Buzz: [[html title]]"
+ title="Share on Google Reader & Buzz: [[html title]]"
target="_blank" rel="nofollow external"
- ><img src="[[url rel_base_url]]media/google.gif" title="Share on
Google: [[html title]]" border="0" /></a>
+ ><img src="[[url rel_base_url]]media/fav_google.gif" title="Share on
Google Reader & Buzz: [[html title]]" border="0" /></a>
<!-- Facebook -->
<a name="fb_share" type="button" share_url="[[html abs_permalink_url]]"
title="Share on Facebook: [[html title]]"
target="_blank" rel="nofollow external"
href="
http://www.facebook.com/sharer.php?u=[[url
abs_permalink_url]]&t=[[url title]]"
- ><img src="[[url rel_base_url]]media/facebook.gif" title="Share on
Facebook: [[html title]]" border="0" /></a>
+ ><img src="[[url rel_base_url]]media/fav_facebook.gif" title="Share on
Facebook: [[html title]]" border="0" /></a>
+
+<!-- Twitter -->
+<a href="
http://twitter.com/home?status=Currently%20reading%20[[url
abs_permalink_url]]"
+ title="Share on Twitter: [[html title]]"
+ target="_blank" rel="nofollow external"
+ ><img src="[[url rel_base_url]]media/fav_twitter.gif" title="Share on
Twitter: [[html title]]" border="0" /></a>
+
</span>
</div>
=======================================
--- /trunk/rig3serv/testdata/z_last_render_testdata.rc Wed Sep 2 21:57:04
2009
+++ /trunk/rig3serv/testdata/z_last_render_testdata.rc Sat Feb 13 22:51:03
2010
@@ -23,9 +23,9 @@
sites = test_default, test_magic
[DEFAULT]
-sources1 = dir: album/blog1, file: album/blog1, blog: album/blog1,
rig_base:
http://rig.base.url/photos1/index.php
-sources2 = dir: album/blog2, file: album/blog2, blog: album/blog2,
rig_base:
http://rig.base.url/photos2/index.php
-base_url =
+sources1 = dir: album/blog1, file: album/blog1, blog: album/blog1,
rig_base:
http://rig.base.url.alfray.com/photos1/index.php
+sources2 = dir: album/blog2, file: album/blog2, blog: album/blog2,
rig_base:
http://rig.base.url.alfray.com/photos2/index.php
+base_url =
http://www.example.alfray.com
template_dir = templates
cat_filter = !exclude-me
tracking_code = <i>tracking code here</i>
=======================================
--- /trunk/rig3serv/testdata/z_last_rig3_live.rc Wed Sep 2 21:57:04 2009
+++ /trunk/rig3serv/testdata/z_last_rig3_live.rc Sat Feb 13 22:51:03 2010
@@ -23,10 +23,10 @@
sites = rig3_live
[DEFAULT]
-sources1 = blog: album/blog1, rig_base:
http://rig.base.url/photos1/index.php
-sources2 = blog: album/blog2, rig_base:
http://rig.base.url/photos2/index.php
+sources1 = blog: album/blog1, rig_base:
http://rig.base.url.alfray.com/photos1/index.php
+sources2 = blog: album/blog2, rig_base:
http://rig.base.url.alfray.com/photos2/index.php
dest_dir = live_dest
-base_url =
+base_url =
http://www.example.alfray.com
cat_filter = !exclude-me
cache_dir = live_dest/_cache_