{"action":"created","comment":{"url":"https://api.github.com/repos/c2corg/v6_ui/pulls/comments/72396885","id":72396885,"diff_hunk":"@@ -107,4 +107,101 @@ app.CardController.prototype.createURL = function() {\n };\n \n \n+/**\n+ * Gets the global ratings for each activity of a route.\n+ * @export\n+ * @return {Object | null} ratings\n+ */\n+app.CardController.prototype.getGlobalRatings = function() {\n+  var doc = this.doc;\n+  var ratings = {};\n+\n+  doc.activities.forEach(function(a) {\n+    if (a === 'rock_climbing' || a === 'mountain_climbing' || a === 'snow_ice_mixed') {\n+      ratings['global_rating'] = doc.global_rating;\n+\n+    } else if (a === 'via_ferrata') {\n+      ratings['via_ferrata_rating'] = doc.via_ferrata_rating;\n+\n+    } else if (a === 'snowshoeing') {\n+      ratings['snowshoe_rating'] = doc.snowshoe_rating;\n+\n+    } else if (a === 'hiking') {\n+      ratings['hiking_rating'] = doc.hiking_rating;\n+\n+    } else if (a === 'ice_climbing') {\n+      ratings['ice_climbing'] = this.slashSeparatedRating(doc.ice_rating, doc.engagement_rating);\n+\n+    } else if (a === 'skitouring') {\n+      ratings['labande_global_rating'] = this.slashSeparatedRating(doc.ski_rating, doc.ski_exposition);\n+      ratings['labande_global_rating'] += doc.labande_global_rating ? doc.labande_global_rating : '';\n+\n+    } else if (a === 'mountain_biking') {\n+      ratings['mountain_biking'] = this.slashSeparatedRating(doc.mtb_down_rating, doc.hiking_mtb_exposition);\n+    }\n+  }.bind(this));\n+  console.log(ratings);","path":"c2corg_ui/static/js/card.js","position":37,"original_position":37,"commit_id":"b0c2f875fafa88e2484bc064d16868701a983634","original_commit_id":"b0c2f875fafa88e2484bc064d16868701a983634","user":{"login":"asaunier","id":1192331,"avatar_url":"https://avatars.githubusercontent.com/u/1192331?v=3","gravatar_id":"","url":"https://api.github.com/users/asaunier","html_url":"https://github.com/asaunier","followers_url":"https://api.github.com/users/asaunier/followers","following_url":"https://api.github.com/users/asaunier/following{/other_user}","gists_url":"https://api.github.com/users/asaunier/gists{/gist_id}","starred_url":"https://api.github.com/users/asaunier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asaunier/subscriptions","organizations_url":"https://api.github.com/users/asaunier/orgs","repos_url":"https://api.github.com/users/asaunier/repos","events_url":"https://api.github.com/users/asaunier/events{/privacy}","received_events_url":"https://api.github.com/users/asaunier/received_events","type":"User","site_admin":false},"body":"Please remove the debug code","created_at":"2016-07-27T08:05:06Z","updated_at":"2016-07-27T08:05:06Z","html_url":"https://github.com/c2corg/v6_ui/pull/512#discussion_r72396885","pull_request_url":"https://api.github.com/repos/c2corg/v6_ui/pulls/512","_links":{"self":{"href":"https://api.github.com/repos/c2corg/v6_ui/pulls/comments/72396885"},"html":{"href":"https://github.com/c2corg/v6_ui/pull/512#discussion_r72396885"},"pull_request":{"href":"https://api.github.com/repos/c2corg/v6_ui/pulls/512"}}},"pull_request":{"url":"https://api.github.com/repos/c2corg/v6_ui/pulls/512","id":78327488,"html_url":"https://github.com/c2corg/v6_ui/pull/512","diff_url":"https://github.com/c2corg/v6_ui/pull/512.diff","patch_url":"https://github.com/c2corg/v6_ui/pull/512.patch","issue_url":"https://api.github.com/repos/c2corg/v6_ui/issues/512","number":512,"state":"open","locked":false,"title":"Card contents","user":{"login":"ginold","id":7814311,"avatar_url":"https://avatars.githubusercontent.com/u/7814311?v=3","gravatar_id":"","url":"https://api.github.com/users/ginold","html_url":"https://github.com/ginold","followers_url":"https://api.github.com/users/ginold/followers","following_url":"https://api.github.com/users/ginold/following{/other_user}","gists_url":"https://api.github.com/users/ginold/gists{/gist_id}","starred_url":"https://api.github.com/users/ginold/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ginold/subscriptions","organizations_url":"https://api.github.com/users/ginold/orgs","repos_url":"https://api.github.com/users/ginold/repos","events_url":"https://api.github.com/users/ginold/events{/privacy}","received_events_url":"https://api.github.com/users/ginold/received_events","type":"User","site_admin":false},"body":"![screenshot from 2016-07-21 16 39 11](https://cloud.githubusercontent.com/assets/7814311/17026804/ad6b37bc-4f61-11e6-88b2-0b01e4151df5.png)\r\nrelated to #398  \r\nbased on comments and https://docs.google.com/spreadsheets/d/1W2kEAyGPc7cw9yKe3hyYIMTNgUDLPsFUD0ccTS8jI5Y/edit?pref=2&pli=1#gid=0\r\n\r\nStill some work to do. \r\nThe cards on listing pages are the same as associated document's documents, but not all data is returned in the associations yet, so for now you should be testing the styling and content only on the listing pages.","created_at":"2016-07-21T14:38:17Z","updated_at":"2016-07-27T08:05:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f9264e5eaa3e5c530438bf8a8240c025b004df4b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/c2corg/v6_ui/pulls/512/commits","review_comments_url":"https://api.github.com/repos/c2corg/v6_ui/pulls/512/comments","review_comment_url":"https://api.github.com/repos/c2corg/v6_ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/c2corg/v6_ui/issues/512/comments","statuses_url":"https://api.github.com/repos/c2corg/v6_ui/statuses/b0c2f875fafa88e2484bc064d16868701a983634","head":{"label":"c2corg:card-contents","ref":"card-contents","sha":"b0c2f875fafa88e2484bc064d16868701a983634","user":{"login":"c2corg","id":3200587,"avatar_url":"https://avatars.githubusercontent.com/u/3200587?v=3","gravatar_id":"","url":"https://api.github.com/users/c2corg","html_url":"https://github.com/c2corg","followers_url":"https://api.github.com/users/c2corg/followers","following_url":"https://api.github.com/users/c2corg/following{/other_user}","gists_url":"https://api.github.com/users/c2corg/gists{/gist_id}","starred_url":"https://api.github.com/users/c2corg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/c2corg/subscriptions","organizations_url":"https://api.github.com/users/c2corg/orgs","repos_url":"https://api.github.com/users/c2corg/repos","events_url":"https://api.github.com/users/c2corg/events{/privacy}","received_events_url":"https://api.github.com/users/c2corg/received_events","type":"Organization","site_admin":false},"repo":{"id":43445823,"name":"v6_ui","full_name":"c2corg/v6_ui","owner":{"login":"c2corg","id":3200587,"avatar_url":"https://avatars.githubusercontent.com/u/3200587?v=3","gravatar_id":"","url":"https://api.github.com/users/c2corg","html_url":"https://github.com/c2corg","followers_url":"https://api.github.com/users/c2corg/followers","following_url":"https://api.github.com/users/c2corg/following{/other_user}","gists_url":"https://api.github.com/users/c2corg/gists{/gist_id}","starred_url":"https://api.github.com/users/c2corg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/c2corg/subscriptions","organizations_url":"https://api.github.com/users/c2corg/orgs","repos_url":"https://api.github.com/users/c2corg/repos","events_url":"https://api.github.com/users/c2corg/events{/privacy}","received_events_url":"https://api.github.com/users/c2corg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/c2corg/v6_ui","description":"UI for c2c.org v6","fork":false,"url":"https://api.github.com/repos/c2corg/v6_ui","forks_url":"https://api.github.com/repos/c2corg/v6_ui/forks","keys_url":"https://api.github.com/repos/c2corg/v6_ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/c2corg/v6_ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/c2corg/v6_ui/teams","hooks_url":"https://api.github.com/repos/c2corg/v6_ui/hooks","issue_events_url":"https://api.github.com/repos/c2corg/v6_ui/issues/events{/number}","events_url":"https://api.github.com/repos/c2corg/v6_ui/events","assignees_url":"https://api.github.com/repos/c2corg/v6_ui/assignees{/user}","branches_url":"https://api.github.com/repos/c2corg/v6_ui/branches{/branch}","tags_url":"https://api.github.com/repos/c2corg/v6_ui/tags","blobs_url":"https://api.github.com/repos/c2corg/v6_ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/c2corg/v6_ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/c2corg/v6_ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/c2corg/v6_ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/c2corg/v6_ui/statuses/{sha}","languages_url":"https://api.github.com/repos/c2corg/v6_ui/languages","stargazers_url":"https://api.github.com/repos/c2corg/v6_ui/stargazers","contributors_url":"https://api.github.com/repos/c2corg/v6_ui/contributors","subscribers_url":"https://api.github.com/repos/c2corg/v6_ui/subscribers","subscription_url":"https://api.github.com/repos/c2corg/v6_ui/subscription","commits_url":"https://api.github.com/repos/c2corg/v6_ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/c2corg/v6_ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/c2corg/v6_ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/c2corg/v6_ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/c2corg/v6_ui/contents/{+path}","compare_url":"https://api.github.com/repos/c2corg/v6_ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/c2corg/v6_ui/merges","archive_url":"https://api.github.com/repos/c2corg/v6_ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/c2corg/v6_ui/downloads","issues_url":"https://api.github.com/repos/c2corg/v6_ui/issues{/number}","pulls_url":"https://api.github.com/repos/c2corg/v6_ui/pulls{/number}","milestones_url":"https://api.github.com/repos/c2corg/v6_ui/milestones{/number}","notifications_url":"https://api.github.com/repos/c2corg/v6_ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/c2corg/v6_ui/labels{/name}","releases_url":"https://api.github.com/repos/c2corg/v6_ui/releases{/id}","deployments_url":"https://api.github.com/repos/c2corg/v6_ui/deployments","created_at":"2015-09-30T16:52:44Z","updated_at":"2016-04-12T09:20:57Z","pushed_at":"2016-07-27T07:21:30Z","git_url":"git://github.com/c2corg/v6_ui.git","ssh_url":"git@github.com:c2corg/v6_ui.git","clone_url":"https://github.com/c2corg/v6_ui.git","svn_url":"https://github.com/c2corg/v6_ui","homepage":null,"size":2228,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":106,"forks":2,"open_issues":106,"watchers":2,"default_branch":"master"}},"base":{"label":"c2corg:master","ref":"master","sha":"fb28669bfcb59fcb14a44773c5319aff60a9ad79","user":{"login":"c2corg","id":3200587,"avatar_url":"https://avatars.githubusercontent.com/u/3200587?v=3","gravatar_id":"","url":"https://api.github.com/users/c2corg","html_url":"https://github.com/c2corg","followers_url":"https://api.github.com/users/c2corg/followers","following_url":"https://api.github.com/users/c2corg/following{/other_user}","gists_url":"https://api.github.com/users/c2corg/gists{/gist_id}","starred_url":"https://api.github.com/users/c2corg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/c2corg/subscriptions","organizations_url":"https://api.github.com/users/c2corg/orgs","repos_url":"https://api.github.com/users/c2corg/repos","events_url":"https://api.github.com/users/c2corg/events{/privacy}","received_events_url":"https://api.github.com/users/c2corg/received_events","type":"Organization","site_admin":false},"repo":{"id":43445823,"name":"v6_ui","full_name":"c2corg/v6_ui","owner":{"login":"c2corg","id":3200587,"avatar_url":"https://avatars.githubusercontent.com/u/3200587?v=3","gravatar_id":"","url":"https://api.github.com/users/c2corg","html_url":"https://github.com/c2corg","followers_url":"https://api.github.com/users/c2corg/followers","following_url":"https://api.github.com/users/c2corg/following{/other_user}","gists_url":"https://api.github.com/users/c2corg/gists{/gist_id}","starred_url":"https://api.github.com/users/c2corg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/c2corg/subscriptions","organizations_url":"https://api.github.com/users/c2corg/orgs","repos_url":"https://api.github.com/users/c2corg/repos","events_url":"https://api.github.com/users/c2corg/events{/privacy}","received_events_url":"https://api.github.com/users/c2corg/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/c2corg/v6_ui","description":"UI for c2c.org v6","fork":false,"url":"https://api.github.com/repos/c2corg/v6_ui","forks_url":"https://api.github.com/repos/c2corg/v6_ui/forks","keys_url":"https://api.github.com/repos/c2corg/v6_ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/c2corg/v6_ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/c2corg/v6_ui/teams","hooks_url":"https://api.github.com/repos/c2corg/v6_ui/hooks","issue_events_url":"https://api.github.com/repos/c2corg/v6_ui/issues/events{/number}","events_url":"https://api.github.com/repos/c2corg/v6_ui/events","assignees_url":"https://api.github.com/repos/c2corg/v6_ui/assignees{/user}","branches_url":"https://api.github.com/repos/c2corg/v6_ui/branches{/branch}","tags_url":"https://api.github.com/repos/c2corg/v6_ui/tags","blobs_url":"https://api.github.com/repos/c2corg/v6_ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/c2corg/v6_ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/c2corg/v6_ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/c2corg/v6_ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/c2corg/v6_ui/statuses/{sha}","languages_url":"https://api.github.com/repos/c2corg/v6_ui/languages","stargazers_url":"https://api.github.com/repos/c2corg/v6_ui/stargazers","contributors_url":"https://api.github.com/repos/c2corg/v6_ui/contributors","subscribers_url":"https://api.github.com/repos/c2corg/v6_ui/subscribers","subscription_url":"https://api.github.com/repos/c2corg/v6_ui/subscription","commits_url":"https://api.github.com/repos/c2corg/v6_ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/c2corg/v6_ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/c2corg/v6_ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/c2corg/v6_ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/c2corg/v6_ui/contents/{+path}","compare_url":"https://api.github.com/repos/c2corg/v6_ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/c2corg/v6_ui/merges","archive_url":"https://api.github.com/repos/c2corg/v6_ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/c2corg/v6_ui/downloads","issues_url":"https://api.github.com/repos/c2corg/v6_ui/issues{/number}","pulls_url":"https://api.github.com/repos/c2corg/v6_ui/pulls{/number}","milestones_url":"https://api.github.com/repos/c2corg/v6_ui/milestones{/number}","notifications_url":"https://api.github.com/repos/c2corg/v6_ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/c2corg/v6_ui/labels{/name}","releases_url":"https://api.github.com/repos/c2corg/v6_ui/releases{/id}","deployments_url":"https://api.github.com/repos/c2corg/v6_ui/deployments","created_at":"2015-09-30T16:52:44Z","updated_at":"2016-04-12T09:20:57Z","pushed_at":"2016-07-27T07:21:30Z","git_url":"git://github.com/c2corg/v6_ui.git","ssh_url":"git@github.com:c2corg/v6_ui.git","clone_url":"https://github.com/c2corg/v6_ui.git","svn_url":"https://github.com/c2corg/v6_ui","homepage":null,"size":2228,"stargazers_count":2,"watchers_count":2,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":106,"forks":2,"open_issues":106,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/c2corg/v6_ui/pulls/512"},"html":{"href":"https://github.com/c2corg/v6_ui/pull/512"},"issue":{"href":"https://api.github.com/repos/c2corg/v6_ui/issues/512"},"comments":{"href":"https://api.github.com/repos/c2corg/v6_ui/issues/512/comments"},"review_comments":{"href":"https://api.github.com/repos/c2corg/v6_ui/pulls/512/comments"},"review_comment":{"href":"https://api.github.com/repos/c2corg/v6_ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/c2corg/v6_ui/pulls/512/commits"},"statuses":{"href":"https://api.github.com/repos/c2corg/v6_ui/statuses/b0c2f875fafa88e2484bc064d16868701a983634"}}}}
{"actor":{"display_login":"asaunier"}}