{"action":"created","comment":{"url":"https://api.github.com/repos/HabitRPG/habitrpg/pulls/comments/32375904","id":32375904,"diff_hunk":"@@ -86,6 +86,46 @@ habitrpg.controller(\"ChallengesCtrl\", ['$rootScope','$scope', 'Shared', 'User',\n     };\n \n     /**\n+     * Clone\n+     */\n+    $scope.clone = function(challenge) {\n+     //We need to clone habits, dailys, todos, and rewards. They each need a new id and entry in the database\n+     var clonedTasks = {\n+      habit: [],\n+      daily: [],\n+      todo: [],\n+      reward: []\n+     };\n+\n+     function cloneTask(element, index, array) {\n+      var task = Shared.taskDefaults({text: element.text, type: element.type});","path":"website/public/js/controllers/challengesCtrl.js","position":16,"original_position":16,"commit_id":"acdc358f939004ed651676731ba80cfcc0a36002","original_commit_id":"acdc358f939004ed651676731ba80cfcc0a36002","user":{"login":"crookedneighbor","id":2916945,"avatar_url":"https://avatars.githubusercontent.com/u/2916945?v=3","gravatar_id":"","url":"https://api.github.com/users/crookedneighbor","html_url":"https://github.com/crookedneighbor","followers_url":"https://api.github.com/users/crookedneighbor/followers","following_url":"https://api.github.com/users/crookedneighbor/following{/other_user}","gists_url":"https://api.github.com/users/crookedneighbor/gists{/gist_id}","starred_url":"https://api.github.com/users/crookedneighbor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crookedneighbor/subscriptions","organizations_url":"https://api.github.com/users/crookedneighbor/orgs","repos_url":"https://api.github.com/users/crookedneighbor/repos","events_url":"https://api.github.com/users/crookedneighbor/events{/privacy}","received_events_url":"https://api.github.com/users/crookedneighbor/received_events","type":"User","site_admin":false},"body":"What about notes? Advanced options? For dailies, days of the week/everyX days?","created_at":"2015-06-14T03:15:54Z","updated_at":"2015-06-14T03:15:54Z","html_url":"https://github.com/HabitRPG/habitrpg/pull/5023#discussion_r32375904","pull_request_url":"https://api.github.com/repos/HabitRPG/habitrpg/pulls/5023","_links":{"self":{"href":"https://api.github.com/repos/HabitRPG/habitrpg/pulls/comments/32375904"},"html":{"href":"https://github.com/HabitRPG/habitrpg/pull/5023#discussion_r32375904"},"pull_request":{"href":"https://api.github.com/repos/HabitRPG/habitrpg/pulls/5023"}}},"pull_request":{"url":"https://api.github.com/repos/HabitRPG/habitrpg/pulls/5023","id":33203712,"html_url":"https://github.com/HabitRPG/habitrpg/pull/5023","diff_url":"https://github.com/HabitRPG/habitrpg/pull/5023.diff","patch_url":"https://github.com/HabitRPG/habitrpg/pull/5023.patch","issue_url":"https://api.github.com/repos/HabitRPG/habitrpg/issues/5023","number":5023,"state":"open","locked":false,"title":"Added clone ability to challenges.","user":{"login":"TheHollidayInn","id":1253400,"avatar_url":"https://avatars.githubusercontent.com/u/1253400?v=3","gravatar_id":"","url":"https://api.github.com/users/TheHollidayInn","html_url":"https://github.com/TheHollidayInn","followers_url":"https://api.github.com/users/TheHollidayInn/followers","following_url":"https://api.github.com/users/TheHollidayInn/following{/other_user}","gists_url":"https://api.github.com/users/TheHollidayInn/gists{/gist_id}","starred_url":"https://api.github.com/users/TheHollidayInn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheHollidayInn/subscriptions","organizations_url":"https://api.github.com/users/TheHollidayInn/orgs","repos_url":"https://api.github.com/users/TheHollidayInn/repos","events_url":"https://api.github.com/users/TheHollidayInn/events{/privacy}","received_events_url":"https://api.github.com/users/TheHollidayInn/received_events","type":"User","site_admin":false},"body":"Fixes #5017 .\r\n\r\nI did the following:\r\n--Added clone string\r\n--Add clone button to challenge detail view with clone function\r\n--Add clone function to challenge controller\r\n~The function recreates all challenges and uses data from the challenge based to set the newChallenge variable\r\n\r\n**Before the Clone**\r\n![screen shot 2015-04-13 at 3 56 19 pm](https://cloud.githubusercontent.com/assets/1253400/7125496/dc0026ca-e1f6-11e4-9b65-be9c359e6fab.png)\r\n\r\n**After Clicking Clone**\r\n![screen shot 2015-04-13 at 3 56 39 pm](https://cloud.githubusercontent.com/assets/1253400/7125498/dc02ef9a-e1f6-11e4-996b-8ab851ca0f00.png)\r\n\r\n**Here are the tasks copied**\r\n![screen shot 2015-04-13 at 3 56 43 pm](https://cloud.githubusercontent.com/assets/1253400/7125499/dc030250-e1f6-11e4-8049-da0450e8458f.png)\r\n\r\n**After Saving the Clone**\r\n![screen shot 2015-04-13 at 3 56 55 pm](https://cloud.githubusercontent.com/assets/1253400/7125497/dc022a38-e1f6-11e4-81f8-6d0aa20db5fb.png)\r\n\r\n**Verifying the filter works (which did not when directly copying the tasks and not creating new entries)**\r\n![screen shot 2015-04-13 at 3 57 07 pm](https://cloud.githubusercontent.com/assets/1253400/7125500/dc03cc58-e1f6-11e4-8232-6b0bb1b90f56.png)\r\n\r\n**All previous tests work**\r\n![screen shot 2015-04-13 at 4 00 14 pm](https://cloud.githubusercontent.com/assets/1253400/7125501/dc03fd04-e1f6-11e4-9a41-731fbf38c991.png)","created_at":"2015-04-13T21:08:24Z","updated_at":"2015-06-14T03:15:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"35a5338939d3df9ed63d982df1c7fe92e39c0e87","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/HabitRPG/habitrpg/pulls/5023/commits","review_comments_url":"https://api.github.com/repos/HabitRPG/habitrpg/pulls/5023/comments","review_comment_url":"https://api.github.com/repos/HabitRPG/habitrpg/pulls/comments{/number}","comments_url":"https://api.github.com/repos/HabitRPG/habitrpg/issues/5023/comments","statuses_url":"https://api.github.com/repos/HabitRPG/habitrpg/statuses/acdc358f939004ed651676731ba80cfcc0a36002","head":{"label":"TheHollidayInn:challenges-clone","ref":"challenges-clone","sha":"acdc358f939004ed651676731ba80cfcc0a36002","user":{"login":"TheHollidayInn","id":1253400,"avatar_url":"https://avatars.githubusercontent.com/u/1253400?v=3","gravatar_id":"","url":"https://api.github.com/users/TheHollidayInn","html_url":"https://github.com/TheHollidayInn","followers_url":"https://api.github.com/users/TheHollidayInn/followers","following_url":"https://api.github.com/users/TheHollidayInn/following{/other_user}","gists_url":"https://api.github.com/users/TheHollidayInn/gists{/gist_id}","starred_url":"https://api.github.com/users/TheHollidayInn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheHollidayInn/subscriptions","organizations_url":"https://api.github.com/users/TheHollidayInn/orgs","repos_url":"https://api.github.com/users/TheHollidayInn/repos","events_url":"https://api.github.com/users/TheHollidayInn/events{/privacy}","received_events_url":"https://api.github.com/users/TheHollidayInn/received_events","type":"User","site_admin":false},"repo":{"id":31106714,"name":"habitrpg","full_name":"TheHollidayInn/habitrpg","owner":{"login":"TheHollidayInn","id":1253400,"avatar_url":"https://avatars.githubusercontent.com/u/1253400?v=3","gravatar_id":"","url":"https://api.github.com/users/TheHollidayInn","html_url":"https://github.com/TheHollidayInn","followers_url":"https://api.github.com/users/TheHollidayInn/followers","following_url":"https://api.github.com/users/TheHollidayInn/following{/other_user}","gists_url":"https://api.github.com/users/TheHollidayInn/gists{/gist_id}","starred_url":"https://api.github.com/users/TheHollidayInn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheHollidayInn/subscriptions","organizations_url":"https://api.github.com/users/TheHollidayInn/orgs","repos_url":"https://api.github.com/users/TheHollidayInn/repos","events_url":"https://api.github.com/users/TheHollidayInn/events{/privacy}","received_events_url":"https://api.github.com/users/TheHollidayInn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TheHollidayInn/habitrpg","description":"A habit tracker app which treats your goals like a Role Playing Game.","fork":true,"url":"https://api.github.com/repos/TheHollidayInn/habitrpg","forks_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/forks","keys_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/teams","hooks_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/hooks","issue_events_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/issues/events{/number}","events_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/events","assignees_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/assignees{/user}","branches_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/branches{/branch}","tags_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/tags","blobs_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/git/refs{/sha}","trees_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/statuses/{sha}","languages_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/languages","stargazers_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/stargazers","contributors_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/contributors","subscribers_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/subscribers","subscription_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/subscription","commits_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/commits{/sha}","git_commits_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/git/commits{/sha}","comments_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/comments{/number}","issue_comment_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/issues/comments{/number}","contents_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/contents/{+path}","compare_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/merges","archive_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/downloads","issues_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/issues{/number}","pulls_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/pulls{/number}","milestones_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/milestones{/number}","notifications_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/labels{/name}","releases_url":"https://api.github.com/repos/TheHollidayInn/habitrpg/releases{/id}","created_at":"2015-02-21T02:07:13Z","updated_at":"2015-06-14T00:25:40Z","pushed_at":"2015-06-14T02:20:19Z","git_url":"git://github.com/TheHollidayInn/habitrpg.git","ssh_url":"git@github.com:TheHollidayInn/habitrpg.git","clone_url":"https://github.com/TheHollidayInn/habitrpg.git","svn_url":"https://github.com/TheHollidayInn/habitrpg","homepage":"habitrpg.com","size":195656,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"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":0,"default_branch":"develop"}},"base":{"label":"HabitRPG:develop","ref":"develop","sha":"703a2511dad0e7f8763ac422285c902719770a5d","user":{"login":"HabitRPG","id":3834775,"avatar_url":"https://avatars.githubusercontent.com/u/3834775?v=3","gravatar_id":"","url":"https://api.github.com/users/HabitRPG","html_url":"https://github.com/HabitRPG","followers_url":"https://api.github.com/users/HabitRPG/followers","following_url":"https://api.github.com/users/HabitRPG/following{/other_user}","gists_url":"https://api.github.com/users/HabitRPG/gists{/gist_id}","starred_url":"https://api.github.com/users/HabitRPG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HabitRPG/subscriptions","organizations_url":"https://api.github.com/users/HabitRPG/orgs","repos_url":"https://api.github.com/users/HabitRPG/repos","events_url":"https://api.github.com/users/HabitRPG/events{/privacy}","received_events_url":"https://api.github.com/users/HabitRPG/received_events","type":"Organization","site_admin":false},"repo":{"id":4578898,"name":"habitrpg","full_name":"HabitRPG/habitrpg","owner":{"login":"HabitRPG","id":3834775,"avatar_url":"https://avatars.githubusercontent.com/u/3834775?v=3","gravatar_id":"","url":"https://api.github.com/users/HabitRPG","html_url":"https://github.com/HabitRPG","followers_url":"https://api.github.com/users/HabitRPG/followers","following_url":"https://api.github.com/users/HabitRPG/following{/other_user}","gists_url":"https://api.github.com/users/HabitRPG/gists{/gist_id}","starred_url":"https://api.github.com/users/HabitRPG/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HabitRPG/subscriptions","organizations_url":"https://api.github.com/users/HabitRPG/orgs","repos_url":"https://api.github.com/users/HabitRPG/repos","events_url":"https://api.github.com/users/HabitRPG/events{/privacy}","received_events_url":"https://api.github.com/users/HabitRPG/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/HabitRPG/habitrpg","description":"A habit tracker app which treats your goals like a Role Playing Game.","fork":false,"url":"https://api.github.com/repos/HabitRPG/habitrpg","forks_url":"https://api.github.com/repos/HabitRPG/habitrpg/forks","keys_url":"https://api.github.com/repos/HabitRPG/habitrpg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HabitRPG/habitrpg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HabitRPG/habitrpg/teams","hooks_url":"https://api.github.com/repos/HabitRPG/habitrpg/hooks","issue_events_url":"https://api.github.com/repos/HabitRPG/habitrpg/issues/events{/number}","events_url":"https://api.github.com/repos/HabitRPG/habitrpg/events","assignees_url":"https://api.github.com/repos/HabitRPG/habitrpg/assignees{/user}","branches_url":"https://api.github.com/repos/HabitRPG/habitrpg/branches{/branch}","tags_url":"https://api.github.com/repos/HabitRPG/habitrpg/tags","blobs_url":"https://api.github.com/repos/HabitRPG/habitrpg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HabitRPG/habitrpg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HabitRPG/habitrpg/git/refs{/sha}","trees_url":"https://api.github.com/repos/HabitRPG/habitrpg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HabitRPG/habitrpg/statuses/{sha}","languages_url":"https://api.github.com/repos/HabitRPG/habitrpg/languages","stargazers_url":"https://api.github.com/repos/HabitRPG/habitrpg/stargazers","contributors_url":"https://api.github.com/repos/HabitRPG/habitrpg/contributors","subscribers_url":"https://api.github.com/repos/HabitRPG/habitrpg/subscribers","subscription_url":"https://api.github.com/repos/HabitRPG/habitrpg/subscription","commits_url":"https://api.github.com/repos/HabitRPG/habitrpg/commits{/sha}","git_commits_url":"https://api.github.com/repos/HabitRPG/habitrpg/git/commits{/sha}","comments_url":"https://api.github.com/repos/HabitRPG/habitrpg/comments{/number}","issue_comment_url":"https://api.github.com/repos/HabitRPG/habitrpg/issues/comments{/number}","contents_url":"https://api.github.com/repos/HabitRPG/habitrpg/contents/{+path}","compare_url":"https://api.github.com/repos/HabitRPG/habitrpg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HabitRPG/habitrpg/merges","archive_url":"https://api.github.com/repos/HabitRPG/habitrpg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HabitRPG/habitrpg/downloads","issues_url":"https://api.github.com/repos/HabitRPG/habitrpg/issues{/number}","pulls_url":"https://api.github.com/repos/HabitRPG/habitrpg/pulls{/number}","milestones_url":"https://api.github.com/repos/HabitRPG/habitrpg/milestones{/number}","notifications_url":"https://api.github.com/repos/HabitRPG/habitrpg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HabitRPG/habitrpg/labels{/name}","releases_url":"https://api.github.com/repos/HabitRPG/habitrpg/releases{/id}","created_at":"2012-06-06T22:49:48Z","updated_at":"2015-06-13T20:18:22Z","pushed_at":"2015-06-14T02:13:07Z","git_url":"git://github.com/HabitRPG/habitrpg.git","ssh_url":"git@github.com:HabitRPG/habitrpg.git","clone_url":"https://github.com/HabitRPG/habitrpg.git","svn_url":"https://github.com/HabitRPG/habitrpg","homepage":"habitrpg.com","size":218064,"stargazers_count":2784,"watchers_count":2784,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1087,"mirror_url":null,"open_issues_count":607,"forks":1087,"open_issues":607,"watchers":2784,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/HabitRPG/habitrpg/pulls/5023"},"html":{"href":"https://github.com/HabitRPG/habitrpg/pull/5023"},"issue":{"href":"https://api.github.com/repos/HabitRPG/habitrpg/issues/5023"},"comments":{"href":"https://api.github.com/repos/HabitRPG/habitrpg/issues/5023/comments"},"review_comments":{"href":"https://api.github.com/repos/HabitRPG/habitrpg/pulls/5023/comments"},"review_comment":{"href":"https://api.github.com/repos/HabitRPG/habitrpg/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/HabitRPG/habitrpg/pulls/5023/commits"},"statuses":{"href":"https://api.github.com/repos/HabitRPG/habitrpg/statuses/acdc358f939004ed651676731ba80cfcc0a36002"}}}}