lilalo

changeset 75:58ea78973bbb

Вывод таблицы с командами переведён на div'ы.
Наведён относительный порядок с таблицами стилей.
Если прошло > 1 часа, временной интервал выводится в часах
author devi
date Fri Feb 10 23:35:24 2006 +0200 (2006-02-10)
parents a10db759e587
children 0da83215839a
files l3-frontend l3config.pm
line diff
     1.1 --- a/l3-frontend	Thu Feb 09 18:47:04 2006 +0200
     1.2 +++ b/l3-frontend	Fri Feb 10 23:35:24 2006 +0200
     1.3 @@ -567,7 +567,7 @@
     1.4  
     1.5                      my $table_caption = "Таблица ".$table_number++.". ".$Day_Name[$last_wday].". Новые ".$new_entries_of{$entry_class};
     1.6                      if ($new_commands_section) {
     1.7 -                        $result .= "<table class='new_commands_table' width='700'>"
     1.8 +                        $result .= "<table class='new_commands_table' width='700' cellspacing='0' cellpadding='0'>"
     1.9                                  .  "<tr class='new_commands_caption'><td colspan='2' align='right'>$table_caption</td></tr>"
    1.10                                  .  "<tr class='new_commands_header'><td width=100>Команда</td><td width=600>Описание</td></tr>"
    1.11                                  .  $new_commands_section 
    1.12 @@ -576,9 +576,9 @@
    1.13  
    1.14                  }
    1.15                  @known_commands = keys %CommandsFDistribution;
    1.16 -                $result .= "<table width='100%'>\n";
    1.17 +                #$result .= "<table width='100%'>\n";
    1.18                  $result .= $this_day_result;
    1.19 -                $result .= "</table>";
    1.20 +                #$result .= "</table>";
    1.21              }
    1.22  
    1.23              push @toc, "<a href='#day$day'>".$Day_Name[$wday]."</a>\n";
    1.24 @@ -586,13 +586,25 @@
    1.25              $last_wday=$wday;
    1.26              $this_day_result = q();
    1.27          }
    1.28 +        elsif ($seconds_since_last_command > 7200) {
    1.29 +            my $hours_passed =  int($seconds_since_last_command/3600);
    1.30 +            my $passed_word  = $minutes_passed % 10 == 1 ? "прошла"
    1.31 +                                                         : "прошло";
    1.32 +            my $hours_word   = $hours_passed % 10 == 1 ?   "часа":
    1.33 +                                                           "часов";
    1.34 +            $this_day_result .= "<div class='much_time_passed'>"
    1.35 +                             .  $passed_word." &gt;".$hours_passed." ".$hours_word
    1.36 +                             .  "</div>\n";
    1.37 +        }
    1.38          elsif ($seconds_since_last_command > 600) {
    1.39 -            my $height = $seconds_since_last_command > 1200 ? 100: 60;
    1.40              my $minutes_passed =  int($seconds_since_last_command/60);
    1.41  
    1.42  
    1.43 -            my $passed_word  = $minutes_passed % 10 == 1 ? "прошла"
    1.44 -                                                         : "прошло";
    1.45 +            my $passed_word  = $minutes_passed % 100 > 10 
    1.46 +                            && $minutes_passed % 100 < 20 ? "прошло"
    1.47 +                             : $minutes_passed % 10 == 1  ? "прошла"
    1.48 +                                                          : "прошло";
    1.49 +
    1.50              my $minutes_word = $minutes_passed % 100 > 10 
    1.51                              && $minutes_passed % 100 < 20 ? "минут" :
    1.52                                 $minutes_passed % 10 == 1 ? "минута":
    1.53 @@ -600,32 +612,38 @@
    1.54                                 $minutes_passed % 10  > 4 ? "минут" :
    1.55                                                             "минуты";
    1.56  
    1.57 -            $this_day_result .= "<tr height='60'>"
    1.58 -                             .  "<td colspan='5' height='$height'>"
    1.59 -                             .  "<font size='-1'>"
    1.60 +            if ($seconds_since_last_command < 1800) {
    1.61 +            $this_day_result .= "<div class='time_passed'>"
    1.62                               .  $passed_word." ".$minutes_passed." ".$minutes_word
    1.63 -                             .  "</font>"
    1.64 -                             .  "</td></tr>\n";
    1.65 +                             .  "</div>\n";
    1.66 +            }
    1.67 +            else {
    1.68 +            $this_day_result .= "<div class='much_time_passed'>"
    1.69 +                             .  $passed_word." ".$minutes_passed." ".$minutes_word
    1.70 +                             .  "</div>\n";
    1.71 +            }
    1.72          }
    1.73  
    1.74 -        $this_day_result .= "<tr class='command' id='command:".$cl->{"id"}."'>\n";
    1.75 +        #$this_day_result .= "<table cellspacing='0' cellpading='0' class='command' id='command:".$cl->{"id"}."' width='100%'><tr>\n";
    1.76 +        $this_day_result .= "<div class='command' id='command:".$cl->{"id"}."' >\n";
    1.77                          
    1.78  
    1.79  # CONSOLE CHANGE
    1.80 -        if ( $last_tty ne $cl->{"tty"}) {
    1.81 +        if ( $last_tty ne $cl->{"tty"} && 0) {
    1.82              my $tty = $cl->{"tty"};
    1.83 -            $this_day_result .= "<td colspan='6'>"
    1.84 -                                ."<table><tr><td class='ttychange' width='140' align='center'>"
    1.85 +            $this_day_result .= "<div class='ttychange'>"
    1.86                                  . $tty
    1.87 -                                ."</td></tr></table>"
    1.88 -                                ."</td></tr><tr>";
    1.89 +                                ."</div>";
    1.90              $last_tty=$cl->{"tty"};
    1.91          }
    1.92  
    1.93  # TIME
    1.94 -        $this_day_result .= $Config{"show_time"} =~ /^y/i
    1.95 -                 ? "<td width='100' valign='top' class='time' width='$Config{time_width}'>$hour:$min:$sec</td>"
    1.96 -                 : "<td width='0'/>";
    1.97 +        $this_day_result .= "<div class='time'>$hour:$min:$sec</div>" 
    1.98 +                            if $Config{"show_time"} =~ /^y/i;
    1.99 +
   1.100 +        #$this_day_result .= $Config{"show_time"} =~ /^y/i
   1.101 +        #         ? "<td width='100' valign='top' class='time' width='$Config{time_width}'>$hour:$min:$sec</td>"
   1.102 +        #         : "<td width='0'/>";
   1.103  
   1.104  # CLASS
   1.105  #        if ($cl->{"err"}) {
   1.106 @@ -651,10 +669,12 @@
   1.107          $cline = "<span title='$hint' class='with_hint'>$cline</span>" if $hint;
   1.108          $cline = "<span class='without_hint'>$cline</span>" if !$hint;
   1.109  
   1.110 -        $this_day_result .= "<td class='script'>\n";
   1.111 -        $this_day_result .= "<pre class='${class}_cline'>\n" . $cline ;
   1.112 -        $this_day_result .= "<span title='Код завершения ".$cl->{"err"}."'> <img src='".$Config{frontend_ico_path}."/error.png'/></span>" if $cl->{"err"};
   1.113 -        $this_day_result .= "</pre>\n";
   1.114 +        $this_day_result .= "<table cellpadding='0' cellspacing='0'><tr><td>\n<div class='cblock_$cl->{class}'>\n";
   1.115 +        $this_day_result .= "<div class='cline'>\n" . $cline ;      #cline
   1.116 +        $this_day_result .= "<span title='Код завершения ".$cl->{"err"}."'>\n"
   1.117 +                         .  "<img src='".$Config{frontend_ico_path}."/error.png'/>\n"
   1.118 +                         .  "</span>\n" if $cl->{"err"};
   1.119 +        $this_day_result .= "</div>\n";                             #cline
   1.120  
   1.121  # OUTPUT
   1.122          my $last_command = $cl->{"last_command"};
   1.123 @@ -663,15 +683,12 @@
   1.124          $Config{"suppress_pagers"}  =~ /^y/i && grep ($_ eq $last_command, @{$Config{"pagers"}}) ||
   1.125          $Config{"suppress_terminal"}=~ /^y/i && grep ($_ eq $last_command, @{$Config{"terminal"}})
   1.126              )) {
   1.127 -            $this_day_result .= "<pre class='".$class."_output'>" . $output . "</pre>\n";
   1.128 +            $this_day_result .= "<pre class='output'>\n" . $output . "</pre>\n";
   1.129          }   
   1.130  
   1.131  # DIFF
   1.132 -        if ( $Config{"show_diffs"} =~ /^y/i && $cl->{"diff"}) {
   1.133 -            $this_day_result .= "<table><tr><td width='5'/><td class='diff'><pre>"
   1.134 -                    .  $cl->{"diff"}
   1.135 -                    .  "</pre></td></tr></table>";
   1.136 -        }
   1.137 +        $this_day_result .= "<pre class='diff'>".$cl->{"diff"}."</pre>"
   1.138 +            if ( $Config{"show_diffs"} =~ /^y/i && $cl->{"diff"});
   1.139  
   1.140  #NOTES
   1.141          if ( $Config{"show_notes"} =~ /^y/i && $cl->{"note"}) {
   1.142 @@ -680,29 +697,29 @@
   1.143              if (not $note =~ s@(http:[a-zA-Z.0-9/_?%-]*)@<a href='$1'>$1</a>@g) {
   1.144                $note =~ s@(www\.[a-zA-Z.0-9/_?%-]*)@<a href='$1'>$1</a>@g;
   1.145              };
   1.146 -        #   Ширину пока не используем
   1.147 -        #   $this_day_result .= "<table width='$Config{note_width}' class='note'>";
   1.148 -            $this_day_result .= "<table class='note'>";
   1.149 -            $this_day_result .= "<tr><td class='note_title'>".$cl->{note_title}."</td></tr>" if $cl->{note_title};
   1.150 -            $this_day_result .= "<tr><td width='100%' class='note_text'>".$note."</td></tr>";
   1.151 -            $this_day_result .= "</table>\n";
   1.152 +            $this_day_result .= "<div class='note'>";
   1.153 +            $this_day_result .= "<div class='note_title'>".$cl->{note_title}."</div>" if $cl->{note_title};
   1.154 +            $this_day_result .= "<div class='note_text'>".$note."</div>";
   1.155 +            $this_day_result .= "</div>\n";
   1.156          }
   1.157  
   1.158  # COMMENT
   1.159          if ( $Config{"show_comments"} =~ /^y/i) {
   1.160              my $comment = make_comment($cl->{"cline"});
   1.161              if ($comment) {
   1.162 -                $this_day_result .= "<table width='$Config{comment_width}'><tr><td width='5'/><td>"
   1.163 -                        .  "<table class='note' width='100%'>"
   1.164 +                $this_day_result .= 
   1.165 +                           "<div class='note' width='100%'>"
   1.166                          .  $comment
   1.167 -                        .  "</table>\n"
   1.168 -                        .  "</td></tr></table>";
   1.169 +                        .  "</div>\n"
   1.170 +                        ;
   1.171 +                 
   1.172              }
   1.173          }
   1.174  
   1.175          # Вывод очередной команды окончен
   1.176 -        $this_day_result .= "</td>\n";
   1.177 -        $this_day_result .= "</tr>\n";
   1.178 +        $this_day_result .= "</div>\n";                     # cblock
   1.179 +        $this_day_result .= "</td></tr></table>\n"
   1.180 +                         .  "</div>\n";                     # command
   1.181      }
   1.182      last: {
   1.183          $result .= "<h3 id='day$last_day'>".$Day_Name[$last_wday]."</h3>";
   1.184 @@ -723,9 +740,9 @@
   1.185  
   1.186          }
   1.187  
   1.188 -        $result .= "<table width='100%'>\n";
   1.189 +        #$result .= "<table width='100%'>\n";
   1.190          $result .= $this_day_result;
   1.191 -        $result .= "</table>";
   1.192 +        #$result .= "</table>";
   1.193     }
   1.194  
   1.195      return ($result, collapse_list (\@toc));
     2.1 --- a/l3config.pm	Thu Feb 09 18:47:04 2006 +0200
     2.2 +++ b/l3config.pm	Fri Feb 10 23:35:24 2006 +0200
     2.3 @@ -74,7 +74,7 @@
     2.4  
     2.5      comment_width       => "300",
     2.6      note_width      => "500",
     2.7 -    time_width      => "60",
     2.8 +    time_width      => "6em",
     2.9  
    2.10      "mode"          => "daemon",        # daemon | normal
    2.11      "daemon_sleep_interval" => "10",