<% this.title = '排名' %> <% include header %> <% const getOrderString = function(order) { return order ? 'asc' : 'desc'; } const createSortableTitle = function(item, display, defaultOrder) { const isCurrent = curSort === item; console.log("IScurrent: ========> " + isCurrent); const url = syzoj.utils.makeUrl(['ranklist'], { sort: item, order: getOrderString(isCurrent ? (!curOrder) : defaultOrder) }); const triangle = isCurrent ? `` : ""; return `${display}${triangle}`; } %>
<% let i = (paginate.currPage - 1) * paginate.perPage; for (let user of ranklist) { ++i; %> <% } %>
# <%- createSortableTitle('id', 'ID', true) %> <%- createSortableTitle('username', '用户名', true) %> 个性签名 <%- createSortableTitle('ac_num', '通过数量', false) %> <%- createSortableTitle('rating', 'Rating', false) %>
<%= i %> <%= user.id %> <%= user.username %><% if (user.nameplate) { %><%- user.nameplate %><% } %> <%= user.ac_num %> <%= user.rating %>

<% include page %>
<% include footer %>