{"action":"created","comment":{"url":"https://api.github.com/repos/liviuignat/email-templates/pulls/comments/52213485","id":52213485,"diff_hunk":"@@ -0,0 +1,121 @@\n+import React, { Component, PropTypes } from 'react';\n+import {\n+  Paper,\n+  CodeEditor\n+} from './../../../../components';\n+\n+export default class TemplateDetailHtmlEditor extends Component {\n+  static propTypes = {\n+    project: PropTypes.object.isRequired,\n+    template: PropTypes.object.isRequired\n+  };\n+\n+  get isLiveDocVisible() {\n+    if (!this.state) {\n+      return false;\n+    }\n+    return this.state.isLiveDocVisible;\n+  }\n+  set isLiveDocVisible(value) {\n+    this.setState({isLiveDocVisible: value});\n+  }\n+\n+  toggleLiveDoc() {\n+    this.isLiveDocVisible = !this.isLiveDocVisible;\n+  }\n+\n+  render() {\n+    const style = require('./TemplateApiDocumentation.scss');\n+    const {project, template} = this.props;\n+    const currentVersionJsonString = template.currentVersion.sampleJson;\n+    const currentVersionJson = JSON.parse(currentVersionJsonString);\n+    const exampleJson = JSON.stringify({\n+      layoutId: '[OPTIONAL LAYOUT ID]',\n+      versionId: '[OPTIONAL TEMPLATE ID]',\n+      languageKey: '[OPTIONAL LANGUAGE KEY]',\n+      json: {}\n+    }, null, 2).replace('{}', '{ [JSON OBJECT NEEDED TO GENERATE THE TEMPLATE] }');\n+    const liveExampleJson = JSON.stringify({\n+      layoutId: '[OPTIONAL LAYOUT ID]',\n+      versionId: '[OPTIONAL TEMPLATE ID]',\n+      languageKey: '[OPTIONAL LANGUAGE KEY]',\n+      json: currentVersionJson\n+    }, null, 2);\n+\n+    return (\n+      <Paper className={style.TemplateApiDocumentation_sampleContent}>\n+        <div style={{\n+          'display': this.isLiveDocVisible ? 'none' : 'block'\n+        }}>\n+          <h3>\n+            API DOCUMENTATION &nbsp;\n+            <span className={style.TemplateApiDocumentation_toggleApi}\n+              onClick={::this.toggleLiveDoc}>\n+              show live docs\n+            </span>\n+          </h3>\n+          <div className={style.TemplateApiDocumentation_sampleSubsection}>\n+            <div><b>Link:</b></div>\n+            <code>\n+              {`[POST] /app/projects/:projectId/templates/:templateId/generate`}\n+            </code>\n+          </div>\n+          <div className={style.TemplateApiDocumentation_sampleSubsection}>\n+            <div><b>Headers:</b></div>\n+            <code>\n+              <div>Api-Secret:   '[API SECRET FROM MY ACCOUNT]'</div>\n+              <div>Content-Type: 'application/json'</div>\n+            </code>\n+          </div>\n+          <div className={style.TemplateApiDocumentation_sampleSubsection}>\n+            <div><b>Payload:</b></div>\n+            <CodeEditor\n+              readOnly\n+              theme=\"\"\n+              mode={{\n+                name: 'javascript',\n+                json: true\n+              }}\n+              value={exampleJson} />\n+          </div>\n+        </div>\n+\n+        <div style={{\n+          'display': this.isLiveDocVisible ? 'block' : 'none'","path":"src/universal/containers/app/TemplateDetailPage/TemplateApiDocumentation/TemplateApiDocumentation.js","position":84,"original_position":84,"commit_id":"e9a9ea887a26f4d630e7c15f6e918bf04f2a356a","original_commit_id":"e9a9ea887a26f4d630e7c15f6e918bf04f2a356a","user":{"login":"KamikazeBVB","id":6389635,"avatar_url":"https://avatars.githubusercontent.com/u/6389635?v=3","gravatar_id":"","url":"https://api.github.com/users/KamikazeBVB","html_url":"https://github.com/KamikazeBVB","followers_url":"https://api.github.com/users/KamikazeBVB/followers","following_url":"https://api.github.com/users/KamikazeBVB/following{/other_user}","gists_url":"https://api.github.com/users/KamikazeBVB/gists{/gist_id}","starred_url":"https://api.github.com/users/KamikazeBVB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KamikazeBVB/subscriptions","organizations_url":"https://api.github.com/users/KamikazeBVB/orgs","repos_url":"https://api.github.com/users/KamikazeBVB/repos","events_url":"https://api.github.com/users/KamikazeBVB/events{/privacy}","received_events_url":"https://api.github.com/users/KamikazeBVB/received_events","type":"User","site_admin":false},"body":"A little bit too much copy paste for my taste.","created_at":"2016-02-08T19:34:25Z","updated_at":"2016-02-08T19:34:25Z","html_url":"https://github.com/liviuignat/email-templates/pull/25#discussion_r52213485","pull_request_url":"https://api.github.com/repos/liviuignat/email-templates/pulls/25","_links":{"self":{"href":"https://api.github.com/repos/liviuignat/email-templates/pulls/comments/52213485"},"html":{"href":"https://github.com/liviuignat/email-templates/pull/25#discussion_r52213485"},"pull_request":{"href":"https://api.github.com/repos/liviuignat/email-templates/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/liviuignat/email-templates/pulls/25","id":58654640,"html_url":"https://github.com/liviuignat/email-templates/pull/25","diff_url":"https://github.com/liviuignat/email-templates/pull/25.diff","patch_url":"https://github.com/liviuignat/email-templates/pull/25.patch","issue_url":"https://api.github.com/repos/liviuignat/email-templates/issues/25","number":25,"state":"open","locked":false,"title":"Feature/api documentation improvements","user":{"login":"liviuignat","id":2430288,"avatar_url":"https://avatars.githubusercontent.com/u/2430288?v=3","gravatar_id":"","url":"https://api.github.com/users/liviuignat","html_url":"https://github.com/liviuignat","followers_url":"https://api.github.com/users/liviuignat/followers","following_url":"https://api.github.com/users/liviuignat/following{/other_user}","gists_url":"https://api.github.com/users/liviuignat/gists{/gist_id}","starred_url":"https://api.github.com/users/liviuignat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liviuignat/subscriptions","organizations_url":"https://api.github.com/users/liviuignat/orgs","repos_url":"https://api.github.com/users/liviuignat/repos","events_url":"https://api.github.com/users/liviuignat/events{/privacy}","received_events_url":"https://api.github.com/users/liviuignat/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-08T19:24:42Z","updated_at":"2016-02-08T19:34:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4a62ac6b18beff7da8d01e2286a02be8fcf3bfb4","assignee":{"login":"KamikazeBVB","id":6389635,"avatar_url":"https://avatars.githubusercontent.com/u/6389635?v=3","gravatar_id":"","url":"https://api.github.com/users/KamikazeBVB","html_url":"https://github.com/KamikazeBVB","followers_url":"https://api.github.com/users/KamikazeBVB/followers","following_url":"https://api.github.com/users/KamikazeBVB/following{/other_user}","gists_url":"https://api.github.com/users/KamikazeBVB/gists{/gist_id}","starred_url":"https://api.github.com/users/KamikazeBVB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KamikazeBVB/subscriptions","organizations_url":"https://api.github.com/users/KamikazeBVB/orgs","repos_url":"https://api.github.com/users/KamikazeBVB/repos","events_url":"https://api.github.com/users/KamikazeBVB/events{/privacy}","received_events_url":"https://api.github.com/users/KamikazeBVB/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/liviuignat/email-templates/pulls/25/commits","review_comments_url":"https://api.github.com/repos/liviuignat/email-templates/pulls/25/comments","review_comment_url":"https://api.github.com/repos/liviuignat/email-templates/pulls/comments{/number}","comments_url":"https://api.github.com/repos/liviuignat/email-templates/issues/25/comments","statuses_url":"https://api.github.com/repos/liviuignat/email-templates/statuses/e9a9ea887a26f4d630e7c15f6e918bf04f2a356a","head":{"label":"liviuignat:feature/api-documentation-improvements","ref":"feature/api-documentation-improvements","sha":"e9a9ea887a26f4d630e7c15f6e918bf04f2a356a","user":{"login":"liviuignat","id":2430288,"avatar_url":"https://avatars.githubusercontent.com/u/2430288?v=3","gravatar_id":"","url":"https://api.github.com/users/liviuignat","html_url":"https://github.com/liviuignat","followers_url":"https://api.github.com/users/liviuignat/followers","following_url":"https://api.github.com/users/liviuignat/following{/other_user}","gists_url":"https://api.github.com/users/liviuignat/gists{/gist_id}","starred_url":"https://api.github.com/users/liviuignat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liviuignat/subscriptions","organizations_url":"https://api.github.com/users/liviuignat/orgs","repos_url":"https://api.github.com/users/liviuignat/repos","events_url":"https://api.github.com/users/liviuignat/events{/privacy}","received_events_url":"https://api.github.com/users/liviuignat/received_events","type":"User","site_admin":false},"repo":{"id":44245839,"name":"email-templates","full_name":"liviuignat/email-templates","owner":{"login":"liviuignat","id":2430288,"avatar_url":"https://avatars.githubusercontent.com/u/2430288?v=3","gravatar_id":"","url":"https://api.github.com/users/liviuignat","html_url":"https://github.com/liviuignat","followers_url":"https://api.github.com/users/liviuignat/followers","following_url":"https://api.github.com/users/liviuignat/following{/other_user}","gists_url":"https://api.github.com/users/liviuignat/gists{/gist_id}","starred_url":"https://api.github.com/users/liviuignat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liviuignat/subscriptions","organizations_url":"https://api.github.com/users/liviuignat/orgs","repos_url":"https://api.github.com/users/liviuignat/repos","events_url":"https://api.github.com/users/liviuignat/events{/privacy}","received_events_url":"https://api.github.com/users/liviuignat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/liviuignat/email-templates","description":"","fork":false,"url":"https://api.github.com/repos/liviuignat/email-templates","forks_url":"https://api.github.com/repos/liviuignat/email-templates/forks","keys_url":"https://api.github.com/repos/liviuignat/email-templates/keys{/key_id}","collaborators_url":"https://api.github.com/repos/liviuignat/email-templates/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/liviuignat/email-templates/teams","hooks_url":"https://api.github.com/repos/liviuignat/email-templates/hooks","issue_events_url":"https://api.github.com/repos/liviuignat/email-templates/issues/events{/number}","events_url":"https://api.github.com/repos/liviuignat/email-templates/events","assignees_url":"https://api.github.com/repos/liviuignat/email-templates/assignees{/user}","branches_url":"https://api.github.com/repos/liviuignat/email-templates/branches{/branch}","tags_url":"https://api.github.com/repos/liviuignat/email-templates/tags","blobs_url":"https://api.github.com/repos/liviuignat/email-templates/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/liviuignat/email-templates/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/liviuignat/email-templates/git/refs{/sha}","trees_url":"https://api.github.com/repos/liviuignat/email-templates/git/trees{/sha}","statuses_url":"https://api.github.com/repos/liviuignat/email-templates/statuses/{sha}","languages_url":"https://api.github.com/repos/liviuignat/email-templates/languages","stargazers_url":"https://api.github.com/repos/liviuignat/email-templates/stargazers","contributors_url":"https://api.github.com/repos/liviuignat/email-templates/contributors","subscribers_url":"https://api.github.com/repos/liviuignat/email-templates/subscribers","subscription_url":"https://api.github.com/repos/liviuignat/email-templates/subscription","commits_url":"https://api.github.com/repos/liviuignat/email-templates/commits{/sha}","git_commits_url":"https://api.github.com/repos/liviuignat/email-templates/git/commits{/sha}","comments_url":"https://api.github.com/repos/liviuignat/email-templates/comments{/number}","issue_comment_url":"https://api.github.com/repos/liviuignat/email-templates/issues/comments{/number}","contents_url":"https://api.github.com/repos/liviuignat/email-templates/contents/{+path}","compare_url":"https://api.github.com/repos/liviuignat/email-templates/compare/{base}...{head}","merges_url":"https://api.github.com/repos/liviuignat/email-templates/merges","archive_url":"https://api.github.com/repos/liviuignat/email-templates/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/liviuignat/email-templates/downloads","issues_url":"https://api.github.com/repos/liviuignat/email-templates/issues{/number}","pulls_url":"https://api.github.com/repos/liviuignat/email-templates/pulls{/number}","milestones_url":"https://api.github.com/repos/liviuignat/email-templates/milestones{/number}","notifications_url":"https://api.github.com/repos/liviuignat/email-templates/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/liviuignat/email-templates/labels{/name}","releases_url":"https://api.github.com/repos/liviuignat/email-templates/releases{/id}","deployments_url":"https://api.github.com/repos/liviuignat/email-templates/deployments","created_at":"2015-10-14T12:22:53Z","updated_at":"2016-01-24T21:49:18Z","pushed_at":"2016-02-08T19:32:06Z","git_url":"git://github.com/liviuignat/email-templates.git","ssh_url":"git@github.com:liviuignat/email-templates.git","clone_url":"https://github.com/liviuignat/email-templates.git","svn_url":"https://github.com/liviuignat/email-templates","homepage":null,"size":2607,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"liviuignat:develop","ref":"develop","sha":"f77c519e21dbac4cd6beca37a4afe5209c6bb594","user":{"login":"liviuignat","id":2430288,"avatar_url":"https://avatars.githubusercontent.com/u/2430288?v=3","gravatar_id":"","url":"https://api.github.com/users/liviuignat","html_url":"https://github.com/liviuignat","followers_url":"https://api.github.com/users/liviuignat/followers","following_url":"https://api.github.com/users/liviuignat/following{/other_user}","gists_url":"https://api.github.com/users/liviuignat/gists{/gist_id}","starred_url":"https://api.github.com/users/liviuignat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liviuignat/subscriptions","organizations_url":"https://api.github.com/users/liviuignat/orgs","repos_url":"https://api.github.com/users/liviuignat/repos","events_url":"https://api.github.com/users/liviuignat/events{/privacy}","received_events_url":"https://api.github.com/users/liviuignat/received_events","type":"User","site_admin":false},"repo":{"id":44245839,"name":"email-templates","full_name":"liviuignat/email-templates","owner":{"login":"liviuignat","id":2430288,"avatar_url":"https://avatars.githubusercontent.com/u/2430288?v=3","gravatar_id":"","url":"https://api.github.com/users/liviuignat","html_url":"https://github.com/liviuignat","followers_url":"https://api.github.com/users/liviuignat/followers","following_url":"https://api.github.com/users/liviuignat/following{/other_user}","gists_url":"https://api.github.com/users/liviuignat/gists{/gist_id}","starred_url":"https://api.github.com/users/liviuignat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/liviuignat/subscriptions","organizations_url":"https://api.github.com/users/liviuignat/orgs","repos_url":"https://api.github.com/users/liviuignat/repos","events_url":"https://api.github.com/users/liviuignat/events{/privacy}","received_events_url":"https://api.github.com/users/liviuignat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/liviuignat/email-templates","description":"","fork":false,"url":"https://api.github.com/repos/liviuignat/email-templates","forks_url":"https://api.github.com/repos/liviuignat/email-templates/forks","keys_url":"https://api.github.com/repos/liviuignat/email-templates/keys{/key_id}","collaborators_url":"https://api.github.com/repos/liviuignat/email-templates/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/liviuignat/email-templates/teams","hooks_url":"https://api.github.com/repos/liviuignat/email-templates/hooks","issue_events_url":"https://api.github.com/repos/liviuignat/email-templates/issues/events{/number}","events_url":"https://api.github.com/repos/liviuignat/email-templates/events","assignees_url":"https://api.github.com/repos/liviuignat/email-templates/assignees{/user}","branches_url":"https://api.github.com/repos/liviuignat/email-templates/branches{/branch}","tags_url":"https://api.github.com/repos/liviuignat/email-templates/tags","blobs_url":"https://api.github.com/repos/liviuignat/email-templates/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/liviuignat/email-templates/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/liviuignat/email-templates/git/refs{/sha}","trees_url":"https://api.github.com/repos/liviuignat/email-templates/git/trees{/sha}","statuses_url":"https://api.github.com/repos/liviuignat/email-templates/statuses/{sha}","languages_url":"https://api.github.com/repos/liviuignat/email-templates/languages","stargazers_url":"https://api.github.com/repos/liviuignat/email-templates/stargazers","contributors_url":"https://api.github.com/repos/liviuignat/email-templates/contributors","subscribers_url":"https://api.github.com/repos/liviuignat/email-templates/subscribers","subscription_url":"https://api.github.com/repos/liviuignat/email-templates/subscription","commits_url":"https://api.github.com/repos/liviuignat/email-templates/commits{/sha}","git_commits_url":"https://api.github.com/repos/liviuignat/email-templates/git/commits{/sha}","comments_url":"https://api.github.com/repos/liviuignat/email-templates/comments{/number}","issue_comment_url":"https://api.github.com/repos/liviuignat/email-templates/issues/comments{/number}","contents_url":"https://api.github.com/repos/liviuignat/email-templates/contents/{+path}","compare_url":"https://api.github.com/repos/liviuignat/email-templates/compare/{base}...{head}","merges_url":"https://api.github.com/repos/liviuignat/email-templates/merges","archive_url":"https://api.github.com/repos/liviuignat/email-templates/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/liviuignat/email-templates/downloads","issues_url":"https://api.github.com/repos/liviuignat/email-templates/issues{/number}","pulls_url":"https://api.github.com/repos/liviuignat/email-templates/pulls{/number}","milestones_url":"https://api.github.com/repos/liviuignat/email-templates/milestones{/number}","notifications_url":"https://api.github.com/repos/liviuignat/email-templates/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/liviuignat/email-templates/labels{/name}","releases_url":"https://api.github.com/repos/liviuignat/email-templates/releases{/id}","deployments_url":"https://api.github.com/repos/liviuignat/email-templates/deployments","created_at":"2015-10-14T12:22:53Z","updated_at":"2016-01-24T21:49:18Z","pushed_at":"2016-02-08T19:32:06Z","git_url":"git://github.com/liviuignat/email-templates.git","ssh_url":"git@github.com:liviuignat/email-templates.git","clone_url":"https://github.com/liviuignat/email-templates.git","svn_url":"https://github.com/liviuignat/email-templates","homepage":null,"size":2607,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/liviuignat/email-templates/pulls/25"},"html":{"href":"https://github.com/liviuignat/email-templates/pull/25"},"issue":{"href":"https://api.github.com/repos/liviuignat/email-templates/issues/25"},"comments":{"href":"https://api.github.com/repos/liviuignat/email-templates/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/liviuignat/email-templates/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/liviuignat/email-templates/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/liviuignat/email-templates/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/liviuignat/email-templates/statuses/e9a9ea887a26f4d630e7c15f6e918bf04f2a356a"}}}}