Commit 57fccd22 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Small tweaks and fixes to comments users code.

parent db83fed2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -107,7 +107,7 @@ app.get('/auth/:sdk/:version/comments_recent', function(req, res) {
    });
});

// Returns the most upvoted users.
// Returns top users (with most upvotes or with most comments).
app.get('/auth/:sdk/:version/users', function(req, res) {
    new Request(req).getTopUsers(req.query.sortBy, function(users) {
        res.json(users);
+2 −2
Original line number Diff line number Diff line
@@ -366,10 +366,10 @@ Comments.prototype = {
    },

    /**
     * Retrieves users ordered by number of upvotes.
     * Retrieves users ordered by number of upvotes or number of comments.
     * @param {String} sortBy Either "votes" or "comments"
     * @param {Function} callback Called when done.
     * @param {String} callback.err Error message when login failed.
     * @param {String} callback.err Error message when query failed.
     * @param {Object} callback.users The top users.
     */
    getTopUsers: function(sortBy, callback) {
+1 −2
Original line number Diff line number Diff line
@@ -50,7 +50,6 @@ Ext.define('Docs.view.comments.Users', {
                cls: "iScroll users-list",
                autoScroll: true,
                store: Ext.create('Ext.data.Store', {
                    model: 'Image',
                    fields: ["username", "score", "emailHash", "moderator"]
                }),
                allowDeselect: true,
@@ -61,7 +60,7 @@ Ext.define('Docs.view.comments.Users', {
                            '<span class="score">{score}</span>',
                            '<img class="avatar" width="25" height="25" src="http://www.gravatar.com/avatar/{emailHash}',
                                  '?s=25&amp;r=PG&amp;d=http://www.sencha.com/img/avatar.png">',
                            '<span href="#" class="username <tpl if="moderator">moderator</tpl>">{username}</span>',
                            '<span class="username <tpl if="moderator">moderator</tpl>">{username}</span>',
                        '</li>',
                    '</tpl>',
                    '</ul>'