{"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-analytics-dashboard/pulls/comments/52374504","id":52374504,"diff_hunk":"@@ -0,0 +1,212 @@\n+/**\n+ * Renders a sortable, filterable, and searchable paginated table of\n+ * learners for the Learner Analytics app.\n+ *\n+ * Requires the following values in the options hash:\n+ * - options.collection - an instance of LearnerCollection\n+ */\n+define([\n+    'backgrid',\n+    'backgrid-filter',\n+    'backgrid-paginator',\n+    'jquery',\n+    'marionette',\n+    'text!learners/templates/name-username-cell.underscore',\n+    'text!learners/templates/roster.underscore',\n+    'text!learners/templates/search.underscore',\n+    'underscore',\n+    'utils/utils'\n+], function (\n+    Backgrid,\n+    _backgridFilter,\n+    _backgridPaginator,\n+    $,\n+    Marionette,\n+    nameUsernameCellTemplate,\n+    rosterTemplate,\n+    learnerSearchTemplate,\n+    _,\n+    Utils\n+) {\n+    'use strict';\n+\n+    var BaseHeaderCell,\n+        createEngagementCell,\n+        EngagementHeaderCell,\n+        LearnerSearch,\n+        LearnerRosterView,\n+        NameAndUsernameCell;\n+\n+    /**\n+     * Base class for all header cells.  Adds proper routing and icons.\n+     */\n+    BaseHeaderCell = Backgrid.HeaderCell.extend({\n+        initialize: function () {\n+            Backgrid.HeaderCell.prototype.initialize.apply(this, arguments);\n+            this.collection.on('backgrid:sort', this.onSort, this);\n+        },\n+        render: function () {\n+            Backgrid.HeaderCell.prototype.render.apply(this, arguments);\n+            // TODO: set href from current fragment plus deep link value in https://openedx.atlassian.net/browse/AN-6671\n+            this.$el.attr('aria-sort', 'none');\n+            this.$('a').attr('href', '#');\n+            this.$('a').append('&nbsp;');\n+            this.$('a').append('<i class=\"sort-arrow-neutral fa fa-sort\" aria-hidden=\"true\"></i>');\n+            this.$('a').append('<i class=\"sort-arrow-ascending fa fa-sort-asc hidden\" aria-hidden=\"true\"></i>');\n+            this.$('a').append('<i class=\"sort-arrow-descending fa fa-sort-desc hidden\" aria-hidden=\"true\"></i>');\n+            this.$el.attr('scope', 'col');\n+            return this;\n+        },\n+\n+        onSort: function (column, direction) {\n+            // Handle arrow icons\n+            this.$('i').addClass('hidden');\n+            if (column.cid === this.column.cid) {\n+                if (direction === 'ascending') {\n+                    this.$('i.sort-arrow-ascending').removeClass('hidden');\n+                    this.$el.attr('aria-sort', direction);\n+                } else if (direction === 'descending') {\n+                    this.$('i.sort-arrow-descending').removeClass('hidden');\n+                    this.$el.attr('aria-sort', direction);\n+                } else if (direction === null) {\n+                    this.$('i.sort-arrow-neutral').removeClass('hidden');\n+                    this.$el.attr('aria-sort', 'none');\n+                }\n+            } else {\n+                this.$('i.sort-arrow-neutral').removeClass('hidden');\n+                this.$el.attr('aria-sort', 'none');\n+            }\n+        }\n+    });\n+\n+    /**\n+     * Cell class for engagement headers, which need to be right\n+     * aligned.\n+     */\n+    EngagementHeaderCell = BaseHeaderCell.extend({\n+        className: 'learner-engagement-cell'\n+    });\n+\n+    /**\n+     * Factory for creating a Backgrid cell class that renders a key\n+     * from the learner model's engagement attribute.\n+     */\n+    createEngagementCell = function (key) {\n+        return Backgrid.Cell.extend({\n+            className: 'learner-engagement-cell ' + key,\n+            formatter: {\n+                fromRaw: function (rawData, model) {\n+                    var value = model.get('engagements')[key];\n+                    return value === null ? gettext('infinity') : value;","path":"analytics_dashboard/static/apps/learners/js/views/learner-roster-view.js","position":100,"original_position":100,"commit_id":"40731240ed94b3f20bcc67d40dcd11ff3752f2cd","original_commit_id":"40731240ed94b3f20bcc67d40dcd11ff3752f2cd","user":{"login":"dan-f","id":2146312,"avatar_url":"https://avatars.githubusercontent.com/u/2146312?v=3","gravatar_id":"","url":"https://api.github.com/users/dan-f","html_url":"https://github.com/dan-f","followers_url":"https://api.github.com/users/dan-f/followers","following_url":"https://api.github.com/users/dan-f/following{/other_user}","gists_url":"https://api.github.com/users/dan-f/gists{/gist_id}","starred_url":"https://api.github.com/users/dan-f/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dan-f/subscriptions","organizations_url":"https://api.github.com/users/dan-f/orgs","repos_url":"https://api.github.com/users/dan-f/repos","events_url":"https://api.github.com/users/dan-f/events{/privacy}","received_events_url":"https://api.github.com/users/dan-f/received_events","type":"User","site_admin":false},"body":"@mulby - Using \"Infinity\" to represent learners with 0 attempts per 0 problems completed looks quite odd on the table, as @andy-armstrong pointed out. What if we went with something like \"Not Applicable\"? @lamagnifica can you suggest a value to put in the learner roster table for the case in which a learner has a 0/0 problem attempts / problems completed ratio?","created_at":"2016-02-09T21:14:03Z","updated_at":"2016-02-09T21:14:03Z","html_url":"https://github.com/edx/edx-analytics-dashboard/pull/406#discussion_r52374504","pull_request_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/pulls/406","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-analytics-dashboard/pulls/comments/52374504"},"html":{"href":"https://github.com/edx/edx-analytics-dashboard/pull/406#discussion_r52374504"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-analytics-dashboard/pulls/406"}}},"pull_request":{"url":"https://api.github.com/repos/edx/edx-analytics-dashboard/pulls/406","id":57136634,"html_url":"https://github.com/edx/edx-analytics-dashboard/pull/406","diff_url":"https://github.com/edx/edx-analytics-dashboard/pull/406.diff","patch_url":"https://github.com/edx/edx-analytics-dashboard/pull/406.patch","issue_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/issues/406","number":406,"state":"open","locked":false,"title":"Implement the learner table","user":{"login":"dan-f","id":2146312,"avatar_url":"https://avatars.githubusercontent.com/u/2146312?v=3","gravatar_id":"","url":"https://api.github.com/users/dan-f","html_url":"https://github.com/dan-f","followers_url":"https://api.github.com/users/dan-f/followers","following_url":"https://api.github.com/users/dan-f/following{/other_user}","gists_url":"https://api.github.com/users/dan-f/gists{/gist_id}","starred_url":"https://api.github.com/users/dan-f/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dan-f/subscriptions","organizations_url":"https://api.github.com/users/dan-f/orgs","repos_url":"https://api.github.com/users/dan-f/repos","events_url":"https://api.github.com/users/dan-f/events{/privacy}","received_events_url":"https://api.github.com/users/dan-f/received_events","type":"User","site_admin":false},"body":"This PR does two things:\r\n* Extends/formalizes our application structure for Learner Analytics\r\n* Implements the \"roster\" / \"learner list\" / \"learner table\" view - a searchable, sortable, paginated list of students within the course available to course staff.\r\n\r\nhttps://openedx.atlassian.net/browse/AN-6205","created_at":"2016-01-25T21:53:49Z","updated_at":"2016-02-09T21:14:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0b2ee92ba39de5b9f191e560a5891c7ce23e4aef","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/pulls/406/commits","review_comments_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/pulls/406/comments","review_comment_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/issues/406/comments","statuses_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/statuses/40731240ed94b3f20bcc67d40dcd11ff3752f2cd","head":{"label":"edx:dan-f/learner-list","ref":"dan-f/learner-list","sha":"40731240ed94b3f20bcc67d40dcd11ff3752f2cd","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":20941273,"name":"edx-analytics-dashboard","full_name":"edx/edx-analytics-dashboard","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-analytics-dashboard","description":"Dashboard to display course analytics to course teams","fork":false,"url":"https://api.github.com/repos/edx/edx-analytics-dashboard","forks_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/forks","keys_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/teams","hooks_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/events","assignees_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/tags","blobs_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/languages","stargazers_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/subscription","commits_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/merges","archive_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/downloads","issues_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/releases{/id}","deployments_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/deployments","created_at":"2014-06-17T22:14:33Z","updated_at":"2016-01-19T19:46:47Z","pushed_at":"2016-02-09T20:37:54Z","git_url":"git://github.com/edx/edx-analytics-dashboard.git","ssh_url":"git@github.com:edx/edx-analytics-dashboard.git","clone_url":"https://github.com/edx/edx-analytics-dashboard.git","svn_url":"https://github.com/edx/edx-analytics-dashboard","homepage":null,"size":15696,"stargazers_count":24,"watchers_count":24,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":38,"mirror_url":null,"open_issues_count":4,"forks":38,"open_issues":4,"watchers":24,"default_branch":"master"}},"base":{"label":"edx:learner-analytics","ref":"learner-analytics","sha":"1b79fa8c8950ee44481658c239985ca82eba1b20","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":20941273,"name":"edx-analytics-dashboard","full_name":"edx/edx-analytics-dashboard","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-analytics-dashboard","description":"Dashboard to display course analytics to course teams","fork":false,"url":"https://api.github.com/repos/edx/edx-analytics-dashboard","forks_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/forks","keys_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/teams","hooks_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/events","assignees_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/tags","blobs_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/languages","stargazers_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/subscription","commits_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/merges","archive_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/downloads","issues_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/releases{/id}","deployments_url":"https://api.github.com/repos/edx/edx-analytics-dashboard/deployments","created_at":"2014-06-17T22:14:33Z","updated_at":"2016-01-19T19:46:47Z","pushed_at":"2016-02-09T20:37:54Z","git_url":"git://github.com/edx/edx-analytics-dashboard.git","ssh_url":"git@github.com:edx/edx-analytics-dashboard.git","clone_url":"https://github.com/edx/edx-analytics-dashboard.git","svn_url":"https://github.com/edx/edx-analytics-dashboard","homepage":null,"size":15696,"stargazers_count":24,"watchers_count":24,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":38,"mirror_url":null,"open_issues_count":4,"forks":38,"open_issues":4,"watchers":24,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-analytics-dashboard/pulls/406"},"html":{"href":"https://github.com/edx/edx-analytics-dashboard/pull/406"},"issue":{"href":"https://api.github.com/repos/edx/edx-analytics-dashboard/issues/406"},"comments":{"href":"https://api.github.com/repos/edx/edx-analytics-dashboard/issues/406/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-analytics-dashboard/pulls/406/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/edx-analytics-dashboard/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/edx-analytics-dashboard/pulls/406/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-analytics-dashboard/statuses/40731240ed94b3f20bcc67d40dcd11ff3752f2cd"}}}}