Merge pull request #2754 from solgenomics/topic/fix_homepage_add_accessions_dialog
[sgn.git] / mason / genomic / library / library_summary.mas
blob463eee1d944714ef54db44b328d26ffc1784e17b
1 <%doc>
3 =head2 library_summary_html
5   Desc: get a chunk of HTML describing this library
6   Args: none
7   Ret : html string containing a summary of this library's vital statistics
8   Side Effects:
9   Example:
11 =cut
13 </%doc>
14 <%init>
15 sub library_summary_html {
16     my $this = shift;
18     my $libname = $this->name;
19 #     my $superclone = $this->superclone_object;
20 #    my $super_html = $superclone ? die 'not implemented' : 'none';
21     my (undef, $organism, $accession) = $this->accession_name;
23     my $host = $this->cloning_host;
24     my $vector = $this->cloning_vector_object->name;
25     my ($rs1,$rs2) = ($this->rs1, $this->rs2);
27     ($host,$vector,$rs1,$rs2) =
28       map {$_ || ''} ($host,$vector,$rs1,$rs2);
29     $vector &&= $this->cloning_vector_object->link_html;
31     info_table_html(#table attributes
32                     __title          => 'Library',
33                     __multicol       => 2,
35                     #fields that will always be there
36                     Name             => $libname,
37                     Organism         => $organism,
38                     Accession        => $accession,
39                     'Cloning host'   => $host,
40                     'Cloning vector' => $vector,
42                     #fields that are only sometimes there
43                     $rs1 ? $rs2 ? ('Restriction enzyme 1', $rs1)
44                                 : ('Restriction enzyme'  , $rs1)
45                          : (),
46                     $rs2 ? $rs1 ? ('Restriction enzyme 2', $rs2)
47                                 : ('Restriction enzyme'  , $rs2)
48                          : (),
49                     );
52 </%init>
54 <%args>
55  $library
56 </%args>
58 <%perl>
59         print library_summary_html($library);
60 </%perl>