From: helge Date: Mon, 3 Oct 2005 21:36:49 +0000 (+0000) Subject: improvs X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=320aa4f7a0941ef13e7a9456c377fd2b0411f9eb;p=sope improvs git-svn-id: http://svn.opengroupware.org/SOPE/trunk@1151 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-appserver/samples/CoreDataBlog/ChangeLog b/sope-appserver/samples/CoreDataBlog/ChangeLog index cc990a4c..104da5bb 100644 --- a/sope-appserver/samples/CoreDataBlog/ChangeLog +++ b/sope-appserver/samples/CoreDataBlog/ChangeLog @@ -1,5 +1,7 @@ 2005-10-03 Helge Hess + * MonthPage: highlight days with articles + * MonthPage.wo/MonthPage.woo: added missing selector for kv qualifier 2005-08-06 Helge Hess diff --git a/sope-appserver/samples/CoreDataBlog/MonthPage.m b/sope-appserver/samples/CoreDataBlog/MonthPage.m index b59ba8c8..a1e15ca7 100644 --- a/sope-appserver/samples/CoreDataBlog/MonthPage.m +++ b/sope-appserver/samples/CoreDataBlog/MonthPage.m @@ -21,10 +21,11 @@ #include -@class NSArray; +@class NSArray, NSCalendarDate; @interface MonthPage : WOComponent { + NSCalendarDate *date; } @end @@ -42,13 +43,22 @@ } - (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 { diff --git a/sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.html b/sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.html index 42e38b26..cd9c71e9 100644 --- a/sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.html +++ b/sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.html @@ -128,18 +128,18 @@ <#Weeks> <#Week> - + <#SetupCalDayDisplayGroup/> <#IsSameMonth> - <#Day/> (<#Count/>) + <#DayHasArticles> + <#Day/> + + + <#DayHasNoArticles> + <#Day/> + <#IsOtherMonth> diff --git a/sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.wod b/sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.wod index 357e3904..a63bf4de 100644 --- a/sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.wod +++ b/sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.wod @@ -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; +} diff --git a/sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.woo b/sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.woo index 8a8dd11f..7bc731bd 100644 --- a/sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.woo +++ b/sope-appserver/samples/CoreDataBlog/MonthPage.wo/MonthPage.woo @@ -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; }; };