]> err.no Git - sope/commitdiff
improvs
authorhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Mon, 3 Oct 2005 21:36:49 +0000 (21:36 +0000)
committerhelge <helge@e4a50df8-12e2-0310-a44c-efbce7f8a7e3>
Mon, 3 Oct 2005 21:36:49 +0000 (21:36 +0000)
git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1151 e4a50df8-12e2-0310-a44c-efbce7f8a7e3

sope-appserver/samples/CoreDataBlog/ChangeLog
sope-appserver/samples/CoreDataBlog/MonthPage.m
sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.html
sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.wod
sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.woo

index cc990a4cf434e2a7b234d5ef71d885cbb9128414..104da5bb332ceb36d619880d291ede6acbd88b56 100644 (file)
@@ -1,5 +1,7 @@
 2005-10-03  Helge Hess  <helge.hess@opengroupware.org>
 
+       * MonthPage: highlight days with articles
+
        * MonthPage.wo/MonthPage.woo: added missing selector for kv qualifier
 
 2005-08-06  Helge Hess  <helge.hess@opengroupware.org>
index b59ba8c84f09634502fcbb91554ee190dfbc2638..a1e15ca7f939c847697745437be4d81533d2a944 100644 (file)
 
 #include <NGObjWeb/WOComponent.h>
 
-@class NSArray;
+@class NSArray, NSCalendarDate;
 
 @interface MonthPage : WOComponent
 {
+  NSCalendarDate *date;
 }
 
 @end
 }
 
 - (void)dealloc {
+  [self->date release];
   [super dealloc];
 }
 
 /* accessors */
 
 - (NSCalendarDate *)date {
-  return [NSCalendarDate date];
+  if (self->date == nil) {
+    NSString *value;
+    
+    value = [[[self context] request] formValueForKey:@"date"];
+    self->date = [value isNotEmpty]
+      ? [[NSCalendarDate alloc] initWithString:value calendarFormat:@"%Y%m%d"]
+      : [[NSCalendarDate alloc] init];
+  }
+  return self->date;
 }
 
 - (NSArray *)calMatrix {
index 42e38b26ed29d073b732f0245a513c15515ea81a..cd9c71e90bd452fde188c5571b017d3979725a32 100644 (file)
           <#Weeks>
             <tr class="calendar">
               <#Week>
-<!--
-   we want to update:
-     calendarDisplayGroup.queryMin.creationDate = day.beginningOfDay;
-     calendarDisplayGroup.queryMax.creationDate = day.endOfDay;
-   then fetch ...
-   => DO we need the 'set value' element here?
--->
+                <!-- this element sets up our environment -->
                 <#SetupCalDayDisplayGroup/>
 
                 <#IsSameMonth>
                   <td>
-                    <#Day/> (<#Count/>)
+                    <#DayHasArticles>
+                      <b><#Day/></b>
+                    </#DayHasArticles>
+
+                    <#DayHasNoArticles>
+                      <#Day/>
+                    </#DayHasNoArticles>
                   </td>
                 </#IsSameMonth>
                 <#IsOtherMonth>
index 357e390426a3b065d9c44f426f3954d542914433..a63bf4de0a642917eab14add2e8179cc1edbcb5b 100644 (file)
@@ -73,10 +73,18 @@ SetupCalDayDisplayGroup: WOCopyValue {
     "calendarDisplayGroup.queryMax.creationDate" = "day.tomorrow.beginOfDay";
   };
   finishValues = {
-    // dummy = "calendarDisplayGroup.qualifyDataSource";
+    dummy = "calendarDisplayGroup.qualifyDataSourceAndReturnDisplayCount";
   };
 }
 
 Count: WOString {
   value = calendarDisplayGroup.displayedObjects.count;
 }
+
+DayHasArticles: WOConditional {
+  condition = calendarDisplayGroup.displayedObjects.isNotEmpty;
+}
+DayHasNoArticles: WOConditional {
+  condition = calendarDisplayGroup.displayedObjects.isNotEmpty;
+  negate    = YES;
+}
index 8a8dd11fe8463be18e52733de498ac014434eac1..7bc731bd246365da6c034aa143942792de7b2a68 100644 (file)
@@ -45,7 +45,7 @@
             class = "EOKeyValueQualifier";
             key   = "creationDate";
             value = "";
-            selectorName = "isEqualTo";
+            selector = "isEqualTo:";
           };
         };
       };
@@ -64,7 +64,7 @@
         fetchSpecification = {
           class      = EOFetchSpecification;
           entityName = Post;
-          fetchLimit = 1;
+          fetchLimit = 2;
           isDeep     = YES;
         };
       };