Re: [PATCH] pycalendar

Klaus Trainer <klaus.trainer-S0/[email protected]>
Newsgroups gmane.comp.web.pyblosxom.devel
Message-ID <[email protected]>
> it looks like this should be done for blosxomCalendarSpecificDay also,
> right? maybe the best approach would be to build up the class names
> based on the day and whether it's been blogged, then construct the td
> element once, at the end.

Yeah, you're right, Ryan.
With this patch I should have solved it in a prettier way...



Ryan Barrett wrote:
> thanks for the patch! and sorry for the delay, my day job has been
> all-encompassing the last couple weeks.
> 
> it looks like this should be done for blosxomCalendarSpecificDay also,
> right? maybe the best approach would be to build up the class names
> based on the day and whether it's been blogged, then construct the td
> element once, at the end.
> 
> On Thu, 3 Apr 2008, Klaus Trainer wrote:
> 
>> I've just had a little problem with my Pyblosxom's CSS style and needed
>> to add a few lines to the pycalendar plugin to solve it.
>>
>> The problem:
>> If a blog entry has been posted today, I expect the day number to be a
>> member of both CSS classes blosxomCalendarToday _and_
>> blosxomCalendarBlogged in the HTML code. However the day number is only
>> a member of blosxomCalendarToday.
>>
>> This small patch fixes the inconsistency.
>>
> 
> -Ryan
> 
> -- 
> http://snarfed.org/

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone

_______________________________________________
Pyblosxom-devel mailing list
Pyblosxom-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/pyblosxom-devel
pycalendar.diff (text/x-patch, 1.4 KB)
--- pycalendar.py	2008-04-10 22:53:54.000000000 +0200
+++ my_pycalendar.py	2008-04-10 22:51:14.000000000 +0200
@@ -231,20 +231,27 @@
         else:
             link = strday
 
+        td_class_str = ""
+
         # if it's today
         if (self._view[0], self._view[1], day) == self._today[0:3]:
-            return "<td class=\"blosxomCalendarToday\">%s</td>" % link
+            td_class_str += "blosxomCalendarToday "
 
         if self._specificday:
-            # if it's the day we're viewing
+        # if it's the day we're viewing
             if (self._view[0], self._view[1], day) == self._specificday:
-                return "<td class=\"blosxomCalendarSpecificDay\">%s</td>" % link
-
+                td_class_str += "blosxomCalendarSpecificDay "
+        
         # if it's a day that's been blogged
         if self._entries.has_key(strday):
-            return "<td class=\"blosxomCalendarBlogged\">%s</td>" % link
+            td_class_str += "blosxomCalendarBlogged"
+
+        if td_class_str != "":
+            td_class_str = "<td class=\"" + td_class_str + "\">%s</td>" % link
+        else:
+            td_class_str = "<td class=\"blosxomCalendarCell\">%s</td>" % strday
 
-        return "<td class=\"blosxomCalendarCell\">%s</td>" % strday
+        return td_class_str
 
     def _fixweek(self, item):
         return "<td class=\"blosxomCalendarWeekHeader\">%s</td>" % item
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.