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

15
views/ranklist.ejs

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

Loading…
Cancel
Save