Skip to content

Commit

Permalink
Merge pull request escoz#552 from cfilipov/master
Browse files Browse the repository at this point in the history
Fix github commits json example.
  • Loading branch information
escoz committed Sep 3, 2013
2 parents 135f8b1 + 2cf5793 commit a0de294
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 15 deletions.
3 changes: 3 additions & 0 deletions quickdialog/QBindingEvaluator.m
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ - (void)bindRootElement:(QRootElement *)element toCollection:(NSArray *)items {
}

- (void)bindSection:(QSection *)section toProperties:(NSDictionary *)object {
if ([object isKindOfClass:[NSNull class]]) {
return;
}
[section.elements removeAllObjects];
for (id item in [object allKeys]){
QElement *element = [_builder buildElementWithObject:section.elementTemplate];
Expand Down
69 changes: 54 additions & 15 deletions sample/Resources/jsonremote.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,65 @@
"grouped": false,
"title": "Remote Files",
"controllerName": "QuickDialogWebController",
"object":"https://github.com/api/v2/json/commits/list/escoz/quickdialog/master",
"sections": [
"object":"https://api.github.com/repos/escoz/quickdialog/commits",
"sections":
[
{
"elements":[
{ "type":"QTextElement", "text":"This controller automatically downloads data from the web and binds it to the form. Data is downloaded from GitHub."}
"elements":
[
{
"type":"QTextElement",
"text":"This controller automatically downloads data from the web and binds it to the form. Data is downloaded from GitHub."
}
]
},
{ "title":"Commits for QuickDialog", "bind":"iterate:commits", "elementTemplate":
{ "type":"QTextElement", "bind":"text:message, title:committed_date", "controllerName":"QuickDialogController", "grouped":true, "sections":[
{"title":"Dates", "elements":[
{ "type":"QLabelElement", "title":"Committed date", "bind":"value:committed_date"},
{ "type":"QLabelElement", "title":"Authored date", "bind":"value:authored_date"}
]},
{"title":"Committer", "bind":"iterateproperties:committer", "elementTemplate":
{ "type":"QLabelElement", "bind":"title:key, value:value"}
{
"title":"Commits for QuickDialog",
"bind":"iterate:@allObjects",
"elementTemplate":
{
"type":"QTextElement",
"bind":"text:commit.message, title:sha",
"controllerName":"QuickDialogController",
"grouped":true,
"sections":
[
{
"title":"Dates",
"elements":
[
{
"type":"QLabelElement",
"title":"Committed date",
"bind":"value:commit.committer.date"
},
{
"type":"QLabelElement",
"title":"Authored date",
"bind":"value:commit.author.date"
}
]
},
{
"title":"Committer",
"bind":"iterateproperties:committer",
"elementTemplate":
{
"type":"QLabelElement",
"bind":"title:key, value:value"
}
},
{"title":"Author", "bind":"iterateproperties:author", "elementTemplate":
{ "type":"QLabelElement", "bind":"title:key, value:value"}
{
"title":"Author",
"bind":"iterateproperties:author",
"elementTemplate":
{
"type":"QLabelElement",
"bind":"title:key, value:value"
}
}
]}
]
}
}
]
}

0 comments on commit a0de294

Please sign in to comment.