/bans: size columns to avoid unnecessary wrapping.

Sizes columns such that they automatically shrink to fit. This fixes
problems with usernames and dates wrapping in the middle.
This commit is contained in:
evazion
2017-04-12 22:40:10 -05:00
parent 40fe0f595f
commit 715dcc491b
2 changed files with 18 additions and 2 deletions

View File

@@ -40,6 +40,22 @@ table.striped {
}
}
/*
* A table where one column expands to fill the screen, while the
* other columns shrink to fit their contents.
*/
table.autofit {
td, th, .col-fit {
white-space: nowrap;
padding-right: 2em;
}
.col-expand {
white-space: normal;
width: 100%;
}
}
table.search {
tr {
height: 2em;

View File

@@ -2,7 +2,7 @@
<div id="a-index">
<h1>Bans</h1>
<table class="striped" width="100%">
<table class="striped autofit">
<thead>
<tr>
<th>User</th>
@@ -16,7 +16,7 @@
<tr id="ban-<%= ban.id %>" data-expired="<%= ban.expired? %>">
<td><%= link_to_user(ban.user) %></td>
<td><%= ban.expires_at %></td>
<td><%= format_text ban.reason, :ragel => true %></td>
<td class="col-expand"><%= format_text ban.reason, :ragel => true %></td>
<td>
<% if CurrentUser.is_moderator? %>
<%= link_to "Edit", edit_ban_path(ban) %>