Subversion Repositories gelsvn

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
107 bj 1
package HTMLWorkspaceCreator;
2
 
3
# ************************************************************
4
# Description   : An html workspace creator
5
# Author        : Justin Michel
6
# Create Date   : 8/25/2003
7
# ************************************************************
8
 
9
# ************************************************************
10
# Pragmas
11
# ************************************************************
12
 
13
use strict;
14
 
15
use HTMLProjectCreator;
16
use WorkspaceCreator;
17
 
18
use vars qw(@ISA);
19
@ISA = qw(WorkspaceCreator);
20
 
21
# ************************************************************
22
# Subroutine Section
23
# ************************************************************
24
 
25
sub workspace_file_name {
26
  my($self) = shift;
27
  return $self->get_modified_workspace_name($self->get_workspace_name(),
28
                                            '_workspace.html');
29
}
30
 
31
 
32
sub pre_workspace {
33
  my($self) = shift;
34
  my($fh)   = shift;
35
  my($crlf) = $self->crlf();
36
 
37
  print $fh '<html>', $crlf,
38
            '<!-- $Id: HTMLWorkspaceCreator.pm 107 2005-09-02 16:42:23Z bj $ -->', $crlf,
39
            '<!-- MPC Command: -->', $crlf,
40
            "<!-- $0@ARGV -->", $crlf,
41
            '<head>', $crlf,
42
            '  <style>', $crlf,
43
            '    a {font: 12pt bold verdana, lucida; color: white; padding: 3px;}', $crlf,
44
            '    td {font: 12pt bold verdana, lucida; color: white; padding: 3px; background-color: cadetblue;}', $crlf,
45
            '    thead tr td {font: 18pt "trebuchet ms", helvetica; color: white; padding: 3px; background-color: teal;}', $crlf,
46
            '  </style>', $crlf,
47
            '</head>', $crlf,
48
            '<body>', $crlf;
49
}
50
 
51
 
52
sub write_comps {
53
  my($self)         = shift;
54
  my($fh)           = shift;
55
  my($creator)      = shift;
56
  my($projects)     = $self->get_projects();
57
  my($project_info) = $self->get_project_info();
58
  my($crlf)         = $self->crlf();
59
 
60
  print $fh "<table style=\"table-layout:fixed\" width=\"400\">$crlf" .
61
            "<col style=\"background-color: darkcyan;\">$crlf" .
62
            "<thead>$crlf" .
63
            "<tr><td>Projects</td></tr>$crlf" .
64
            "</thead>$crlf" .
65
            "<tbody>$crlf";
66
 
67
  foreach my $project (sort { $creator->file_sorter($a, $b) } @$projects) {
68
    my($name) = $$project_info{$project}->[0];
69
    print $fh "<tr><td>" .
70
              "<a href='$project'>$name</a>" .
71
              "</td></tr>$crlf";
72
  }
73
 
74
  print $fh "</tbody></table>";
75
}
76
 
77
 
78
sub post_workspace {
79
  my($self) = shift;
80
  my($fh)   = shift;
81
  print $fh "</body></html>" . $self->crlf();
82
}
83
 
84
 
85
1;