[typo] Delicious sidebar oops

Alastair Rankine arsptr at internode.on.net
Fri Aug 4 06:32:45 EDT 2006


Currently the "group by date" setting in the delicious sidebar does  
not seem to have any effect: it's always on.

I think the reason is that the value in @sb_config['groupdate']  
evaluates to "0" or "1", both strings and hence both true according  
to Ruby (any Perl programmers out there want to own up to this one? :).

I guess a proper fix would be to map this setting to a boolean, but I  
don't know much about how sidebars are configured, so I've got a bit  
of a brute force fix instead, comments appreciated.


typo $ svn diff components/plugins/sidebars/delicious/content.rhtml
Index: components/plugins/sidebars/delicious/content.rhtml
===================================================================
--- components/plugins/sidebars/delicious/content.rhtml (revision 1193)
+++ components/plugins/sidebars/delicious/content.rhtml (working copy)
@@ -1,8 +1,8 @@
<% if @delicious -%>
    <div id="delicious">
      <h3><a href="http://<%=h @delicious.title %>"><%=h  
@delicious.title %></a></h3>
-    <% (@sb_config['groupdate'] ? @delicious.days : [{ :container =>  
@delicious.items }]).each do |group| -%>
-    <% if @sb_config['groupdate'] -%>
+    <% (@sb_config['groupdate'] != "0" ? @delicious.days :  
[{ :container => @delicious.items }]).each do |group| -%>
+    <% if @sb_config['groupdate'] != "0" -%>
      <span class="date"><%=h group[:date].to_s.to_date.strftime("%b % 
d") %></span>
      <% end -%>
      <ul>



More information about the Typo-list mailing list