Monotone-Parent: efb15318c83fe427840ce7814c65d5a7c2518a07
Monotone-Revision: 08fdc5d0a9471051564e0739b2dd3367c1e5143a Monotone-Author: crobert@inverse.ca Monotone-Date: 2009-08-21T14:25:42 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
parent
3e8d354672
commit
7acec88b97
|
@ -1,3 +1,7 @@
|
||||||
|
2009-08-21 Cyril Robert <crobert@inverse.ca>
|
||||||
|
|
||||||
|
* UI/Contacts/UIxListView.m: Implementation, allows VLISTs to be displayed.
|
||||||
|
|
||||||
2009-08-21 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
2009-08-21 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
* Tests/webdavlib.py (WebDAVQuery.xpath_evaluate): new method to
|
* Tests/webdavlib.py (WebDAVQuery.xpath_evaluate): new method to
|
||||||
|
|
|
@ -26,6 +26,10 @@
|
||||||
#import <SOGoUI/UIxComponent.h>
|
#import <SOGoUI/UIxComponent.h>
|
||||||
|
|
||||||
@interface UIxListView : UIxComponent
|
@interface UIxListView : UIxComponent
|
||||||
|
{
|
||||||
|
NGVList *list;
|
||||||
|
id item;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,66 @@
|
||||||
* Boston, MA 02111-1307, USA.
|
* Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#import <NGObjWeb/NSException+HTTP.h>
|
||||||
|
#import <NGObjWeb/WOResponse.h>
|
||||||
|
#import <NGCards/NGVList.h>
|
||||||
|
#import <NGCards/NGVCard.h>
|
||||||
|
|
||||||
#import "UIxListView.h"
|
#import "UIxListView.h"
|
||||||
|
|
||||||
@implementation UIxListView
|
@implementation UIxListView
|
||||||
|
|
||||||
|
|
||||||
|
- (NSString *) listName
|
||||||
|
{
|
||||||
|
return [list fn];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL) hasNickname
|
||||||
|
{
|
||||||
|
return [list nickname] != nil;
|
||||||
|
}
|
||||||
|
- (NSString *) listNickname
|
||||||
|
{
|
||||||
|
return [list nickname];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (BOOL) hasDescription
|
||||||
|
{
|
||||||
|
return [list description] != nil;
|
||||||
|
}
|
||||||
|
- (NSString *) listDescription
|
||||||
|
{
|
||||||
|
return [list description];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSArray *) components
|
||||||
|
{
|
||||||
|
return [list cardReferences];
|
||||||
|
}
|
||||||
|
- (NSString *) itemText
|
||||||
|
{
|
||||||
|
NSString *rc;
|
||||||
|
|
||||||
|
rc = [NSString stringWithFormat: @"%@ <%@>", [item fn], [item email]];
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id <WOActionResults>) defaultAction
|
||||||
|
{
|
||||||
|
id rc;
|
||||||
|
|
||||||
|
list = [[self clientObject] vList];
|
||||||
|
//TODO: make sure references are valid
|
||||||
|
|
||||||
|
if (list)
|
||||||
|
rc = self;
|
||||||
|
else
|
||||||
|
rc = [NSException exceptionWithHTTPStatus: 404 /* Not Found */
|
||||||
|
reason: @"could not locate contact"];
|
||||||
|
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -9,4 +9,17 @@
|
||||||
className="UIxPageFrame"
|
className="UIxPageFrame"
|
||||||
title="name"
|
title="name"
|
||||||
const:popup="YES"
|
const:popup="YES"
|
||||||
>Unimplemented</var:component>
|
>
|
||||||
|
<h3 class="contactCardTitle"><var:string value="listName" /></h3>
|
||||||
|
<var:if condition="hasNickname">
|
||||||
|
<h4><var:string value="listNickname" /></h4>
|
||||||
|
</var:if>
|
||||||
|
<var:if condition="hasDescription">
|
||||||
|
<div class="listDescription"><var:string value="listDescription" /></div>
|
||||||
|
</var:if>
|
||||||
|
<ul class="listComponents">
|
||||||
|
<var:foreach list="components" item="item">
|
||||||
|
<li><var:string value="itemText"/></li>
|
||||||
|
</var:foreach>
|
||||||
|
</ul>
|
||||||
|
</var:component>
|
||||||
|
|
Loading…
Reference in a new issue