forked from lix-project/hydra
Ellipsize long jobset/job names to prevent bootstrap navbar breakage
This commit is contained in:
parent
fd7acd9bbf
commit
71eaa115f8
|
@ -8,7 +8,7 @@ __PACKAGE__->config(
|
|||
TEMPLATE_EXTENSION => '.tt',
|
||||
PRE_CHOMP => 1,
|
||||
POST_CHOMP => 1,
|
||||
expose_methods => [qw/log_exists/]);
|
||||
expose_methods => [qw/log_exists ellipsize/]);
|
||||
|
||||
sub log_exists {
|
||||
my ($self, $c, $drvPath) = @_;
|
||||
|
@ -16,4 +16,9 @@ sub log_exists {
|
|||
return defined $x;
|
||||
}
|
||||
|
||||
sub ellipsize {
|
||||
my ($self, $c, $s, $n) = @_;
|
||||
return length $s <= $n ? $s : substr($s, 0, $n - 3) . "...";
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
[% END %]
|
||||
|
||||
[% IF jobset %]
|
||||
[% WRAPPER makeSubMenu title=("Jobset: " _ jobset.name) %]
|
||||
[% WRAPPER makeSubMenu title=("Jobset: " _ ellipsize(jobset.name, 30)) %]
|
||||
[% INCLUDE makeLink
|
||||
uri = c.uri_for(c.controller('Jobset').action_for('index'), [project.name, jobset.name])
|
||||
title = "Overview" %]
|
||||
|
@ -109,7 +109,7 @@
|
|||
[% END %]
|
||||
|
||||
[% IF job %]
|
||||
[% WRAPPER makeSubMenu title=("Job: " _ job.name) %]
|
||||
[% WRAPPER makeSubMenu title=("Job: " _ ellipsize(job.name, 30)) %]
|
||||
[% INCLUDE makeLink
|
||||
uri = c.uri_for(c.controller('Job').action_for('overview'), [project.name, jobset.name, job.name])
|
||||
title = "Overview" %]
|
||||
|
|
Loading…
Reference in a new issue