Browse Source

排名增加通过率

master
richie 5 years ago
parent
commit
02d77c7542
  1. 20
      views/ranklist.ejs

20
views/ranklist.ejs

@ -13,8 +13,9 @@
<tr>
<th style="width: 60px; ">#</th>
<th style="width: 150px; "><%- createSortableTitle('username', '用户名', true) %></th>
<th>个性签名</th>
<th style="width: 100px; "><%- createSortableTitle('ac_num', '通过数量', false) %></th>
<th style="width: 150px; "><%- createSortableTitle('submit_num', '提交数量', true) %></th>
<th style="width: 150px; "><%- createSortableTitle('percent', '通过率', true) %></th>
<th style="width: 100px; "><%- createSortableTitle('rating', '积分', false) %></th>
</tr>
</thead>
@ -39,22 +40,9 @@
<tr>
<td><b><%= i %></b></td>
<td><a href="<%= syzoj.utils.makeUrl(['user', user.id]) %>"><%= user.username %></a><% if (user.nameplate) { %><%- user.nameplate %><% } %></td>
<td class="font-content">
<script id="user-infomation-script-<%= i %>">
(function () {
var html = <%- serializejs(user.information) %>;
var elem = document.createElement('div');
elem.style = 'overflow: hidden; width: 100%; position: relative; ';
elem.style.maxHeight = lineHeight + 'px';
elem.innerHTML = html;
var imgs = Array.prototype.slice.call(elem.getElementsByTagName('img'));
for (var i in imgs) imgs[i].parentNode.removeChild(imgs[i]);
var script = document.getElementById('user-infomation-script-<%= i %>');
script.parentNode.replaceChild(elem, script);
})();
</script>
</td>
<td><%= user.ac_num %></td>
<td><%= user.submit_num %></td>
<td><%= user.submit_num == 0 ? 0 : Math.round(user.ac_num / user.submit_num * 10000) / 100.00 + "%" %></td>
<td><%= user.rating %></td>
</tr>
<% } %>

Loading…
Cancel
Save