Browse Source

Fix user infomation caused page layout error

pull/6/head
Menci 8 years ago
parent
commit
2c136932aa
  1. 15
      views/index.ejs
  2. 15
      views/ranklist.ejs

15
views/index.ejs

@ -42,11 +42,16 @@
<td><%= i %></td> <td><%= i %></td>
<td><a href="<%= syzoj.utils.makeUrl(['user', user.id]) %>"><%= user.username %></a><% if (user.nameplate) { %><%- user.nameplate %><% } %></td> <td><a href="<%= syzoj.utils.makeUrl(['user', user.id]) %>"><%= user.username %></a><% if (user.nameplate) { %><%- user.nameplate %><% } %></td>
<td> <td>
<div style="max-height: 50px; overflow: hidden; "> <script id="user-infomation-script-<%= i %>">
<table width="100%"><tr style="border: none; "><td style="padding: 0; "> (function () {
<%- user.information %> var html = <%- JSON.stringify(user.information) %>;
</td></tr></table> var elem = document.createElement('div');
</div> elem.style = 'max-height: 50px; overflow: hidden; width: 100%; ';
elem.innerHTML = html;
var script = document.getElementById('user-infomation-script-<%= i %>');
script.parentNode.replaceChild(elem, script);
})();
</script>
</td> </td>
</tr> </tr>
<% <%

15
views/ranklist.ejs

@ -26,11 +26,16 @@
<td><%= i %></td> <td><%= i %></td>
<td><a href="<%= syzoj.utils.makeUrl(['user', user.id]) %>"><%= user.username %></a><% if (user.nameplate) { %><%- user.nameplate %><% } %></td> <td><a href="<%= syzoj.utils.makeUrl(['user', user.id]) %>"><%= user.username %></a><% if (user.nameplate) { %><%- user.nameplate %><% } %></td>
<td> <td>
<div style="max-height: 50px; overflow: hidden; "> <script id="user-infomation-script-<%= i %>">
<table width="100%"><tr style="border: none; "><td style="padding: 0; "> (function () {
<%- user.information %> var html = <%- JSON.stringify(user.information) %>;
</td></tr></table> var elem = document.createElement('div');
</div> elem.style = 'max-height: 50px; overflow: hidden; width: 100%; ';
elem.innerHTML = html;
var script = document.getElementById('user-infomation-script-<%= i %>');
script.parentNode.replaceChild(elem, script);
})();
</script>
</td> </td>
<td><%= user.ac_num %></td> <td><%= user.ac_num %></td>
</tr> </tr>

Loading…
Cancel
Save