[rt-users] Adding something to Elements/Header

Mathew Snyder theillien at yahoo.com
Wed May 16 05:52:56 EDT 2007


Subredu Manuel wrote:
>  Sorry, I could not help it :P
> 
>  my $months = {
>   0 => 'January',
>   1 => 'February',
>   2 => 'March',
>   3 => 'April',
>   4 => 'May',
>   5 => 'June',
>   6 => 'July',
>   7 => 'August',
>   8 => 'September',
>   9 => 'October',
>  10 => 'November',
>  11 => 'December',
> };
> 
> my @dt = localtime;
> $dt[5] += 1900;
> print sprintf q{%9s%3s,%5s%3s:%2d:%2d},
>         $months->{$dt[4]},
>         $dt[3],
>         $dt[5],
>         $dt[2],
>         $dt[1],
>         $dt[0];
> 
> Do you think it looks better ?
> 
> Mathew Snyder wrote:
>> I know nothing of CGI and Mason and whatnot so I don't know how to do this
>> exactly.  I've sorted a little bit out.  I want to add a timestamp to the header
>> which will be centered above the bar that holds the text such as 'RT at a
>> glance' or 'Query Builder'.  So far I have it formatted using
>> % my %months = (
>> %       1  => "January",
>> %       2  => "February",
>> %       3  => "March",
>> %       4  => "April",
>> %       5  => "May",
>> %       6  => "June",
>> %       7  => "July",
>> %       8  => "August",
>> %       9  => "September",
>> %       10 => "October",
>> %       11 => "November",
>> %       12 => "December");
>>
>> % my ($second, $minute, $hour, $day_in_month, $month, $year) = (localtime) [0..5];
>> % $year += 1900;
>> % printf "%9s%3s,%5s%3s:%2d:%2d", "$months{$month}", "$day_in_month", "$year",
>> "$hour", "$minute", "$second";
>>
>> I just don't know how to format it like HTML.  How can I center it and place it
>> directly above the bar instead of floating at the top of the page?  I'd also
>> like to be able to manipulate the font.  Can anyone provide insight?
>>
>> Thanks,
>> Mathew
> 

I find it easier to read things side to side so I replace the months hash with
an array and just laid it out in a long 'qw//' way.  Using the sprintf doesn't
really improve things much over printf.

At any rate, I have no idea how to format a <div> block.  Any help would be
appreciated.

Mathew



More information about the rt-users mailing list