From ab74bd7504ae8cabc2f5d8ebce824ca94e0def71 Mon Sep 17 00:00:00 2001 From: Jared Hancock <jared@osticket.com> Date: Mon, 10 Aug 2015 15:31:46 -0500 Subject: [PATCH] tickets: Calculate space for the subject for truncation --- include/staff/tickets.inc.php | 13 +++++++++++-- scp/css/scp.css | 3 +++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include/staff/tickets.inc.php b/include/staff/tickets.inc.php index 34dee7b1d..148af95c0 100644 --- a/include/staff/tickets.inc.php +++ b/include/staff/tickets.inc.php @@ -473,7 +473,15 @@ return false;"> ><?php echo $tid; ?></a></td> <td align="center" nowrap><?php echo Format::datetime($T[$date_col ?: 'lastupdate']) ?: $date_fallback; ?></td> <td><a <?php if ($flag) { ?> class="Icon <?php echo $flag; ?>Ticket" title="<?php echo ucfirst($flag); ?> Ticket" <?php } ?> - style="max-width: 210px;" + style="max-width: <?php + $base = 280; + // Make room for the paperclip and some extra + if ($T['attachment_count']) $base -= 18; + // Assume about 8px per digit character + if ($threadcount > 1) $base -= 20 + ((int) log($threadcount, 10) + 1) * 8; + // Make room for overdue flag and friends + if ($flag) $base -= 20; + echo $base; ?>px;" href="tickets.php?id=<?php echo $T['ticket_id']; ?>"><span class="truncate"><?php echo $subject; ?></span></a> <?php if ($T['attachment_count']) @@ -506,7 +514,8 @@ return false;"> <?php } ?> - <td nowrap> <?php echo Format::htmlchars($lc); ?></td> + <td nowrap><span class="truncate" style="max-width: 150px"><?php + echo Format::htmlchars($lc); ?></span></td> </tr> <?php } //end of foreach diff --git a/scp/css/scp.css b/scp/css/scp.css index e802d1574..a560fbded 100644 --- a/scp/css/scp.css +++ b/scp/css/scp.css @@ -2404,6 +2404,9 @@ tr i.help-tip.warning { text-overflow: ellipsis; vertical-align: bottom; } +.truncate.bleed { + text-overflow: hidden; +} td.indented { padding-left: 20px; } -- GitLab