{"action":"created","comment":{"url":"https://api.github.com/repos/linzjs/linz/pulls/comments/71999413","id":71999413,"diff_hunk":"@@ -0,0 +1,46 @@\n+mixin renderOverviewFields(obj, hasTitle, hasSubtitle)\n+\tsection.group\n+\t\tdiv.panel\n+\t\t\tif hasTitle\n+\t\t\t\tdiv.panel-heading=obj.label\n+\t\t\tdiv.panel-body\n+\t\t\t\tif hasSubtitle\n+\t\t\t\t\th4=obj.label\n+\t\t\t\t-\tif (obj.body)\n+\t\t\t\t\tdiv=obj.body\n+\t\t\t\t-\tif (obj.fields && Array.isArray(obj.fields))\n+\t\t\t\t\tul.list-group\n+\t\t\t\t\t\teach field in obj.fields\n+\t\t\t\t\t\t\tli.list-group-item\n+\t\t\t\t\t\t\t\tspan\n+\t\t\t\t\t\t\t\t\tstrong=field.label + ':'\n+\t\t\t\t\t\t\t\tspan='\t' + field.value\n+\n+\n+mixin renderTabs(tabs)\n+\tdiv.tabs\n+\t\tdiv\n+\t\t\tul.nav.nav-tabs.nav-tabs-overview\n+\t\t\t\teach tab, index in tabs\n+\t\t\t\t\t- var tabLink = (tab.label || '').replace(/\\s+/g, '-').toLowerCase() + index;","path":"views/mixins/overviewBody.jade","position":25,"original_position":25,"commit_id":"634e878cd5ea66418a9946aefdd43a884292e349","original_commit_id":"634e878cd5ea66418a9946aefdd43a884292e349","user":{"login":"smebberson","id":74628,"avatar_url":"https://avatars.githubusercontent.com/u/74628?v=3","gravatar_id":"","url":"https://api.github.com/users/smebberson","html_url":"https://github.com/smebberson","followers_url":"https://api.github.com/users/smebberson/followers","following_url":"https://api.github.com/users/smebberson/following{/other_user}","gists_url":"https://api.github.com/users/smebberson/gists{/gist_id}","starred_url":"https://api.github.com/users/smebberson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smebberson/subscriptions","organizations_url":"https://api.github.com/users/smebberson/orgs","repos_url":"https://api.github.com/users/smebberson/repos","events_url":"https://api.github.com/users/smebberson/events{/privacy}","received_events_url":"https://api.github.com/users/smebberson/received_events","type":"User","site_admin":false},"body":"This stuff shouldn't be within the view itself. Please surface all this code to a route that prepares everything properly for the view.","created_at":"2016-07-25T00:44:34Z","updated_at":"2016-07-25T00:44:34Z","html_url":"https://github.com/linzjs/linz/pull/102#discussion_r71999413","pull_request_url":"https://api.github.com/repos/linzjs/linz/pulls/102","_links":{"self":{"href":"https://api.github.com/repos/linzjs/linz/pulls/comments/71999413"},"html":{"href":"https://github.com/linzjs/linz/pull/102#discussion_r71999413"},"pull_request":{"href":"https://api.github.com/repos/linzjs/linz/pulls/102"}}},"pull_request":{"url":"https://api.github.com/repos/linzjs/linz/pulls/102","id":71675590,"html_url":"https://github.com/linzjs/linz/pull/102","diff_url":"https://github.com/linzjs/linz/pull/102.diff","patch_url":"https://github.com/linzjs/linz/pull/102.patch","issue_url":"https://api.github.com/repos/linzjs/linz/issues/102","number":102,"state":"open","locked":false,"title":"Upgrade overview UI","user":{"login":"patelswapnil","id":12613138,"avatar_url":"https://avatars.githubusercontent.com/u/12613138?v=3","gravatar_id":"","url":"https://api.github.com/users/patelswapnil","html_url":"https://github.com/patelswapnil","followers_url":"https://api.github.com/users/patelswapnil/followers","following_url":"https://api.github.com/users/patelswapnil/following{/other_user}","gists_url":"https://api.github.com/users/patelswapnil/gists{/gist_id}","starred_url":"https://api.github.com/users/patelswapnil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patelswapnil/subscriptions","organizations_url":"https://api.github.com/users/patelswapnil/orgs","repos_url":"https://api.github.com/users/patelswapnil/repos","events_url":"https://api.github.com/users/patelswapnil/events{/privacy}","received_events_url":"https://api.github.com/users/patelswapnil/received_events","type":"User","site_admin":false},"body":"### This PR improves the overview UI and allows the user to define the Overview as follow:\r\n- Render `Date created` and `Date modified` as default Summary when `overview` or `overview.body` is not set in overview configuration\r\n- User can group fields to be rendered under given title in Overview\r\n- User can pass their own function to render the data as they wish \r\n- User can group fields to be rendered under given title in seperate tabs\r\n- User can pass their own function to render data as they wish under each tab\r\n\r\n### Usage\r\n\r\n- Group fields to render them under one title:\r\n```\r\noverview: {\r\n  body: [\r\n    {\r\n      label: 'label 1',\r\n      fields: [field1, field2, ...]\r\n    },\r\n    {\r\n      label: 'label 2',\r\n      fields: [field3, field4, ...]\r\n    },\r\n    .... more field groups ....\r\n  ]\r\n}\r\n```\r\n\r\n- Provide your custom function to render the data as you like:\r\n```\r\noverview: {\r\n  body: [\r\n    {\r\n      label: 'Custom Data',\r\n      body: function (req, res, record, model, callback) {\r\n        .... function code to create html content here....\r\n        return callback(null, 'html content here');\r\n      }\r\n    },\r\n    .... more field groups ....\r\n  ]\r\n}\r\n```\r\n   __Note:__ Linz will provide four arguments (**_req_**, **_res_**, **_record_**, **_model_**) to custom function in overview.\r\n   Your custom function should return **html content**.\r\n\r\n- Fields can be grouped and rendered under tabs as follow:\r\n```\r\noverview: {\r\n  body: [\r\n    [\r\n      {\r\n        label: 'Tab 1',\r\n        fields: [field1, field2, ...]\r\n      },\r\n      {\r\n        label: 'Tab 2',\r\n        fields: [field3, field4, ...]\r\n      },\r\n      .... more tabs ....\r\n    ]\r\n  ]\r\n}\r\n```\r\n- Provide your custom function to render data as you like under tab\r\n```\r\noverview: {\r\n  body: [\r\n    [\r\n      {\r\n        label: 'Custom Tab',\r\n        body: function (req, res, record, model, callback) {\r\n          .... function code to create html content here....\r\n          return callback(null, 'html content here');\r\n        }\r\n      },\r\n      .... more tabs ....\r\n    ]\r\n  ]\r\n}\r\n```\r\n\r\n- A detailed example of how overview can be configured:\r\n\r\n```\r\noverview: {\r\n  body: [\r\n    // fieldsets (grouping fields under one title)\r\n    {\r\n      label: 'Label 1',\r\n      fields: ['field1', 'field2', ...]\r\n    },\r\n    {\r\n      label: 'Label 2',\r\n      body: function (req, res, record, model, callback) {\r\n        .... function code to create custom html content here ....\r\n        return callback(null, 'html content here');\r\n      }\r\n    },\r\n    // .... more fieldsets .... \r\n    // tabs\r\n    [\r\n      {\r\n        label: 'Tab 1',\r\n        fields: ['field1', 'field2', ...]\r\n      },\r\n      {\r\n        label: 'Tab 2',\r\n        body: function (req, res, record, model, callback) {\r\n          .... function code to create custom html content here ....\r\n          return callback(null, 'html content here');\r\n        }\r\n      },\r\n      // example of tab containing multiple fieldsets\r\n      {\r\n        label: 'Tab containing multiple fieldsets',\r\n        body: [\r\n          {\r\n            label: 'label 1',\r\n            fields: ['field1', 'field2', ...]\r\n          },\r\n          {\r\n            label: 'Label 2',\r\n            body: function (req, res, record, model, callback) {\r\n              .... function code to create custom html content here....\r\n              return callback(null, 'html content here');\r\n            }\r\n          },\r\n          .... more fieldsets ....\r\n        ]\r\n      },\r\n      {\r\n        label: 'Tab 4',\r\n        fields: ['field3', 'field4', ...]\r\n      }\r\n      .... more tabs ...\r\n    ], // end of tabs\r\n    // few more fieldsets if neded after tabs \r\n    {\r\n      label: 'Label 3',\r\n      fields: ['field3', 'field4', ...]\r\n    },\r\n    {\r\n      label: 'Label 4',\r\n      body: function (req, res, record, model, callback) {\r\n        .... function code to create custom html content here ....\r\n        return callback(null, 'html content here');\r\n      }\r\n    },\r\n    // .... more fieldsets ....\r\n  ] // end of overview.body\r\n}\r\n```","created_at":"2016-05-27T08:12:07Z","updated_at":"2016-07-25T00:44:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"38984d7cd3d977e10e60e163fae110eb4fb1dd41","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/linzjs/linz/pulls/102/commits","review_comments_url":"https://api.github.com/repos/linzjs/linz/pulls/102/comments","review_comment_url":"https://api.github.com/repos/linzjs/linz/pulls/comments{/number}","comments_url":"https://api.github.com/repos/linzjs/linz/issues/102/comments","statuses_url":"https://api.github.com/repos/linzjs/linz/statuses/634e878cd5ea66418a9946aefdd43a884292e349","head":{"label":"linzjs:overview-ui","ref":"overview-ui","sha":"634e878cd5ea66418a9946aefdd43a884292e349","user":{"login":"linzjs","id":11432541,"avatar_url":"https://avatars.githubusercontent.com/u/11432541?v=3","gravatar_id":"","url":"https://api.github.com/users/linzjs","html_url":"https://github.com/linzjs","followers_url":"https://api.github.com/users/linzjs/followers","following_url":"https://api.github.com/users/linzjs/following{/other_user}","gists_url":"https://api.github.com/users/linzjs/gists{/gist_id}","starred_url":"https://api.github.com/users/linzjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linzjs/subscriptions","organizations_url":"https://api.github.com/users/linzjs/orgs","repos_url":"https://api.github.com/users/linzjs/repos","events_url":"https://api.github.com/users/linzjs/events{/privacy}","received_events_url":"https://api.github.com/users/linzjs/received_events","type":"Organization","site_admin":false},"repo":{"id":12881781,"name":"linz","full_name":"linzjs/linz","owner":{"login":"linzjs","id":11432541,"avatar_url":"https://avatars.githubusercontent.com/u/11432541?v=3","gravatar_id":"","url":"https://api.github.com/users/linzjs","html_url":"https://github.com/linzjs","followers_url":"https://api.github.com/users/linzjs/followers","following_url":"https://api.github.com/users/linzjs/following{/other_user}","gists_url":"https://api.github.com/users/linzjs/gists{/gist_id}","starred_url":"https://api.github.com/users/linzjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linzjs/subscriptions","organizations_url":"https://api.github.com/users/linzjs/orgs","repos_url":"https://api.github.com/users/linzjs/repos","events_url":"https://api.github.com/users/linzjs/events{/privacy}","received_events_url":"https://api.github.com/users/linzjs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/linzjs/linz","description":"NodeJS Content Management System","fork":false,"url":"https://api.github.com/repos/linzjs/linz","forks_url":"https://api.github.com/repos/linzjs/linz/forks","keys_url":"https://api.github.com/repos/linzjs/linz/keys{/key_id}","collaborators_url":"https://api.github.com/repos/linzjs/linz/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/linzjs/linz/teams","hooks_url":"https://api.github.com/repos/linzjs/linz/hooks","issue_events_url":"https://api.github.com/repos/linzjs/linz/issues/events{/number}","events_url":"https://api.github.com/repos/linzjs/linz/events","assignees_url":"https://api.github.com/repos/linzjs/linz/assignees{/user}","branches_url":"https://api.github.com/repos/linzjs/linz/branches{/branch}","tags_url":"https://api.github.com/repos/linzjs/linz/tags","blobs_url":"https://api.github.com/repos/linzjs/linz/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/linzjs/linz/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/linzjs/linz/git/refs{/sha}","trees_url":"https://api.github.com/repos/linzjs/linz/git/trees{/sha}","statuses_url":"https://api.github.com/repos/linzjs/linz/statuses/{sha}","languages_url":"https://api.github.com/repos/linzjs/linz/languages","stargazers_url":"https://api.github.com/repos/linzjs/linz/stargazers","contributors_url":"https://api.github.com/repos/linzjs/linz/contributors","subscribers_url":"https://api.github.com/repos/linzjs/linz/subscribers","subscription_url":"https://api.github.com/repos/linzjs/linz/subscription","commits_url":"https://api.github.com/repos/linzjs/linz/commits{/sha}","git_commits_url":"https://api.github.com/repos/linzjs/linz/git/commits{/sha}","comments_url":"https://api.github.com/repos/linzjs/linz/comments{/number}","issue_comment_url":"https://api.github.com/repos/linzjs/linz/issues/comments{/number}","contents_url":"https://api.github.com/repos/linzjs/linz/contents/{+path}","compare_url":"https://api.github.com/repos/linzjs/linz/compare/{base}...{head}","merges_url":"https://api.github.com/repos/linzjs/linz/merges","archive_url":"https://api.github.com/repos/linzjs/linz/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/linzjs/linz/downloads","issues_url":"https://api.github.com/repos/linzjs/linz/issues{/number}","pulls_url":"https://api.github.com/repos/linzjs/linz/pulls{/number}","milestones_url":"https://api.github.com/repos/linzjs/linz/milestones{/number}","notifications_url":"https://api.github.com/repos/linzjs/linz/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/linzjs/linz/labels{/name}","releases_url":"https://api.github.com/repos/linzjs/linz/releases{/id}","deployments_url":"https://api.github.com/repos/linzjs/linz/deployments","created_at":"2013-09-16T23:56:05Z","updated_at":"2016-04-04T05:17:27Z","pushed_at":"2016-07-24T23:40:14Z","git_url":"git://github.com/linzjs/linz.git","ssh_url":"git@github.com:linzjs/linz.git","clone_url":"https://github.com/linzjs/linz.git","svn_url":"https://github.com/linzjs/linz","homepage":null,"size":2046,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":25,"forks":1,"open_issues":25,"watchers":2,"default_branch":"master"}},"base":{"label":"linzjs:master","ref":"master","sha":"420384ccbc45c626dafcd4234ec73dc251311591","user":{"login":"linzjs","id":11432541,"avatar_url":"https://avatars.githubusercontent.com/u/11432541?v=3","gravatar_id":"","url":"https://api.github.com/users/linzjs","html_url":"https://github.com/linzjs","followers_url":"https://api.github.com/users/linzjs/followers","following_url":"https://api.github.com/users/linzjs/following{/other_user}","gists_url":"https://api.github.com/users/linzjs/gists{/gist_id}","starred_url":"https://api.github.com/users/linzjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linzjs/subscriptions","organizations_url":"https://api.github.com/users/linzjs/orgs","repos_url":"https://api.github.com/users/linzjs/repos","events_url":"https://api.github.com/users/linzjs/events{/privacy}","received_events_url":"https://api.github.com/users/linzjs/received_events","type":"Organization","site_admin":false},"repo":{"id":12881781,"name":"linz","full_name":"linzjs/linz","owner":{"login":"linzjs","id":11432541,"avatar_url":"https://avatars.githubusercontent.com/u/11432541?v=3","gravatar_id":"","url":"https://api.github.com/users/linzjs","html_url":"https://github.com/linzjs","followers_url":"https://api.github.com/users/linzjs/followers","following_url":"https://api.github.com/users/linzjs/following{/other_user}","gists_url":"https://api.github.com/users/linzjs/gists{/gist_id}","starred_url":"https://api.github.com/users/linzjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linzjs/subscriptions","organizations_url":"https://api.github.com/users/linzjs/orgs","repos_url":"https://api.github.com/users/linzjs/repos","events_url":"https://api.github.com/users/linzjs/events{/privacy}","received_events_url":"https://api.github.com/users/linzjs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/linzjs/linz","description":"NodeJS Content Management System","fork":false,"url":"https://api.github.com/repos/linzjs/linz","forks_url":"https://api.github.com/repos/linzjs/linz/forks","keys_url":"https://api.github.com/repos/linzjs/linz/keys{/key_id}","collaborators_url":"https://api.github.com/repos/linzjs/linz/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/linzjs/linz/teams","hooks_url":"https://api.github.com/repos/linzjs/linz/hooks","issue_events_url":"https://api.github.com/repos/linzjs/linz/issues/events{/number}","events_url":"https://api.github.com/repos/linzjs/linz/events","assignees_url":"https://api.github.com/repos/linzjs/linz/assignees{/user}","branches_url":"https://api.github.com/repos/linzjs/linz/branches{/branch}","tags_url":"https://api.github.com/repos/linzjs/linz/tags","blobs_url":"https://api.github.com/repos/linzjs/linz/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/linzjs/linz/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/linzjs/linz/git/refs{/sha}","trees_url":"https://api.github.com/repos/linzjs/linz/git/trees{/sha}","statuses_url":"https://api.github.com/repos/linzjs/linz/statuses/{sha}","languages_url":"https://api.github.com/repos/linzjs/linz/languages","stargazers_url":"https://api.github.com/repos/linzjs/linz/stargazers","contributors_url":"https://api.github.com/repos/linzjs/linz/contributors","subscribers_url":"https://api.github.com/repos/linzjs/linz/subscribers","subscription_url":"https://api.github.com/repos/linzjs/linz/subscription","commits_url":"https://api.github.com/repos/linzjs/linz/commits{/sha}","git_commits_url":"https://api.github.com/repos/linzjs/linz/git/commits{/sha}","comments_url":"https://api.github.com/repos/linzjs/linz/comments{/number}","issue_comment_url":"https://api.github.com/repos/linzjs/linz/issues/comments{/number}","contents_url":"https://api.github.com/repos/linzjs/linz/contents/{+path}","compare_url":"https://api.github.com/repos/linzjs/linz/compare/{base}...{head}","merges_url":"https://api.github.com/repos/linzjs/linz/merges","archive_url":"https://api.github.com/repos/linzjs/linz/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/linzjs/linz/downloads","issues_url":"https://api.github.com/repos/linzjs/linz/issues{/number}","pulls_url":"https://api.github.com/repos/linzjs/linz/pulls{/number}","milestones_url":"https://api.github.com/repos/linzjs/linz/milestones{/number}","notifications_url":"https://api.github.com/repos/linzjs/linz/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/linzjs/linz/labels{/name}","releases_url":"https://api.github.com/repos/linzjs/linz/releases{/id}","deployments_url":"https://api.github.com/repos/linzjs/linz/deployments","created_at":"2013-09-16T23:56:05Z","updated_at":"2016-04-04T05:17:27Z","pushed_at":"2016-07-24T23:40:14Z","git_url":"git://github.com/linzjs/linz.git","ssh_url":"git@github.com:linzjs/linz.git","clone_url":"https://github.com/linzjs/linz.git","svn_url":"https://github.com/linzjs/linz","homepage":null,"size":2046,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":25,"forks":1,"open_issues":25,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/linzjs/linz/pulls/102"},"html":{"href":"https://github.com/linzjs/linz/pull/102"},"issue":{"href":"https://api.github.com/repos/linzjs/linz/issues/102"},"comments":{"href":"https://api.github.com/repos/linzjs/linz/issues/102/comments"},"review_comments":{"href":"https://api.github.com/repos/linzjs/linz/pulls/102/comments"},"review_comment":{"href":"https://api.github.com/repos/linzjs/linz/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/linzjs/linz/pulls/102/commits"},"statuses":{"href":"https://api.github.com/repos/linzjs/linz/statuses/634e878cd5ea66418a9946aefdd43a884292e349"}}}}
{"actor":{"display_login":"smebberson"}}