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>
#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 {
<#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>
"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;
+}
class = "EOKeyValueQualifier";
key = "creationDate";
value = "";
- selectorName = "isEqualTo";
+ selector = "isEqualTo:";
};
};
};
fetchSpecification = {
class = EOFetchSpecification;
entityName = Post;
- fetchLimit = 1;
+ fetchLimit = 2;
isDeep = YES;
};
};