Tweaks to trials.mas: hides breeding program table in non-accession stocks and rename...
[sgn.git] / mason / genomic / clone / clone_summary.mas
blob82fd7c57e1a400e8bdcbcf2683d737bcc6b93bd3
1 <%doc>
3 =head2 clone_summary_html
5   Usage: my $html = clone_summary_html($clone);
6   Desc: get a snippet of html summarizing this clone
7   Args: none
8   Ret : HTML string containing a concise summary of this
9         clones vital statistics
10   Side Effects:
12 =cut
14 </%doc>
16 <%init>
17 use Carp;
18 use CXGN::Tools::Text qw/ commify_number /;
19 use CXGN::Page::FormattingHelpers qw/ info_table_html /;
20 sub clone_summary_html {
21     my $this = shift;
22     @_ and croak 'summary_html takes no parameters';
23     my $length =
24       $this->estimated_length && commify_number($this->estimated_length)
25       || 'not yet estimated';
27     my $badclonehtml = $this->bad_clone 
28                        ? '<span style="color:red">contaminated</span>'
29                        : 'none';
33     my $az_name = $this->arizona_clone_name;
34     my $type = $this->clone_type_object->name;
36     return info_table_html( __title            => 'Clone',
37                             'Clone name'       => join('<br />',
38                                                        $this->intl_clone_name,
39                                                        $this->arizona_clone_name,
40                                                        ($this->chromosome_num ? ($this->clone_name_with_chromosome) :  ()),
41                                                        ($this->cornell_clone_name =~ /^P/ ? ($this->cornell_clone_name) : ()),
42                                                       ),
43                             'Clone type'       => $type,
44                             'Contamination'    => $badclonehtml,
45                             'Estimated length' => $length,
46                           );
48 </%init>
50 <%args>
51         $clone
52 </%args>
53 <%perl>
54         print clone_summary_html($clone);
55 </%perl>