Merge branch 'topic/image_upload'
[sgn.git] / mason / genomic / clone / clone_summary.mas
blob0b8fd914b3dec8e90bcc086cf238a77063400e2a
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->arizona_clone_name,
39                                                        ($this->chromosome_num ? ($this->clone_name_with_chromosome) :  ()),
40                                                        ($this->cornell_clone_name =~ /^P/ ? ($this->cornell_clone_name) : ()),
41                                                       ),
42                             'Clone type'       => $type,
43                             'Contamination'    => $badclonehtml,
44                             'Estimated length' => $length,
45                           );
47 </%init>
49 <%args>
50         $clone
51 </%args>
52 <%perl>
53         print clone_summary_html($clone);
54 </%perl>